ReactOS  0.4.12-dev-36-g472787f
rosdhcp.h
Go to the documentation of this file.
1 #ifndef ROSDHCP_H
2 #define ROSDHCP_H
3 
4 #include <stdarg.h>
5 
6 #define WIN32_NO_STATUS
7 #define _INC_WINDOWS
8 #define COM_NO_WINDOWS_H
9 
10 #include <windef.h>
11 #include <winbase.h>
12 #include <winreg.h>
13 #define NTOS_MODE_USER
14 #include <ndk/rtlfuncs.h>
15 #include <dhcpcsdk.h>
16 #include <dhcp/rosdhcp_public.h>
17 
18 #include "debug.h"
19 
20 #define IFNAMSIZ MAX_INTERFACE_NAME_LEN
21 #undef interface /* wine/objbase.h -- Grrr */
22 
23 #undef IGNORE
24 #undef ACCEPT
25 #undef PREFER
26 #define DHCP_DISCOVER_INTERVAL 5
27 #define DHCP_REBOOT_TIMEOUT 10
28 #define DHCP_PANIC_TIMEOUT 20
29 #define DHCP_BACKOFF_MAX 300
30 #define DHCP_DEFAULT_LEASE_TIME 43200 /* 12 hours */
31 #define _PATH_DHCLIENT_PID "\\systemroot\\system32\\drivers\\etc\\dhclient.pid"
32 typedef void *VOIDPTR;
33 typedef unsigned char u_int8_t;
34 typedef unsigned short u_int16_t;
35 typedef unsigned int u_int32_t;
36 typedef char *caddr_t;
37 
38 #ifndef _SSIZE_T_DEFINED
39 #define _SSIZE_T_DEFINED
40 #undef ssize_t
41 #ifdef _WIN64
42 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
43  typedef int ssize_t __attribute__ ((mode (DI)));
44 #else
45  typedef __int64 ssize_t;
46 #endif
47 #else
48  typedef int ssize_t;
49 #endif
50 #endif
51 
53 #define TIME uintTIME
54 #include "dhcpd.h"
55 
56 #define INLINE inline
57 #define PROTO(x) x
58 
59 typedef void (*handler_t) PROTO ((struct packet *));
60 
61 struct iaddr;
62 struct interface_info;
63 
64 typedef struct _DHCP_ADAPTER {
75  unsigned int BindStatus;
76  unsigned char recv_buf[1];
78 
79 typedef DWORD (*PipeSendFunc)( COMM_DHCP_REPLY *Reply );
80 
81 #define random rand
82 #define srandom srand
83 
84 int init_client(void);
85 void stop_client(void);
86 
87 void AdapterInit(VOID);
89 void AdapterStop(VOID);
90 extern PDHCP_ADAPTER AdapterGetFirst(VOID);
91 extern PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER);
92 extern PDHCP_ADAPTER AdapterFindIndex( unsigned int AdapterIndex );
93 extern PDHCP_ADAPTER AdapterFindInfo( struct interface_info *info );
94 extern PDHCP_ADAPTER AdapterFindByHardwareAddress( u_int8_t haddr[16], u_int8_t hlen );
95 extern HANDLE PipeInit(VOID);
96 extern VOID ApiInit(VOID);
97 extern VOID ApiFree(VOID);
98 extern VOID ApiLock(VOID);
99 extern VOID ApiUnlock(VOID);
100 extern DWORD DSQueryHWInfo( PipeSendFunc Send, COMM_DHCP_REQ *Req );
101 extern DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req );
105 extern DWORD DSGetAdapterInfo( PipeSendFunc Send, COMM_DHCP_REQ *Req );
106 extern int inet_aton(const char *s, struct in_addr *addr);
107 int warn( char *format, ... );
108 
109 #endif /* ROSDHCP_H */
unsigned int BindStatus
Definition: rosdhcp.h:75
ULONG NteInstance
Definition: rosdhcp.h:70
int warn(char *format,...)
Definition: util.c:42
MIB_IFROW IfMib
Definition: rosdhcp.h:66
DWORD DSStaticRefreshParams(PipeSendFunc Send, COMM_DHCP_REQ *Req)
Definition: api.c:165
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
DWORD DSQueryHWInfo(PipeSendFunc Send, COMM_DHCP_REQ *Req)
Definition: api.c:68
ULONG NteContext
Definition: rosdhcp.h:70
DWORD DSReleaseIpAddressLease(PipeSendFunc Send, COMM_DHCP_REQ *Req)
Definition: api.c:90
#define DWORD
Definition: msvc.h:34
#define DI
Definition: assyntax.h:175
struct _DHCP_ADAPTER DHCP_ADAPTER
PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER)
Definition: adapter.c:579
#define __attribute__(Spec)
Definition: hlsl.tab.c:1213
char * caddr_t
Definition: rosdhcp.h:36
PDHCP_ADAPTER AdapterFindIndex(unsigned int AdapterIndex)
Definition: adapter.c:513
void AdapterInit(VOID)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
unsigned char u_int8_t
Definition: rosdhcp.h:33
PDHCP_ADAPTER AdapterFindByHardwareAddress(u_int8_t haddr[16], u_int8_t hlen)
Definition: adapter.c:555
void stop_client(void)
Definition: dhclient.c:137
void * VOIDPTR
Definition: rosdhcp.h:32
MIB_IPFORWARDROW RouterMib
Definition: rosdhcp.h:67
struct _DHCP_ADAPTER * PDHCP_ADAPTER
struct client_config DhclientConfig
Definition: rosdhcp.h:73
VOID ApiFree(VOID)
DWORD DSGetAdapterInfo(PipeSendFunc Send, COMM_DHCP_REQ *Req)
Definition: api.c:209
Definition: dhcpd.h:135
PDHCP_ADAPTER AdapterFindInfo(struct interface_info *info)
Definition: adapter.c:541
void AdapterStop(VOID)
Definition: tcpip.h:125
DWORD DSLeaseIpAddress(PipeSendFunc Send, COMM_DHCP_REQ *Req)
Definition: api.c:36
VOID ApiLock(VOID)
u_int32_t uintTIME
Definition: rosdhcp.h:52
HANDLE PipeInit(VOID)
unsigned long DWORD
Definition: ntddk_ex.h:95
int init_client(void)
Definition: dhclient.c:111
PDHCP_ADAPTER AdapterGetFirst(VOID)
unsigned short u_int16_t
Definition: rosdhcp.h:34
SOCKADDR Address
Definition: rosdhcp.h:69
GLenum const GLvoid * addr
Definition: glext.h:9621
Definition: dhcpd.h:125
struct interface_info DhclientInfo
Definition: rosdhcp.h:71
unsigned int u_int32_t
Definition: rosdhcp.h:35
int ssize_t
Definition: rosdhcp.h:48
GLdouble s
Definition: gl.h:2039
Definition: typedefs.h:117
VOID ApiUnlock(VOID)
struct client_state DhclientState
Definition: rosdhcp.h:72
DWORD(* PipeSendFunc)(COMM_DHCP_REPLY *Reply)
Definition: rosdhcp.h:79
LIST_ENTRY ListEntry
Definition: rosdhcp.h:65
DWORD DSRenewIpAddressLease(PipeSendFunc Send, COMM_DHCP_REQ *Req)
Definition: api.c:129
unsigned int ULONG
Definition: retypes.h:1
VOID ApiInit(VOID)
#define PROTO(x)
Definition: rosdhcp.h:57
int inet_aton(const char *s, struct in_addr *addr)
Definition: compat.c:32
MIB_IPADDRROW IfAddr
Definition: rosdhcp.h:68
HANDLE StartAdapterDiscovery(VOID)
Definition: adapter.c:471
#define __int64
Definition: basetyps.h:16
struct sockaddr_in ListenAddr
Definition: rosdhcp.h:74
unsigned char recv_buf[1]
Definition: rosdhcp.h:76