mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
Interface for lan.sys
svn path=/trunk/; revision=10886
This commit is contained in:
parent
83fc2a9406
commit
77700375d6
2 changed files with 129 additions and 0 deletions
79
reactos/include/net/lan.h
Normal file
79
reactos/include/net/lan.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
#ifndef _NET_LAN_H
|
||||
|
||||
#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) ); \
|
||||
}
|
||||
|
||||
#endif/*_NET_LAN_H*/
|
50
reactos/include/net/wh.h
Normal file
50
reactos/include/net/wh.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#ifndef _NET_WH_H
|
||||
#define _NET_WH_H
|
||||
|
||||
#ifdef i386
|
||||
|
||||
/* DWORD network to host byte order conversion for i386 */
|
||||
#define DN2H(dw) \
|
||||
((((dw) & 0xFF000000L) >> 24) | \
|
||||
(((dw) & 0x00FF0000L) >> 8) | \
|
||||
(((dw) & 0x0000FF00L) << 8) | \
|
||||
(((dw) & 0x000000FFL) << 24))
|
||||
|
||||
/* DWORD host to network byte order conversion for i386 */
|
||||
#define DH2N(dw) \
|
||||
((((dw) & 0xFF000000L) >> 24) | \
|
||||
(((dw) & 0x00FF0000L) >> 8) | \
|
||||
(((dw) & 0x0000FF00L) << 8) | \
|
||||
(((dw) & 0x000000FFL) << 24))
|
||||
|
||||
/* WORD network to host order conversion for i386 */
|
||||
#define WN2H(w) \
|
||||
((((w) & 0xFF00) >> 8) | \
|
||||
(((w) & 0x00FF) << 8))
|
||||
|
||||
/* WORD host to network byte order conversion for i386 */
|
||||
#define WH2N(w) \
|
||||
((((w) & 0xFF00) >> 8) | \
|
||||
(((w) & 0x00FF) << 8))
|
||||
|
||||
#else /* i386 */
|
||||
|
||||
/* DWORD network to host byte order conversion for other architectures */
|
||||
#define DN2H(dw) \
|
||||
(dw)
|
||||
|
||||
/* DWORD host to network byte order conversion for other architectures */
|
||||
#define DH2N(dw) \
|
||||
(dw)
|
||||
|
||||
/* WORD network to host order conversion for other architectures */
|
||||
#define WN2H(w) \
|
||||
(w)
|
||||
|
||||
/* WORD host to network byte order conversion for other architectures */
|
||||
#define WH2N(w) \
|
||||
(w)
|
||||
|
||||
#endif /* i386 */
|
||||
|
||||
#endif/*_NET_WH_H*/
|
Loading…
Reference in a new issue