The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/net/ethernet.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Fundamental constants relating to ethernet.
    3  *
    4  * $FreeBSD: src/sys/net/ethernet.h,v 1.2.2.1 1999/09/05 08:17:31 peter Exp $
    5  *
    6  */
    7 
    8 #ifndef _NET_ETHERNET_H_
    9 #define _NET_ETHERNET_H_
   10 
   11 /*
   12  * The number of bytes in an ethernet (MAC) address.
   13  */
   14 #define ETHER_ADDR_LEN          6
   15 
   16 /*
   17  * The number of bytes in the type field.
   18  */
   19 #define ETHER_TYPE_LEN          2
   20 
   21 /*
   22  * The number of bytes in the trailing CRC field.
   23  */
   24 #define ETHER_CRC_LEN           4
   25 
   26 /*
   27  * The length of the combined header.
   28  */
   29 #define ETHER_HDR_LEN           (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
   30 
   31 /*
   32  * The minimum packet length.
   33  */
   34 #define ETHER_MIN_LEN           64
   35 
   36 /*
   37  * The maximum packet length.
   38  */
   39 #define ETHER_MAX_LEN           1518
   40 
   41 /*
   42  * A macro to validate a length with
   43  */
   44 #define ETHER_IS_VALID_LEN(foo) \
   45         ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
   46 
   47 /*
   48  * Structure of a 10Mb/s Ethernet header.
   49  */
   50 struct  ether_header {
   51         u_char  ether_dhost[ETHER_ADDR_LEN];
   52         u_char  ether_shost[ETHER_ADDR_LEN];
   53         u_short ether_type;
   54 };
   55 
   56 /*
   57  * Structure of a 48-bit Ethernet address.
   58  */
   59 struct  ether_addr {
   60         u_char octet[ETHER_ADDR_LEN];
   61 };
   62 
   63 #endif

Cache object: c556f3f763089c0f88f5cc3bc0a1a9f5


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.