ReactOS 0.4.15-dev-7705-g2320c37
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>
11typedef 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
26typedef struct IPv4_HEADER
27{
39
40typedef 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)
#define ETH_LENGTH_OF_ADDRESS
Definition: efilter.h:16
struct _ETH_HEADER ETH_HEADER
struct IPv4_HEADER * PIPv4_HEADER
struct TCPv4_HEADER TCPv4_HEADER
struct IPv4_HEADER IPv4_HEADER
struct TCPv4_HEADER * PTCPv4_HEADER
struct _ETH_HEADER * PETH_HEADER
unsigned short USHORT
Definition: pedump.c:61
UCHAR Tos
Definition: eth.h:29
UCHAR Ttl
Definition: eth.h:33
ULONG Destination
Definition: eth.h:37
USHORT Id
Definition: eth.h:31
USHORT TotalLength
Definition: eth.h:30
USHORT Offset
Definition: eth.h:32
ULONG Source
Definition: eth.h:36
UCHAR VersionLength
Definition: eth.h:28
UCHAR Protocol
Definition: eth.h:34
USHORT Checksum
Definition: eth.h:35
UCHAR Flags
Definition: eth.h:47
USHORT Window
Definition: eth.h:48
USHORT Checksum
Definition: eth.h:49
USHORT Urgent
Definition: eth.h:50
USHORT SourcePort
Definition: eth.h:42
USHORT DestinationPort
Definition: eth.h:43
ULONG AckNumber
Definition: eth.h:45
ULONG SequenceNumber
Definition: eth.h:44
UCHAR DataOffset
Definition: eth.h:46
UCHAR Destination[ETH_LENGTH_OF_ADDRESS]
Definition: util.h:13
UCHAR Source[ETH_LENGTH_OF_ADDRESS]
Definition: util.h:14
USHORT PayloadType
Definition: util.h:15
uint32_t ULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181