ReactOS  0.4.15-dev-5122-g72bdbdd
eth.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS nVidia nForce Ethernet Controller Driver
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Ethernet definitions
5  * COPYRIGHT: Copyright 2021-2022 Dmitry Borisov <di.sean@protonmail.com>
6  */
7 
8 #pragma once
9 
10 #include <pshpack1.h>
11 typedef struct _ETH_HEADER
12 {
17 #include <poppack.h>
18 
19 #define ETH_IS_LOCALLY_ADMINISTERED(Address) \
20  (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x02))
21 
22 #define ETH_IS_EMPTY(Address) \
23  (BOOLEAN)((((PUCHAR)(Address))[0] | ((PUCHAR)(Address))[1] | ((PUCHAR)(Address))[2] | \
24  ((PUCHAR)(Address))[3] | ((PUCHAR)(Address))[5] | ((PUCHAR)(Address))[5]) == 0)
25 
26 typedef struct IPv4_HEADER
27 {
39 
40 typedef struct TCPv4_HEADER
41 {
52 
53 #define IP_HEADER_LENGTH(Header) \
54  (((Header)->VersionLength & 0x0F) << 2)
55 
56 #define TCP_HEADER_LENGTH(Header) \
57  ((Header->DataOffset & 0xF0) >> 2)
UCHAR Source[IEEE_802_ADDR_LENGTH]
Definition: e1000hw.h:29
UCHAR Tos
Definition: eth.h:29
USHORT TotalLength
Definition: eth.h:30
UCHAR DataOffset
Definition: eth.h:46
USHORT Window
Definition: eth.h:48
ULONG Source
Definition: eth.h:36
ULONG Destination
Definition: eth.h:37
UCHAR Flags
Definition: eth.h:47
UCHAR Destination[IEEE_802_ADDR_LENGTH]
Definition: e1000hw.h:28
USHORT PayloadType
Definition: e1000hw.h:30
struct TCPv4_HEADER * PTCPv4_HEADER
USHORT Offset
Definition: eth.h:32
USHORT DestinationPort
Definition: eth.h:43
struct IPv4_HEADER IPv4_HEADER
UCHAR Ttl
Definition: eth.h:33
struct IPv4_HEADER * PIPv4_HEADER
struct TCPv4_HEADER TCPv4_HEADER
UCHAR Protocol
Definition: eth.h:34
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG AckNumber
Definition: eth.h:45
USHORT Checksum
Definition: eth.h:49
USHORT Checksum
Definition: eth.h:35
UCHAR VersionLength
Definition: eth.h:28
USHORT SourcePort
Definition: eth.h:42
struct _ETH_HEADER ETH_HEADER
unsigned short USHORT
Definition: pedump.c:61
#define ETH_LENGTH_OF_ADDRESS
Definition: efilter.h:16
ULONG SequenceNumber
Definition: eth.h:44
unsigned int ULONG
Definition: retypes.h:1
USHORT Id
Definition: eth.h:31
USHORT Urgent
Definition: eth.h:50
struct _ETH_HEADER * PETH_HEADER