This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Question about fix.sendingTime for FIX Protocol

0

Hi All,

I am using FIX Dissector to decode FIX Protocol, and I got following message.

SendingTime (52): 20120927-19:28:04.909

I am sure there should be 6 digits for milliseconds and microseconds, for instance, 19:28:04.909XXX. Can I show the all 6 digits by changing some settings?

Thanks.

asked 28 Sep '12, 07:49

ylin's gravatar image

ylin
1222
accept rate: 0%


One Answer:

0

This is great. Could you let me know how you are doing it, as I am not able to dissect it yet, I tried this program but its not working.

------------------------------------------------------------------------------

from scapy.all import *

def ExtractFIX(pcap): """A generator that iterates over the packets in a scapy pcap iterable and extracts the FIX messages. In the case where there are multiple FIX messages in one packet, yield each FIX message individually.""" for packet in pcap: if packet.haslayer('Raw'): # Only consider TCP packets which contain raw data. load = packet.getlayer('Raw').load

        # Ignore raw data that doesn't contain FIX.
        if not 'FIX' in load:
            continue
    # Replace \x01 with '|'.
    load = re.sub(r'\x01', '|', load)

    # Split out each individual FIX message in the packet by putting a 
    # ';' between them and then using split(';').
    for subMessage in re.sub(r'\|8=FIX', '|;8=FIX', load).split(';'):
        # Yield each sub message. More often than not, there will only be one.
        assert subMessage[-1:] == '|'
        yield subMessage
else:
    continue</code></pre><p>pcap = rdpcap('dump.pcap') for fixMessage in ExtractFIX(pcap): print fixMessage<br />

---------------------------------------------------------------------------------------

And giving this error

pcap = rdpcap('dump.pcap') NameError: name 'rdpcap' is not defined process finished with exit code 1

answered 09 Feb '16, 22:02

fixmessenger's gravatar image

fixmessenger
6446
accept rate: 0%