G
Guest
Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip,microsoft.public.win32.programmer.networks (More info?)
(Apologies for the cross-posting as I am still new to the Microsoft groups.)
The situation is that, an interface (say an Ethernet LAN connection) may
have multiple IP addresses. When DHCP is enabled on the interface, what
is the best way to determine if a particular IP address is DHCP assigned?
What I have done so far is traversing the IP address table returned by
the GetIpAddrTable() function, then check the (dwType) field in each
MIB_IPADDRROW entry for the MIB_IPADDR_DYNAMIC bit. The document for
MIB_IPADDRROW on MSDN simply says that the bit means "Dynamic IP
address" and that's all the information I have been able to find on the Net.
However, that bit of information does not seem to be consistant across
different Windows operating systems. On 2000, the bit is unset for a
DHCP assigned IP address, while on XP Pro SP2 it is set. However, on XP
Pro SP2, an IP address programmatically setup on the host using the
AddIPAddress() function also has that bit set.
Any insights on this bit of information? Any ideas, thoughts, or
pointers would be greatly appreciated.
Have a good day!
--
Wei Wang
(Apologies for the cross-posting as I am still new to the Microsoft groups.)
The situation is that, an interface (say an Ethernet LAN connection) may
have multiple IP addresses. When DHCP is enabled on the interface, what
is the best way to determine if a particular IP address is DHCP assigned?
What I have done so far is traversing the IP address table returned by
the GetIpAddrTable() function, then check the (dwType) field in each
MIB_IPADDRROW entry for the MIB_IPADDR_DYNAMIC bit. The document for
MIB_IPADDRROW on MSDN simply says that the bit means "Dynamic IP
address" and that's all the information I have been able to find on the Net.
However, that bit of information does not seem to be consistant across
different Windows operating systems. On 2000, the bit is unset for a
DHCP assigned IP address, while on XP Pro SP2 it is set. However, on XP
Pro SP2, an IP address programmatically setup on the host using the
AddIPAddress() function also has that bit set.
Any insights on this bit of information? Any ideas, thoughts, or
pointers would be greatly appreciated.
Have a good day!
--
Wei Wang