2 * (C)opyright 1995 by Darren Reed.
4 * This code may be freely distributed as long as it retains this notice
5 * and is not changed in any way. The author accepts no responsibility
6 * for the use of this software. I hate legaleese, don't you ?
8 * @(#)ip_compat.h 1.2 12/7/95
12 * These #ifdef's are here mainly for linux, but who knows, they may
13 * not be in other places or maybe one day linux will grow up and some
14 * of these will turn up there too.
17 # define ICMP_UNREACH ICMP_DEST_UNREACH
19 #ifndef ICMP_SOURCEQUENCH
20 # define ICMP_SOURCEQUENCH ICMP_SOURCE_QUENCH
23 # define ICMP_TIMXCEED ICMP_TIME_EXCEEDED
25 #ifndef ICMP_PARAMPROB
26 # define ICMP_PARAMPROB ICMP_PARAMETERPROB
32 # define IPOPT_MINOFF 4
35 # define IPOPT_COPIED(x) ((x)&0x80)
44 # define IP_MF ((u_short)0x2000)
47 # define ETHERTYPE_IP ((u_short)0x0800)
79 #ifndef IPOPT_SECURITY
80 # define IPOPT_SECURITY 130
83 # define IPOPT_LSRR 131
86 # define IPOPT_SATID 136
89 # define IPOPT_SSRR 137
91 #ifndef IPOPT_SECUR_UNCLASS
92 # define IPOPT_SECUR_UNCLASS ((u_short)0x0000)
94 #ifndef IPOPT_SECUR_CONFID
95 # define IPOPT_SECUR_CONFID ((u_short)0xf135)
97 #ifndef IPOPT_SECUR_EFTO
98 # define IPOPT_SECUR_EFTO ((u_short)0x789a)
100 #ifndef IPOPT_SECUR_MMMM
101 # define IPOPT_SECUR_MMMM ((u_short)0xbc4d)
103 #ifndef IPOPT_SECUR_RESTR
104 # define IPOPT_SECUR_RESTR ((u_short)0xaf13)
106 #ifndef IPOPT_SECUR_SECRET
107 # define IPOPT_SECUR_SECRET ((u_short)0xd788)
109 #ifndef IPOPT_SECUR_TOPSECRET
110 # define IPOPT_SECUR_TOPSECRET ((u_short)0x6bc5)
115 # define icmp icmphdr
116 # define icmp_type type
117 # define icmp_code code
121 * From /usr/include/netinet/ip_var.h
125 caddr_t ih_next, ih_prev; /* for protocol sequence q's */
126 u_char ih_x1; /* (unused) */
127 u_char ih_pr; /* protocol */
128 short ih_len; /* protocol length */
129 struct in_addr ih_src; /* source internet address */
130 struct in_addr ih_dst; /* destination internet address */
138 # if defined(__i386__) || defined(__MIPSEL__) || defined(__alpha__) ||\
160 # if defined(__i386__) || defined(__MIPSEL__) || defined(__alpha__) ||\
175 struct in_addr ip_src;
176 struct in_addr ip_dst;
185 typedef struct icmp {
186 u_char icmp_type; /* type of message, see below */
187 u_char icmp_code; /* type sub code */
188 u_short icmp_cksum; /* ones complement cksum of struct */
190 u_char ih_pptr; /* ICMP_PARAMPROB */
191 struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
198 #define icmp_pptr icmp_hun.ih_pptr
199 #define icmp_gwaddr icmp_hun.ih_gwaddr
200 #define icmp_id icmp_hun.ih_idseq.icd_id
201 #define icmp_seq icmp_hun.ih_idseq.icd_seq
202 #define icmp_void icmp_hun.ih_void
211 /* options and then 64 bits of data */
216 #define icmp_otime icmp_dun.id_ts.its_otime
217 #define icmp_rtime icmp_dun.id_ts.its_rtime
218 #define icmp_ttime icmp_dun.id_ts.its_ttime
219 #define icmp_ip icmp_dun.id_ip.idi_ip
220 #define icmp_mask icmp_dun.id_mask
221 #define icmp_data icmp_dun.id_data
224 # define bcopy(a,b,c) memmove(b,a,c)
225 # define bcmp(a,b,c) memcmp(a,b,c)
227 # define ifnet device
231 typedef struct udphdr udphdr_t;
232 typedef struct tcphdr tcphdr_t;
233 typedef struct ip ip_t;
234 typedef struct ether_header ether_header_t;
238 #if defined(__SVR4) || defined(__svr4__)
239 # define bcopy(a,b,c) memmove(b,a,c)
240 # define bcmp(a,b,c) memcmp(a,b,c)
241 # define bzero(a,b) memset(a,0,b)