2000-08-02 00:24:26 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS TCP/IP protocol driver
|
|
|
|
* FILE: include/lan.h
|
|
|
|
* PURPOSE: LAN adapter definitions
|
|
|
|
*/
|
|
|
|
|
2010-02-26 11:43:19 +00:00
|
|
|
#pragma once
|
2000-08-02 00:24:26 +00:00
|
|
|
|
2004-02-09 06:59:01 +00:00
|
|
|
/* Media we support */
|
2000-08-02 00:24:26 +00:00
|
|
|
#define MEDIA_ETH 0
|
|
|
|
|
|
|
|
#define MAX_MEDIA 1
|
|
|
|
|
|
|
|
#define IEEE_802_ADDR_LENGTH 6
|
|
|
|
|
|
|
|
/* Ethernet header layout */
|
|
|
|
typedef struct ETH_HEADER {
|
|
|
|
UCHAR DstAddr[IEEE_802_ADDR_LENGTH]; /* Destination MAC address */
|
|
|
|
UCHAR SrcAddr[IEEE_802_ADDR_LENGTH]; /* Source MAC address */
|
|
|
|
USHORT EType; /* Ethernet protocol type */
|
|
|
|
} ETH_HEADER, *PETH_HEADER;
|
|
|
|
|
|
|
|
#define MAX_MEDIA_ETH sizeof(ETH_HEADER)
|
|
|
|
|
|
|
|
/* Broadcast masks */
|
|
|
|
#define BCAST_ETH_MASK 0x01
|
|
|
|
|
|
|
|
/* Broadcast values to check against */
|
|
|
|
#define BCAST_ETH_CHECK 0x01
|
|
|
|
|
|
|
|
/* Offset of broadcast address */
|
|
|
|
#define BCAST_ETH_OFFSET 0x00
|
|
|
|
|
2004-09-25 20:24:00 +00:00
|
|
|
/* Max packets queued for a single adapter */
|
|
|
|
#define IP_MAX_RECV_BACKLOG 0x20
|
|
|
|
|
2000-08-02 00:24:26 +00:00
|
|
|
/* Per adapter information */
|
|
|
|
typedef struct LAN_ADAPTER {
|
2000-08-27 16:28:59 +00:00
|
|
|
LIST_ENTRY ListEntry; /* Entry on list */
|
2000-08-02 00:24:26 +00:00
|
|
|
KSPIN_LOCK Lock; /* Lock for this structure */
|
- Merge 54929, 54930, 54932, 54933, 54934, 54939, 54941, 54942, 54944, 54945, 54946, and 54947
- The DHCP service now recognizes adapter configuration and media state changes without manual intervention
- Multiple bugs with a static IP configuration are fixed
- IpRenewAddress (ipconfig /renew) and IpReleaseAddress (ipconfig /release) no longer corrupt internal DHCP state
- Routes that cannot currently be resolved by ARP no longer become corrupted by the neighbor timeout
svn path=/trunk/; revision=54966
2012-01-14 19:42:58 +00:00
|
|
|
UCHAR State, OldState; /* State of the adapter */
|
|
|
|
BOOLEAN CompletingReset; /* Reset is finishing */
|
2000-08-02 00:24:26 +00:00
|
|
|
KEVENT Event; /* Opening event */
|
|
|
|
PVOID Context; /* Upper layer context information */
|
|
|
|
NDIS_HANDLE NdisHandle; /* NDIS binding handle */
|
|
|
|
NDIS_STATUS NdisStatus; /* NDIS status of last request */
|
|
|
|
NDIS_MEDIUM Media; /* Media type */
|
|
|
|
UCHAR HWAddress[IEEE_802_ADDR_LENGTH]; /* Local HW address */
|
|
|
|
UINT HWAddressLength; /* Length of HW address */
|
|
|
|
UCHAR BCastMask; /* Mask for checking broadcast */
|
|
|
|
UCHAR BCastCheck; /* Value to check against */
|
|
|
|
UCHAR BCastOffset; /* Offset in frame to check against */
|
|
|
|
UCHAR HeaderSize; /* Size of link-level header */
|
|
|
|
USHORT MTU; /* Maximum Transfer Unit */
|
|
|
|
UINT MinFrameSize; /* Minimum frame size in bytes */
|
|
|
|
UINT MaxPacketSize; /* Maximum packet size when sending */
|
|
|
|
UINT MaxSendPackets; /* Maximum number of packets per send */
|
|
|
|
UINT MacOptions; /* MAC options for NIC driver/adapter */
|
|
|
|
UINT Speed; /* Link speed */
|
|
|
|
UINT PacketFilter; /* Packet filter for this adapter */
|
|
|
|
} LAN_ADAPTER, *PLAN_ADAPTER;
|
|
|
|
|
|
|
|
/* LAN adapter state constants */
|
|
|
|
#define LAN_STATE_OPENING 0
|
|
|
|
#define LAN_STATE_RESETTING 1
|
|
|
|
#define LAN_STATE_STARTED 2
|
|
|
|
#define LAN_STATE_STOPPED 3
|
|
|
|
|
|
|
|
/* Size of out lookahead buffer */
|
|
|
|
#define LOOKAHEAD_SIZE 128
|
|
|
|
|
|
|
|
/* Ethernet types. We swap constants so we can compare values at runtime
|
2000-08-27 16:28:59 +00:00
|
|
|
without swapping them there */
|
2000-08-02 00:24:26 +00:00
|
|
|
#define ETYPE_IPv4 WH2N(0x0800)
|
2004-02-09 06:59:01 +00:00
|
|
|
#define ETYPE_IPv6 WH2N(0x86DD)
|
2000-08-02 00:24:26 +00:00
|
|
|
#define ETYPE_ARP WH2N(0x0806)
|
|
|
|
|
|
|
|
/* Protocols */
|
|
|
|
#define LAN_PROTO_IPv4 0x0000 /* Internet Protocol version 4 */
|
|
|
|
#define LAN_PROTO_IPv6 0x0001 /* Internet Protocol version 6 */
|
|
|
|
#define LAN_PROTO_ARP 0x0002 /* Address Resolution Protocol */
|
|
|
|
|
|
|
|
|
|
|
|
NDIS_STATUS LANRegisterAdapter(
|
2003-12-17 23:34:35 +00:00
|
|
|
PNDIS_STRING AdapterName,
|
|
|
|
PNDIS_STRING RegistryPath);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
|
|
|
NDIS_STATUS LANUnregisterAdapter(
|
|
|
|
PLAN_ADAPTER Adapter);
|
|
|
|
|
|
|
|
NTSTATUS LANRegisterProtocol(
|
2003-08-04 19:31:06 +00:00
|
|
|
PNDIS_STRING Name);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
2009-05-05 23:43:18 +00:00
|
|
|
VOID NTAPI
|
|
|
|
LANUnregisterProtocol(VOID);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
2011-03-15 18:41:17 +00:00
|
|
|
VOID LANStartup(VOID);
|
|
|
|
VOID LANShutdown(VOID);
|
2004-09-25 20:24:00 +00:00
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
NTSTATUS TcpipLanGetDwordOid( PIP_INTERFACE Interface, NDIS_OID Oid,
|
2008-11-27 15:02:47 +00:00
|
|
|
PULONG Result );
|
2005-03-18 03:26:12 +00:00
|
|
|
|
2004-08-19 21:39:00 +00:00
|
|
|
NDIS_STATUS NDISCall(
|
|
|
|
PLAN_ADAPTER Adapter,
|
|
|
|
NDIS_REQUEST_TYPE Type,
|
|
|
|
NDIS_OID OID,
|
|
|
|
PVOID Buffer,
|
|
|
|
UINT Length);
|
|
|
|
|
2000-08-02 00:24:26 +00:00
|
|
|
/* EOF */
|