Changeset ef1f80e in rtems


Ignore:
Timestamp:
Apr 14, 2005, 3:09:06 PM (15 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
44557f8
Parents:
8d740cf1
Message:

Partial updates from FreeBSD.

Location:
cpukit/libnetworking
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/net/if_arp.h

    r8d740cf1 ref1f80e  
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    1713 * 4. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
     
    3228 *
    3329 *      @(#)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 $
    3531 */
    3632
     
    3834#define _NET_IF_ARP_H_
    3935
    40 #include <netinet/in.h>
     36#ifdef __rtems__
     37#define BYTE_PACK __attribute__((packed))
     38#endif
     39
    4140/*
    4241 * Address Resolution Protocol.
     
    7574};
    7675
     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
    7785/*
    7886 * ARP ioctl request
     
    9098#define ATF_USETRAILERS 0x10    /* has requested trailers */
    9199
     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 */
     108struct  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
    92127#endif /* !_NET_IF_ARP_H_ */
  • cpukit/libnetworking/net/if_ethersubr.c

    r8d740cf1 ref1f80e  
    2828 *
    2929 *      @(#)if_ethersubr.c      8.1 (Berkeley) 6/10/93
    30  * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.179 2004/10/12 10:33:41 glebius Exp $
     30 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.189 2005/03/06 22:59:40 sobomax Exp $
    3131 */
    3232 
     
    7777#endif
    7878
     79#ifdef DEV_CARP
     80#include <netinet/ip_carp.h>
     81#endif
     82
    7983#ifdef IPX
    8084#include <netipx/ipx.h>
     
    9599
    96100u_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)
    98102
    99103/*
  • cpukit/libnetworking/netinet/if_ether.h

    r8d740cf1 ref1f80e  
    2828 *
    2929 *      @(#)if_ether.h  8.3 (Berkeley) 5/2/95
    30  * $FreeBSD: src/sys/netinet/if_ether.h,v 1.30 2004/04/07 20:46:13 imp Exp $
     30 * $FreeBSD: src/sys/netinet/if_ether.h,v 1.32 2005/02/22 13:04:03 glebius Exp $
    3131 */
    3232
     
    8080#define arp_op  ea_hdr.ar_op
    8181
    82 
    83 /*
    84  * Structure shared between the ethernet driver modules and
    85  * the address resolution code.  For example, each ec_softc or il_softc
    86  * 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 };
    9782
    9883struct sockaddr_inarp {
  • cpukit/libnetworking/netinet/in.h

    r8d740cf1 ref1f80e  
    235235 * is done according to subnet mask, not the masks here.
    236236 */
    237 #define IN_CLASSA(i)            (((long)(i) & 0x80000000) == 0)
     237#define IN_CLASSA(i)            (((u_int32_t)(i) & 0x80000000) == 0)
    238238#define IN_CLASSA_NET           0xff000000
    239239#define IN_CLASSA_NSHIFT        24
     
    241241#define IN_CLASSA_MAX           128
    242242
    243 #define IN_CLASSB(i)            (((long)(i) & 0xc0000000) == 0x80000000)
     243#define IN_CLASSB(i)            (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
    244244#define IN_CLASSB_NET           0xffff0000
    245245#define IN_CLASSB_NSHIFT        16
     
    247247#define IN_CLASSB_MAX           65536
    248248
    249 #define IN_CLASSC(i)            (((long)(i) & 0xe0000000) == 0xc0000000)
     249#define IN_CLASSC(i)            (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
    250250#define IN_CLASSC_NET           0xffffff00
    251251#define IN_CLASSC_NSHIFT        8
    252252#define IN_CLASSC_HOST          0x000000ff
    253253
    254 #define IN_CLASSD(i)            (((long)(i) & 0xf0000000) == 0xe0000000)
     254#define IN_CLASSD(i)            (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
    255255#define IN_CLASSD_NET           0xf0000000      /* These ones aren't really */
    256256#define IN_CLASSD_NSHIFT        28              /* net and host fields, but */
     
    258258#define IN_MULTICAST(i)         IN_CLASSD(i)
    259259
    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)
    262262
    263263#define INADDR_ANY              (u_long)0x00000000
Note: See TracChangeset for help on using the changeset viewer.