Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/net
File: ethernet.h
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
[0] Fix | Delete
This file is part of the GNU C Library.
[1] Fix | Delete
[2] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[3] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[4] Fix | Delete
License as published by the Free Software Foundation; either
[5] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[6] Fix | Delete
[7] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[8] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[9] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[10] Fix | Delete
Lesser General Public License for more details.
[11] Fix | Delete
[12] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[13] Fix | Delete
License along with the GNU C Library; if not, see
[14] Fix | Delete
<http://www.gnu.org/licenses/>. */
[15] Fix | Delete
[16] Fix | Delete
/* Based on the FreeBSD version of this file. Curiously, that file
[17] Fix | Delete
lacks a copyright in the header. */
[18] Fix | Delete
[19] Fix | Delete
#ifndef __NET_ETHERNET_H
[20] Fix | Delete
#define __NET_ETHERNET_H 1
[21] Fix | Delete
[22] Fix | Delete
#include <sys/types.h>
[23] Fix | Delete
#include <stdint.h>
[24] Fix | Delete
[25] Fix | Delete
#include <linux/if_ether.h> /* IEEE 802.3 Ethernet constants */
[26] Fix | Delete
[27] Fix | Delete
__BEGIN_DECLS
[28] Fix | Delete
[29] Fix | Delete
/* This is a name for the 48 bit ethernet address available on many
[30] Fix | Delete
systems. */
[31] Fix | Delete
struct ether_addr
[32] Fix | Delete
{
[33] Fix | Delete
uint8_t ether_addr_octet[ETH_ALEN];
[34] Fix | Delete
} __attribute__ ((__packed__));
[35] Fix | Delete
[36] Fix | Delete
/* 10Mb/s ethernet header */
[37] Fix | Delete
struct ether_header
[38] Fix | Delete
{
[39] Fix | Delete
uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
[40] Fix | Delete
uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
[41] Fix | Delete
uint16_t ether_type; /* packet type ID field */
[42] Fix | Delete
} __attribute__ ((__packed__));
[43] Fix | Delete
[44] Fix | Delete
/* Ethernet protocol ID's */
[45] Fix | Delete
#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
[46] Fix | Delete
#define ETHERTYPE_SPRITE 0x0500 /* Sprite */
[47] Fix | Delete
#define ETHERTYPE_IP 0x0800 /* IP */
[48] Fix | Delete
#define ETHERTYPE_ARP 0x0806 /* Address resolution */
[49] Fix | Delete
#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
[50] Fix | Delete
#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */
[51] Fix | Delete
#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */
[52] Fix | Delete
#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
[53] Fix | Delete
#define ETHERTYPE_IPX 0x8137 /* IPX */
[54] Fix | Delete
#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
[55] Fix | Delete
#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
[56] Fix | Delete
[57] Fix | Delete
[58] Fix | Delete
#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
[59] Fix | Delete
#define ETHER_TYPE_LEN 2 /* bytes in type field */
[60] Fix | Delete
#define ETHER_CRC_LEN 4 /* bytes in CRC field */
[61] Fix | Delete
#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
[62] Fix | Delete
#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
[63] Fix | Delete
#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
[64] Fix | Delete
[65] Fix | Delete
/* make sure ethenet length is valid */
[66] Fix | Delete
#define ETHER_IS_VALID_LEN(foo) \
[67] Fix | Delete
((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
[68] Fix | Delete
[69] Fix | Delete
/*
[70] Fix | Delete
* The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
[71] Fix | Delete
* (type-ETHERTYPE_TRAIL)*512 bytes of data followed
[72] Fix | Delete
* by an ETHER type (as given above) and then the (variable-length) header.
[73] Fix | Delete
*/
[74] Fix | Delete
#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
[75] Fix | Delete
#define ETHERTYPE_NTRAILER 16
[76] Fix | Delete
[77] Fix | Delete
#define ETHERMTU ETH_DATA_LEN
[78] Fix | Delete
#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
[79] Fix | Delete
[80] Fix | Delete
__END_DECLS
[81] Fix | Delete
[82] Fix | Delete
#endif /* net/ethernet.h */
[83] Fix | Delete
[84] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function