ReactOS 0.4.15-dev-5666-gc548b97
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"
32typedef void *VOIDPTR;
33typedef unsigned char u_int8_t;
34typedef unsigned short u_int16_t;
35typedef unsigned int u_int32_t;
36typedef 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
59typedef void (*handler_t) PROTO ((struct packet *));
60
61struct iaddr;
62struct interface_info;
63
64typedef struct _DHCP_ADAPTER {
75 unsigned int BindStatus;
76 unsigned char recv_buf[1];
78
79typedef DWORD (*PipeSendFunc)(HANDLE CommPipe, COMM_DHCP_REPLY *Reply );
80
81#define random rand
82#define srandom srand
83
84int init_client(void);
85void stop_client(void);
86
92extern PDHCP_ADAPTER AdapterFindIndex( unsigned int AdapterIndex );
100extern DWORD DSQueryHWInfo( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req );
101extern DWORD DSLeaseIpAddress( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req );
102extern DWORD DSRenewIpAddressLease( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req );
103extern DWORD DSReleaseIpAddressLease( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req );
104extern DWORD DSStaticRefreshParams( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req );
105extern DWORD DSGetAdapterInfo( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req );
106extern int inet_aton(const char *s, struct in_addr *addr);
107int warn( char *format, ... );
108
109#endif /* ROSDHCP_H */
void AdapterInit()
Definition: adapter.c:192
void AdapterStop()
Definition: adapter.c:485
PDHCP_ADAPTER AdapterGetFirst()
Definition: adapter.c:557
VOID ApiFree()
Definition: api.c:30
VOID ApiLock()
Definition: api.c:22
VOID ApiInit()
Definition: api.c:18
VOID ApiUnlock()
Definition: api.c:26
#define __int64
Definition: basetyps.h:16
HANDLE hStopEvent
Definition: dhcpcsvc.c:19
#define __attribute__(x)
Definition: wpp_private.h:207
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLenum mode
Definition: glext.h:6217
GLenum const GLvoid * addr
Definition: glext.h:9621
#define inet_aton(cp, addr)
Definition: inet.h:99
unsigned int ULONG
Definition: retypes.h:1
#define DWORD
Definition: nt_native.h:44
#define warn(...)
int init_client(void)
Definition: dhclient.c:111
DWORD DSQueryHWInfo(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
Definition: api.c:68
unsigned int u_int32_t
Definition: rosdhcp.h:35
struct _DHCP_ADAPTER DHCP_ADAPTER
PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER)
Definition: adapter.c:564
DWORD DSStaticRefreshParams(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
Definition: api.c:165
void * VOIDPTR
Definition: rosdhcp.h:32
unsigned short u_int16_t
Definition: rosdhcp.h:34
unsigned char u_int8_t
Definition: rosdhcp.h:33
DWORD DSRenewIpAddressLease(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
Definition: api.c:129
PDHCP_ADAPTER AdapterFindInfo(struct interface_info *info)
Definition: adapter.c:526
DWORD(* PipeSendFunc)(HANDLE CommPipe, COMM_DHCP_REPLY *Reply)
Definition: rosdhcp.h:79
u_int32_t uintTIME
Definition: rosdhcp.h:52
HANDLE StartAdapterDiscovery(HANDLE hStopEvent)
Definition: adapter.c:481
DWORD DSReleaseIpAddressLease(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
Definition: api.c:90
HANDLE PipeInit(HANDLE hStopEvent)
Definition: pipe.c:422
PDHCP_ADAPTER AdapterFindByHardwareAddress(u_int8_t haddr[16], u_int8_t hlen)
Definition: adapter.c:540
char * caddr_t
Definition: rosdhcp.h:36
void stop_client(void)
Definition: dhclient.c:129
#define PROTO(x)
Definition: rosdhcp.h:57
struct _DHCP_ADAPTER * PDHCP_ADAPTER
DWORD DSGetAdapterInfo(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
Definition: api.c:209
DWORD DSLeaseIpAddress(PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req)
Definition: api.c:36
int ssize_t
Definition: rosdhcp.h:48
PDHCP_ADAPTER AdapterFindIndex(unsigned int AdapterIndex)
Definition: adapter.c:498
ULONG NteContext
Definition: rosdhcp.h:70
ULONG NteInstance
Definition: rosdhcp.h:70
MIB_IPFORWARDROW RouterMib
Definition: rosdhcp.h:67
unsigned char recv_buf[1]
Definition: rosdhcp.h:76
struct interface_info DhclientInfo
Definition: rosdhcp.h:71
MIB_IPADDRROW IfAddr
Definition: rosdhcp.h:68
struct client_state DhclientState
Definition: rosdhcp.h:72
SOCKADDR Address
Definition: rosdhcp.h:69
struct client_config DhclientConfig
Definition: rosdhcp.h:73
LIST_ENTRY ListEntry
Definition: rosdhcp.h:65
struct sockaddr_in ListenAddr
Definition: rosdhcp.h:74
unsigned int BindStatus
Definition: rosdhcp.h:75
MIB_IFROW IfMib
Definition: rosdhcp.h:66
Definition: typedefs.h:120
Definition: dhcpd.h:125
Definition: tcpip.h:126
Definition: dhcpd.h:135