Home | History | Annotate | Download | only in Export_Inc
      1 /*
      2  * Ethernet.h
      3  *
      4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  *
     11  *  * Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  *  * Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in
     15  *    the documentation and/or other materials provided with the
     16  *    distribution.
     17  *  * Neither the name Texas Instruments nor the names of its
     18  *    contributors may be used to endorse or promote products derived
     19  *    from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  */
     33 
     34 
     35 /***************************************************************************/
     36 /*                                                                         */
     37 /*    MODULE:   Ethernet.h                                                     */
     38 /*    PURPOSE:                                                             */
     39 /*                                                                         */
     40 /***************************************************************************/
     41 #ifndef _ETHERNET_H_
     42 #define _ETHERNET_H_
     43 
     44 
     45 typedef struct
     46 {
     47     TMacAddr        dst;
     48     TMacAddr        src;
     49     TI_UINT16       type;
     50 
     51 } TEthernetHeader;
     52 
     53 
     54 typedef struct
     55 {
     56     TMacAddr        dst;
     57     TMacAddr        src;
     58     TI_UINT16       length;
     59     TI_UINT8        dsap;
     60     TI_UINT8        ssap;
     61     TI_UINT8        control;
     62     TI_UINT8        oui[3];
     63     TI_UINT16       type;
     64 
     65 } TLlcSnapHeader;
     66 
     67 
     68 #define ETHERTYPE_802_1D                        0x8100
     69 #define ETHERTYPE_EAPOL                         0x888e
     70 #define ETHERTYPE_PREAUTH_EAPOL                 0x88c7
     71 #define ETHERTYPE_IP                            0x0800
     72 #define ETHERTYPE_APPLE_AARP                    0x80f3
     73 #define ETHERTYPE_DIX_II_IPX                    0x8137
     74 
     75 #define ETHERNET_HDR_LEN                        14
     76 #define IEEE802_3_HDR_LEN                       14
     77 #define LLC_SNAP_HDR_LEN                        20
     78 
     79 #define SNAP_CHANNEL_ID                         0xAA
     80 #define LLC_CONTROL_UNNUMBERED_INFORMATION      0x03
     81 #define ETHERNET_MAX_PAYLOAD_SIZE               1500
     82 
     83 #define SNAP_OUI_802_1H_BYTE0                   0x00
     84 #define SNAP_OUI_802_1H_BYTE1                   0x00
     85 #define SNAP_OUI_802_1H_BYTE2                   0xf8
     86 #define SNAP_OUI_802_1H_BYTES  { SNAP_OUI_802_1H_BYTE0, SNAP_OUI_802_1H_BYTE1, SNAP_OUI_802_1H_BYTE2 }
     87 
     88 #define SNAP_OUI_RFC1042_BYTE0                  0x00
     89 #define SNAP_OUI_RFC1042_BYTE1                  0x00
     90 #define SNAP_OUI_RFC1042_BYTE2                  0x00
     91 #define SNAP_OUI_RFC1042_LEN                    3
     92 #define SNAP_OUI_RFC1042_BYTES { SNAP_OUI_RFC1042_BYTE0, SNAP_OUI_RFC1042_BYTE1, SNAP_OUI_RFC1042_BYTE2 }
     93 
     94 
     95 #endif
     96