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;
593 ip->client->new->medium =
ip->client->medium;
596 if (
ip->client->active)
598 ip->client->active =
ip->client->new;
608 note(
"bound to %s -- renewal in %ld seconds.",
609 piaddr(
ip->client->active->address),
610 (
long int)(
ip->client->active->renewal -
cur_time));
618 warning(
"Could not find adapter for info %p\n",
ip);
640 ip->client->xid =
ip->client->packet.xid;
643 memcpy(
ip->client->destination.iabuf,
ip->client->active->
645 ip->client->destination.len = 4;
649 time(&
ip->client->first_sending);
650 ip->client->interval =
ip->client->config->initial_interval;
719 int arp_timeout_needed = 0, stop_selecting;
721 "DHCPOFFER" :
"BOOTREPLY";
740 for (
i = 0;
ip->client->config->required_options[
i];
i++) {
742 required_options[
i]].len) {
743 note(
"%s isn't satisfactory.",
name);
749 for (lease =
ip->client->offered_leases;
750 lease; lease = lease->
next) {
761 note(
"packet_to_lease failed.");
775 note(
"Arp check failed\n");
781 ip->client->first_sending +
ip->client->config->select_interval;
785 if (lease->
address.len ==
ip->client->requested_address.len &&
787 ip->client->requested_address.iabuf,
788 ip->client->requested_address.len)) {
789 lease->
next =
ip->client->offered_leases;
790 ip->client->offered_leases = lease;
796 if (
ip->client->offered_leases &&
797 (
cur_time + arp_timeout_needed) > stop_selecting)
798 arp_timeout_needed = 0;
802 if (!
ip->client->offered_leases)
803 ip->client->offered_leases = lease;
805 for (lp =
ip->client->offered_leases; lp->
next;
815 if (stop_selecting -
cur_time < arp_timeout_needed)
816 stop_selecting =
cur_time + arp_timeout_needed;
821 if (stop_selecting <= 0)
841 warning(
"dhcpoffer: no memory to record lease.");
845 memset(lease, 0,
sizeof(*lease));
848 for (
i = 0;
i < 256;
i++) {
853 warning(
"dhcpoffer: no memory for option %d",
i);
867 warning(
"Invalid lease option - ignoring offer");
877 lease->serveraddress.len =
sizeof(
packet->
raw->siaddr);
887 warning(
"dhcpoffer: no memory for server name.");
908 warning(
"dhcpoffer: no memory for filename.");
939 if (!
ip->client->active) {
940 note(
"DHCPNAK with no active lease.\n");
945 ip->client->active =
NULL;
982 if (!
ip->client->offered_leases &&
983 ip->client->config->media) {
986 if (
ip->client->medium) {
987 ip->client->medium =
ip->client->medium->next;
990 if (!
ip->client->medium) {
992 error(
"No valid media types for %s!",
ip->name);
993 ip->client->medium =
ip->client->config->media;
997 note(
"Trying medium \"%s\" %d",
ip->client->medium->string,
1010 if (!
ip->client->interval)
1011 ip->client->interval =
1012 ip->client->config->initial_interval;
1014 ip->client->interval += (
rand() >> 2) %
1015 (2 *
ip->client->interval);
1019 if (
ip->client->interval >
1020 ip->client->config->backoff_cutoff)
1021 ip->client->interval =
1022 ((
ip->client->config->backoff_cutoff / 2)
1024 ip->client->config->backoff_cutoff));
1025 }
else if (!
ip->client->interval)
1026 ip->client->interval =
1027 ip->client->config->initial_interval;
1032 ip->client->first_sending +
ip->client->config->timeout)
1033 ip->client->interval =
1034 (
ip->client->first_sending +
1041 ip->client->packet.secs =
htons(65535);
1042 ip->client->secs =
ip->client->packet.secs;
1044 note(
"DHCPDISCOVER on %s to %s port %d interval %ld",
1076 note(
"No DHCPOFFERS received.");
1081 DbgPrint(
"DHCPCSVC: Failed to receive a response from a DHCP server. An automatic private address will be assigned.\n");
1088 address_low =
rand();
1089 for (
i = 0;
i <
ip->hw_address.hlen;
i++)
1090 address_low +=
ip->hw_address.haddr[
i];
1092 IpAddress =
htonl(0xA9FE0000 | address_low);
1142 interval >
ip->client->config->reboot_timeout) {
1152 !
ip->client->medium &&
1153 ip->client->active->medium ) {
1158 ip->client->medium =
ip->client->active->medium;
1183 if (!
ip->client->interval)
1184 ip->client->interval =
ip->client->config->initial_interval;
1186 ip->client->interval += ((
rand() >> 2) %
1187 (2 *
ip->client->interval));
1190 if (
ip->client->interval >
1191 ip->client->config->backoff_cutoff)
1192 ip->client->interval =
1193 ((
ip->client->config->backoff_cutoff / 2) +
1194 ((
rand() >> 2) %
ip->client->interval));
1200 ip->client->active->expiry)
1201 ip->client->interval =
1206 memset(&destination, 0,
sizeof(destination));
1213 ip->client->destination.iabuf,
1214 sizeof(destination.
sin_addr.s_addr));
1227 ip->client->packet.secs =
ip->client->secs;
1232 ip->client->packet.secs =
htons(65535);
1235 note(
"DHCPREQUEST on %s to %s port %d",
ip->name,
1250 note(
"DHCPDECLINE on %s to %s port %d",
ip->name,
1268 memset(option_elements, 0,
sizeof(option_elements));
1270 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1276 options[
i]->len =
sizeof(discover);
1277 options[
i]->buf_size =
sizeof(discover);
1283 options[
i]->value =
ip->client->config->requested_options;
1284 options[
i]->len =
ip->client->config->requested_option_count;
1286 ip->client->config->requested_option_count;
1291 ip->client->requested_address = lease->
address;
1299 ip->client->requested_address.len = 0;
1302 for (
i = 0;
i < 256;
i++)
1304 ip->client->config->send_options[
i].data) {
1307 ip->client->config->send_options[
i].data;
1309 ip->client->config->send_options[
i].len;
1311 ip->client->config->send_options[
i].len;
1322 ip->client->packet.htype =
ip->hw_address.htype;
1323 ip->client->packet.hlen =
ip->hw_address.hlen;
1324 ip->client->packet.hops = 0;
1326 ip->client->packet.secs = 0;
1327 ip->client->packet.flags = 0;
1329 memset(&(
ip->client->packet.ciaddr),
1330 0,
sizeof(
ip->client->packet.ciaddr));
1331 memset(&(
ip->client->packet.yiaddr),
1332 0,
sizeof(
ip->client->packet.yiaddr));
1333 memset(&(
ip->client->packet.siaddr),
1334 0,
sizeof(
ip->client->packet.siaddr));
1335 memset(&(
ip->client->packet.giaddr),
1336 0,
sizeof(
ip->client->packet.giaddr));
1338 ip->hw_address.haddr,
ip->hw_address.hlen);
1351 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1364 options[
i]->value =
ip->client->config->requested_options;
1365 options[
i]->len =
ip->client->config->requested_option_count;
1367 ip->client->config->requested_option_count;
1383 ip->client->requested_address = lease->
address;
1391 ip->client->requested_address.len = 0;
1394 for (
i = 0;
i < 256;
i++)
1396 ip->client->config->send_options[
i].data) {
1399 ip->client->config->send_options[
i].data;
1401 ip->client->config->send_options[
i].len;
1403 ip->client->config->send_options[
i].len;
1414 ip->client->packet.htype =
ip->hw_address.htype;
1415 ip->client->packet.hlen =
ip->hw_address.hlen;
1416 ip->client->packet.hops = 0;
1417 ip->client->packet.xid =
ip->client->xid;
1418 ip->client->packet.secs = 0;
1427 ip->client->packet.flags = 0;
1429 memset(&
ip->client->packet.ciaddr, 0,
1430 sizeof(
ip->client->packet.ciaddr));
1431 ip->client->packet.flags = 0;
1434 memset(&
ip->client->packet.yiaddr, 0,
1435 sizeof(
ip->client->packet.yiaddr));
1436 memset(&
ip->client->packet.siaddr, 0,
1437 sizeof(
ip->client->packet.siaddr));
1438 memset(&
ip->client->packet.giaddr, 0,
1439 sizeof(
ip->client->packet.giaddr));
1441 ip->hw_address.haddr,
ip->hw_address.hlen);
1449 struct tree_cache server_id_tree, client_id_tree;
1454 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1461 options[
i]->buf_size =
sizeof(decline);
1474 options[
i] = &requested_address_tree;
1482 if (
ip->client->config->send_options[
i].len) {
1484 options[
i]->value =
ip->client->config->send_options[
i].data;
1485 options[
i]->len =
ip->client->config->send_options[
i].len;
1486 options[
i]->buf_size =
ip->client->config->send_options[
i].len;
1498 ip->client->packet.htype =
ip->hw_address.htype;
1499 ip->client->packet.hlen =
ip->hw_address.hlen;
1500 ip->client->packet.hops = 0;
1501 ip->client->packet.xid =
ip->client->xid;
1502 ip->client->packet.secs = 0;
1503 ip->client->packet.flags = 0;
1506 memset(&
ip->client->packet.ciaddr, 0,
1507 sizeof(
ip->client->packet.ciaddr));
1508 memset(&
ip->client->packet.yiaddr, 0,
1509 sizeof(
ip->client->packet.yiaddr));
1510 memset(&
ip->client->packet.siaddr, 0,
1511 sizeof(
ip->client->packet.siaddr));
1512 memset(&
ip->client->packet.giaddr, 0,
1513 sizeof(
ip->client->packet.giaddr));
1515 ip->hw_address.haddr,
ip->hw_address.hlen);
1527 for (
i = 0;
i < 256;
i++) {
1550 for (lp = ifi->
client->leases; lp; lp = lp->
next)
1562 static int leases_written;
1567 if (leases_written++ > 20) {
1598 for (
i = 0;
i < 256;
i++)
1608 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1609 t->tm_hour,
t->tm_min,
t->tm_sec);
1613 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1614 t->tm_hour,
t->tm_min,
t->tm_sec);
1618 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1619 t->tm_hour,
t->tm_min,
t->tm_sec);
1645 sizeof(lease->
address.iabuf))) {
1663 "broadcast_address",
1680 for (
i = 0;
i < 256;
i++) {
1683 if (
ip->client->config->defaults[
i].len) {
1686 ip->client->config->default_actions[
i]) {
1687 case ACTION_DEFAULT:
1691 case ACTION_SUPERSEDE:
1698 case ACTION_PREPEND:
1702 if (
len >=
sizeof(dbuf)) {
1724 if (
len >
sizeof(dbuf)) {
1747 }
else if (lease->
options[
i].len) {
1776 if (
i + 1 == buflen)
1792 static int state = 0;
1802 if (daemon(1, 0) == -1)
1825 l->options[
option].len, 0, 0);
1850 warning(
"Invalid IP address in option(%d): %s",
option, opbuf);
1916 while (ch !=
'\0') {
1951 note(
"got %s", tmp);
1963 static char optbuf[32768];
1965 int opleft =
sizeof(optbuf);
1966 unsigned char *dp =
data;
1969 error(
"option_as_string: bad code %d",
code);
1971 for (; dp <
data +
len; dp++) {
1973 if (dp + 1 !=
data +
len || *dp != 0) {
1978 }
else if (*dp ==
'"' || *dp ==
'\'' || *dp ==
'$' ||
1979 *dp ==
'`' || *dp ==
'\\') {
1993 warning(
"dhcp option too large");
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
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
#define inet_aton(ap, inp)
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 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]
Character const *const prefix
static const u8_t broadcast[6]
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
void int int ULONGLONG int va_list * ap
#define HKEY_LOCAL_MACHINE