home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / bsd / netinet / if_ether.h < prev    next >
Text File  |  1992-07-29  |  3KB  |  90 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  * Copyright (c) 1982, 1986 Regents of the University of California.
  9.  * All rights reserved.
  10.  *
  11.  * Redistribution and use in source and binary forms are permitted
  12.  * provided that this notice is preserved and that due credit is given
  13.  * to the University of California at Berkeley. The name of the University
  14.  * may not be used to endorse or promote products derived from this
  15.  * software without specific prior written permission. This software
  16.  * is provided ``as is'' without express or implied warranty.
  17.  *
  18.  *    @(#)if_ether.h    7.2 (Berkeley) 12/7/87
  19.  *
  20.  * HISTORY
  21.  * 09-Apr-90  Bradley Taylor (btaylor) at NeXT, Inc.
  22.  *    Move Ethernet definitions to <net/etherdefs.h>. Leave arp stuff here.
  23.  *
  24.  * 20-Oct-87  Peter King (king) at NeXT, Inc.
  25.  *    SUN_RPC: Add definition for ether_addr.  Add RARP support.
  26.  *
  27.  * 25-Jan-86  Avadis Tevanian (avie) at Carnegie-Mellon University
  28.  *    Upgraded to 4.3.
  29.  *
  30.  * 15-Aug@ Mike Accetta (mja) at Carnegie-Mellon University
  31.  *    CS_INET:  added ac_if field to arptab definition to allow
  32.  *    multiple interfaces to co-exist.
  33.  *    [V1(1)]
  34.  */
  35.  
  36. /*    @(#)if_ether.h    2.1 88/05/18 4.0NFSSRC SMI;    from UCB 7.1 6/5/86    */
  37.  
  38. #import <net/etherdefs.h>
  39.  
  40.  
  41. /*
  42.  * Ethernet Address Resolution Protocol.
  43.  *
  44.  * See RFC 826 for protocol description.  Structure below is adapted
  45.  * to resolving internet addresses.  Field names used correspond to 
  46.  * RFC 826.
  47.  */
  48. struct    ether_arp {
  49.     struct    arphdr ea_hdr;    /* fixed-size header */
  50.     u_char    arp_sha[6];    /* sender hardware address */
  51.     u_char    arp_spa[4];    /* sender protocol address */
  52.     u_char    arp_tha[6];    /* target hardware address */
  53.     u_char    arp_tpa[4];    /* target protocol address */
  54. };
  55. #define    arp_hrd    ea_hdr.ar_hrd
  56. #define    arp_pro    ea_hdr.ar_pro
  57. #define    arp_hln    ea_hdr.ar_hln
  58. #define    arp_pln    ea_hdr.ar_pln
  59. #define    arp_op    ea_hdr.ar_op
  60.  
  61.  
  62. /*
  63.  * Structure shared between the ethernet driver modules and
  64.  * the address resolution code.  For example, each ec_softc or il_softc
  65.  * begins with this structure.
  66.  */
  67. struct    arpcom {
  68.     struct     ifnet ac_if;        /* network-visible interface */
  69.     u_char    ac_enaddr[6];        /* ethernet hardware address */
  70.     struct in_addr ac_ipaddr;    /* copy of ip address- XXX */
  71. };
  72.  
  73. /*
  74.  * Internet to ethernet address resolution table.
  75.  */
  76. struct    arptab {
  77.     struct    in_addr at_iaddr;    /* internet address */
  78.     u_char    at_enaddr[6];        /* ethernet address */
  79.     u_char    at_timer;        /* minutes since last reference */
  80.     u_char    at_flags;        /* flags */
  81.     struct    mbuf *at_hold;        /* last packet until resolved/timeout */
  82.     struct  ifnet *at_if;        /* interface (CS_INET) */
  83. };
  84.  
  85. #ifdef    KERNEL
  86. u_char etherbroadcastaddr[6];
  87. struct    arptab *arptnew();
  88. char *ether_sprintf();
  89. #endif
  90.