2
* router_types.h - ip router
4
* Basilisk II (C) 1997-2001 Christian Bauer
6
* Windows platform specific code copyright (C) Lauri Pesonen
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#ifndef _ROUTER_TYPES_H_
24
#define _ROUTER_TYPES_H_
29
// --------------------------- MAC ---------------------------
34
} ATTRIBUTE_PACKED mac_t;
37
mac_type_llc_ipx_limit = 0x05DC, // <= mac_type_llc_ipx_limit -->> 802.3 MAC frame
38
mac_type_ip4 = 0x0800,
39
mac_type_arp = 0x0806,
40
mac_type_rarp = 0x8035,
41
mac_type_ip6 = 0x86DD,
42
mac_type_loopback = 0x9000
45
// --------------------------- ARP ---------------------------
53
uint8 srch[6]; // size for ethernet
54
uint8 srcp[4]; // size for ip
55
uint8 dsth[6]; // size for ethernet
56
uint8 dstp[4]; // size for ip
57
} ATTRIBUTE_PACKED arp_t;
67
// --------------------------- IP4 ---------------------------
75
uint16 flags_n_frag_offset; // foffset 0..11, flags 12..15
81
// ip options, size = 4 * header_len - 20
82
} ATTRIBUTE_PACKED ip_t;
84
// Protocol STD numbers
86
ip_proto_icmp = IPPROTO_ICMP,
87
ip_proto_tcp = IPPROTO_TCP,
88
ip_proto_udp = IPPROTO_UDP
91
// --------------------------- ICMP ---------------------------
98
} ATTRIBUTE_PACKED icmp_t;
102
icmp_Destination_unreachable = 3,
103
icmp_Source_quench = 4,
106
icmp_Router_advertisement = 9,
107
icmp_Router_solicitation = 10,
108
icmp_Time_exceeded = 11,
109
icmp_Parameter_problem = 12,
110
icmp_Time_Stamp_request = 13,
111
icmp_Time_Stamp_reply = 14,
112
icmp_Information_request_obsolete = 15,
113
icmp_Information_reply_obsolete = 16,
114
icmp_Address_mask_request = 17,
115
icmp_Address_mask_reply = 18,
116
icmp_Traceroute = 30,
117
icmp_Datagram_conversion_error = 31,
118
icmp_Mobile_host_redirect = 32,
119
icmp_IPv6_Where_Are_You = 33,
120
icmp_IPv6_I_Am_Here = 34,
121
icmp_Mobile_registration_request = 35,
122
icmp_Mobile_registration_reply = 36,
123
icmp_Domain_name_request = 37,
124
icmp_Domain_name_reply = 38,
129
// --------------------------- TCP ---------------------------
136
uint8 header_len; // note: some reserved bits
137
uint8 flags; // note: some reserved bits
141
// options + padding: size = dataoffset*4-20
143
} ATTRIBUTE_PACKED tcp_t;
146
tcp_flags_URG = 0x20, // The urgent pointer field is significant in this segment.
147
tcp_flags_ACK = 0x10, // The acknowledgment field is significant in this segment.
148
tcp_flags_PSH = 0x08, // Push function.
149
tcp_flags_RST = 0x04, // Resets the connection.
150
tcp_flags_SYN = 0x02, // Synchronizes the sequence numbers.
151
tcp_flags_FIN = 0x01 // No more data from sender.
159
tcp_state_established,
160
tcp_state_close_wait,
168
// --------------------------- UDP ---------------------------
176
} ATTRIBUTE_PACKED udp_t;
179
uint16 src_lo, src_hi;
180
uint16 dest_lo, dest_hi;
183
} ATTRIBUTE_PACKED pseudo_ip_t;
187
#endif // _ROUTER_TYPES_H_