reactos/drivers/network/lan/include/net_lan.h
Cameron Gutman c2d0d784c7 [USB-BRINGUP-TRUNK]
- Create a branch to do a proper merge of USB work from a trunk base instead of from cmake-bringup
- In the future, DO NOT under any circumstances branch another branch. This leads to merge problems!

svn path=/branches/usb-bringup-trunk/; revision=55018
2012-01-20 20:58:46 +00:00

77 lines
2.2 KiB
C

#pragma once
#include "net_wh.h"
#define FSCTL_LAN_BASE FILE_DEVICE_NETWORK
#define _LAN_CONTROL_CODE(Function, Method) \
CTL_CODE(FSCTL_LAN_BASE, Function, Method, FILE_WRITE_ACCESS)
#define LAN_ENUM_ADAPTERS 0
#define LAN_BUFFERED_MODE 1
#define LAN_ADAPTER_INFO 2
#define IOCTL_IF_ENUM_ADAPTERS \
_LAN_CONTROL_CODE(LAN_ENUM_ADAPTERS,METHOD_BUFFERED)
#define IOCTL_IF_BUFFERED_MODE \
_LAN_CONTROL_CODE(LAN_BUFFERED_MODE,METHOD_BUFFERED)
#define IOCTL_IF_ADAPTER_INFO \
_LAN_CONTROL_CODE(LAN_ADAPTER_INFO,METHOD_BUFFERED)
typedef struct _LAN_PACKET_HEADER_T {
UINT Adapter;
UINT AddressType;
UINT AddressLen;
UINT PacketType;
PVOID Mdl;
} LAN_PACKET_HEADER_T, *PLAN_PACKET_HEADER_T;
typedef struct _LAN_PACKET_HEADER {
LAN_PACKET_HEADER_T Fixed;
CHAR Address[1];
} LAN_PACKET_HEADER, *PLAN_PACKET_HEADER;
typedef struct _LAN_ADDRESS {
UINT Adapter;
UINT Flags;
USHORT AddressType;
USHORT AddressLen;
USHORT HWAddressType;
USHORT HWAddressLen;
CHAR Address[1];
} LAN_ADDRESS, *PLAN_ADDRESS;
typedef struct _LAN_ADAPTER_INFO_S {
UINT Index;
UINT Media;
UINT Speed;
USHORT AddressLen;
USHORT Overhead;
USHORT MTU;
USHORT RegKeySize;
} LAN_ADAPTER_INFO_S, *PLAN_ADAPTER_INFO_S;
#define LAN_DATA_PTR(PH) \
((PH)->Address + (PH)->Fixed.AddressLen)
#define LAN_ALLOC_SIZE(AddrLen,PayloadLen) \
(sizeof(LAN_PACKET_HEADER_T) + (AddrLen) + (PayloadLen))
#define LAN_PAYLOAD_SIZE(PH,Size) \
(Size - (PH)->Fixed.AddressLen - sizeof(LAN_PACKET_HEADER_T))
#define LAN_ADDR_SIZE(AddrLen,HWAddrLen) \
(sizeof(LAN_ADDRESS) - 1 + (AddrLen) + (HWAddrLen))
#define LAN_ADDR_PTR(LA) \
((LA)->Address)
#define LAN_HWADDR_PTR(LA) \
((LA)->Address + (LA)->AddressLen)
#define LAN_EA_INFO_SIZE(NumTypes) \
sizeof(FILE_FULL_EA_INFORMATION) + (6 + sizeof(USHORT) * NumTypes)
#define LAN_FILL_EA_INFO(Ea,NumTypes,Types) \
{ \
RtlCopyMemory( (Ea)->EaName, "TYPES", 6 ); \
(Ea)->EaNameLength = 6; \
(Ea)->EaValueLength = sizeof(USHORT) * (NumTypes); \
RtlCopyMemory( (Ea)->EaName + (Ea)->EaNameLength, \
(Types), \
sizeof(USHORT) * (NumTypes) ); \
}