Changeset ef1f80e in rtems
- Timestamp:
- 04/14/05 15:09:06 (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 44557f8
- Parents:
- 8d740cf1
- Location:
- cpukit/libnetworking
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libnetworking/net/if_arp.h
r8d740cf1 ref1f80e 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 * @(#)if_arp.h 8.1 (Berkeley) 6/10/93 34 * $ Id$30 * $FreeBSD: src/sys/net/if_arp.h,v 1.21 2005/01/07 01:45:34 imp Exp $ 35 31 */ 36 32 … … 38 34 #define _NET_IF_ARP_H_ 39 35 40 #include <netinet/in.h> 36 #ifdef __rtems__ 37 #define BYTE_PACK __attribute__((packed)) 38 #endif 39 41 40 /* 42 41 * Address Resolution Protocol. … … 75 74 }; 76 75 76 #define ar_sha(ap) (((caddr_t)((ap)+1)) + 0) 77 #define ar_spa(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln) 78 #define ar_tha(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln + (ap)->ar_pln) 79 #define ar_tpa(ap) (((caddr_t)((ap)+1)) + 2*(ap)->ar_hln + (ap)->ar_pln) 80 81 #define arphdr_len2(ar_hln, ar_pln) \ 82 (sizeof(struct arphdr) + 2*(ar_hln) + 2*(ar_pln)) 83 #define arphdr_len(ap) (arphdr_len2((ap)->ar_hln, (ap)->ar_pln)) 84 77 85 /* 78 86 * ARP ioctl request … … 90 98 #define ATF_USETRAILERS 0x10 /* has requested trailers */ 91 99 100 #ifdef _KERNEL 101 /* 102 * Structure shared between the ethernet driver modules and 103 * the address resolution code. For example, each ec_softc or il_softc 104 * begins with this structure. 105 * The code is written so that each *_softc _must_ begin with a 106 * struct arpcom, which in turn _must_ begin with a struct ifnet. 107 */ 108 struct arpcom { 109 /* 110 * The ifnet struct _must_ be at the head of this structure. 111 */ 112 struct ifnet ac_if; /* network-visible interface */ 113 u_char ac_enaddr[6]; /* ethernet hardware address */ 114 #if defined(__rtems__) 115 /* Cruft from ancient BSD - should be removed once RTEMS is updated */ 116 struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */ 117 int ac_multicnt; /* length of ac_multiaddrs list */ 118 #else 119 int now_unused; /* XXX was length of ac_multiaddrs list */ 120 void *ac_netgraph; /* ng_ether(4) netgraph node info */ 121 #endif 122 }; 123 #define IFP2AC(ifp) ((struct arpcom *)(ifp)) 124 125 #endif 126 92 127 #endif /* !_NET_IF_ARP_H_ */ -
cpukit/libnetworking/net/if_ethersubr.c
r8d740cf1 ref1f80e 28 28 * 29 29 * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 30 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.1 79 2004/10/12 10:33:41 glebiusExp $30 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.189 2005/03/06 22:59:40 sobomax Exp $ 31 31 */ 32 32 … … 77 77 #endif 78 78 79 #ifdef DEV_CARP 80 #include <netinet/ip_carp.h> 81 #endif 82 79 83 #ifdef IPX 80 84 #include <netipx/ipx.h> … … 95 99 96 100 u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 97 #define senderr(e) { error = (e); goto bad;}101 #define senderr(e) do { error = (e); goto bad;} while (0) 98 102 99 103 /* -
cpukit/libnetworking/netinet/if_ether.h
r8d740cf1 ref1f80e 28 28 * 29 29 * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 30 * $FreeBSD: src/sys/netinet/if_ether.h,v 1.3 0 2004/04/07 20:46:13 impExp $30 * $FreeBSD: src/sys/netinet/if_ether.h,v 1.32 2005/02/22 13:04:03 glebius Exp $ 31 31 */ 32 32 … … 80 80 #define arp_op ea_hdr.ar_op 81 81 82 83 /*84 * Structure shared between the ethernet driver modules and85 * the address resolution code. For example, each ec_softc or il_softc86 * begins with this structure.87 */88 struct arpcom {89 /*90 * The ifnet struct _must_ be at the head of this structure.91 */92 struct ifnet ac_if; /* network-visible interface */93 u_char ac_enaddr[ETHER_ADDR_LEN]; /* ethernet hardware address */94 struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */95 int ac_multicnt; /* length of ac_multiaddrs list */96 };97 82 98 83 struct sockaddr_inarp { -
cpukit/libnetworking/netinet/in.h
r8d740cf1 ref1f80e 235 235 * is done according to subnet mask, not the masks here. 236 236 */ 237 #define IN_CLASSA(i) ((( long)(i) & 0x80000000) == 0)237 #define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) 238 238 #define IN_CLASSA_NET 0xff000000 239 239 #define IN_CLASSA_NSHIFT 24 … … 241 241 #define IN_CLASSA_MAX 128 242 242 243 #define IN_CLASSB(i) ((( long)(i) & 0xc0000000) == 0x80000000)243 #define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) 244 244 #define IN_CLASSB_NET 0xffff0000 245 245 #define IN_CLASSB_NSHIFT 16 … … 247 247 #define IN_CLASSB_MAX 65536 248 248 249 #define IN_CLASSC(i) ((( long)(i) & 0xe0000000) == 0xc0000000)249 #define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) 250 250 #define IN_CLASSC_NET 0xffffff00 251 251 #define IN_CLASSC_NSHIFT 8 252 252 #define IN_CLASSC_HOST 0x000000ff 253 253 254 #define IN_CLASSD(i) ((( long)(i) & 0xf0000000) == 0xe0000000)254 #define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) 255 255 #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ 256 256 #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ … … 258 258 #define IN_MULTICAST(i) IN_CLASSD(i) 259 259 260 #define IN_EXPERIMENTAL(i) ((( long)(i) & 0xf0000000) == 0xf0000000)261 #define IN_BADCLASS(i) ((( long)(i) & 0xf0000000) == 0xf0000000)260 #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) 261 #define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) 262 262 263 263 #define INADDR_ANY (u_long)0x00000000
Note: See TracChangeset
for help on using the changeset viewer.