59#define hyphenchar(c) ((c) == 0x2d)
60#define bslashchar(c) ((c) == 0x5c)
61#define periodchar(c) ((c) == PERIOD)
62#define asterchar(c) ((c) == 0x2a)
63#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \
64 ((c) >= 0x61 && (c) <= 0x7a))
65#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
67#define borderchar(c) (alphachar(c) || digitchar(c))
68#define middlechar(c) (borderchar(c) || hyphenchar(c))
69#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
88#define ASSERT_STATE(state_is, state_shouldbe) {}
90#define TIME_MAX 2147483647
105#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
178 if (!
ip->client->active ||
ip->client->active->is_bootp) {
195 time(&
ip->client->first_sending);
196 ip->client->interval =
ip->client->config->initial_interval;
199 ip->client->medium =
NULL;
219 ip->client->xid =
ip->client->packet.xid;
222 time(&
ip->client->first_sending);
223 ip->client->interval =
ip->client->config->initial_interval;
254 for (lp =
ip->client->offered_leases; lp; lp =
next) {
268 ip->client->offered_leases =
NULL;
280 ip->client->new = picked;
299 ip->client->interval =
ip->client->config->initial_interval;
303 ip->client->xid =
ip->client->packet.xid;
342 note(
"packet_to_lease failed.");
346 ip->client->new = lease;
359 if (
ip->client->new->expiry < 0)
362 if (
ip->client->new->expiry < 60)
363 ip->client->new->expiry = 60;
371 ip->client->new->renewal =
ip->client->new->expiry / 2;
378 ip->client->new->rebind =
ip->client->new->renewal +
379 ip->client->new->renewal / 2 +
ip->client->new->renewal / 4;
399 CHAR Buffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
409 struct iaddr nameserver;
418 for(
i = 0;
i < addrs;
i++ ) {
424 if(
i != addrs-1 )
strcat( nsbuf,
"," );
446 CHAR Buffer1[
MAX_PATH] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
447 CHAR Buffer2[
MAX_PATH] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters";
448 HKEY RegKey1, RegKey2;
493 CHAR Buffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
494 struct iaddr netmask;
589 ip->client->new->medium =
ip->client->medium;
592 if (
ip->client->active)
594 ip->client->active =
ip->client->new;
604 note(
"bound to %s -- renewal in %ld seconds.",
605 piaddr(
ip->client->active->address),
606 (
long int)(
ip->client->active->renewal -
cur_time));
614 warning(
"Could not find adapter for info %p\n",
ip);
636 ip->client->xid =
ip->client->packet.xid;
639 memcpy(
ip->client->destination.iabuf,
ip->client->active->
641 ip->client->destination.len = 4;
645 time(&
ip->client->first_sending);
646 ip->client->interval =
ip->client->config->initial_interval;
715 int arp_timeout_needed = 0, stop_selecting;
717 "DHCPOFFER" :
"BOOTREPLY";
736 for (
i = 0;
ip->client->config->required_options[
i];
i++) {
738 required_options[
i]].len) {
739 note(
"%s isn't satisfactory.",
name);
745 for (lease =
ip->client->offered_leases;
746 lease; lease = lease->
next) {
757 note(
"packet_to_lease failed.");
771 note(
"Arp check failed\n");
777 ip->client->first_sending +
ip->client->config->select_interval;
781 if (lease->
address.len ==
ip->client->requested_address.len &&
783 ip->client->requested_address.iabuf,
784 ip->client->requested_address.len)) {
785 lease->
next =
ip->client->offered_leases;
786 ip->client->offered_leases = lease;
792 if (
ip->client->offered_leases &&
793 (
cur_time + arp_timeout_needed) > stop_selecting)
794 arp_timeout_needed = 0;
798 if (!
ip->client->offered_leases)
799 ip->client->offered_leases = lease;
801 for (lp =
ip->client->offered_leases; lp->
next;
811 if (stop_selecting -
cur_time < arp_timeout_needed)
812 stop_selecting =
cur_time + arp_timeout_needed;
817 if (stop_selecting <= 0)
837 warning(
"dhcpoffer: no memory to record lease.");
841 memset(lease, 0,
sizeof(*lease));
844 for (
i = 0;
i < 256;
i++) {
849 warning(
"dhcpoffer: no memory for option %d",
i);
863 warning(
"Invalid lease option - ignoring offer");
873 lease->serveraddress.len =
sizeof(
packet->
raw->siaddr);
883 warning(
"dhcpoffer: no memory for server name.");
904 warning(
"dhcpoffer: no memory for filename.");
935 if (!
ip->client->active) {
936 note(
"DHCPNAK with no active lease.\n");
941 ip->client->active =
NULL;
978 if (!
ip->client->offered_leases &&
979 ip->client->config->media) {
982 if (
ip->client->medium) {
983 ip->client->medium =
ip->client->medium->next;
986 if (!
ip->client->medium) {
988 error(
"No valid media types for %s!",
ip->name);
989 ip->client->medium =
ip->client->config->media;
993 note(
"Trying medium \"%s\" %d",
ip->client->medium->string,
1006 if (!
ip->client->interval)
1007 ip->client->interval =
1008 ip->client->config->initial_interval;
1010 ip->client->interval += (
rand() >> 2) %
1011 (2 *
ip->client->interval);
1015 if (
ip->client->interval >
1016 ip->client->config->backoff_cutoff)
1017 ip->client->interval =
1018 ((
ip->client->config->backoff_cutoff / 2)
1020 ip->client->config->backoff_cutoff));
1021 }
else if (!
ip->client->interval)
1022 ip->client->interval =
1023 ip->client->config->initial_interval;
1028 ip->client->first_sending +
ip->client->config->timeout)
1029 ip->client->interval =
1030 (
ip->client->first_sending +
1037 ip->client->packet.secs =
htons(65535);
1038 ip->client->secs =
ip->client->packet.secs;
1040 note(
"DHCPDISCOVER on %s to %s port %d interval %ld",
1072 note(
"No DHCPOFFERS received.");
1077 DbgPrint(
"DHCPCSVC: Failed to receive a response from a DHCP server. An automatic private address will be assigned.\n");
1084 address_low =
rand();
1085 for (
i = 0;
i <
ip->hw_address.hlen;
i++)
1086 address_low +=
ip->hw_address.haddr[
i];
1088 IpAddress =
htonl(0xA9FE0000 | address_low);
1138 interval >
ip->client->config->reboot_timeout) {
1148 !
ip->client->medium &&
1149 ip->client->active->medium ) {
1154 ip->client->medium =
ip->client->active->medium;
1179 if (!
ip->client->interval)
1180 ip->client->interval =
ip->client->config->initial_interval;
1182 ip->client->interval += ((
rand() >> 2) %
1183 (2 *
ip->client->interval));
1186 if (
ip->client->interval >
1187 ip->client->config->backoff_cutoff)
1188 ip->client->interval =
1189 ((
ip->client->config->backoff_cutoff / 2) +
1190 ((
rand() >> 2) %
ip->client->interval));
1196 ip->client->active->expiry)
1197 ip->client->interval =
1202 memset(&destination, 0,
sizeof(destination));
1209 ip->client->destination.iabuf,
1210 sizeof(destination.
sin_addr.s_addr));
1223 ip->client->packet.secs =
ip->client->secs;
1228 ip->client->packet.secs =
htons(65535);
1231 note(
"DHCPREQUEST on %s to %s port %d",
ip->name,
1246 note(
"DHCPDECLINE on %s to %s port %d",
ip->name,
1264 memset(option_elements, 0,
sizeof(option_elements));
1266 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1272 options[
i]->len =
sizeof(discover);
1273 options[
i]->buf_size =
sizeof(discover);
1279 options[
i]->value =
ip->client->config->requested_options;
1280 options[
i]->len =
ip->client->config->requested_option_count;
1282 ip->client->config->requested_option_count;
1287 ip->client->requested_address = lease->
address;
1295 ip->client->requested_address.len = 0;
1298 for (
i = 0;
i < 256;
i++)
1300 ip->client->config->send_options[
i].data) {
1303 ip->client->config->send_options[
i].data;
1305 ip->client->config->send_options[
i].len;
1307 ip->client->config->send_options[
i].len;
1318 ip->client->packet.htype =
ip->hw_address.htype;
1319 ip->client->packet.hlen =
ip->hw_address.hlen;
1320 ip->client->packet.hops = 0;
1322 ip->client->packet.secs = 0;
1323 ip->client->packet.flags = 0;
1325 memset(&(
ip->client->packet.ciaddr),
1326 0,
sizeof(
ip->client->packet.ciaddr));
1327 memset(&(
ip->client->packet.yiaddr),
1328 0,
sizeof(
ip->client->packet.yiaddr));
1329 memset(&(
ip->client->packet.siaddr),
1330 0,
sizeof(
ip->client->packet.siaddr));
1331 memset(&(
ip->client->packet.giaddr),
1332 0,
sizeof(
ip->client->packet.giaddr));
1334 ip->hw_address.haddr,
ip->hw_address.hlen);
1347 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1360 options[
i]->value =
ip->client->config->requested_options;
1361 options[
i]->len =
ip->client->config->requested_option_count;
1363 ip->client->config->requested_option_count;
1379 ip->client->requested_address = lease->
address;
1387 ip->client->requested_address.len = 0;
1390 for (
i = 0;
i < 256;
i++)
1392 ip->client->config->send_options[
i].data) {
1395 ip->client->config->send_options[
i].data;
1397 ip->client->config->send_options[
i].len;
1399 ip->client->config->send_options[
i].len;
1410 ip->client->packet.htype =
ip->hw_address.htype;
1411 ip->client->packet.hlen =
ip->hw_address.hlen;
1412 ip->client->packet.hops = 0;
1413 ip->client->packet.xid =
ip->client->xid;
1414 ip->client->packet.secs = 0;
1423 ip->client->packet.flags = 0;
1425 memset(&
ip->client->packet.ciaddr, 0,
1426 sizeof(
ip->client->packet.ciaddr));
1427 ip->client->packet.flags = 0;
1430 memset(&
ip->client->packet.yiaddr, 0,
1431 sizeof(
ip->client->packet.yiaddr));
1432 memset(&
ip->client->packet.siaddr, 0,
1433 sizeof(
ip->client->packet.siaddr));
1434 memset(&
ip->client->packet.giaddr, 0,
1435 sizeof(
ip->client->packet.giaddr));
1437 ip->hw_address.haddr,
ip->hw_address.hlen);
1445 struct tree_cache server_id_tree, client_id_tree;
1450 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1457 options[
i]->buf_size =
sizeof(decline);
1470 options[
i] = &requested_address_tree;
1478 if (
ip->client->config->send_options[
i].len) {
1480 options[
i]->value =
ip->client->config->send_options[
i].data;
1481 options[
i]->len =
ip->client->config->send_options[
i].len;
1482 options[
i]->buf_size =
ip->client->config->send_options[
i].len;
1494 ip->client->packet.htype =
ip->hw_address.htype;
1495 ip->client->packet.hlen =
ip->hw_address.hlen;
1496 ip->client->packet.hops = 0;
1497 ip->client->packet.xid =
ip->client->xid;
1498 ip->client->packet.secs = 0;
1499 ip->client->packet.flags = 0;
1502 memset(&
ip->client->packet.ciaddr, 0,
1503 sizeof(
ip->client->packet.ciaddr));
1504 memset(&
ip->client->packet.yiaddr, 0,
1505 sizeof(
ip->client->packet.yiaddr));
1506 memset(&
ip->client->packet.siaddr, 0,
1507 sizeof(
ip->client->packet.siaddr));
1508 memset(&
ip->client->packet.giaddr, 0,
1509 sizeof(
ip->client->packet.giaddr));
1511 ip->hw_address.haddr,
ip->hw_address.hlen);
1523 for (
i = 0;
i < 256;
i++) {
1546 for (lp = ifi->
client->leases; lp; lp = lp->
next)
1558 static int leases_written;
1563 if (leases_written++ > 20) {
1594 for (
i = 0;
i < 256;
i++)
1604 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1605 t->tm_hour,
t->tm_min,
t->tm_sec);
1609 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1610 t->tm_hour,
t->tm_min,
t->tm_sec);
1614 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1615 t->tm_hour,
t->tm_min,
t->tm_sec);
1641 sizeof(lease->
address.iabuf))) {
1642 struct iaddr netmask, subnet, broadcast;
1659 "broadcast_address",
1676 for (
i = 0;
i < 256;
i++) {
1679 if (
ip->client->config->defaults[
i].len) {
1682 ip->client->config->default_actions[
i]) {
1683 case ACTION_DEFAULT:
1687 case ACTION_SUPERSEDE:
1694 case ACTION_PREPEND:
1698 if (
len >=
sizeof(dbuf)) {
1720 if (
len >
sizeof(dbuf)) {
1743 }
else if (lease->
options[
i].len) {
1772 if (
i + 1 == buflen)
1788 static int state = 0;
1798 if (daemon(1, 0) == -1)
1821 l->options[
option].len, 0, 0);
1846 warning(
"Invalid IP address in option(%d): %s",
option, opbuf);
1912 while (ch !=
'\0') {
1947 note(
"got %s", tmp);
1959 static char optbuf[32768];
1961 int opleft =
sizeof(optbuf);
1962 unsigned char *dp =
data;
1965 error(
"option_as_string: bad code %d",
code);
1967 for (; dp <
data +
len; dp++) {
1969 if (dp + 1 !=
data +
len || *dp != 0) {
1974 }
else if (*dp ==
'"' || *dp ==
'\'' || *dp ==
'$' ||
1975 *dp ==
'`' || *dp ==
'\\') {
1989 warning(
"dhcp option too large");
char * strcat(char *DstString, const char *SrcString)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strtok(char *String, const char *Delimiters)
unsigned short int uint16_t
PDHCP_ADAPTER AdapterFindInfo(struct interface_info *ip)
void cancel_timeout(void(*where)(void *), void *what)
void add_timeout(time_t when, void(*where)(void *), void *what)
void(* bootp_packet_handler)(struct interface_info *, struct dhcp_packet *, int, unsigned int, struct iaddr, struct hardware *)
char * pretty_print_option(unsigned int code, unsigned char *data, int len, int emit_commas, int emit_quotes)
int cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, int mms, struct tree_cache **options)
void do_packet(struct interface_info *interface, struct dhcp_packet *packet, int len, unsigned int from_port, struct iaddr from, struct hardware *hfrom)
int note(char *format,...)
int addr_eq(struct iaddr a, struct iaddr b)
struct iaddr broadcast_addr(struct iaddr addr, struct iaddr mask)
char * piaddr(struct iaddr addr)
u_int32_t getULong(unsigned char *data)
struct iaddr subnet_number(struct iaddr addr, struct iaddr mask)
#define DH_DbgPrint(_t_, _x_)
#define DHO_MASK_SUPPLIER
#define DHO_TCP_KEEPALIVE_GARBAGE
#define DHO_DHCP_MAX_MESSAGE_SIZE
#define DHO_ROUTER_DISCOVERY
#define DHO_VENDOR_ENCAPSULATED_OPTIONS
#define DHO_PERFORM_MASK_DISCOVERY
#define DHO_NON_LOCAL_SOURCE_ROUTING
#define DHO_NETBIOS_NAME_SERVERS
#define DHO_DHCP_PARAMETER_REQUEST_LIST
#define DHO_NETBIOS_SCOPE
#define DHO_NETBIOS_NODE_TYPE
#define DHO_TCP_KEEPALIVE_INTERVAL
#define DHO_BROADCAST_ADDRESS
#define DHO_NETBIOS_DD_SERVER
#define DHO_IP_FORWARDING
#define DHO_IMPRESS_SERVERS
#define DHO_TRAILER_ENCAPSULATION
#define DHO_PATH_MTU_PLATEAU_TABLE
#define DHO_DHCP_USER_CLASS_ID
#define DHO_EXTENSIONS_PATH
#define DHO_DHCP_CLIENT_IDENTIFIER
#define DHO_DEFAULT_TCP_TTL
#define DHO_DHCP_MESSAGE_TYPE
#define DHO_INTERFACE_MTU
#define DHO_X_DISPLAY_MANAGER
#define DHO_POLICY_FILTER
#define DHO_ALL_SUBNETS_LOCAL
#define DHO_MAX_DGRAM_REASSEMBLY
#define DHO_COOKIE_SERVERS
#define DHO_DHCP_RENEWAL_TIME
#define DHO_DOMAIN_NAME_SERVERS
#define DHO_DEFAULT_IP_TTL
#define DHO_DHCP_REBINDING_TIME
#define DHO_DHCP_OPTION_OVERLOAD
#define DHO_DHCP_SERVER_IDENTIFIER
#define DHO_ARP_CACHE_TIMEOUT
#define DHO_IEEE802_3_ENCAPSULATION
#define DHO_DHCP_REQUESTED_ADDRESS
#define DHO_DHCP_LEASE_TIME
#define DHO_STATIC_ROUTES
#define DHO_DHCP_CLASS_IDENTIFIER
#define DHO_ROUTER_SOLICITATION_ADDRESS
#define DHO_PATH_MTU_AGING_TIMEOUT
#define DHO_RESOURCE_LOCATION_SERVERS
#define RegCloseKey(hKey)
void make_request(struct interface_info *ip, struct client_lease *lease)
struct client_lease * packet_to_lease(struct packet *packet)
void bootp(struct packet *packet)
void bind_lease(struct interface_info *ip)
void dhcp(struct packet *packet)
void send_discover(void *ipp)
void free_client_lease(struct client_lease *lease)
void dhcpnak(struct packet *packet)
int dhcp_option_ev_name(char *buf, size_t buflen, struct dhcp_option *option)
struct iaddr iaddr_broadcast
void write_client_lease(struct interface_info *ip, struct client_lease *lease, int rewrite)
struct in_addr inaddr_any
int check_option(struct client_lease *l, int option)
void state_bound(void *ipp)
char * path_dhclient_conf
void setup_adapter(PDHCP_ADAPTER Adapter, struct client_lease *new_lease)
int fork_privchld(int, int)
void make_decline(struct interface_info *ip, struct client_lease *lease)
struct sockaddr_in sockaddr_broadcast
void state_selecting(void *ipp)
void send_decline(void *ipp)
int check_arp(struct interface_info *ip, struct client_lease *lp)
void state_reboot(void *ipp)
void set_domain(PDHCP_ADAPTER Adapter, struct client_lease *new_lease)
void dhcpack(struct packet *packet)
void state_panic(void *ipp)
char * option_as_string(unsigned int code, unsigned char *data, int len)
void priv_script_init(struct interface_info *ip, char *reason, char *medium)
void priv_script_write_params(struct interface_info *ip, char *prefix, struct client_lease *lease)
void state_init(void *ipp)
int res_hnok(const char *dn)
#define ASSERT_STATE(state_is, state_shouldbe)
void set_name_servers(PDHCP_ADAPTER Adapter, struct client_lease *new_lease)
void rewrite_client_leases(struct interface_info *ifi)
void dhcpoffer(struct packet *packet)
unsigned long debug_trace_level
void make_discover(struct interface_info *ip, struct client_lease *lease)
#define _PATH_DHCLIENT_CONF
void script_set_env(struct client_state *, const char *, const char *, const char *)
#define NT_SUCCESS(StatCode)
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
DWORD WINAPI GetTickCount(VOID)
UINT(* handler)(MSIPACKAGE *)
static void increase(int &a_)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP void __cdecl rewind(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl rand(void)
DWORD WINAPI AddIPAddress(IPAddr Address, IPMask Netmask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance)
DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
DWORD WINAPI SendARP(IPAddr DestIP, IPAddr SrcIP, PULONG pMacAddr, PULONG PhyAddrLen)
#define inet_aton(cp, addr)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
static unsigned __int64 next
#define DHCP_DEFAULT_LEASE_TIME
_Check_return_ _CRTIMP int __cdecl dup2(_In_ int _FileHandleSrc, _In_ int _FileHandleDst)
_CRTIMP struct tm *__cdecl gmtime(const time_t *_Time)
_CRTIMP void __cdecl tzset(void)
ssize_t send_packet(struct interface_info *ip, struct dhcp_packet *p, size_t size, struct in_addr addr, struct sockaddr_in *broadcast, struct hardware *hardware)
MIB_IPFORWARDROW RouterMib
struct interface_info DhclientInfo
IF_INDEX dwForwardIfIndex
struct string_list * medium
struct option_data options[256]
struct client_lease * next
struct client_state * client
struct interface_info * interface
struct option_data options[256]
struct dhcp_option dhcp_options[256]
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
void int int ULONGLONG int va_list * ap
#define HKEY_LOCAL_MACHINE