Revision 8, 2.0 KB
(checked in by andreu, 17 years ago)
|
second RENETCOL CVS Integration
|
-
Property svn:eol-style set to
native
|
Line | |
---|
1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | #ifndef HEADERS_MGMT_H |
---|
26 | #define HEADERS_MGMT_H |
---|
27 | |
---|
28 | #include <stdio.h> |
---|
29 | #include <string.h> |
---|
30 | #include <syslog.h> |
---|
31 | |
---|
32 | #include "get_conf.h" |
---|
33 | |
---|
34 | typedef struct IpHeader * IpHeaderPtr; |
---|
35 | typedef struct IpHeader { |
---|
36 | unsigned short versionAndLength; |
---|
37 | unsigned short tos; |
---|
38 | unsigned short length; |
---|
39 | unsigned short ident; |
---|
40 | unsigned short flagsAndOffset; |
---|
41 | unsigned short ttl; |
---|
42 | unsigned short protocol; |
---|
43 | unsigned short checksum; |
---|
44 | unsigned long srcAdd; |
---|
45 | unsigned long dstAdd; |
---|
46 | } IpHeaderType; |
---|
47 | |
---|
48 | typedef struct UdpHeader * UdpHeaderPtr; |
---|
49 | typedef struct UdpHeader { |
---|
50 | unsigned short srcPort; |
---|
51 | unsigned short dstPort; |
---|
52 | unsigned short length; |
---|
53 | unsigned short checksum; |
---|
54 | } UdpHeaderType; |
---|
55 | |
---|
56 | typedef struct Datagram * DatagramPtr; |
---|
57 | typedef struct Datagram { |
---|
58 | IpHeaderPtr ipH; |
---|
59 | UdpHeaderPtr udp_header; |
---|
60 | } DatagramType; |
---|
61 | |
---|
62 | unsigned short getIpHeader(DatagramPtr, unsigned char *); |
---|
63 | unsigned short checkIpHeader(DatagramPtr, unsigned long *, int); |
---|
64 | unsigned short getUdpHeader(DatagramPtr, unsigned char *); |
---|
65 | unsigned short checkUdpHeader(DatagramPtr, int, unsigned short); |
---|
66 | #endif |
---|