1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)if_ether.h	7.1 (Berkeley) 6/5/86
   7:  */
   8: 
   9: /*
  10:  * Structure of a 10Mb/s Ethernet header.
  11:  */
  12: struct  ether_header {
  13:     u_char  ether_dhost[6];
  14:     u_char  ether_shost[6];
  15:     u_short ether_type;
  16: };
  17: 
  18: #define ETHERTYPE_PUP   0x0200      /* PUP protocol */
  19: #define ETHERTYPE_IP    0x0800      /* IP protocol */
  20: #define ETHERTYPE_ARP   0x0806      /* Addr. resolution protocol */
  21: 
  22: /*
  23:  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
  24:  * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
  25:  * by an ETHER type (as given above) and then the (variable-length) header.
  26:  */
  27: #define ETHERTYPE_TRAIL     0x1000      /* Trailer packet */
  28: #define ETHERTYPE_NTRAILER  16
  29: 
  30: #define ETHERMTU    1500
  31: #define ETHERMIN    (60-14)
  32: 
  33: /*
  34:  * Ethernet Address Resolution Protocol.
  35:  *
  36:  * See RFC 826 for protocol description.  Structure below is adapted
  37:  * to resolving internet addresses.  Field names used correspond to
  38:  * RFC 826.
  39:  */
  40: struct  ether_arp {
  41:     struct  arphdr ea_hdr;  /* fixed-size header */
  42:     u_char  arp_sha[6]; /* sender hardware address */
  43:     u_char  arp_spa[4]; /* sender protocol address */
  44:     u_char  arp_tha[6]; /* target hardware address */
  45:     u_char  arp_tpa[4]; /* target protocol address */
  46: };
  47: #define arp_hrd ea_hdr.ar_hrd
  48: #define arp_pro ea_hdr.ar_pro
  49: #define arp_hln ea_hdr.ar_hln
  50: #define arp_pln ea_hdr.ar_pln
  51: #define arp_op  ea_hdr.ar_op
  52: 
  53: 
  54: /*
  55:  * Structure shared between the ethernet driver modules and
  56:  * the address resolution code.  For example, each ec_softc or il_softc
  57:  * begins with this structure.
  58:  */
  59: struct  arpcom {
  60:     struct  ifnet ac_if;        /* network-visible interface */
  61:     u_char  ac_enaddr[6];       /* ethernet hardware address */
  62:     struct in_addr ac_ipaddr;   /* copy of ip address- XXX */
  63: };
  64: 
  65: /*
  66:  * Internet to ethernet address resolution table.
  67:  */
  68: struct  arptab {
  69:     struct  in_addr at_iaddr;   /* internet address */
  70:     u_char  at_enaddr[6];       /* ethernet address */
  71:     u_char  at_timer;       /* minutes since last reference */
  72:     u_char  at_flags;       /* flags */
  73:     struct  mbuf *at_hold;      /* last packet until resolved/timeout */
  74: };
  75: 
  76: #ifdef  KERNEL
  77: u_char etherbroadcastaddr[6];
  78: struct  arptab *arptnew();
  79: char *ether_sprintf();
  80: #endif

Defined struct's

arpcom defined in line 59; used 38 times
arptab defined in line 68; used 20 times
ether_arp defined in line 40; used 10 times
ether_header defined in line 12; used 130 times

Defined macros

ETHERTYPE_ARP defined in line 20; used 2 times
ETHERTYPE_PUP defined in line 18; never used
arp_hln defined in line 49; used 1 times
arp_hrd defined in line 47; used 1 times
arp_op defined in line 51; used 3 times
arp_pln defined in line 50; used 1 times
arp_pro defined in line 48; used 4 times

Usage of this include

Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1257
Valid CSS Valid XHTML 1.0 Strict