1 #ifndef ROSDHCP_PUBLIC_H
2 #define ROSDHCP_PUBLIC_H
3 
4 enum {
5     DhcpReqLeaseIpAddress,
6     DhcpReqQueryHWInfo,
7     DhcpReqReleaseIpAddress,
8     DhcpReqRenewIpAddress,
9     DhcpReqStaticRefreshParams,
10     DhcpReqGetAdapterInfo,
11 };
12 
13 typedef struct _COMM_DHCP_REQ {
14     UINT Type;
15     DWORD AdapterIndex;
16     union {
17         struct {
18             BOOL Inserted;
19         } PnpEvent;
20         struct {
21             LPWSTR AdapterName;
22             DHCPCAPI_PARAMS_ARRAY Params;
23         } RegisterParamChange;
24         struct {
25             LPWSTR AdapterName;
26             LPWSTR RequestId;
27         } RequestParams, UndoRequestParams;
28         struct {
29             DWORD IPAddress;
30             DWORD Netmask;
31         } StaticRefreshParams;
32     } Body;
33 } COMM_DHCP_REQ;
34 
35 typedef union _COMM_DHCP_REPLY {
36     DWORD Reply;
37     struct {
38         DWORD AdapterIndex;
39         DWORD MediaType;
40         DWORD Mtu;
41         DWORD Speed;
42     } QueryHWInfo;
43     struct {
44         BOOL DhcpEnabled;
45         DWORD DhcpServer;
46         time_t LeaseObtained;
47         time_t LeaseExpires;
48     } GetAdapterInfo;
49 } COMM_DHCP_REPLY;
50 
51 #define DHCP_PIPE_NAME L"\\\\.\\pipe\\dhcpclient"
52 
53 #endif/*ROSDHCP_PUBLIC_H*/
54