ReactOS  0.4.14-dev-583-g2a1ba2c
loopback.h File Reference
#include <lan.h>
Include dependency graph for loopback.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NDIS_STATUS LoopRegisterAdapter (PNDIS_STRING AdapterName, PLAN_ADAPTER *Adapter)
 
NDIS_STATUS LoopUnregisterAdapter (PLAN_ADAPTER Adapter)
 

Variables

PIP_INTERFACE Loopback
 

Function Documentation

◆ LoopRegisterAdapter()

NDIS_STATUS LoopRegisterAdapter ( PNDIS_STRING  AdapterName,
PLAN_ADAPTER Adapter 
)

Definition at line 89 of file loopback.c.

100 {
101  LLIP_BIND_INFO BindInfo;
102 
103  TI_DbgPrint(MID_TRACE, ("Called.\n"));
104 
105  /* Bind the adapter to network (IP) layer */
106  BindInfo.Context = NULL;
107  BindInfo.HeaderSize = 0;
108  BindInfo.MinFrameSize = 0;
109  BindInfo.Address = NULL;
110  BindInfo.AddressLength = 0;
111  BindInfo.Transmit = LoopTransmit;
112 
113  Loopback = IPCreateInterface(&BindInfo);
114  if (!Loopback) return NDIS_STATUS_RESOURCES;
115 
116  Loopback->MTU = 16384;
117 
118  Loopback->Name.Buffer = L"Loopback";
120  wcslen(Loopback->Name.Buffer) * sizeof(WCHAR);
121 
125 
127 
129 
130  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
131 
132  return NDIS_STATUS_SUCCESS;
133 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
IP_ADDRESS Broadcast
Definition: ip.h:162
UINT AddressLength
Definition: ip.h:131
#define MID_TRACE
Definition: debug.h:15
#define LOOPBACK_BCASTADDR_IPv4
Definition: ip.h:187
USHORT MaximumLength
Definition: env_spec_w32.h:370
UINT MinFrameSize
Definition: ip.h:129
PVOID Context
Definition: ip.h:127
PIP_INTERFACE IPCreateInterface(PLLIP_BIND_INFO BindInfo)
Definition: ip.c:182
UNICODE_STRING Name
Definition: ip.h:163
PUCHAR Address
Definition: ip.h:130
LL_TRANSMIT_ROUTINE Transmit
Definition: ip.h:132
smooth NULL
Definition: ftsmooth.c:416
IP_ADDRESS Unicast
Definition: ip.h:159
BOOLEAN IPRegisterInterface(PIP_INTERFACE IF)
Definition: ip.c:293
UINT MTU
Definition: ip.h:157
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT HeaderSize
Definition: ip.h:128
#define AddrInitIPv4(IPAddress, RawAddress)
Definition: address.h:16
VOID IPAddInterfaceRoute(PIP_INTERFACE IF)
Definition: ip.c:266
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
static const WCHAR L[]
Definition: oid.c:1250
IP_ADDRESS Netmask
Definition: ip.h:161
#define LOOPBACK_ADDRMASK_IPv4
Definition: ip.h:188
#define MAX_TRACE
Definition: debug.h:16
#define LOOPBACK_ADDRESS_IPv4
Definition: ip.h:186
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
PIP_INTERFACE Loopback
Definition: loopback.c:13
VOID LoopTransmit(PVOID Context, PNDIS_PACKET NdisPacket, UINT Offset, PVOID LinkAddress, USHORT Type)
Definition: loopback.c:26
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by DriverEntry().

◆ LoopUnregisterAdapter()

NDIS_STATUS LoopUnregisterAdapter ( PLAN_ADAPTER  Adapter)

Definition at line 136 of file loopback.c.

147 {
148  TI_DbgPrint(MID_TRACE, ("Called.\n"));
149 
150  if (Loopback != NULL)
151  {
154  Loopback = NULL;
155  }
156 
157  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
158 
159  return NDIS_STATUS_SUCCESS;
160 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
VOID IPDestroyInterface(PIP_INTERFACE IF)
Definition: ip.c:246
#define MID_TRACE
Definition: debug.h:15
VOID IPUnregisterInterface(PIP_INTERFACE IF)
Definition: ip.c:353
smooth NULL
Definition: ftsmooth.c:416
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define MAX_TRACE
Definition: debug.h:16
PIP_INTERFACE Loopback
Definition: loopback.c:13

Referenced by TiUnload().

Variable Documentation

◆ Loopback