Modified: trunk/reactos/bootdata/hivesft.inf
Modified: trunk/reactos/bootdata/hivesys.inf
Modified: trunk/reactos/bootdata/packages/reactos.dff
Modified: trunk/reactos/drivers/lib/ip/network/loopback.c
Modified: trunk/reactos/drivers/net/tcpip/datalink/lan.c
Modified: trunk/reactos/drivers/net/tcpip/include/debug.h
Modified: trunk/reactos/drivers/net/tcpip/tcpip/iinfo.c
Modified: trunk/reactos/drivers/net/tcpip/tcpip/info.c
Modified: trunk/reactos/drivers/net/tcpip/tcpip/ninfo.c
Modified: trunk/reactos/subsys/system/dhcp/Makefile
Modified: trunk/reactos/subsys/system/dhcp/adapter.c
Modified: trunk/reactos/subsys/system/dhcp/api.c
Modified: trunk/reactos/subsys/system/dhcp/dhclient.c
Modified: trunk/reactos/subsys/system/dhcp/dispatch.c
Modified: trunk/reactos/subsys/system/dhcp/include/dhcpd.h
Modified: trunk/reactos/subsys/system/dhcp/include/rosdhcp.h
--- trunk/reactos/bootdata/hivesft.inf 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/bootdata/hivesft.inf 2005-04-22 09:45:17 UTC (rev 14737)
@@ -725,8 +725,8 @@
0x00,0x00,0x0a,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00
-;HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\system32\cmd.exe"
-HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"
+HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\system32\cmd.exe"
+;HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartGUI",0x00010001,0x00000000
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe"
--- trunk/reactos/bootdata/hivesys.inf 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/bootdata/hivesys.inf 2005-04-22 09:45:17 UTC (rev 14737)
@@ -293,9 +293,9 @@
HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Linkage","Route",0x00010000,"3c90x1"
HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters","SlotNumber",0x00000000,"10"
HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters","BusNumber",0x00000000,"0"
-HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters\Tcpip","DefaultGateway",0x00010000,"10.0.0.1"
-HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters\Tcpip","IPAddress",0x00010000,"10.0.0.100"
-HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters\Tcpip","SubnetMask",0x00010000,"255.255.255.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters\Tcpip","DefaultGateway",0x00010000,"0.0.0.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters\Tcpip","IPAddress",0x00010000,"0.0.0.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\3c90x1\Parameters\Tcpip","SubnetMask",0x00010000,"0.0.0.0"
; Afd driver
HKLM,"SYSTEM\CurrentControlSet\Services\Afd","ErrorControl",0x00010001,0x00000001
@@ -446,6 +446,13 @@
HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Start",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Type",0x00010001,0x00000010
+; DHCP client service
+HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ErrorControl",0x00010001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Group",0x00000000,"Network"
+HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ImagePath",0x00020000,"%SystemRoot%\system32\dhcp.exe"
+HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Start",0x00010001,0x00000002
+HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Type",0x00010001,0x00000010
+
; Floppy driver
HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","Group",0x00000000,"Primary Disk"
@@ -572,9 +579,9 @@
HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0001","Port",0x00000000,"280"
HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0001","Irq",0x00000000,"9"
HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0001","NetworkAddress",0x00000000,"001122334455"
-HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","DefaultGateway",0x00010000,"10.0.0.1"
-HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","IPAddress",0x00010000,"10.0.0.100"
-HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","SubnetMask",0x00010000,"255.255.255.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","DefaultGateway",0x00010000,"0.0.0.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","IPAddress",0x00010000,"0.0.0.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","SubnetMask",0x00010000,"0.0.0.0"
; one day this will happen automatically; until then we need this since ndis5 drivers
; rely on the fact that their resources are handed to them by ndis, so we have to find
@@ -663,9 +670,9 @@
HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0000","BusNumber",0x00000000,"0"
HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{RANDOMCFGGUIDFOR_PCNET1}",,0x00000000,"Network Adapters"
HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{RANDOMCFGGUIDFOR_PCNET1}\Connection","Name",0x00000000,"AMD PCNet (static Registry entry)"
-HKLM,"SYSTEM\CurrentControlSet\Services\PCNet1\Parameters\Tcpip","DefaultGateway",0x00010000,"10.0.0.1"
-HKLM,"SYSTEM\CurrentControlSet\Services\PCNet1\Parameters\Tcpip","IPAddress",0x00010000,"10.0.0.100"
-HKLM,"SYSTEM\CurrentControlSet\Services\PCNet1\Parameters\Tcpip","SubnetMask",0x00010000,"255.255.255.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\PCNet1\Parameters\Tcpip","DefaultGateway",0x00010000,"0.0.0.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\PCNet1\Parameters\Tcpip","IPAddress",0x00010000,"0.0.0.0"
+HKLM,"SYSTEM\CurrentControlSet\Services\PCNet1\Parameters\Tcpip","SubnetMask",0x00010000,"0.0.0.0"
; Named Pipe filesystem driver
HKLM,"SYSTEM\CurrentControlSet\Services\Npfs","ErrorControl",0x00010001,0x00000000
@@ -867,100 +874,4 @@
HKLM,"SYSTEM\Setup","SetupType",0x00010001,0x00000001
HKLM,"SYSTEM\Setup","SystemPartition",0x00000000,"\Device\Harddisk0\Partition1"
HKLM,"SYSTEM\Setup","SystemSetupInProgress",0x00010001,0x00000000
-
-; ----------------------------- KJS Init ----------------------------
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","kjsinit",0x00010000,\
-"function init(v) { var rk = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Kdb'; eval(System.regread(rk,v)); } for( i = 1; i <= 45; i++ ) { init((new Number(i)).toString()); }"
-
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","1",0x00010000,\
-"function write(x) { System.print(x); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","2",0x00010000,\
-"function regs(n) { return System.regs(n); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","3",0x00010000,\
-"function debugebp() { return regs(0); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","4",0x00010000,\
-"function debugeip() { return regs(1); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","5",0x00010000,\
-"function tf_argmark() { return regs(2); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","6",0x00010000,\
-"function tf_pointer() { return regs(3); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","7",0x00010000,\
-"function tf_tempcs() { return regs(4); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","8",0x00010000,\
-"function tf_tempeip() { return regs(5); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","9",0x00010000,\
-"function dr0() { return regs(6); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","10",0x00010000,\
-"function dr1() { return regs(7); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","11",0x00010000,\
-"function dr2() { return regs(8); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","12",0x00010000,\
-"function dr3() { return regs(9); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","13",0x00010000,\
-"function dr6() { return regs(10); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","14",0x00010000,\
-"function dr7() { return regs(11); } "
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","15",0x00010000,\
-"function gs() { return regs(12) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","16",0x00010000,\
-"function es() { return regs(13) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","17",0x00010000,\
-"function ds() { return regs(14) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","18",0x00010000,\
-"function edx() { return regs(15); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","19",0x00010000,\
-"function ecx() { return regs(16); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","20",0x00010000,\
-"function eax() { return regs(17); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","21",0x00010000,\
-"function tf_pmode() { return regs(18); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","22",0x00010000,\
-"function tf_exl() { return regs(19); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","23",0x00010000,\
-"function fs() { return regs(20) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","24",0x00010000,\
-"function edi() { return regs(21); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","25",0x00010000,\
-"function esi() { return regs(22); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","26",0x00010000,\
-"function ebx() { return regs(23); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","27",0x00010000,\
-"function ebp() { return regs(24); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","28",0x00010000,\
-"function error_code() { return regs(25); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","29",0x00010000,\
-"function eip() { return regs(26); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","30",0x00010000,\
-"function cs() { return regs(27) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","31",0x00010000,\
-"function eflags() { return regs(28); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","32",0x00010000,\
-"function esp() { return regs(29); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","33",0x00010000,\
-"function ss() { return regs(30) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","34",0x00010000,\
-"function v86_es() { return regs(31) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","35",0x00010000,\
-"function v86_ds() { return regs(32) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","36",0x00010000,\
-"function v86_fs() { return regs(33) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","37",0x00010000,\
-"function v86_gs() { return regs(34) & 0xffff; }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","38",0x00010000,\
-"function peekl(a) { return System.mread(4,a); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","39",0x00010000,\
-"function pokel(a,b) { return System.mwrite(4,a,b); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","40",0x00010000,\
-"function peekw(a) { return System.mread(2,a); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","41",0x00010000,\
-"function pokew(a,b) { return System.mwrite(2,a,b); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","42",0x00010000,\
-"function peek(a) { return System.mread(1,a); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","43",0x00010000,\
-"function poke(a,b) { return System.mwrite(1,a,b); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","44",0x00010000,\
-"function regread(x,y) { return System.regread(x,y); }"
-HKLM,"SYSTEM\CurrentControlSet\Control\Kdb","45",0x00010000,\
-"write('JS Registry Init Complete. Welcome to ReactOS kernel scripting');"
-
; EOF
--- trunk/reactos/bootdata/packages/reactos.dff 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/bootdata/packages/reactos.dff 2005-04-22 09:45:17 UTC (rev 14737)
@@ -167,6 +167,7 @@
subsys\system\vmwinst\vmwinst.exe 1
subsys\system\winlogon\winlogon.exe 1
subsys\system\winefile\winefile.exe 1
+subsys\system\dhcp\dhcp.exe 1
services\eventlog\eventlog.exe 1
services\rpcss\rpcss.exe 1
services\umpnpmgr\umpnpmgr.exe 1
--- trunk/reactos/drivers/lib/ip/network/loopback.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/drivers/lib/ip/network/loopback.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -189,6 +189,10 @@
Loopback = IPCreateInterface(&BindInfo);
+ Loopback->Name.Buffer = L"Loopback";
+ Loopback->Name.MaximumLength = Loopback->Name.Length =
+ wcslen(Loopback->Name.Buffer) * sizeof(WCHAR);
+
AddrInitIPv4(&Loopback->Unicast, LOOPBACK_ADDRESS_IPv4);
AddrInitIPv4(&Loopback->Netmask, LOOPBACK_ADDRMASK_IPv4);
--- trunk/reactos/drivers/net/tcpip/datalink/lan.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/drivers/net/tcpip/datalink/lan.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -366,6 +366,8 @@
PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext;
KIRQL OldIrql;
+ TI_DbgPrint(DEBUG_DATALINK,("called\n"));
+
TcpipAcquireSpinLock( &LanWorkLock, &OldIrql );
WQItem = ExAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) );
@@ -408,6 +410,8 @@
{
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
+ TI_DbgPrint(DEBUG_DATALINK,("called\n"));
+
TransferDataCompleteCalled++;
ASSERT(TransferDataCompleteCalled <= TransferDataCalled);
@@ -736,59 +740,6 @@
return Status;
}
-static NTSTATUS ReadIPAddressFromRegistry( HANDLE RegHandle,
- PWCHAR RegistryValue,
- PIP_ADDRESS Address ) {
- UNICODE_STRING ValueName;
- UNICODE_STRING UnicodeAddress;
- NTSTATUS Status;
- ULONG ResultLength;
- UCHAR buf[1024];
- PKEY_VALUE_PARTIAL_INFORMATION Information = (PKEY_VALUE_PARTIAL_INFORMATION)buf;
- ANSI_STRING AnsiAddress;
- ULONG AnsiLen;
-
- RtlInitUnicodeString(&ValueName, RegistryValue);
- Status =
- ZwQueryValueKey(RegHandle,
- &ValueName,
- KeyValuePartialInformation,
- Information,
- sizeof(buf),
- &ResultLength);
-
- if (!NT_SUCCESS(Status))
- return Status;
- /* IP address is stored as a REG_MULTI_SZ - we only pay attention to the first one though */
- TI_DbgPrint(MIN_TRACE, ("Information DataLength: 0x%x\n", Information->DataLength));
-
- UnicodeAddress.Buffer = (PWCHAR)&Information->Data;
- UnicodeAddress.Length = Information->DataLength;
- UnicodeAddress.MaximumLength = Information->DataLength;
-
- AnsiLen = RtlUnicodeStringToAnsiSize(&UnicodeAddress);
- if(!AnsiLen)
- return STATUS_NO_MEMORY;
-
- AnsiAddress.Buffer = exAllocatePoolWithTag(PagedPool, AnsiLen, 0x01020304);
- if(!AnsiAddress.Buffer)
- return STATUS_NO_MEMORY;
-
- AnsiAddress.Length = AnsiLen;
- AnsiAddress.MaximumLength = AnsiLen;
-
- Status = RtlUnicodeStringToAnsiString(&AnsiAddress, &UnicodeAddress, FALSE);
- if (!NT_SUCCESS(Status)) {
- exFreePool(AnsiAddress.Buffer);
- return STATUS_UNSUCCESSFUL;
- }
-
- AnsiAddress.Buffer[AnsiAddress.Length] = 0;
- AddrInitIPv4(Address, inet_addr(AnsiAddress.Buffer));
-
- return STATUS_SUCCESS;
-}
-
static NTSTATUS ReadStringFromRegistry( HANDLE RegHandle,
PWCHAR RegistryValue,
PUNICODE_STRING String ) {
@@ -1001,7 +952,7 @@
PIP_INTERFACE IF;
NDIS_STATUS NdisStatus;
LLIP_BIND_INFO BindInfo;
- IP_ADDRESS DefaultGateway, DefaultMask = { 0 };
+ IP_ADDRESS DefaultMask = { 0 };
ULONG Lookahead = LOOKAHEAD_SIZE;
NTSTATUS Status;
HANDLE RegHandle = 0;
@@ -1055,20 +1006,10 @@
TI_DbgPrint(DEBUG_DATALINK,("Adapter Name: %wZ\n", &IF->Name));
}
- if(NT_SUCCESS(Status))
- Status = ReadIPAddressFromRegistry( RegHandle, L"DefaultGateway",
- &DefaultGateway );
- if(!NT_SUCCESS(Status)) {
- Status = STATUS_SUCCESS;
- RtlZeroMemory( &DefaultGateway, sizeof(DefaultGateway) );
- }
+ DefaultMask.Type = IP_ADDRESS_V4;
- if(NT_SUCCESS(Status))
- Status = ReadIPAddressFromRegistry( RegHandle, L"IPAddress",
- &IF->Unicast );
- if(NT_SUCCESS(Status))
- Status = ReadIPAddressFromRegistry( RegHandle, L"SubnetMask",
- &IF->Netmask );
+ IF->Unicast = DefaultMask;
+ IF->Netmask = DefaultMask;
IF->Broadcast.Type = IP_ADDRESS_V4;
IF->Broadcast.Address.IPv4Address =
@@ -1077,33 +1018,6 @@
TI_DbgPrint(DEBUG_DATALINK,("BCAST(IF) %s\n", A2S(&IF->Broadcast)));
- if(NT_SUCCESS(Status)) {
- /* It's ok to fail some of the above. We'll just use DHCP. */
- TI_DbgPrint
- (DEBUG_DATALINK,
- ("--> Our IP address on this interface: '%s'\n",
- A2S(&IF->Unicast)));
-
- TI_DbgPrint
- (DEBUG_DATALINK,
- ("--> Our net mask on this interface: '%s'\n",
- A2S(&IF->Netmask)));
-
- if( DefaultGateway.Address.IPv4Address ) {
- TI_DbgPrint
- (DEBUG_DATALINK,
- ("--> Our gateway is: '%s'\n",
- A2S(&DefaultGateway)));
-
- /* Create a default route */
- RouterCreateRoute( &DefaultMask, /* Zero */
- &DefaultMask, /* Zero */
- &DefaultGateway,
- IF,
- 1 );
- }
- }
-
/* Get maximum link speed */
NdisStatus = NDISCall(Adapter,
NdisRequestQueryInformation,
--- trunk/reactos/drivers/net/tcpip/include/debug.h 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/drivers/net/tcpip/include/debug.h 2005-04-22 09:45:17 UTC (rev 14737)
@@ -32,6 +32,7 @@
#define DEBUG_NCACHE 0x00400000
#define DEBUG_CPOINT 0x00800000
#define DEBUG_LOCK 0x01000000
+#define DEBUG_INFO 0x02000000
#define DEBUG_ULTRA 0xFFFFFFFF
#ifdef DBG
--- trunk/reactos/drivers/net/tcpip/tcpip/iinfo.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/drivers/net/tcpip/tcpip/iinfo.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -21,7 +21,7 @@
ULONG Size;
UINT DescrLenMax = MAX_IFDESCR_LEN - 1;
- TI_DbgPrint(MAX_TRACE,
+ TI_DbgPrint(DEBUG_INFO,
("Getting IFEntry MIB (IF %08x LA %08x) (%04x:%d)\n",
Interface, IF, ID->tei_entity, ID->tei_instance));
@@ -38,7 +38,7 @@
OutData->Type = Interface ==
Loopback ? MIB_IF_TYPE_LOOPBACK : MIB_IF_TYPE_ETHERNET;
OutData->Mtu = Interface->MTU;
- TI_DbgPrint(MAX_TRACE,
+ TI_DbgPrint(DEBUG_INFO,
("Getting interface speed\n"));
OutData->PhysAddrLen = Interface->AddressLength;
OutData->AdminStatus = MIB_IF_ADMIN_STATUS_UP;
@@ -53,27 +53,28 @@
if( IF ) {
GetInterfaceSpeed( Interface, (PUINT)&OutData->Speed );
- TI_DbgPrint(MAX_TRACE,
+ TI_DbgPrint(DEBUG_INFO,
("IF Speed = %d * 100bps\n", OutData->Speed));
memcpy(OutData->PhysAddr,Interface->Address,Interface->AddressLength);
- TI_DbgPrint(MAX_TRACE, ("Got HWAddr\n"));
- GetInterfaceName( Interface, IFDescr, MAX_IFDESCR_LEN - 1 );
- DescrLenMax = strlen( IFDescr ) + 1;
+ TI_DbgPrint(DEBUG_INFO, ("Got HWAddr\n"));
}
- IFDescr[DescrLenMax] = 0; /* Terminate ifdescr string */
+ GetInterfaceName( Interface, IFDescr, MAX_IFDESCR_LEN - 1 );
+ DescrLenMax = strlen( IFDescr ) + 1;
- TI_DbgPrint(MAX_TRACE, ("Copied in name %s\n", IFDescr));
+ TI_DbgPrint(DEBUG_INFO, ("Copied in name %s\n", IFDescr));
OutData->DescrLen = DescrLenMax;
IFDescr += DescrLenMax;
Size = IFDescr - (PCHAR)OutData + 1;
- TI_DbgPrint(MAX_TRACE, ("Finished IFEntry MIB (%04x:%d) size %d\n",
+ TI_DbgPrint(DEBUG_INFO, ("Finished IFEntry MIB (%04x:%d) size %d\n",
ID->tei_entity, ID->tei_instance, Size));
Status = InfoCopyOut( (PCHAR)OutData, Size, Buffer, BufferSize );
ExFreePool( OutData );
+ TI_DbgPrint(DEBUG_INFO,("Returning %x\n", Status));
+
return Status;
}
@@ -104,7 +105,7 @@
TDIEntityID *id,
PCHAR Buffer,
UINT BufferSize ) {
- TI_DbgPrint(MAX_TRACE, ("Got Request: Class %x Type %x Id %x, EntityID %x:%x\n",
+ TI_DbgPrint(DEBUG_INFO, ("Got Request: Class %x Type %x Id %x, EntityID %x:%x\n",
InfoClass, InfoId, id->tei_entity, id->tei_instance));
return TDI_INVALID_REQUEST;
}
--- trunk/reactos/drivers/net/tcpip/tcpip/info.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/drivers/net/tcpip/tcpip/info.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -28,7 +28,7 @@
KIRQL OldIrql;
UINT Count = 0, i;
- TI_DbgPrint(MAX_TRACE,
+ TI_DbgPrint(DEBUG_INFO,
("Inserting interface %08x (%d entities already)\n",
Interface, EntityCount));
@@ -38,7 +38,7 @@
for( i = 0; i < EntityCount; i++ )
if( EntityList[i].tei_entity == IF_ENTITY ) {
Count++;
- TI_DbgPrint(MAX_TRACE, ("Entity %d is an IF. Found %d\n",
+ TI_DbgPrint(DEBUG_INFO, ("Entity %d is an IF. Found %d\n",
i, Count));
}
@@ -80,7 +80,7 @@
UINT Count, Size, BufSize = *BufferSize;
KIRQL OldIrql;
- TI_DbgPrint(MAX_TRACE,("About to copy %d TDIEntityIDs to user\n",
+ TI_DbgPrint(DEBUG_INFO,("About to copy %d TDIEntityIDs to user\n",
EntityCount));
TcpipAcquireSpinLock(&EntityListLock, &OldIrql);
@@ -134,7 +134,7 @@
BOOL FoundEntity = FALSE;
InfoRequest_f InfoRequest = NULL;
- TI_DbgPrint(MAX_TRACE,
+ TI_DbgPrint(DEBUG_INFO,
("InfoEx Req: %x %x %x!%04x:%d\n",
ID->toi_class,
ID->toi_type,
@@ -148,7 +148,7 @@
if ((ID->toi_class != INFO_CLASS_GENERIC) ||
(ID->toi_type != INFO_TYPE_PROVIDER) ||
(ID->toi_id != ENTITY_LIST_ID)) {
- TI_DbgPrint(MAX_TRACE,("Invalid parameter\n"));
+ TI_DbgPrint(DEBUG_INFO,("Invalid parameter\n"));
Status = TDI_INVALID_PARAMETER;
} else
Status = InfoTdiQueryListEntities(Buffer, BufferSize);
@@ -168,7 +168,7 @@
TcpipReleaseSpinLock( &EntityListLock, OldIrql );
if( FoundEntity ) {
- TI_DbgPrint(MAX_TRACE,
+ TI_DbgPrint(DEBUG_INFO,
("Calling Entity %d (%04x:%d) InfoEx (%x,%x,%x)\n",
i, ID->toi_entity.tei_entity,
ID->toi_entity.tei_instance,
@@ -183,7 +183,7 @@
}
}
- TI_DbgPrint(MAX_TRACE,("Status: %08x\n", Status));
+ TI_DbgPrint(DEBUG_INFO,("Status: %08x\n", Status));
return Status;
}
--- trunk/reactos/drivers/net/tcpip/tcpip/ninfo.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/drivers/net/tcpip/tcpip/ninfo.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -25,7 +25,7 @@
ExAllocatePool( NonPagedPool, sizeof( IPADDR_ENTRY ) * IfCount );
PIPADDR_ENTRY IpCurrent = IpAddress;
- TI_DbgPrint(MAX_TRACE, ("Called.\n"));
+ TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql);
@@ -56,7 +56,7 @@
ExFreePool( IpAddress );
- TI_DbgPrint(MAX_TRACE, ("Returning %08x\n", Status));
+ TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
return Status;
}
@@ -73,7 +73,7 @@
PIPROUTE_ENTRY RouteEntries = ExAllocatePool( NonPagedPool, Size ),
RtCurrent = RouteEntries;
- TI_DbgPrint(MAX_TRACE, ("Called, routes = %d, RCache = %08x\n",
+ TI_DbgPrint(DEBUG_INFO, ("Called, routes = %d, RCache = %08x\n",
RtCount, RCache));
if( !RCache || !RouteEntries ) {
@@ -106,7 +106,7 @@
RtCurrent->Type = TDI_ADDRESS_TYPE_IP;
TI_DbgPrint
- (MAX_TRACE,
+ (DEBUG_INFO,
("%d: NA %08x NM %08x GW %08x MT %x\n",
RtCurrent - RouteEntries,
RtCurrent->Dest,
@@ -132,7 +132,7 @@
ExFreePool( RouteEntries );
ExFreePool( RCache );
- TI_DbgPrint(MAX_TRACE, ("Returning %08x\n", Status));
+ TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
return Status;
}
@@ -144,7 +144,7 @@
UINT RouteCount = CountFIBs( NULL );
TDI_STATUS Status = TDI_INVALID_REQUEST;
- TI_DbgPrint(MAX_TRACE, ("Called.\n"));
+ TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
RtlZeroMemory(&SnmpInfo, sizeof(IPSNMP_INFO));
@@ -155,7 +155,7 @@
Status = InfoCopyOut( (PCHAR)&SnmpInfo, sizeof(SnmpInfo),
Buffer, BufferSize );
- TI_DbgPrint(MAX_TRACE, ("Returning %08x\n", Status));
+ TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
return Status;
}
@@ -169,7 +169,7 @@
PUINT BufferSize ) {
TDI_STATUS Status = TDI_INVALID_REQUEST;
- TI_DbgPrint(MAX_TRACE, ("Called.\n"));
+ TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
switch( InfoClass ) {
case INFO_CLASS_GENERIC:
@@ -200,7 +200,7 @@
}
}
- TI_DbgPrint(MAX_TRACE, ("Returning %08x\n", Status));
+ TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
return Status;
}
@@ -218,7 +218,7 @@
IP_ADDRESS Router;
PNEIGHBOR_CACHE_ENTRY NCE;
- TI_DbgPrint(MID_TRACE,("Called\n"));
+ TI_DbgPrint(DEBUG_INFO,("Called\n"));
OskitDumpBuffer( (OSK_PCHAR)Buffer, BufferSize );
@@ -232,7 +232,7 @@
AddrInitIPv4( &Router, Route->Gw );
if( Route->Type == IP_ROUTE_TYPE_ADD ) { /* Add the route */
- TI_DbgPrint(MID_TRACE,("Adding route (%s)\n", A2S(&Address)));
+ TI_DbgPrint(DEBUG_INFO,("Adding route (%s)\n", A2S(&Address)));
/* Find the existing route this belongs to */
NCE = RouterGetRoute( &Router );
/* Really add the route */
@@ -243,12 +243,12 @@
else
Status = STATUS_UNSUCCESSFUL;
} else if( Route->Type == IP_ROUTE_TYPE_DEL ) {
- TI_DbgPrint(MID_TRACE,("Removing route (%s)\n", A2S(&Address)));
+ TI_DbgPrint(DEBUG_INFO,("Removing route (%s)\n", A2S(&Address)));
Status = RouterRemoveRoute( &Address, &Router );
} else Status = TDI_INVALID_REQUEST;
}
- TI_DbgPrint(MID_TRACE,("Returning %x\n", Status));
+ TI_DbgPrint(DEBUG_INFO,("Returning %x\n", Status));
return Status;
}
--- trunk/reactos/subsys/system/dhcp/Makefile 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/subsys/system/dhcp/Makefile 2005-04-22 09:45:17 UTC (rev 14737)
@@ -16,6 +16,8 @@
TARGET_SDKLIBS = iphlpapi.a ws2_32.a ntdll.a
+TARGET_INSTALLDIR = system32
+
TARGET_RC_SRCS = dhcp.rc
TARGET_RC_BINSRC =
--- trunk/reactos/subsys/system/dhcp/adapter.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/subsys/system/dhcp/adapter.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -5,34 +5,212 @@
static WSADATA wsd;
extern struct interface_info *ifi;
-DWORD GetAddress( PDHCP_ADAPTER Adapter ) {
- PMIB_IPADDRTABLE AddressTable = NULL;
- ULONG i, Size = 0, NumAddressRows;
- DWORD Error = GetIpAddrTable( AddressTable, &Size, FALSE );
+PCHAR *GetSubkeyNames( PCHAR MainKeyName, PCHAR Append ) {
+ int i = 0;
+ DWORD Error;
+ HKEY MainKey;
+ PCHAR *Out, OutKeyName;
+ DWORD CharTotal = 0, ThisKey, AppendLen = 1 + strlen(Append);
+ DWORD MaxSubKeyLen = 0, MaxSubKeys = 0;
- while( Error == ERROR_INSUFFICIENT_BUFFER ) {
- free( AddressTable );
- AddressTable = malloc( Size );
- if( AddressTable )
- Error = GetIpAddrTable( AddressTable, &Size, FALSE );
+ Error = RegOpenKey( HKEY_LOCAL_MACHINE, MainKeyName, &MainKey );
+
+ if( Error ) return NULL;
+
+ Error = RegQueryInfoKey
+ ( MainKey,
+ NULL, NULL, NULL,
+ &MaxSubKeys, &MaxSubKeyLen,
+ NULL, NULL, NULL, NULL, NULL, NULL );
+
+ DH_DbgPrint(MID_TRACE,("MaxSubKeys: %d, MaxSubKeyLen %d\n",
+ MaxSubKeys, MaxSubKeyLen));
+
+ CharTotal = (sizeof(PCHAR) + MaxSubKeyLen + AppendLen) * (MaxSubKeys + 1);
+
+ DH_DbgPrint(MID_TRACE,("AppendLen: %d, CharTotal: %d\n",
+ AppendLen, CharTotal));
+
+ Out = malloc( CharTotal );
+ OutKeyName = ((PCHAR)&Out[MaxSubKeys+1]);
+
+ if( !Out ) { RegCloseKey( MainKey ); return NULL; }
+
+ i = 0;
+ do {
+ Out[i] = OutKeyName;
+ Error = RegEnumKey( MainKey, i, OutKeyName, MaxSubKeyLen );
+ if( !Error ) {
+ strcat( OutKeyName, Append );
+ DH_DbgPrint(MID_TRACE,("[%d]: %s\n", i, OutKeyName));
+ OutKeyName += strlen(OutKeyName) + 1;
+ i++;
+ } else Out[i] = 0;
+ } while( Error == ERROR_SUCCESS );
+
+ RegCloseKey( MainKey );
+
+ return Out;
+}
+
+PCHAR RegReadString( HKEY Root, PCHAR Subkey, PCHAR Value ) {
+ PCHAR SubOut = NULL;
+ DWORD SubOutLen = 0, Error = 0;
+ HKEY ValueKey = NULL;
+
+ DH_DbgPrint(MID_TRACE,("Looking in %x:%s:%s\n", Root, Subkey, Value ));
+
+ if( Subkey && strlen(Subkey) ) {
+ if( RegOpenKey( Root, Subkey, &ValueKey ) != ERROR_SUCCESS )
+ goto regerror;
+ } else ValueKey = Root;
+
+ DH_DbgPrint(MID_TRACE,("Got Key %x\n", ValueKey));
+
+ if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
+ SubOut, &SubOutLen )) != ERROR_SUCCESS )
+ goto regerror;
+
+ DH_DbgPrint(MID_TRACE,("Value %s has size %d\n", Value, SubOutLen));
+
+ if( !(SubOut = malloc(SubOutLen)) )
+ goto regerror;
+
+ if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
+ SubOut, &SubOutLen )) != ERROR_SUCCESS )
+ goto regerror;
+
+ DH_DbgPrint(MID_TRACE,("Value %s is %s\n", Value, SubOut));
+
+ goto cleanup;
+
+regerror:
+ if( SubOut ) free( SubOut );
+cleanup:
+ if( ValueKey && ValueKey != Root ) {
+ DH_DbgPrint(MID_TRACE,("Closing key %x\n", ValueKey));
+ RegCloseKey( ValueKey );
}
- if( Error != ERROR_SUCCESS ) {
- free( AddressTable );
- return Error;
+
+ DH_DbgPrint(MID_TRACE,("Returning %x with error %d\n", SubOut, Error));
+
+ return SubOut;
+}
+
+HKEY FindAdapterKey( PDHCP_ADAPTER Adapter ) {
+ int i = 0;
+ PCHAR EnumKeyName =
+ "SYSTEM\\CurrentControlSet\\Control\\Class\\"
+ "{4D36E972-E325-11CE-BFC1-08002BE10318}";
+ PCHAR TargetKeyNameStart =
+ "SYSTEM\\CurrentControlSet\\Services\\";
+ PCHAR TargetKeyNameEnd = "\\Parameters\\Tcpip";
+ PCHAR TargetKeyName = NULL;
+ PCHAR *EnumKeysLinkage = GetSubkeyNames( EnumKeyName, "\\Linkage" );
+ PCHAR *EnumKeysTop = GetSubkeyNames( EnumKeyName, "" );
+ PCHAR RootDevice = NULL, DriverDesc = NULL;
+ HKEY EnumKey, OutKey = NULL;
+ DWORD Error = ERROR_SUCCESS;
+
+ if( !EnumKeysLinkage || !EnumKeysTop ) goto cleanup;
+
+ Error = RegOpenKey( HKEY_LOCAL_MACHINE, EnumKeyName, &EnumKey );
+
+ if( Error ) goto cleanup;
+
+ for( i = 0; EnumKeysLinkage[i]; i++ ) {
+ RootDevice = RegReadString
+ ( EnumKey, EnumKeysLinkage[i], "RootDevice" );
+ DriverDesc = RegReadString
+ ( EnumKey, EnumKeysTop[i], "DriverDesc" );
+
+ if( DriverDesc &&
+ !strcmp( DriverDesc, Adapter->DhclientInfo.name ) ) {
+ TargetKeyName =
+ malloc( strlen( TargetKeyNameStart ) +
+ strlen( RootDevice ) +
+ strlen( TargetKeyNameEnd ) + 1 );
+ if( !TargetKeyName ) goto cleanup;
+ sprintf( TargetKeyName, "%s%s%s",
+ TargetKeyNameStart, RootDevice, TargetKeyNameEnd );
+ Error = RegOpenKey( HKEY_LOCAL_MACHINE, TargetKeyName, &OutKey );
+ break;
+ } else {
+ free( RootDevice ); RootDevice = 0;
+ free( DriverDesc ); DriverDesc = 0;
+ }
}
- NumAddressRows = Size / sizeof(MIB_IPADDRTABLE);
- for( i = 0; i < AddressTable->dwNumEntries; i++ ) {
- DH_DbgPrint(MID_TRACE,
- ("Finding address for adapter %d: (%d -> %x)\n",
- Adapter->IfMib.dwIndex,
- AddressTable->table[i].dwIndex,
- AddressTable->table[i].dwAddr));
- if( Adapter->IfMib.dwIndex == AddressTable->table[i].dwIndex ) {
- memcpy( &Adapter->IfAddr, &AddressTable->table[i],
- sizeof( MIB_IPADDRROW ) );
+cleanup:
+ if( RootDevice ) free( RootDevice );
+ if( DriverDesc ) free( DriverDesc );
+ if( EnumKeysLinkage ) free( EnumKeysLinkage );
+ if( EnumKeysTop ) free( EnumKeysTop );
+ if( TargetKeyName ) free( TargetKeyName );
+
+ return OutKey;
+}
+
+BOOL PrepareAdapterForService( PDHCP_ADAPTER Adapter ) {
+ HKEY AdapterKey = NULL;
+ PCHAR IPAddress = NULL, Netmask = NULL, DefaultGateway = NULL;
+ NTSTATUS Status = STATUS_SUCCESS;
+ DWORD Error = ERROR_SUCCESS;
+ MIB_IPFORWARDROW DefGatewayRow;
+
+ Adapter->DhclientState.config = &Adapter->DhclientConfig;
+ strncpy(Adapter->DhclientInfo.name, Adapter->IfMib.bDescr,
+ sizeof(Adapter->DhclientInfo.name));
+
+ AdapterKey = FindAdapterKey( Adapter );
+ if( AdapterKey )
+ IPAddress = RegReadString( AdapterKey, NULL, "IPAddress" );
+
+ if( IPAddress && strcmp( IPAddress, "0.0.0.0" ) ) {
+ /* Non-automatic case */
+ DH_DbgPrint
+ (MID_TRACE,("Adapter Name: [%s] (Bind Status %x) (static %s)\n",
+ Adapter->DhclientInfo.name,
+ Adapter->BindStatus,
+ IPAddress));
+
+ Adapter->DhclientState.state = S_STATIC;
+
+ Netmask = RegReadString( AdapterKey, NULL, "Subnetmask" );
+ if( !Netmask ) Netmask = "255.255.255.0";
+
+ Status = AddIPAddress( inet_addr( IPAddress ),
+ inet_addr( Netmask ),
+ Adapter->IfMib.dwIndex,
+ &Adapter->NteContext,
+ &Adapter->NteInstance );
+
+ DefaultGateway = RegReadString( AdapterKey, NULL, "DefaultGateway" );
+
+ if( DefaultGateway ) {
+ DefGatewayRow.dwForwardDest = 0;
+ DefGatewayRow.dwForwardMask = 0;
+ DefGatewayRow.dwForwardMetric1 = 1;
+ DefGatewayRow.dwForwardNextHop = inet_addr(DefaultGateway);
+ Error = CreateIpForwardEntry( &DefGatewayRow );
+ if( Error )
+ warning("Failed to set default gateway %s: %d\n",
+ DefaultGateway, Error);
}
+
+ if( DefaultGateway ) free( DefaultGateway );
+ if( Netmask ) free( Netmask );
+ } else {
+ /* Automatic case */
+ DH_DbgPrint
+ (MID_TRACE,("Adapter Name: [%s] (Bind Status %x) (dynamic)\n",
+ Adapter->DhclientInfo.name,
+ Adapter->BindStatus));
}
+
+ if( IPAddress ) free( IPAddress );
+
+ return TRUE;
}
/*
@@ -66,20 +244,23 @@
Table->table[i].dwIndex));
Adapter = calloc( sizeof( DHCP_ADAPTER ) + Table->table[i].dwMtu, 1 );
- if( Adapter && Table->table[i].dwType ) {
+ if( Adapter && Table->table[i].dwType == MIB_IF_TYPE_ETHERNET ) {
memcpy( &Adapter->IfMib, &Table->table[i],
sizeof(Adapter->IfMib) );
- GetAddress( Adapter );
- InsertTailList( &AdapterList, &Adapter->ListEntry );
- Adapter->DhclientInfo.next = ifi;
Adapter->DhclientInfo.client = &Adapter->DhclientState;
Adapter->DhclientInfo.rbuf = Adapter->recv_buf;
Adapter->DhclientInfo.rbuf_max = Table->table[i].dwMtu;
Adapter->DhclientInfo.rbuf_len =
Adapter->DhclientInfo.rbuf_offset = 0;
+ memcpy(Adapter->DhclientInfo.hw_address.haddr,
+ Adapter->IfMib.bPhysAddr,
+ Adapter->IfMib.dwPhysAddrLen);
+ Adapter->DhclientInfo.hw_address.hlen =
+ Adapter->IfMib.dwPhysAddrLen;
+
if( DhcpSocket == INVALID_SOCKET ) {
DhcpSocket =
- Adapter->DhclientInfo.rfdesc =
+ Adapter->DhclientInfo.rfdesc =
Adapter->DhclientInfo.wfdesc =
socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
Adapter->ListenAddr.sin_family = AF_INET;
@@ -93,7 +274,7 @@
Adapter->DhclientInfo.rfdesc =
Adapter->DhclientInfo.wfdesc = DhcpSocket;
}
- Adapter->DhclientState.config = &Adapter->DhclientConfig;
+
Adapter->DhclientConfig.timeout = DHCP_PANIC_TIMEOUT;
Adapter->DhclientConfig.initial_interval = DHCP_DISCOVER_INTERVAL;
Adapter->DhclientConfig.retry_interval = DHCP_DISCOVER_INTERVAL;
@@ -102,13 +283,17 @@
Adapter->DhclientConfig.backoff_cutoff = DHCP_BACKOFF_MAX;
Adapter->DhclientState.interval =
Adapter->DhclientConfig.retry_interval;
- strncpy(Adapter->DhclientInfo.name, Adapter->IfMib.bDescr,
- sizeof(Adapter->DhclientInfo.name));
- DH_DbgPrint(MID_TRACE,("Adapter Name: [%s] (Bind Status %x)\n",
- Adapter->DhclientInfo.name,
- Adapter->BindStatus));
- ifi = &Adapter->DhclientInfo;
- }
+
+ if( PrepareAdapterForService( Adapter ) ) {
+ Adapter->DhclientInfo.next = ifi;
+ ifi = &Adapter->DhclientInfo;
+ InsertTailList( &AdapterList, &Adapter->ListEntry );
+ } else { free( Adapter ); Adapter = 0; }
+ } else { free( Adapter ); Adapter = 0; }
+
+ if( !Adapter )
+ DH_DbgPrint(MID_TRACE,("Adapter %d was rejected\n",
+ Table->table[i].dwIndex));
}
DH_DbgPrint(MID_TRACE,("done with AdapterInit\n"));
--- trunk/reactos/subsys/system/dhcp/api.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/subsys/system/dhcp/api.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -38,8 +38,11 @@
Reply.Reply = Adapter ? 1 : 0;
if( Adapter ) {
- Adapter->DhclientState.state = S_REBOOTING;
- send_discover( &Adapter->DhclientInfo );
+ add_protocol( Adapter->DhclientInfo.name,
+ Adapter->DhclientInfo.rfdesc, got_one,
+ &Adapter->DhclientInfo );
+ Adapter->DhclientInfo.client->state = S_INIT;
+ state_reboot(&Adapter->DhclientInfo);
}
ApiUnlock();
@@ -77,6 +80,7 @@
if( Adapter ) {
DeleteIPAddress( Adapter->NteContext );
+ remove_protocol( find_protocol_by_adapter( &Adapter->DhclientInfo ) );
}
ApiUnlock();
@@ -101,6 +105,7 @@
Adapter->DhclientState.state = S_BOUND;
+ send_discover( &Adapter->DhclientInfo );
state_bound( &Adapter->DhclientInfo );
ApiUnlock();
@@ -121,7 +126,8 @@
if( Adapter ) {
DeleteIPAddress( Adapter->NteContext );
- Adapter->DhclientState.state = S_BOUND;
+ Adapter->DhclientState.state = S_STATIC;
+ remove_protocol( find_protocol_by_adapter( &Adapter->DhclientInfo ) );
Status = AddIPAddress( Req->Body.StaticRefreshParams.IPAddress,
Req->Body.StaticRefreshParams.Netmask,
Req->AdapterIndex,
--- trunk/reactos/subsys/system/dhcp/dhclient.c 2005-04-22 09:19:18 UTC (rev 14736)
+++ trunk/reactos/subsys/system/dhcp/dhclient.c 2005-04-22 09:45:17 UTC (rev 14737)
@@ -108,6 +108,7 @@
int res_hnok(const char *dn);
char *option_as_string(unsigned int code, unsigned char *data, int len);
int fork_privchld(int, int);
+int check_arp( struct interface_info *ip, struct client_lease *lp );
#define ROUNDUP(a) \
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
@@ -115,143 +116,11 @@
time_t scripttime;
-#if 0
-
-int
-findproto(char *cp, int n)
-{
- struct sockaddr *sa;
- int i;
-
- if (n == 0)
- return -1;
- for (i = 1; i; i <<= 1) {
- if (i & n) {
[truncated at 1000 lines; 674 more skipped]