ReactOS  0.4.14-dev-337-gf981a68
ainfo.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS TCP/IP protocol driver
4  * FILE: tcpip/ainfo.c
5  * PURPOSE: Per-socket information.
6  * PROGRAMMER: Cameron Gutman
7  */
8 
9 #include "precomp.h"
10 
12  PADDRESS_FILE AddrFile,
13  PVOID Buffer,
15 {
16  KIRQL OldIrql;
17 
18  switch (ID->toi_id)
19  {
20  case AO_OPTION_TTL:
21  if (BufferSize < sizeof(UINT))
22  return TDI_INVALID_PARAMETER;
23 
24  LockObject(AddrFile, &OldIrql);
25  AddrFile->TTL = *((PUCHAR)Buffer);
26  UnlockObject(AddrFile, OldIrql);
27 
28  return TDI_SUCCESS;
29 
31  if (BufferSize < sizeof(UINT))
32  return TDI_INVALID_PARAMETER;
33 
34  LockObject(AddrFile, &OldIrql);
35  AddrFile->DF = *((PUINT)Buffer);
36  UnlockObject(AddrFile, OldIrql);
37 
38  return TDI_SUCCESS;
39 
41  if (BufferSize < sizeof(UINT))
42  return TDI_INVALID_PARAMETER;
43 
44  LockObject(AddrFile, &OldIrql);
45  AddrFile->BCast = *((PUINT)Buffer);
46  UnlockObject(AddrFile, OldIrql);
47 
48  return TDI_SUCCESS;
49 
51  if (BufferSize < sizeof(UINT))
52  return TDI_INVALID_PARAMETER;
53 
54  LockObject(AddrFile, &OldIrql);
55  AddrFile->HeaderIncl = *((PUINT)Buffer);
56  UnlockObject(AddrFile, OldIrql);
57 
58  return TDI_SUCCESS;
59 
60  default:
61  DbgPrint("Unimplemented option %x\n", ID->toi_id);
62 
63  return TDI_INVALID_REQUEST;
64  }
65 }
66 
68  PADDRESS_FILE AddrFile,
69  PVOID Buffer,
71 {
73 
74  return TDI_INVALID_REQUEST;
75 }
TDI_STATUS SetAddressFileInfo(TDIObjectID *ID, PADDRESS_FILE AddrFile, PVOID Buffer, UINT BufferSize)
Definition: ainfo.c:11
#define TDI_SUCCESS
Definition: tdistat.h:30
#define DbgPrint
Definition: loader.c:25
UCHAR TTL
Definition: titypes.h:141
unsigned char * PUCHAR
Definition: retypes.h:3
#define AO_OPTION_TTL
Definition: tcpioctl.h:61
LONG TDI_STATUS
Definition: tdi.h:36
#define AO_OPTION_BROADCAST
Definition: tcpioctl.h:71
#define LockObject(Object, Irql)
Definition: titypes.h:34
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define UnlockObject(Object, OldIrql)
Definition: titypes.h:54
Definition: bufpool.h:45
#define AO_OPTION_IP_HDRINCL
Definition: tcpioctl.h:72
#define BufferSize
Definition: classpnp.h:419
TDI_STATUS GetAddressFileInfo(TDIObjectID *ID, PADDRESS_FILE AddrFile, PVOID Buffer, PUINT BufferSize)
Definition: ainfo.c:67
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
UINT HeaderIncl
Definition: titypes.h:144
#define AO_OPTION_IP_DONTFRAGMENT
Definition: tcpioctl.h:69
#define ID
Definition: ruserpass.c:36
UINT BCast
Definition: titypes.h:143
unsigned int UINT
Definition: ndis.h:50
#define UNIMPLEMENTED
Definition: debug.h:114
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
unsigned int * PUINT
Definition: ndis.h:50