Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __TCPSERIALIZER_H
00020 #define __TCPSERIALIZER_H
00021
00022
00023 #include "TCPSegment.h"
00024 #include "TCPSegment_m.h"
00025 #include "IPvXAddress.h"
00026
00027 #include "headers/defs.h"
00028
00029 #include "headers/tcp.h"
00030
00034 class TCPSerializer
00035 {
00036 public:
00037 TCPSerializer() {}
00038
00045 int serialize(const TCPSegment *source, unsigned char *destbuf, unsigned int bufsize);
00046
00055 int serialize(const TCPSegment *source, unsigned char *destbuf, unsigned int bufsize,
00056 const IPvXAddress &srcIp, const IPvXAddress &destIp);
00057
00062 void parse(const unsigned char *srcbuf, unsigned int bufsize, TCPSegment *dest);
00063
00067 static uint16_t checksum(const void *addr, unsigned int count,
00068 const IPvXAddress &srcIp, const IPvXAddress &destIp);
00069 };
00070
00071 #endif