#ifndef CONVERTV1V3_H #define CONVERTV1V3_H #include "types.h" struct v1header { uint32 starttime; uint32 stoptime; uint64 nbytes; uint32 nflows; uint32 npkts; }; /* * Tcpflows */ struct v1tcpflow { uint16 startoffset; uint16 endoffset; uint32 src; uint32 dst; uint16 sport; uint16 dport; uint32 pkts; uint32 bytes; }; struct v1udpflow { uint16 startoffset; uint16 endofset; uint32 src; uint32 dst; uint16 sport; uint16 dport; uint32 pkts; uint32 bytes; }; struct v1othflow { uint16 startoffset; uint16 endoffset; uint32 src; uint32 dst; char type; /* IP-Type */ uint32 pkts; uint32 bytes; }; /* * Version 2 */ struct v2header { uint32 starttime; uint32 stoptime; uint64 bytes; uint32 flows; uint32 pkts; }; struct v2flow { u_char typenr; uint16 startoffset; uint16 endoffset; uint32 sdpkts; uint32 sdbytes; uint32 dspkts; uint32 dsbytes; uint32 src; uint32 dst; }; struct v2tcpep { uint16 sport; uint16 dport; }; struct v2udpep { uint16 sport; uint16 dport; }; /* * Version 3 */ struct v3header { char MagicNr[4]; /* The MagicNr. - actual { 'N', 'P', 'F', 'F' } */ char MajVersion; /* Major Version - actual '3' */ char MinVersion; /* Minor Version */ uint32 starttime; /* First Flow in File */ uint32 stoptime; /* Oldes Flow in File */ uint64 bytes; /* Total Bytes of all Flows in File */ uint32 flows; /* Number of Flows in File */ uint32 pkts; /* Number of Packets in all Flows File */ char unused[226]; /* Spare for further use ... 256 Bytes should be reserved for hole flow */ }; struct v3flow { u_char typenr; uint16 startoffset; uint16 endoffset; uint32 sdpkts; uint32 sdbytes; uint32 dspkts; uint32 dsbytes; uint32 src; uint32 dst; union { struct tcp { uint16 sport; uint16 dport; }tcp; struct udp { uint16 sport; uint16 dport; }udp; struct icmp { char type; }; }; }; struct v4header { char MagicNr[4]; /* The MagicNr. - actual { 'N', 'P', 'F', 'F' } */ char MajVersion; /* Major Version - actual '3' */ char MinVersion; /* Minor Version */ uint32 starttime; /* First Flow in File */ uint32 stoptime; /* Oldes Flow in File */ uint64 bytes; /* Total Bytes of all Flows in File */ uint32 flows; /* Number of Flows in File */ uint32 pkts; /* Number of Packets in all Flows File */ char unused[226]; /* Spare for further use ... 256 Bytes should be reserved for hole flow */ } __attribute__( ( packed ) ); struct v4flow { u_char typenr; uint16 startoffset; uint16 endoffset; uint32 sdpkts; uint32 sdbytes; uint32 dspkts; uint32 dsbytes; uint32 src; uint32 dst; union { struct tcp { uint16 sport; uint16 dport; }tcp; struct udp { uint16 sport; uint16 dport; }udp; struct icmp { char type; }; }; } __attribute__( ( packed ) ); #endif