fix inet_aton problem
[reactos.git] / reactos / services / dhcp / include / rosdhcp.h
1 #ifndef ROSDHCP_H
2 #define ROSDHCP_H
3
4 #include <windows.h>
5 #define NTOS_MODE_USER
6 #include <ndk/ntndk.h>
7 #include <iprtrmib.h>
8 #include <iphlpapi.h>
9 #include <winsock2.h>
10 #include <dhcpcsdk.h>
11 #include <stdio.h>
12 #include <setjmp.h>
13 #include "stdint.h"
14 #include "predec.h"
15 #include <dhcp/rosdhcp_public.h>
16 #include "debug.h"
17 #define IFNAMSIZ MAX_INTERFACE_NAME_LEN
18 #undef interface /* wine/objbase.h -- Grrr */
19
20 #undef IGNORE
21 #undef ACCEPT
22 #undef PREFER
23 #define DHCP_DISCOVER_INTERVAL 15
24 #define DHCP_REBOOT_TIMEOUT 300
25 #define DHCP_PANIC_TIMEOUT DHCP_REBOOT_TIMEOUT * 3
26 #define DHCP_BACKOFF_MAX 300
27 #define _PATH_DHCLIENT_PID "\\systemroot\\system32\\drivers\\etc\\dhclient.pid"
28 #define RRF_RT_REG_SZ 2
29 typedef void *VOIDPTR;
30
31 typedef u_int32_t uintTIME;
32 #define TIME uintTIME
33 #include "dhcpd.h"
34
35 #define INLINE inline
36 #define PROTO(x) x
37
38 typedef void (*handler_t) PROTO ((struct packet *));
39
40 typedef struct _DHCP_ADAPTER {
41 LIST_ENTRY ListEntry;
42 MIB_IFROW IfMib;
43 MIB_IPADDRROW IfAddr;
44 SOCKADDR Address;
45 ULONG NteContext,NteInstance;
46 struct interface_info DhclientInfo;
47 struct client_state DhclientState;
48 struct client_config DhclientConfig;
49 struct sockaddr_in ListenAddr;
50 unsigned int BindStatus;
51 unsigned char recv_buf[1];
52 } DHCP_ADAPTER, *PDHCP_ADAPTER;
53
54 typedef DWORD (*PipeSendFunc)( COMM_DHCP_REPLY *Reply );
55
56 #define random rand
57 #define srandom srand
58
59 void AdapterInit(VOID);
60 HANDLE PipeInit(VOID);
61 extern PDHCP_ADAPTER AdapterFindIndex( unsigned int AdapterIndex );
62 extern PDHCP_ADAPTER AdapterFindInfo( struct interface_info *info );
63 extern VOID ApiInit();
64 extern VOID ApiLock();
65 extern VOID ApiUnlock();
66 extern DWORD DSQueryHWInfo( PipeSendFunc Send, COMM_DHCP_REQ *Req );
67 extern DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req );
68 extern DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req );
69 extern DWORD DSReleaseIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req );
70 extern int inet_aton(const char *s, struct in_addr *addr);
71 int warn( char *format, ... );
72 #endif/*ROSDHCP_H*/