Annotation of 43BSDReno/sys/netinet/if_ether.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1982, 1986 Regents of the University of California.
        !             3:  * All rights reserved.
        !             4:  *
        !             5:  * Redistribution is only permitted until one year after the first shipment
        !             6:  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
        !             7:  * binary forms are permitted provided that: (1) source distributions retain
        !             8:  * this entire copyright notice and comment, and (2) distributions including
        !             9:  * binaries display the following acknowledgement:  This product includes
        !            10:  * software developed by the University of California, Berkeley and its
        !            11:  * contributors'' in the documentation or other materials provided with the
        !            12:  * distribution and in all advertising materials mentioning features or use
        !            13:  * of this software.  Neither the name of the University nor the names of
        !            14:  * its contributors may be used to endorse or promote products derived from
        !            15:  * this software without specific prior written permission.
        !            16:  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
        !            17:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
        !            18:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            19:  *
        !            20:  *     @(#)if_ether.h  7.5 (Berkeley) 6/28/90
        !            21:  */
        !            22: 
        !            23: /*
        !            24:  * Structure of a 10Mb/s Ethernet header.
        !            25:  */
        !            26: struct ether_header {
        !            27:        u_char  ether_dhost[6];
        !            28:        u_char  ether_shost[6];
        !            29:        u_short ether_type;
        !            30: };
        !            31: 
        !            32: #define        ETHERTYPE_PUP   0x0200          /* PUP protocol */
        !            33: #define        ETHERTYPE_IP    0x0800          /* IP protocol */
        !            34: #define ETHERTYPE_ARP  0x0806          /* Addr. resolution protocol */
        !            35: 
        !            36: /*
        !            37:  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
        !            38:  * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
        !            39:  * by an ETHER type (as given above) and then the (variable-length) header.
        !            40:  */
        !            41: #define        ETHERTYPE_TRAIL         0x1000          /* Trailer packet */
        !            42: #define        ETHERTYPE_NTRAILER      16
        !            43: 
        !            44: #define        ETHERMTU        1500
        !            45: #define        ETHERMIN        (60-14)
        !            46: 
        !            47: /*
        !            48:  * Ethernet Address Resolution Protocol.
        !            49:  *
        !            50:  * See RFC 826 for protocol description.  Structure below is adapted
        !            51:  * to resolving internet addresses.  Field names used correspond to 
        !            52:  * RFC 826.
        !            53:  */
        !            54: struct ether_arp {
        !            55:        struct  arphdr ea_hdr;  /* fixed-size header */
        !            56:        u_char  arp_sha[6];     /* sender hardware address */
        !            57:        u_char  arp_spa[4];     /* sender protocol address */
        !            58:        u_char  arp_tha[6];     /* target hardware address */
        !            59:        u_char  arp_tpa[4];     /* target protocol address */
        !            60: };
        !            61: #define        arp_hrd ea_hdr.ar_hrd
        !            62: #define        arp_pro ea_hdr.ar_pro
        !            63: #define        arp_hln ea_hdr.ar_hln
        !            64: #define        arp_pln ea_hdr.ar_pln
        !            65: #define        arp_op  ea_hdr.ar_op
        !            66: 
        !            67: 
        !            68: /*
        !            69:  * Structure shared between the ethernet driver modules and
        !            70:  * the address resolution code.  For example, each ec_softc or il_softc
        !            71:  * begins with this structure.
        !            72:  */
        !            73: struct arpcom {
        !            74:        struct  ifnet ac_if;            /* network-visible interface */
        !            75:        u_char  ac_enaddr[6];           /* ethernet hardware address */
        !            76:        struct in_addr ac_ipaddr;       /* copy of ip address- XXX */
        !            77: };
        !            78: 
        !            79: /*
        !            80:  * Internet to ethernet address resolution table.
        !            81:  */
        !            82: struct arptab {
        !            83:        struct  in_addr at_iaddr;       /* internet address */
        !            84:        u_char  at_enaddr[6];           /* ethernet address */
        !            85:        u_char  at_timer;               /* minutes since last reference */
        !            86:        u_char  at_flags;               /* flags */
        !            87:        struct  mbuf *at_hold;          /* last packet until resolved/timeout */
        !            88: };
        !            89: 
        !            90: #ifdef KERNEL
        !            91: u_char etherbroadcastaddr[6];
        !            92: struct arptab *arptnew();
        !            93: int    ether_output(), ether_input();
        !            94: char   *ether_sprintf();
        !            95: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.