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;
276 for (lp =
ip->client->offered_leases; lp; lp =
next) {
290 ip->client->offered_leases =
NULL;
302 ip->client->new = picked;
321 ip->client->interval =
ip->client->config->initial_interval;
325 ip->client->xid =
ip->client->packet.xid;
364 note(
"packet_to_lease failed.");
368 ip->client->new = lease;
381 if (
ip->client->new->expiry < 0)
384 if (
ip->client->new->expiry < 60)
385 ip->client->new->expiry = 60;
393 ip->client->new->renewal =
ip->client->new->expiry / 2;
400 ip->client->new->rebind =
ip->client->new->renewal +
401 ip->client->new->renewal / 2 +
ip->client->new->renewal / 4;
404 ip->client->new->lease =
ip->client->new->expiry;
422 CHAR Buffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
432 struct iaddr nameserver;
441 for(
i = 0;
i < addrs;
i++ ) {
447 if(
i != addrs-1 )
strcat( nsbuf,
"," );
469 CHAR Buffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
486 CHAR Buffer1[
MAX_PATH] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
487 CHAR Buffer2[
MAX_PATH] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters";
488 HKEY RegKey1, RegKey2;
536 CHAR Buffer1[
MAX_PATH] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
537 CHAR Buffer2[
MAX_PATH] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters";
538 HKEY RegKey1, RegKey2;
562 CHAR Buffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
563 CHAR AddressBuffer[32];
600 DWORD dwAddressType = 0;
648 CHAR Buffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
649 CHAR IpAddress[] =
"0.0.0.0";
650 CHAR SubnetMask[] =
"255.0.0.0";
680 new_time =
cur_time + lease - (lease / 8);
682 DWORD dwAddressType = 0;
709 ip->client->new->medium =
ip->client->medium;
712 if (
ip->client->active)
714 ip->client->active =
ip->client->new;
724 note(
"bound to %s -- renewal in %ld seconds.",
725 piaddr(
ip->client->active->address),
726 (
long int)(
ip->client->active->renewal -
cur_time));
734 warning(
"Could not find adapter for info %p\n",
ip);
746 if (
ip->client->active) {
748 ip->client->active =
NULL;
758 warning(
"Could not find adapter for info %p\n",
ip);
778 ip->client->xid =
ip->client->packet.xid;
781 memcpy(
ip->client->destination.iabuf,
ip->client->active->
783 ip->client->destination.len = 4;
787 time(&
ip->client->first_sending);
788 ip->client->interval =
ip->client->config->initial_interval;
857 int arp_timeout_needed = 0;
860 "DHCPOFFER" :
"BOOTREPLY";
879 for (
i = 0;
ip->client->config->required_options[
i];
i++) {
881 required_options[
i]].len) {
882 note(
"%s isn't satisfactory.",
name);
888 for (lease =
ip->client->offered_leases;
889 lease; lease = lease->
next) {
900 note(
"packet_to_lease failed.");
914 note(
"Arp check failed\n");
920 ip->client->first_sending +
ip->client->config->select_interval;
924 if (lease->
address.len ==
ip->client->requested_address.len &&
926 ip->client->requested_address.iabuf,
927 ip->client->requested_address.len)) {
928 lease->
next =
ip->client->offered_leases;
929 ip->client->offered_leases = lease;
935 if (
ip->client->offered_leases &&
936 (
cur_time + arp_timeout_needed) > stop_selecting)
937 arp_timeout_needed = 0;
941 if (!
ip->client->offered_leases)
942 ip->client->offered_leases = lease;
944 for (lp =
ip->client->offered_leases; lp->
next;
954 if (stop_selecting -
cur_time < arp_timeout_needed)
955 stop_selecting =
cur_time + arp_timeout_needed;
960 if (stop_selecting <= 0)
980 warning(
"dhcpoffer: no memory to record lease.");
984 memset(lease, 0,
sizeof(*lease));
987 for (
i = 0;
i < 256;
i++) {
992 warning(
"dhcpoffer: no memory for option %d",
i);
1006 warning(
"Invalid lease option - ignoring offer");
1016 if (
packet->
raw->siaddr.S_un.S_addr == 0)
1023 lease->serveraddress.len =
sizeof(
packet->
raw->siaddr);
1024 memcpy(lease->serveraddress.iabuf, &
packet->
raw->siaddr, lease->serveraddress.len);
1034 warning(
"dhcpoffer: no memory for server name.");
1055 warning(
"dhcpoffer: no memory for filename.");
1086 if (!
ip->client->active) {
1087 note(
"DHCPNAK with no active lease.\n");
1092 ip->client->active =
NULL;
1121 if (
interval >
ip->client->config->timeout) {
1129 if (!
ip->client->offered_leases &&
1130 ip->client->config->media) {
1133 if (
ip->client->medium) {
1134 ip->client->medium =
ip->client->medium->next;
1137 if (!
ip->client->medium) {
1139 error(
"No valid media types for %s!",
ip->name);
1140 ip->client->medium =
ip->client->config->media;
1144 note(
"Trying medium \"%s\" %d",
ip->client->medium->string,
1157 if (!
ip->client->interval)
1158 ip->client->interval =
1159 ip->client->config->initial_interval;
1161 ip->client->interval += (
rand() >> 2) %
1162 (2 *
ip->client->interval);
1166 if (
ip->client->interval >
1167 ip->client->config->backoff_cutoff)
1168 ip->client->interval =
1169 ((
ip->client->config->backoff_cutoff / 2)
1171 ip->client->config->backoff_cutoff));
1172 }
else if (!
ip->client->interval)
1173 ip->client->interval =
1174 ip->client->config->initial_interval;
1179 ip->client->first_sending +
ip->client->config->timeout)
1180 ip->client->interval =
1181 (
ip->client->first_sending +
1188 ip->client->packet.secs =
htons(65535);
1189 ip->client->secs =
ip->client->packet.secs;
1191 note(
"DHCPDISCOVER on %s to %s port %d interval %ld",
1214 CHAR szKeyNameBuffer[200] =
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
1216 CHAR SubnetMask[] =
"255.255.0.0";
1217 CHAR AddressBuffer[32];
1231 DWORD dwAddressType = 0;
1233 note(
"No DHCPOFFERS received.");
1342 address_low =
rand();
1343 for (
i = 0;
i <
ip->hw_address.hlen;
i++)
1344 address_low +=
ip->hw_address.haddr[
i];
1346 IpAddress =
htonl(0xA9FE0000 | address_low);
1369 addr.S_un.S_addr = IpAddress;
1427 interval >
ip->client->config->reboot_timeout) {
1437 !
ip->client->medium &&
1438 ip->client->active->medium ) {
1443 ip->client->medium =
ip->client->active->medium;
1468 if (!
ip->client->interval)
1469 ip->client->interval =
ip->client->config->initial_interval;
1471 ip->client->interval += ((
rand() >> 2) %
1472 (2 *
ip->client->interval));
1475 if (
ip->client->interval >
1476 ip->client->config->backoff_cutoff)
1477 ip->client->interval =
1478 ((
ip->client->config->backoff_cutoff / 2) +
1479 ((
rand() >> 2) %
ip->client->interval));
1485 ip->client->active->expiry)
1486 ip->client->interval =
1491 memset(&destination, 0,
sizeof(destination));
1498 ip->client->destination.iabuf,
1499 sizeof(destination.
sin_addr.s_addr));
1512 ip->client->packet.secs =
ip->client->secs;
1517 ip->client->packet.secs =
htons(65535);
1520 note(
"DHCPREQUEST on %s to %s port %d",
ip->name,
1535 note(
"DHCPDECLINE on %s to %s port %d",
ip->name,
1551 memset(&destination, 0,
sizeof(destination));
1553 ip->client->destination.iabuf,
1554 sizeof(destination.
sin_addr.s_addr));
1561 note(
"DHCPRELEASE on %s to %s port %d",
ip->name,
1578 memset(option_elements, 0,
sizeof(option_elements));
1580 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1586 options[
i]->len =
sizeof(discover);
1587 options[
i]->buf_size =
sizeof(discover);
1593 options[
i]->value =
ip->client->config->requested_options;
1594 options[
i]->len =
ip->client->config->requested_option_count;
1596 ip->client->config->requested_option_count;
1601 ip->client->requested_address = lease->
address;
1609 ip->client->requested_address.len = 0;
1612 for (
i = 0;
i < 256;
i++)
1614 ip->client->config->send_options[
i].data) {
1617 ip->client->config->send_options[
i].data;
1619 ip->client->config->send_options[
i].len;
1621 ip->client->config->send_options[
i].len;
1632 ip->client->packet.htype =
ip->hw_address.htype;
1633 ip->client->packet.hlen =
ip->hw_address.hlen;
1634 ip->client->packet.hops = 0;
1636 ip->client->packet.secs = 0;
1637 ip->client->packet.flags = 0;
1639 memset(&(
ip->client->packet.ciaddr),
1640 0,
sizeof(
ip->client->packet.ciaddr));
1641 memset(&(
ip->client->packet.yiaddr),
1642 0,
sizeof(
ip->client->packet.yiaddr));
1643 memset(&(
ip->client->packet.siaddr),
1644 0,
sizeof(
ip->client->packet.siaddr));
1645 memset(&(
ip->client->packet.giaddr),
1646 0,
sizeof(
ip->client->packet.giaddr));
1648 ip->hw_address.haddr,
ip->hw_address.hlen);
1661 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1674 options[
i]->value =
ip->client->config->requested_options;
1675 options[
i]->len =
ip->client->config->requested_option_count;
1677 ip->client->config->requested_option_count;
1693 ip->client->requested_address = lease->
address;
1701 ip->client->requested_address.len = 0;
1704 for (
i = 0;
i < 256;
i++)
1706 ip->client->config->send_options[
i].data) {
1709 ip->client->config->send_options[
i].data;
1711 ip->client->config->send_options[
i].len;
1713 ip->client->config->send_options[
i].len;
1724 ip->client->packet.htype =
ip->hw_address.htype;
1725 ip->client->packet.hlen =
ip->hw_address.hlen;
1726 ip->client->packet.hops = 0;
1727 ip->client->packet.xid =
ip->client->xid;
1728 ip->client->packet.secs = 0;
1737 ip->client->packet.flags = 0;
1739 memset(&
ip->client->packet.ciaddr, 0,
1740 sizeof(
ip->client->packet.ciaddr));
1741 ip->client->packet.flags = 0;
1744 memset(&
ip->client->packet.yiaddr, 0,
1745 sizeof(
ip->client->packet.yiaddr));
1746 memset(&
ip->client->packet.siaddr, 0,
1747 sizeof(
ip->client->packet.siaddr));
1748 memset(&
ip->client->packet.giaddr, 0,
1749 sizeof(
ip->client->packet.giaddr));
1751 ip->hw_address.haddr,
ip->hw_address.hlen);
1759 struct tree_cache server_id_tree, client_id_tree;
1764 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1771 options[
i]->buf_size =
sizeof(decline);
1784 options[
i] = &requested_address_tree;
1792 if (
ip->client->config->send_options[
i].len) {
1794 options[
i]->value =
ip->client->config->send_options[
i].data;
1795 options[
i]->len =
ip->client->config->send_options[
i].len;
1796 options[
i]->buf_size =
ip->client->config->send_options[
i].len;
1808 ip->client->packet.htype =
ip->hw_address.htype;
1809 ip->client->packet.hlen =
ip->hw_address.hlen;
1810 ip->client->packet.hops = 0;
1811 ip->client->packet.xid =
ip->client->xid;
1812 ip->client->packet.secs = 0;
1813 ip->client->packet.flags = 0;
1816 memset(&
ip->client->packet.ciaddr, 0,
1817 sizeof(
ip->client->packet.ciaddr));
1818 memset(&
ip->client->packet.yiaddr, 0,
1819 sizeof(
ip->client->packet.yiaddr));
1820 memset(&
ip->client->packet.siaddr, 0,
1821 sizeof(
ip->client->packet.siaddr));
1822 memset(&
ip->client->packet.giaddr, 0,
1823 sizeof(
ip->client->packet.giaddr));
1825 ip->hw_address.haddr,
ip->hw_address.hlen);
1832 struct tree_cache server_id_tree, client_id_tree;
1837 memset(&
ip->client->packet, 0,
sizeof(
ip->client->packet));
1844 options[
i]->buf_size =
sizeof(release);
1857 if (
ip->client->config->send_options[
i].len)
1860 options[
i]->value =
ip->client->config->send_options[
i].data;
1861 options[
i]->len =
ip->client->config->send_options[
i].len;
1862 options[
i]->buf_size =
ip->client->config->send_options[
i].len;
1872 ip->client->packet.htype =
ip->hw_address.htype;
1873 ip->client->packet.hlen =
ip->hw_address.hlen;
1874 ip->client->packet.hops = 0;
1875 ip->client->packet.xid = 0;
1876 ip->client->packet.secs = 0;
1877 ip->client->packet.flags = 0;
1882 memset(&
ip->client->packet.yiaddr, 0,
1883 sizeof(
ip->client->packet.yiaddr));
1884 memset(&
ip->client->packet.siaddr, 0,
1885 sizeof(
ip->client->packet.siaddr));
1886 memset(&
ip->client->packet.giaddr, 0,
1887 sizeof(
ip->client->packet.giaddr));
1889 ip->hw_address.haddr,
ip->hw_address.hlen);
1901 for (
i = 0;
i < 256;
i++) {
1924 for (lp = ifi->
client->leases; lp; lp = lp->
next)
1936 static int leases_written;
1941 if (leases_written++ > 20) {
1972 for (
i = 0;
i < 256;
i++)
1982 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1983 t->tm_hour,
t->tm_min,
t->tm_sec);
1987 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1988 t->tm_hour,
t->tm_min,
t->tm_sec);
1992 t->tm_wday,
t->tm_year + 1900,
t->tm_mon + 1,
t->tm_mday,
1993 t->tm_hour,
t->tm_min,
t->tm_sec);
2019 sizeof(lease->
address.iabuf))) {
2037 "broadcast_address",
2054 for (
i = 0;
i < 256;
i++) {
2057 if (
ip->client->config->defaults[
i].len) {
2060 ip->client->config->default_actions[
i]) {
2061 case ACTION_DEFAULT:
2065 case ACTION_SUPERSEDE:
2072 case ACTION_PREPEND:
2076 if (
len >=
sizeof(dbuf)) {
2098 if (
len >
sizeof(dbuf)) {
2121 }
else if (lease->
options[
i].len) {
2150 if (
i + 1 == buflen)
2166 static int state = 0;
2176 if (daemon(1, 0) == -1)
2199 l->options[
option].len, 0, 0);
2213 warning(
"Invalid IP address in option(%d): %s",
option, opbuf);
2225 warning(
"Invalid IP address in option(%d): %s",
option, opbuf);
2246 warning(
"Invalid IP address in option(%d): %s",
option, opbuf);
2312 while (
ch !=
'\0') {
2347 note(
"got %s", tmp);
2359 static char optbuf[32768];
2361 int opleft =
sizeof(optbuf);
2362 unsigned char *dp =
data;
2365 error(
"option_as_string: bad code %d",
code);
2367 for (; dp <
data +
len; dp++) {
2369 if (dp + 1 !=
data +
len || *dp != 0) {
2374 }
else if (*dp ==
'"' || *dp ==
'\'' || *dp ==
'$' ||
2375 *dp ==
'`' || *dp ==
'\\') {
2389 warning(
"dhcp option too large");
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)
struct dhcp_option dhcp_options[256]
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)
void unset_domain(PDHCP_ADAPTER Adapter)
struct client_lease * packet_to_lease(struct packet *packet)
void make_release(struct interface_info *ip, struct client_lease *lease)
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 unset_name_servers(PDHCP_ADAPTER Adapter)
void state_bound(void *ipp)
void send_release(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)
void state_release(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)
void unbind_lease(struct interface_info *ip)
char * option_as_string(unsigned int code, unsigned char *data, int len)
void reset_adapter(PDHCP_ADAPTER Adapter)
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 RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
UINT(* handler)(MSIPACKAGE *)
int WINAPIV fprintf(FILE *file, const char *format,...)
FILE *CDECL fopen(const char *path, const char *mode)
void CDECL rewind(FILE *file)
int CDECL fflush(FILE *file)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
static int dup2(int od, int nd)
static int __cdecl _snprintf(char *buffer, size_t size, const char *format,...) __WINE_CRT_PRINTF_ATTR(3
_ACRTIMP int __cdecl rand(void)
_ACRTIMP void __cdecl srand(unsigned int)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP char *__cdecl strtok(char *, const char *)
static struct tm * gmtime(const time_t *t)
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
GLenum const GLvoid * addr
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
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)
NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
static unsigned __int64 next
#define DHCP_DEFAULT_LEASE_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)
static void Server(int port)
MIB_IPFORWARDROW RouterMib
PALTERNATE_CONFIGURATION AlternateConfiguration
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]
NTSYSAPI PSTR NTAPI RtlIpv4AddressToStringA(_In_ const struct in_addr *Addr, _Out_writes_(16) PSTR S)
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