Rev 4707 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4707 | Rev 4715 | ||
---|---|---|---|
Line 41... | Line 41... | ||
41 | #include <sys/types.h> |
41 | #include <sys/types.h> |
42 | 42 | ||
43 | #include "../../include/in.h" |
43 | #include "../../include/in.h" |
44 | #include "../../include/icmp_codes.h" |
44 | #include "../../include/icmp_codes.h" |
45 | 45 | ||
- | 46 | /** Type definition of the echo specific data. |
|
- | 47 | * @see icmp_echo |
|
- | 48 | */ |
|
- | 49 | typedef struct icmp_echo icmp_echo_t; |
|
- | 50 | ||
- | 51 | /** Type definition of the echo specific data pointer. |
|
- | 52 | * @see icmp_echo |
|
- | 53 | */ |
|
- | 54 | typedef icmp_echo_t * icmp_echo_ref; |
|
- | 55 | ||
- | 56 | /** Echo specific data. |
|
- | 57 | */ |
|
- | 58 | struct icmp_echo{ |
|
- | 59 | /** Message idintifier. |
|
- | 60 | */ |
|
- | 61 | icmp_param_t id; |
|
- | 62 | /** Message sequence number. |
|
- | 63 | */ |
|
- | 64 | icmp_param_t sequence; |
|
- | 65 | } __attribute__ ((packed)); |
|
- | 66 | ||
46 | /** Type definition of the user datagram header. |
67 | /** Type definition of the internet control message header. |
47 | * @see icmp_header |
68 | * @see icmp_header |
48 | */ |
69 | */ |
49 | typedef struct icmp_header icmp_header_t; |
70 | typedef struct icmp_header icmp_header_t; |
50 | 71 | ||
51 | /** Type definition of the user datagram header pointer. |
72 | /** Type definition of the internet control message header pointer. |
52 | * @see icmp_header |
73 | * @see icmp_header |
53 | */ |
74 | */ |
54 | typedef icmp_header_t * icmp_header_ref; |
75 | typedef icmp_header_t * icmp_header_ref; |
55 | 76 | ||
56 | /** User datagram header. |
77 | /** Internet control message header. |
57 | */ |
78 | */ |
58 | struct icmp_header{ |
79 | struct icmp_header{ |
59 | /** Specifies the type of the message. |
80 | /** Specifies the type of the message. |
60 | */ |
81 | */ |
61 | uint8_t type; |
82 | uint8_t type; |
Line 65... | Line 86... | ||
65 | uint8_t code; |
86 | uint8_t code; |
66 | /** Contains the checksum for the ICMP message starting with the ICMP Type field. |
87 | /** Contains the checksum for the ICMP message starting with the ICMP Type field. |
67 | * If the checksum does not match the contents, the datagram is discarded. |
88 | * If the checksum does not match the contents, the datagram is discarded. |
68 | */ |
89 | */ |
69 | uint16_t checksum; |
90 | uint16_t checksum; |
70 | /** \todo |
91 | /** Message specific data. |
71 | */ |
92 | */ |
72 | union{ |
93 | union{ |
- | 94 | /** Echo specific data. |
|
73 | struct{ |
95 | */ |
74 | icmp_param_t id; |
96 | icmp_echo_t echo; |
75 | icmp_param_t sequence; |
97 | /** Proposed gateway value. |
76 | } echo; |
98 | */ |
77 | in_addr_t gateway; |
99 | in_addr_t gateway; |
- | 100 | /** Fragmentation needed specific data. |
|
- | 101 | */ |
|
78 | struct{ |
102 | struct{ |
- | 103 | /** Unused field. |
|
- | 104 | */ |
|
79 | icmp_param_t unused; |
105 | icmp_param_t _unused; |
- | 106 | /** Proposed MTU. |
|
- | 107 | */ |
|
80 | icmp_param_t mtu; |
108 | icmp_param_t mtu; |
81 | } frag; |
109 | } frag; |
- | 110 | /** Parameter problem specific data. |
|
- | 111 | */ |
|
82 | struct{ |
112 | struct{ |
- | 113 | /** Problem pointer. |
|
- | 114 | */ |
|
83 | icmp_param_t pointer; |
115 | icmp_param_t pointer; |
- | 116 | /** Unused field. |
|
- | 117 | */ |
|
84 | icmp_param_t unused; |
118 | icmp_param_t _unused; |
85 | } param; |
119 | } param; |
86 | } un; |
120 | } un; |
87 | } __attribute__ ((packed)); |
121 | } __attribute__ ((packed)); |
88 | 122 | ||
89 | #endif |
123 | #endif |