Changeset e953e2df in rtems
- Timestamp:
- 04/15/05 06:29:42 (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 10a4f75
- Parents:
- 44557f8
- Location:
- cpukit/libnetworking
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libnetworking/net/if_arp.h
r44557f8 re953e2df 51 51 u_short ar_hrd BYTE_PACK; /* format of hardware address */ 52 52 #define ARPHRD_ETHER 1 /* ethernet hardware format */ 53 #define ARPHRD_IEEE802 6 /* token-ring hardware format */ 54 #define ARPHRD_ARCNET 7 /* arcnet hardware format */ 53 55 #define ARPHRD_FRELAY 15 /* frame relay hardware format */ 56 #define ARPHRD_IEEE1394 24 /* firewire hardware format */ 54 57 u_short ar_pro BYTE_PACK; /* format of protocol address */ 55 58 u_char ar_hln BYTE_PACK; /* length of hardware address */ -
cpukit/libnetworking/netinet/ip.h
r44557f8 re953e2df 11 11 * notice, this list of conditions and the following disclaimer in the 12 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software14 * must display the following acknowledgement:15 * This product includes software developed by the University of16 * California, Berkeley and its contributors.17 13 * 4. Neither the name of the University nor the names of its contributors 18 14 * may be used to endorse or promote products derived from this software … … 32 28 * 33 29 * @(#)ip.h 8.2 (Berkeley) 6/1/94 30 * $FreeBSD: src/sys/netinet/ip.h,v 1.29 2005/01/07 01:45:44 imp Exp $ 31 */ 32 33 /* 34 34 * $Id$ 35 35 */ … … 46 46 /* 47 47 * Structure of an internet header, naked of options. 48 *49 * We declare ip_len and ip_off to be short, rather than u_short50 * pragmatically since otherwise unsigned comparisons can result51 * against negative integers quite easily, and fail in subtle ways.52 48 */ 53 49 struct ip { … … 56 52 #else 57 53 #if BYTE_ORDER == LITTLE_ENDIAN 58 u_ charip_hl:4, /* header length */54 u_int ip_hl:4, /* header length */ 59 55 ip_v:4; /* version */ 60 56 #endif 61 57 #if BYTE_ORDER == BIG_ENDIAN 62 u_ charip_v:4, /* version */58 u_int ip_v:4, /* version */ 63 59 ip_hl:4; /* header length */ 64 60 #endif … … 86 82 #endif 87 83 84 #ifdef CTASSERT 85 CTASSERT(sizeof (struct ip) == 20); 86 #endif 87 88 88 #define IP_MAXPACKET 65535 /* maximum packet size */ 89 89 … … 95 95 #define IPTOS_RELIABILITY 0x04 96 96 #define IPTOS_MINCOST 0x02 97 #if 1 98 /* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */ 99 #define IPTOS_CE 0x01 100 #define IPTOS_ECT 0x02 101 #endif 97 102 98 103 /* … … 109 114 110 115 /* 116 * ECN (Explicit Congestion Notification) codepoints in RFC3168 117 * mapped to the lower 2 bits of the TOS field. 118 */ 119 #define IPTOS_ECN_NOTECT 0x00 /* not-ECT */ 120 #define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */ 121 #define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */ 122 #define IPTOS_ECN_CE 0x03 /* congestion experienced */ 123 #define IPTOS_ECN_MASK 0x03 /* ECN field mask */ 124 125 /* 111 126 * Definitions for options. 112 127 */ … … 127 142 #define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ 128 143 #define IPOPT_LSRR 131 /* loose source route */ 144 #define IPOPT_ESO 133 /* extended security */ 145 #define IPOPT_CIPSO 134 /* commerical security */ 129 146 #define IPOPT_SATID 136 /* satnet id */ 130 147 #define IPOPT_SSRR 137 /* strict source route */ … … 147 164 u_char ipt_ptr; /* index of current entry */ 148 165 #if BYTE_ORDER == LITTLE_ENDIAN 149 u_ chaript_flg:4, /* flags, see below */166 u_int ipt_flg:4, /* flags, see below */ 150 167 ipt_oflw:4; /* overflow counter */ 151 168 #endif 152 169 #if BYTE_ORDER == BIG_ENDIAN 153 u_ chaript_oflw:4, /* overflow counter */170 u_int ipt_oflw:4, /* overflow counter */ 154 171 ipt_flg:4; /* flags, see below */ 155 172 #endif … … 189 206 #define IP_MSS 576 /* default maximum segment size */ 190 207 191 #endif 208 /* 209 * This is the real IPv4 pseudo header, used for computing the TCP and UDP 210 * checksums. For the Internet checksum, struct ipovly can be used instead. 211 * For stronger checksums, the real thing must be used. 212 */ 213 struct ippseudo { 214 struct in_addr ippseudo_src; /* source internet address */ 215 struct in_addr ippseudo_dst; /* destination internet address */ 216 u_char ippseudo_pad; /* pad, must be zero */ 217 u_char ippseudo_p; /* protocol */ 218 u_short ippseudo_len; /* protocol length */ 219 }; 220 #endif -
cpukit/libnetworking/netinet/ip_icmp.c
r44557f8 re953e2df 11 11 * notice, this list of conditions and the following disclaimer in the 12 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software14 * must display the following acknowledgement:15 * This product includes software developed by the University of16 * California, Berkeley and its contributors.17 13 * 4. Neither the name of the University nor the names of its contributors 18 14 * may be used to endorse or promote products derived from this software … … 32 28 * 33 29 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 34 * $Id$ 30 * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.98 2005/01/07 01:45:44 imp Exp $ 31 */ 32 33 /* 34 * $Id$ 35 35 */ 36 36 … … 58 58 #include <netinet/icmp_var.h> 59 59 60 #ifdef IPSEC 61 #include <netinet6/ipsec.h> 62 #include <netkey/key.h> 63 #endif 64 65 #ifdef FAST_IPSEC 66 #include <netipsec/ipsec.h> 67 #include <netipsec/key.h> 68 #define IPSEC 69 #endif 70 71 #include <machine/in_cksum.h> 72 60 73 /* 61 74 * ICMP routines: error generation, receive packet processing, and … … 81 94 #endif 82 95 83 static void icmp_reflect __P((struct mbuf *));84 static void icmp_send __P((struct mbuf *, struct mbuf *));85 static int ip_next_mtu __P((int, int));96 static void icmp_reflect(struct mbuf *); 97 static void icmp_send(struct mbuf *, struct mbuf *); 98 static int ip_next_mtu(int, int); 86 99 87 100 extern struct protosw inetsw[]; … … 132 145 if (m == NULL) 133 146 goto freeit; 134 icmplen = oiplen + min(8, oip->ip_len); 147 #ifdef MAC 148 mac_create_mbuf_netlayer(n, m); 149 #endif 150 icmplen = min(oiplen + 8, oip->ip_len); 151 if (icmplen < sizeof(struct ip)) 152 panic("icmp_error: bad length"); 135 153 m->m_len = icmplen + ICMP_MINLEN; 136 154 MH_ALIGN(m, m->m_len); … … 192 210 */ 193 211 void 194 icmp_input(m, hlen)195 registerstruct mbuf *m;196 int hlen;212 icmp_input(m, off) 213 struct mbuf *m; 214 int off; 197 215 { 198 register struct icmp *icp; 199 register struct ip *ip = mtod(m, struct ip *); 216 struct icmp *icp; 217 struct in_ifaddr *ia; 218 struct ip *ip = mtod(m, struct ip *); 219 int hlen = off; 200 220 int icmplen = ip->ip_len; 201 register int i; 202 struct in_ifaddr *ia; 203 void (*ctlfunc) __P((int, struct sockaddr *, void *)); 204 int code; 221 int i, code; 222 void (*ctlfunc)(int, struct sockaddr *, void *); 205 223 206 224 /* … … 258 276 case ICMP_UNREACH_PORT: 259 277 case ICMP_UNREACH_SRCFAIL: 260 code += PRC_UNREACH_NET;278 code = PRC_UNREACH_NET; 261 279 break; 262 280 … … 507 525 struct mbuf *m; 508 526 { 509 registerstruct ip *ip = mtod(m, struct ip *);510 registerstruct in_ifaddr *ia;527 struct ip *ip = mtod(m, struct ip *); 528 struct in_ifaddr *ia; 511 529 struct in_addr t; 512 530 struct mbuf *opts = 0; … … 576 594 len = 1; 577 595 else { 596 if (cnt < IPOPT_OLEN + sizeof(*cp)) 597 break; 578 598 len = cp[IPOPT_OLEN]; 579 if (len <= 0 || len > cnt) 599 if (len < IPOPT_OLEN + sizeof(*cp) || 600 len > cnt) 580 601 break; 581 602 }
Note: See TracChangeset
for help on using the changeset viewer.