2006-01-08 22:14:26 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Networking
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: lib/iphlpapi/dhcp_reactos.c
|
|
|
|
* PURPOSE: DHCP helper functions for ReactOS
|
|
|
|
* COPYRIGHT: Copyright 2006 Ge van Geldorp <gvg@reactos.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "iphlpapi_private.h"
|
|
|
|
|
|
|
|
DWORD APIENTRY DhcpRosGetAdapterInfo(DWORD AdapterIndex,
|
|
|
|
PBOOL DhcpEnabled,
|
|
|
|
PDWORD DhcpServer,
|
|
|
|
time_t *LeaseObtained,
|
|
|
|
time_t *LeaseExpires);
|
|
|
|
|
|
|
|
DWORD getDhcpInfoForAdapter(DWORD AdapterIndex,
|
|
|
|
PBOOL DhcpEnabled,
|
|
|
|
PDWORD DhcpServer,
|
|
|
|
time_t *LeaseObtained,
|
|
|
|
time_t *LeaseExpires)
|
|
|
|
{
|
2010-05-21 06:08:15 +00:00
|
|
|
DWORD Status, Version = 0;
|
|
|
|
|
|
|
|
Status = DhcpCApiInitialize(&Version);
|
2010-05-21 20:17:35 +00:00
|
|
|
if (Status != ERROR_SUCCESS)
|
2010-05-21 06:08:15 +00:00
|
|
|
{
|
2010-05-21 20:17:35 +00:00
|
|
|
/* We assume that the DHCP service isn't running yet */
|
2010-05-21 06:08:15 +00:00
|
|
|
*DhcpEnabled = FALSE;
|
|
|
|
*DhcpServer = htonl(INADDR_NONE);
|
|
|
|
*LeaseObtained = 0;
|
|
|
|
*LeaseExpires = 0;
|
|
|
|
return ERROR_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status = DhcpRosGetAdapterInfo(AdapterIndex, DhcpEnabled, DhcpServer,
|
|
|
|
LeaseObtained, LeaseExpires);
|
|
|
|
|
|
|
|
DhcpCApiCleanup();
|
|
|
|
|
|
|
|
return Status;
|
2006-01-08 22:14:26 +00:00
|
|
|
}
|