ReactOS  0.4.14-dev-293-g2b39b42
net_lan.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "net_wh.h"
4 
5 #define FSCTL_LAN_BASE FILE_DEVICE_NETWORK
6 #define _LAN_CONTROL_CODE(Function, Method) \
7  CTL_CODE(FSCTL_LAN_BASE, Function, Method, FILE_WRITE_ACCESS)
8 
9 #define LAN_ENUM_ADAPTERS 0
10 #define LAN_BUFFERED_MODE 1
11 #define LAN_ADAPTER_INFO 2
12 
13 #define IOCTL_IF_ENUM_ADAPTERS \
14  _LAN_CONTROL_CODE(LAN_ENUM_ADAPTERS,METHOD_BUFFERED)
15 #define IOCTL_IF_BUFFERED_MODE \
16  _LAN_CONTROL_CODE(LAN_BUFFERED_MODE,METHOD_BUFFERED)
17 #define IOCTL_IF_ADAPTER_INFO \
18  _LAN_CONTROL_CODE(LAN_ADAPTER_INFO,METHOD_BUFFERED)
19 
20 typedef struct _LAN_PACKET_HEADER_T {
27 
28 typedef struct _LAN_PACKET_HEADER {
32 
33 typedef struct _LAN_ADDRESS {
42 
43 typedef struct _LAN_ADAPTER_INFO_S {
52 
53 #define LAN_DATA_PTR(PH) \
54  ((PH)->Address + (PH)->Fixed.AddressLen)
55 #define LAN_ALLOC_SIZE(AddrLen,PayloadLen) \
56  (sizeof(LAN_PACKET_HEADER_T) + (AddrLen) + (PayloadLen))
57 #define LAN_PAYLOAD_SIZE(PH,Size) \
58  (Size - (PH)->Fixed.AddressLen - sizeof(LAN_PACKET_HEADER_T))
59 
60 #define LAN_ADDR_SIZE(AddrLen,HWAddrLen) \
61  (sizeof(LAN_ADDRESS) - 1 + (AddrLen) + (HWAddrLen))
62 #define LAN_ADDR_PTR(LA) \
63  ((LA)->Address)
64 #define LAN_HWADDR_PTR(LA) \
65  ((LA)->Address + (LA)->AddressLen)
66 
67 #define LAN_EA_INFO_SIZE(NumTypes) \
68  sizeof(FILE_FULL_EA_INFORMATION) + (6 + sizeof(USHORT) * NumTypes)
69 #define LAN_FILL_EA_INFO(Ea,NumTypes,Types) \
70  { \
71  RtlCopyMemory( (Ea)->EaName, "TYPES", 6 ); \
72  (Ea)->EaNameLength = 6; \
73  (Ea)->EaValueLength = sizeof(USHORT) * (NumTypes); \
74  RtlCopyMemory( (Ea)->EaName + (Ea)->EaNameLength, \
75  (Types), \
76  sizeof(USHORT) * (NumTypes) ); \
77  }
USHORT HWAddressType
Definition: net_lan.h:38
LAN_PACKET_HEADER_T Fixed
Definition: net_lan.h:29
char CHAR
Definition: xmlstorage.h:175
struct _LAN_PACKET_HEADER_T * PLAN_PACKET_HEADER_T
USHORT RegKeySize
Definition: net_lan.h:50
struct _LAN_ADDRESS LAN_ADDRESS
struct _LAN_ADDRESS * PLAN_ADDRESS
USHORT AddressLen
Definition: net_lan.h:47
USHORT HWAddressLen
Definition: net_lan.h:39
struct _LAN_PACKET_HEADER_T LAN_PACKET_HEADER_T
UINT Adapter
Definition: net_lan.h:34
USHORT AddressType
Definition: net_lan.h:36
CHAR Address[1]
Definition: net_lan.h:40
struct _LAN_PACKET_HEADER LAN_PACKET_HEADER
UINT Flags
Definition: net_lan.h:35
struct _LAN_PACKET_HEADER * PLAN_PACKET_HEADER
unsigned short USHORT
Definition: pedump.c:61
unsigned int UINT
Definition: ndis.h:50
USHORT AddressLen
Definition: net_lan.h:37
struct _LAN_ADAPTER_INFO_S LAN_ADAPTER_INFO_S
struct _LAN_ADAPTER_INFO_S * PLAN_ADAPTER_INFO_S
CHAR Address[1]
Definition: net_lan.h:30