ReactOS 0.4.16-dev-92-g0c2cdca
ip.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IP_ADDRESS
 
struct  IPv4_HEADER
 
struct  IPv6_HEADER
 
union  _IP_HEADER
 
struct  _IP_PACKET
 
struct  _PACKET_CONTEXT
 
struct  _LLIP_BIND_INFO
 
struct  _SEND_RECV_STATS
 
struct  _IP_INTERFACE
 
struct  _IP_SET_ADDRESS
 

Macros

#define FOURCC(a, b, c, d)   (((a)<<24)|((b)<<16)|((c)<<8)|(d))
 
#define IP_ADDRESS_V4   0x04 /* IPv4 style address */
 
#define IP_ADDRESS_V6   0x06 /* IPv6 style address */
 
#define IPv4_FRAGOFS_MASK   0x1FFF /* Fragment offset mask (host byte order) */
 
#define IPv4_MF_MASK   0x2000 /* More fragments (host byte order) */
 
#define IPv4_DF_MASK   0x4000 /* Don't fragment (host byte order) */
 
#define IPv4_MAX_HEADER_SIZE   60
 
#define IP_PACKET_FLAG_RAW   0x01 /* Raw IP packet */
 
#define PC(Packet)   ((PPACKET_CONTEXT)(&Packet->ProtocolReserved))
 
#define ADE_UNICAST   0x01
 
#define ADE_BROADCAST   0x02
 
#define ADE_ADDRMASK   0x04
 
#define ADE_POINTOPOINT   0x10
 
#define ADE_MULTICAST   0x8000
 
#define IP_PROTOCOL_TABLE_SIZE   0x100
 
#define LOOPBACK_ADDRESS_IPv4   ((IPv4_RAW_ADDRESS)DH2N(0x7F000001))
 
#define LOOPBACK_BCASTADDR_IPv4   ((IPv4_RAW_ADDRESS)DH2N(0x7FFFFFFF))
 
#define LOOPBACK_ADDRMASK_IPv4   ((IPv4_RAW_ADDRESS)DH2N(0xFF000000))
 
#define IPPROTO_RAW   0 /* Raw IP */
 
#define IPPROTO_ICMP   1 /* Internet Control Message Protocol */
 
#define IPPROTO_IGMP   2 /* Internet Group Management Protocol */
 
#define IPPROTO_TCP   6 /* Transmission Control Protocol */
 
#define IPPROTO_UDP   17 /* User Datagram Protocol */
 
#define IP_TIMEOUT   1000 /* Timeout in milliseconds */
 
#define IP_DEFAULT_LINK_SPEED   10000
 

Typedefs

typedef VOID(* OBJECT_FREE_ROUTINE) (PVOID Object)
 
typedef ULONG IPv4_RAW_ADDRESS
 
typedef IPv4_RAW_ADDRESSPIPv4_RAW_ADDRESS
 
typedef USHORT IPv6_RAW_ADDRESS[8]
 
typedef IPv6_RAW_ADDRESSPIPv6_RAW_ADDRESS
 
typedef struct IP_ADDRESS IP_ADDRESS
 
typedef struct IP_ADDRESSPIP_ADDRESS
 
typedef struct IPv4_HEADER IPv4_HEADER
 
typedef struct IPv4_HEADERPIPv4_HEADER
 
typedef struct IPv6_HEADER IPv6_HEADER
 
typedef struct IPv6_HEADERPIPv6_HEADER
 
typedef union _IP_HEADER IP_HEADER
 
typedef union _IP_HEADERPIP_HEADER
 
typedef VOID(* PACKET_COMPLETION_ROUTINE) (PVOID Context, PNDIS_PACKET NdisPacket, NDIS_STATUS NdisStatus)
 
typedef struct _IP_PACKET IP_PACKET
 
typedef struct _IP_PACKETPIP_PACKET
 
typedef struct _PACKET_CONTEXT PACKET_CONTEXT
 
typedef struct _PACKET_CONTEXTPPACKET_CONTEXT
 
typedef VOID(* LL_TRANSMIT_ROUTINE) (PVOID Context, PNDIS_PACKET NdisPacket, UINT Offset, PVOID LinkAddress, USHORT Type)
 
typedef struct _LLIP_BIND_INFO LLIP_BIND_INFO
 
typedef struct _LLIP_BIND_INFOPLLIP_BIND_INFO
 
typedef struct _SEND_RECV_STATS SEND_RECV_STATS
 
typedef struct _SEND_RECV_STATSPSEND_RECV_STATS
 
typedef struct _IP_INTERFACE IP_INTERFACE
 
typedef struct _IP_INTERFACEPIP_INTERFACE
 
typedef struct _IP_SET_ADDRESS IP_SET_ADDRESS
 
typedef struct _IP_SET_ADDRESSPIP_SET_ADDRESS
 
typedef VOID(* IP_PROTOCOL_HANDLER) (PIP_INTERFACE Interface, PIP_PACKET IPPacket)
 

Functions

PIP_PACKET IPCreatePacket (ULONG Type)
 
PIP_PACKET IPInitializePacket (PIP_PACKET IPPacket, ULONG Type)
 
PIP_INTERFACE IPCreateInterface (PLLIP_BIND_INFO BindInfo)
 
VOID IPAddInterfaceRoute (PIP_INTERFACE IF)
 
VOID IPRemoveInterfaceRoute (PIP_INTERFACE IF)
 
VOID IPDestroyInterface (PIP_INTERFACE IF)
 
BOOLEAN IPRegisterInterface (PIP_INTERFACE IF)
 
VOID IPUnregisterInterface (PIP_INTERFACE IF)
 
VOID NTAPI IPTimeoutDpcFn (PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
 
VOID IPDispatchProtocol (PIP_INTERFACE Interface, PIP_PACKET IPPacket)
 
VOID IPRegisterProtocol (UINT ProtocolNumber, IP_PROTOCOL_HANDLER Handler)
 
NTSTATUS IPStartup (PUNICODE_STRING RegistryPath)
 
NTSTATUS IPShutdown (VOID)
 

Variables

LIST_ENTRY InterfaceListHead
 
KSPIN_LOCK InterfaceListLock
 
LIST_ENTRY NetTableListHead
 
KSPIN_LOCK NetTableListLock
 

Macro Definition Documentation

◆ ADE_ADDRMASK

#define ADE_ADDRMASK   0x04

Definition at line 112 of file ip.h.

◆ ADE_BROADCAST

#define ADE_BROADCAST   0x02

Definition at line 111 of file ip.h.

◆ ADE_MULTICAST

#define ADE_MULTICAST   0x8000

Definition at line 114 of file ip.h.

◆ ADE_POINTOPOINT

#define ADE_POINTOPOINT   0x10

Definition at line 113 of file ip.h.

◆ ADE_UNICAST

#define ADE_UNICAST   0x01

Definition at line 110 of file ip.h.

◆ FOURCC

#define FOURCC (   a,
  b,
  c,
  d 
)    (((a)<<24)|((b)<<16)|((c)<<8)|(d))

Definition at line 12 of file ip.h.

◆ IP_ADDRESS_V4

#define IP_ADDRESS_V4   0x04 /* IPv4 style address */

Definition at line 32 of file ip.h.

◆ IP_ADDRESS_V6

#define IP_ADDRESS_V6   0x06 /* IPv6 style address */

Definition at line 33 of file ip.h.

◆ IP_DEFAULT_LINK_SPEED

#define IP_DEFAULT_LINK_SPEED   10000

Definition at line 201 of file ip.h.

◆ IP_PACKET_FLAG_RAW

#define IP_PACKET_FLAG_RAW   0x01 /* Raw IP packet */

Definition at line 93 of file ip.h.

◆ IP_PROTOCOL_TABLE_SIZE

#define IP_PROTOCOL_TABLE_SIZE   0x100

Definition at line 179 of file ip.h.

◆ IP_TIMEOUT

#define IP_TIMEOUT   1000 /* Timeout in milliseconds */

Definition at line 200 of file ip.h.

◆ IPPROTO_ICMP

#define IPPROTO_ICMP   1 /* Internet Control Message Protocol */

Definition at line 194 of file ip.h.

◆ IPPROTO_IGMP

#define IPPROTO_IGMP   2 /* Internet Group Management Protocol */

Definition at line 195 of file ip.h.

◆ IPPROTO_RAW

#define IPPROTO_RAW   0 /* Raw IP */

Definition at line 192 of file ip.h.

◆ IPPROTO_TCP

#define IPPROTO_TCP   6 /* Transmission Control Protocol */

Definition at line 196 of file ip.h.

◆ IPPROTO_UDP

#define IPPROTO_UDP   17 /* User Datagram Protocol */

Definition at line 197 of file ip.h.

◆ IPv4_DF_MASK

#define IPv4_DF_MASK   0x4000 /* Don't fragment (host byte order) */

Definition at line 67 of file ip.h.

◆ IPv4_FRAGOFS_MASK

#define IPv4_FRAGOFS_MASK   0x1FFF /* Fragment offset mask (host byte order) */

Definition at line 65 of file ip.h.

◆ IPv4_MAX_HEADER_SIZE

#define IPv4_MAX_HEADER_SIZE   60

Definition at line 68 of file ip.h.

◆ IPv4_MF_MASK

#define IPv4_MF_MASK   0x2000 /* More fragments (host byte order) */

Definition at line 66 of file ip.h.

◆ LOOPBACK_ADDRESS_IPv4

#define LOOPBACK_ADDRESS_IPv4   ((IPv4_RAW_ADDRESS)DH2N(0x7F000001))

Definition at line 186 of file ip.h.

◆ LOOPBACK_ADDRMASK_IPv4

#define LOOPBACK_ADDRMASK_IPv4   ((IPv4_RAW_ADDRESS)DH2N(0xFF000000))

Definition at line 188 of file ip.h.

◆ LOOPBACK_BCASTADDR_IPv4

#define LOOPBACK_BCASTADDR_IPv4   ((IPv4_RAW_ADDRESS)DH2N(0x7FFFFFFF))

Definition at line 187 of file ip.h.

◆ PC

#define PC (   Packet)    ((PPACKET_CONTEXT)(&Packet->ProtocolReserved))

Definition at line 106 of file ip.h.

Typedef Documentation

◆ IP_ADDRESS

◆ IP_HEADER

typedef union _IP_HEADER IP_HEADER

◆ IP_INTERFACE

◆ IP_PACKET

◆ IP_PROTOCOL_HANDLER

typedef VOID(* IP_PROTOCOL_HANDLER) (PIP_INTERFACE Interface, PIP_PACKET IPPacket)

Definition at line 181 of file ip.h.

◆ IP_SET_ADDRESS

◆ IPv4_HEADER

◆ IPv4_RAW_ADDRESS

Definition at line 15 of file ip.h.

◆ IPv6_HEADER

◆ IPv6_RAW_ADDRESS

typedef USHORT IPv6_RAW_ADDRESS[8]

Definition at line 19 of file ip.h.

◆ LL_TRANSMIT_ROUTINE

typedef VOID(* LL_TRANSMIT_ROUTINE) (PVOID Context, PNDIS_PACKET NdisPacket, UINT Offset, PVOID LinkAddress, USHORT Type)

Definition at line 118 of file ip.h.

◆ LLIP_BIND_INFO

◆ OBJECT_FREE_ROUTINE

typedef VOID(* OBJECT_FREE_ROUTINE) (PVOID Object)

Definition at line 10 of file ip.h.

◆ PACKET_COMPLETION_ROUTINE

typedef VOID(* PACKET_COMPLETION_ROUTINE) (PVOID Context, PNDIS_PACKET NdisPacket, NDIS_STATUS NdisStatus)

Definition at line 71 of file ip.h.

◆ PACKET_CONTEXT

◆ PIP_ADDRESS

◆ PIP_HEADER

typedef union _IP_HEADER * PIP_HEADER

◆ PIP_INTERFACE

◆ PIP_PACKET

◆ PIP_SET_ADDRESS

◆ PIPv4_HEADER

◆ PIPv4_RAW_ADDRESS

Definition at line 16 of file ip.h.

◆ PIPv6_HEADER

◆ PIPv6_RAW_ADDRESS

Definition at line 20 of file ip.h.

◆ PLLIP_BIND_INFO

◆ PPACKET_CONTEXT

◆ PSEND_RECV_STATS

◆ SEND_RECV_STATS

Function Documentation

◆ IPAddInterfaceRoute()

VOID IPAddInterfaceRoute ( PIP_INTERFACE  IF)

Definition at line 262 of file ip.c.

262 {
265
266 /* Add a permanent neighbor for this NTE */
267 NCE = NBAddNeighbor(IF, &IF->Unicast,
268 IF->Address, IF->AddressLength,
269 NUD_PERMANENT, 0);
270 if (!NCE) {
271 TI_DbgPrint(MIN_TRACE, ("Could not create NCE.\n"));
272 return;
273 }
274
276
277 if (!RouterAddRoute(&NetworkAddress, &IF->Netmask, NCE, 1)) {
278 TI_DbgPrint(MIN_TRACE, ("Could not add route due to insufficient resources.\n"));
279 }
280
281 /* Send a gratuitous ARP packet to update the route caches of
282 * other computers */
283 if (IF != Loopback)
284 ARPTransmit(NULL, NULL, IF);
285
287}
VOID AddrWidenAddress(PIP_ADDRESS Network, PIP_ADDRESS Source, PIP_ADDRESS Netmask)
Definition: address.c:86
BOOLEAN ARPTransmit(PIP_ADDRESS Address, PVOID LinkAddress, PIP_INTERFACE Interface)
Definition: arp.c:111
#define MIN_TRACE
Definition: debug.h:14
#define NULL
Definition: types.h:112
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
VOID TCPUpdateInterfaceIPInformation(PIP_INTERFACE IF)
Definition: if.c:144
PIP_INTERFACE Loopback
Definition: loopback.c:13
_Must_inspect_result_ _Out_ PNDIS_STATUS _Outptr_result_bytebuffer_to_ NetworkAddressLength PVOID * NetworkAddress
Definition: ndis.h:3956
PNEIGHBOR_CACHE_ENTRY NBAddNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, UCHAR Type, UINT EventTimer)
Definition: neighbor.c:273
#define NUD_PERMANENT
Definition: neighbor.h:42
PFIB_ENTRY RouterAddRoute(PIP_ADDRESS NetworkAddress, PIP_ADDRESS Netmask, PNEIGHBOR_CACHE_ENTRY Router, UINT Metric)
Definition: router.c:189
Definition: ip.h:23
Definition: neighbor.h:28
PUCHAR Address
Definition: ip.h:165
IP_ADDRESS Unicast
Definition: ip.h:159
IP_ADDRESS Netmask
Definition: ip.h:161
UINT AddressLength
Definition: ip.h:166

Referenced by DispTdiSetIPAddress(), LoopRegisterAdapter(), and ReadIpConfiguration().

◆ IPCreateInterface()

PIP_INTERFACE IPCreateInterface ( PLLIP_BIND_INFO  BindInfo)

Definition at line 182 of file ip.c.

192{
193 PIP_INTERFACE IF;
194
195 TI_DbgPrint(DEBUG_IP, ("Called. BindInfo (0x%X).\n", BindInfo));
196
197#if DBG
198 if (BindInfo->Address) {
199 PUCHAR A = BindInfo->Address;
200 TI_DbgPrint(DEBUG_IP, ("Interface address (%02X %02X %02X %02X %02X %02X).\n",
201 A[0], A[1], A[2], A[3], A[4], A[5]));
202 }
203#endif
204
207 if (!IF) {
208 TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
209 return NULL;
210 }
211
212 RtlZeroMemory(IF, sizeof(IP_INTERFACE));
213
214 IF->Free = FreeIF;
215 IF->Context = BindInfo->Context;
216 IF->HeaderSize = BindInfo->HeaderSize;
217 IF->MinFrameSize = BindInfo->MinFrameSize;
218 IF->Address = BindInfo->Address;
219 IF->AddressLength = BindInfo->AddressLength;
220 IF->Transmit = BindInfo->Transmit;
221
226
228
230 ( NonPagedPool, sizeof(struct netif));
231 if (!IF->TCPContext) {
233 return NULL;
234 }
235
237
239
240 return IF;
241}
Definition: ehthrow.cxx:93
#define DEBUG_IP
Definition: debug.h:26
#define IP_ADDRESS_V4
Definition: ip.h:32
VOID TcpipInitializeSpinLock(PKSPIN_LOCK SpinLock)
Definition: lock.c:14
#define IP_INTERFACE_TAG
Definition: tags.h:19
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NonPagedPool
Definition: env_spec_w32.h:307
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
VOID InsertTDIInterfaceEntity(PIP_INTERFACE Interface)
Definition: iinfo.c:158
VOID FreeIF(PVOID Object)
Definition: ip.c:81
VOID TCPRegisterInterface(PIP_INTERFACE IF)
Definition: if.c:118
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
UCHAR Type
Definition: ip.h:24
IP_ADDRESS Broadcast
Definition: ip.h:162
IP_ADDRESS PointToPoint
Definition: ip.h:160
LL_TRANSMIT_ROUTINE Transmit
Definition: ip.h:168
OBJECT_FREE_ROUTINE Free
Definition: ip.h:152
PVOID TCPContext
Definition: ip.h:169
KSPIN_LOCK Lock
Definition: ip.h:153
UINT MinFrameSize
Definition: ip.h:156
PVOID Context
Definition: ip.h:154
UINT HeaderSize
Definition: ip.h:155
PUCHAR Address
Definition: ip.h:130
UINT MinFrameSize
Definition: ip.h:129
PVOID Context
Definition: ip.h:127
UINT HeaderSize
Definition: ip.h:128
UINT AddressLength
Definition: ip.h:131
LL_TRANSMIT_ROUTINE Transmit
Definition: ip.h:132
Definition: netif.h:136
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
unsigned char * PUCHAR
Definition: typedefs.h:53

Referenced by BindAdapter(), LoopRegisterAdapter(), and main().

◆ IPCreatePacket()

PIP_PACKET IPCreatePacket ( ULONG  Type)

◆ IPDestroyInterface()

VOID IPDestroyInterface ( PIP_INTERFACE  IF)

Definition at line 244 of file ip.c.

251{
252 TI_DbgPrint(DEBUG_IP, ("Called. IF (0x%X).\n", IF));
253
255
257
260}
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
VOID RemoveTDIInterfaceEntity(PIP_INTERFACE Interface)
Definition: iinfo.c:168
VOID TCPUnregisterInterface(PIP_INTERFACE IF)
Definition: if.c:138

Referenced by BindAdapter(), LoopUnregisterAdapter(), and UnbindAdapter().

◆ IPDispatchProtocol()

VOID IPDispatchProtocol ( PIP_INTERFACE  Interface,
PIP_PACKET  IPPacket 
)

Definition at line 142 of file ip.c.

154{
156 IP_ADDRESS SrcAddress;
157
158 switch (IPPacket->Type) {
159 case IP_ADDRESS_V4:
160 Protocol = ((PIPv4_HEADER)(IPPacket->Header))->Protocol;
161 AddrInitIPv4(&SrcAddress, ((PIPv4_HEADER)(IPPacket->Header))->SrcAddr);
162 break;
163 case IP_ADDRESS_V6:
164 /* FIXME: IPv6 addresses not supported */
165 TI_DbgPrint(MIN_TRACE, ("IPv6 datagram discarded.\n"));
166 return;
167 default:
168 TI_DbgPrint(MIN_TRACE, ("Unrecognized datagram discarded.\n"));
169 return;
170 }
171
172 NBResetNeighborTimeout(&SrcAddress);
173
175 {
176 /* Call the appropriate protocol handler */
177 (*ProtocolTable[Protocol])(Interface, IPPacket);
178 }
179}
#define AddrInitIPv4(IPAddress, RawAddress)
Definition: address.h:16
#define IP_ADDRESS_V6
Definition: ip.h:33
#define IP_PROTOCOL_TABLE_SIZE
Definition: ip.h:179
struct IPv4_HEADER * PIPv4_HEADER
IP_PROTOCOL_HANDLER ProtocolTable[IP_PROTOCOL_TABLE_SIZE]
Definition: ip.c:25
unsigned int UINT
Definition: ndis.h:50
VOID NBResetNeighborTimeout(PIP_ADDRESS Address)
Definition: neighbor.c:387
UCHAR Type
Definition: ip.h:79
PVOID Header
Definition: ip.h:83
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465

Referenced by ProcessFragment().

◆ IPInitializePacket()

PIP_PACKET IPInitializePacket ( PIP_PACKET  IPPacket,
ULONG  Type 
)

Definition at line 92 of file ip.c.

102{
103 RtlZeroMemory(IPPacket, sizeof(IP_PACKET));
104
105 IPPacket->Free = DeinitializePacket;
106 IPPacket->Type = Type;
107
108 return IPPacket;
109}
Type
Definition: Type.h:7
VOID DeinitializePacket(PVOID Object)
Definition: ip.c:35
Definition: ip.h:77
OBJECT_FREE_ROUTINE Free
Definition: ip.h:78

Referenced by BuildRawIpPacket(), BuildUDPPacket(), LanReceiveWorker(), LoopTransmit(), ProcessFragment(), and TCPSendDataCallback().

◆ IPRegisterInterface()

BOOLEAN IPRegisterInterface ( PIP_INTERFACE  IF)

Definition at line 289 of file ip.c.

298{
300 UINT ChosenIndex = 0;
301 BOOLEAN IndexHasBeenChosen;
303
304 TI_DbgPrint(MID_TRACE, ("Called. IF (0x%X).\n", IF));
305
307
308 /* Choose an index */
309 do {
310 IndexHasBeenChosen = TRUE;
312 if( Interface->Index == ChosenIndex ) {
313 ChosenIndex++;
314 IndexHasBeenChosen = FALSE;
315 }
316 } EndFor(Interface);
317 } while( !IndexHasBeenChosen );
318
319 IF->Index = ChosenIndex;
320
321 /* Add interface to the global interface list */
323 &IF->ListEntry,
325
327
328 return TRUE;
329}
unsigned char BOOLEAN
#define MID_TRACE
Definition: debug.h:15
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipInterlockedInsertTailList(PLIST_ENTRY ListHead, PLIST_ENTRY Item, PKSPIN_LOCK Lock)
Definition: lock.c:34
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
UCHAR KIRQL
Definition: env_spec_w32.h:591
KSPIN_LOCK InterfaceListLock
Definition: ip.c:18
LIST_ENTRY InterfaceListHead
Definition: ip.c:17
UINT Index
Definition: ip.h:167
LIST_ENTRY ListEntry
Definition: ip.h:151
#define ForEachInterface(n)
Definition: tilists.h:9
#define EndFor(n)
Definition: tilists.h:20
#define IF_LIST_ITER(n)
Definition: tilists.h:5
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

Referenced by BindAdapter(), and LoopRegisterAdapter().

◆ IPRegisterProtocol()

VOID IPRegisterProtocol ( UINT  ProtocolNumber,
IP_PROTOCOL_HANDLER  Handler 
)

Definition at line 386 of file ip.c.

397{
398 if (ProtocolNumber >= IP_PROTOCOL_TABLE_SIZE) {
399 TI_DbgPrint(MIN_TRACE, ("Protocol number is out of range (%d).\n", ProtocolNumber));
400 return;
401 }
402
404}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:672
VOID DefaultProtocolHandler(PIP_INTERFACE Interface, PIP_PACKET IPPacket)
Definition: ip.c:369

Referenced by ICMPShutdown(), ICMPStartup(), IPStartup(), RawIPShutdown(), RawIPStartup(), TCPShutdown(), TCPStartup(), UDPShutdown(), and UDPStartup().

◆ IPRemoveInterfaceRoute()

VOID IPRemoveInterfaceRoute ( PIP_INTERFACE  IF)

Definition at line 331 of file ip.c.

331 {
333 IP_ADDRESS GeneralRoute;
334
335 NCE = NBLocateNeighbor(&IF->Unicast, IF);
336 if (NCE)
337 {
338 TI_DbgPrint(DEBUG_IP,("Removing interface Addr %s\n", A2S(&IF->Unicast)));
339 TI_DbgPrint(DEBUG_IP,(" Mask %s\n", A2S(&IF->Netmask)));
340
341 AddrWidenAddress(&GeneralRoute,&IF->Unicast,&IF->Netmask);
342
343 RouterRemoveRoute(&GeneralRoute, &IF->Unicast);
344
345 NBRemoveNeighbor(NCE);
346 }
347}
PCHAR A2S(PIP_ADDRESS Address)
Definition: address.c:17
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
Definition: neighbor.c:417
VOID NBRemoveNeighbor(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:590
NTSTATUS RouterRemoveRoute(PIP_ADDRESS Target, PIP_ADDRESS Router)
Definition: router.c:364

Referenced by DispTdiDeleteIPAddress(), DispTdiSetIPAddress(), and IPUnregisterInterface().

◆ IPShutdown()

NTSTATUS IPShutdown ( VOID  )

Definition at line 473 of file ip.c.

480{
481 TI_DbgPrint(MAX_TRACE, ("Called.\n"));
482
483 if (!IPInitialized)
484 return STATUS_SUCCESS;
485
486 /* Shutdown neighbor cache subsystem */
487 NBShutdown();
488
489 /* Shutdown routing subsystem */
491
493
494 /* Destroy lookaside lists */
498
500
501 return STATUS_SUCCESS;
502}
#define MAX_TRACE
Definition: debug.h:16
BOOLEAN IPInitialized
Definition: ip.c:21
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170
VOID NBShutdown(VOID)
Definition: neighbor.c:184
NPAGED_LOOKASIDE_LIST IPHoleList
Definition: receive.c:19
VOID IPFreeReassemblyList(VOID)
Definition: receive.c:485
NPAGED_LOOKASIDE_LIST IPDRList
Definition: receive.c:17
NPAGED_LOOKASIDE_LIST IPFragmentList
Definition: receive.c:18
NTSTATUS RouterShutdown(VOID)
Definition: router.c:500
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by TiUnload().

◆ IPStartup()

NTSTATUS IPStartup ( PUNICODE_STRING  RegistryPath)

Definition at line 407 of file ip.c.

415{
416 UINT i;
417
418 TI_DbgPrint(MAX_TRACE, ("Called.\n"));
419
420 /* Initialize lookaside lists */
422 &IPDRList, /* Lookaside list */
423 NULL, /* Allocate routine */
424 NULL, /* Free routine */
425 0, /* Flags */
426 sizeof(IPDATAGRAM_REASSEMBLY), /* Size of each entry */
427 DATAGRAM_REASSEMBLY_TAG, /* Tag */
428 0); /* Depth */
429
431 &IPFragmentList, /* Lookaside list */
432 NULL, /* Allocate routine */
433 NULL, /* Free routine */
434 0, /* Flags */
435 sizeof(IP_FRAGMENT), /* Size of each entry */
436 DATAGRAM_FRAGMENT_TAG, /* Tag */
437 0); /* Depth */
438
440 &IPHoleList, /* Lookaside list */
441 NULL, /* Allocate routine */
442 NULL, /* Free routine */
443 0, /* Flags */
444 sizeof(IPDATAGRAM_HOLE), /* Size of each entry */
445 DATAGRAM_HOLE_TAG, /* Tag */
446 0); /* Depth */
447
448 /* Start routing subsystem */
450
451 /* Start neighbor cache subsystem */
452 NBStartup();
453
454 /* Fill the protocol dispatch table with pointers
455 to the default protocol handler */
456 for (i = 0; i < IP_PROTOCOL_TABLE_SIZE; i++)
458
459 /* Initialize NTE list and protecting lock */
462
463 /* Initialize reassembly list and protecting lock */
466
468
469 return STATUS_SUCCESS;
470}
#define DATAGRAM_REASSEMBLY_TAG
Definition: tags.h:20
#define DATAGRAM_FRAGMENT_TAG
Definition: tags.h:21
#define DATAGRAM_HOLE_TAG
Definition: tags.h:22
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LIST_ENTRY NetTableListHead
Definition: ip.c:19
KSPIN_LOCK NetTableListLock
Definition: ip.c:20
VOID IPRegisterProtocol(UINT ProtocolNumber, IP_PROTOCOL_HANDLER Handler)
Definition: ip.c:386
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
VOID NBStartup(VOID)
Definition: neighbor.c:169
LIST_ENTRY ReassemblyListHead
Definition: receive.c:15
KSPIN_LOCK ReassemblyListLock
Definition: receive.c:16
NTSTATUS RouterStartup(VOID)
Definition: router.c:482

Referenced by DriverEntry(), and main().

◆ IPTimeoutDpcFn()

VOID NTAPI IPTimeoutDpcFn ( PKDPC  Dpc,
PVOID  DeferredContext,
PVOID  SystemArgument1,
PVOID  SystemArgument2 
)

Definition at line 112 of file ip.c.

126{
128
129 if ((IpTimerExpirations % 10) == 0)
130 {
132 }
133
134 /* Check if datagram fragments have taken too long to assemble */
136
137 /* Clean possible outdated cached neighbor addresses */
138 NBTimeout();
139}
VOID LogActiveObjects(VOID)
Definition: fileobjs.c:109
ULONG IpTimerExpirations
Definition: ip.c:27
VOID NBTimeout(VOID)
Definition: neighbor.c:91
VOID IPDatagramReassemblyTimeout(VOID)
Definition: receive.c:515

Referenced by DriverEntry().

◆ IPUnregisterInterface()

VOID IPUnregisterInterface ( PIP_INTERFACE  IF)

Definition at line 349 of file ip.c.

356{
357 KIRQL OldIrql3;
358
359 TI_DbgPrint(DEBUG_IP, ("Called. IF (0x%X).\n", IF));
360
362
366}
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
VOID IPRemoveInterfaceRoute(PIP_INTERFACE IF)
Definition: ip.c:331

Referenced by BindAdapter(), LoopUnregisterAdapter(), and UnbindAdapter().

Variable Documentation

◆ InterfaceListHead

LIST_ENTRY InterfaceListHead
extern

Definition at line 17 of file ip.c.

Referenced by DriverEntry().

◆ InterfaceListLock

KSPIN_LOCK InterfaceListLock
extern

◆ NetTableListHead

LIST_ENTRY NetTableListHead
extern

Definition at line 19 of file ip.c.

Referenced by IPStartup().

◆ NetTableListLock

KSPIN_LOCK NetTableListLock
extern

Definition at line 20 of file ip.c.

Referenced by IPStartup().