ReactOS 0.4.15-dev-7659-ga55345b
ip.c File Reference
#include "precomp.h"
#include "lwip/netifapi.h"
Include dependency graph for ip.c:

Go to the source code of this file.

Macros

#define __LWIP_INET_H__
 

Functions

VOID TCPRegisterInterface (PIP_INTERFACE IF)
 
VOID TCPUnregisterInterface (PIP_INTERFACE IF)
 
VOID DeinitializePacket (PVOID Object)
 
VOID FreeIF (PVOID Object)
 
PIP_PACKET IPInitializePacket (PIP_PACKET IPPacket, ULONG Type)
 
VOID NTAPI IPTimeoutDpcFn (PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
 
VOID IPDispatchProtocol (PIP_INTERFACE Interface, PIP_PACKET IPPacket)
 
PIP_INTERFACE IPCreateInterface (PLLIP_BIND_INFO BindInfo)
 
VOID IPDestroyInterface (PIP_INTERFACE IF)
 
VOID IPAddInterfaceRoute (PIP_INTERFACE IF)
 
BOOLEAN IPRegisterInterface (PIP_INTERFACE IF)
 
VOID IPRemoveInterfaceRoute (PIP_INTERFACE IF)
 
VOID IPUnregisterInterface (PIP_INTERFACE IF)
 
VOID DefaultProtocolHandler (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
 
BOOLEAN IPInitialized = FALSE
 
BOOLEAN IpWorkItemQueued = FALSE
 
IP_PROTOCOL_HANDLER ProtocolTable [IP_PROTOCOL_TABLE_SIZE]
 
ULONG IpTimerExpirations
 

Macro Definition Documentation

◆ __LWIP_INET_H__

#define __LWIP_INET_H__

Definition at line 13 of file ip.c.

Function Documentation

◆ DefaultProtocolHandler()

VOID DefaultProtocolHandler ( PIP_INTERFACE  Interface,
PIP_PACKET  IPPacket 
)

Definition at line 369 of file ip.c.

378{
379 TI_DbgPrint(MID_TRACE, ("[IF %x] Packet of unknown Internet protocol "
380 "discarded.\n", Interface));
381
382 Interface->Stats.InDiscardedUnknownProto++;
383}
#define MID_TRACE
Definition: debug.h:15
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465

Referenced by IPRegisterProtocol(), and IPStartup().

◆ DeinitializePacket()

VOID DeinitializePacket ( PVOID  Object)

Definition at line 35 of file ip.c.

42{
43 PIP_PACKET IPPacket = Object;
44
45 TI_DbgPrint(MAX_TRACE, ("Freeing object: 0x%p\n", Object));
46
47 /* Detect double free */
48 ASSERT(IPPacket->Type != 0xFF);
49 IPPacket->Type = 0xFF;
50
51 /* Check if there's a packet to free */
52 if (IPPacket->NdisPacket != NULL)
53 {
54 if (IPPacket->ReturnPacket)
55 {
56 /* Return the packet to the miniport driver */
57 TI_DbgPrint(MAX_TRACE, ("Returning packet 0x%p\n",
58 IPPacket->NdisPacket));
59 NdisReturnPackets(&IPPacket->NdisPacket, 1);
60 }
61 else
62 {
63 /* Free it the conventional way */
64 TI_DbgPrint(MAX_TRACE, ("Freeing packet 0x%p\n",
65 IPPacket->NdisPacket));
66 FreeNdisPacket(IPPacket->NdisPacket);
67 }
68 }
69
70 /* Check if we have a pool-allocated header */
71 if (!IPPacket->MappedHeader && IPPacket->Header)
72 {
73 /* Free it */
74 TI_DbgPrint(MAX_TRACE, ("Freeing header: 0x%p\n",
75 IPPacket->Header));
76 ExFreePoolWithTag(IPPacket->Header,
78 }
79}
#define MAX_TRACE
Definition: debug.h:16
#define NULL
Definition: types.h:112
#define PACKET_BUFFER_TAG
Definition: tags.h:27
#define FreeNdisPacket(x)
Definition: memtrack.h:8
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
VOID EXPORT NdisReturnPackets(IN PNDIS_PACKET *PacketsToReturn, IN UINT NumberOfPackets)
Definition: miniport.c:258
Definition: ip.h:77
UCHAR Type
Definition: ip.h:79
BOOLEAN ReturnPacket
Definition: ip.h:82
BOOLEAN MappedHeader
Definition: ip.h:81
PNDIS_PACKET NdisPacket
Definition: ip.h:88
PVOID Header
Definition: ip.h:83
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by IPInitializePacket().

◆ FreeIF()

VOID FreeIF ( PVOID  Object)

Definition at line 81 of file ip.c.

88{
90}
#define IP_INTERFACE_TAG
Definition: tags.h:19

Referenced by IPCreateInterface().

◆ 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
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 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
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().

◆ 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

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
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 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}
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().

◆ TCPRegisterInterface()

VOID TCPRegisterInterface ( PIP_INTERFACE  IF)

Definition at line 118 of file if.c.

119{
120 struct ip_addr ipaddr;
121 struct ip_addr netmask;
122 struct ip_addr gw;
123
124 gw.addr = 0;
125 ipaddr.addr = 0;
126 netmask.addr = 0;
127
129 &ipaddr,
130 &netmask,
131 &gw,
132 IF,
135}
err_t TCPInterfaceInit(struct netif *netif)
Definition: if.c:95
struct netif * netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
Definition: netif.c:139
u32_t addr
Definition: ip_addr.h:45
err_t tcpip_input(struct pbuf *p, struct netif *inp)
Definition: tcpip.c:164

Referenced by IPCreateInterface().

◆ TCPUnregisterInterface()

VOID TCPUnregisterInterface ( PIP_INTERFACE  IF)

Definition at line 138 of file if.c.

139{
141}
void netif_remove(struct netif *netif)
Definition: netif.c:235

Referenced by IPDestroyInterface().

Variable Documentation

◆ InterfaceListHead

LIST_ENTRY InterfaceListHead

Definition at line 17 of file ip.c.

Referenced by DriverEntry(), and IPRegisterInterface().

◆ InterfaceListLock

◆ IPInitialized

BOOLEAN IPInitialized = FALSE

Definition at line 21 of file ip.c.

Referenced by IPShutdown(), and IPStartup().

◆ IpTimerExpirations

ULONG IpTimerExpirations

Definition at line 27 of file ip.c.

Referenced by IPTimeoutDpcFn().

◆ IpWorkItemQueued

BOOLEAN IpWorkItemQueued = FALSE

Definition at line 22 of file ip.c.

◆ NetTableListHead

LIST_ENTRY NetTableListHead

Definition at line 19 of file ip.c.

Referenced by IPStartup().

◆ NetTableListLock

KSPIN_LOCK NetTableListLock

Definition at line 20 of file ip.c.

Referenced by IPStartup().

◆ ProtocolTable

Definition at line 25 of file ip.c.

Referenced by IPDispatchProtocol(), and IPRegisterProtocol().