Home › Forums › Discussions › General › TDI ip and bindings changes notifications
- This topic has 9 replies, 2 voices, and was last updated 18 years, 10 months ago by jb.lernout.
-
AuthorPosts
-
January 31, 2006 at 9:53 am #4983
Hi,
I’m trying to develop a kernel mode driver which is notified when the ip address of an adapter change and when the bindings of an adapter changes. I’m not a transport driver but I use TdiRegisterPnPHandlers.
This function as the DDK documentain says is supposed to notify me when an ip address is added to or removed from an interface and when the bindings of the Transport-to-NIC is changed.
The TdiRegisterPnPHandlers function is successful and I’m notified for the address change but not for the bindings change. My ClientPnPBindingChange function is called with TDI_PNP_OP_PROVIDERREADY and TDI_PNP_OP_NETREADY opcodes but never with TDI_PNP_OP_ADD and TDI_PNP_OP_DEL.So I’m not notified for the binding changes and it’s a big problem to me. I could read the registry keys HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersAdapters{GUID]Ipconfig
but it’s not a good solution as I’m not notified I don’t get the changes at the good time.Does anybody had the same problem ? Is there an other way to be notified ?
Thanks,
JB
February 4, 2006 at 1:00 am #5921Well, may be it is not a good solution for your type of driver but you can track binding changes by hooking NdisOpenAdapter/NdisCloseAdapter in NDIS.SYS
February 4, 2006 at 1:20 am #5922NdisOpenAdapter and NdisCloseAdapter are only called for adapters, it doesn’t work for NDISWAN. So when you add a new interface which uses NDISWAN you don’t see anything in the NDIS layer.
February 4, 2006 at 10:05 am #5923NDISWAN is an intermediate driver, so you can also intercept its lower lewel bind/unbind by intercepting NdisOpenAdapter/NdisCloseAdapter. Or may be I missunderstood your question?
February 4, 2006 at 11:15 am #5924Correct me if I’m wrong but when you open a connection using an xDSL or ISDN modem, you see a new interface at TDI level.
But this interface is managed by NDISWAN which makes the translation from Ethernet packets to ppp. So you don’t see any new adapter which is bound to the TCPIP protocol when you open this kind of connection as the packets go to NDISWAN which then transfer the packets to the good miniport.So the only adapter opened by TCP/IP when you use multiple WAN connections is NDISWAN and there is no way in NDIS layer to associate the adapters intercepted in NdisOpenAdapter to the interfaces at TDI level.
February 4, 2006 at 2:05 pm #5925Ahh, it is clear now (under binding usually meant another thing). Then the solution is intercepting TCP/IP protocol registering and setting a new handler for ProtocolStatus. This handler is called with status WAN line up indication each time when new WAN connection is established. Another option is creating a protocol driver and binding it to NDISWAN, so it should be also possible to receive line up indications.
February 4, 2006 at 2:34 pm #5926Does the device name specified in the NDIS_WAN_LINE_UP structure will be the same as the one seen in the ClientPnPAddNetAddress callback function registered to TdiRegisterPnPHandlers ?
February 4, 2006 at 3:07 pm #5927I have never tried to compare, may be someone else know…
February 4, 2006 at 4:30 pm #5928thanks for your help, I will try to find out a way with the wan line up
February 7, 2006 at 12:00 pm #5929Well it seems that I get the “????????” string as a device name for the NDIS_WAN_LINE_UP
But the NDIS_WAN_LINE_UP allows me to easily associate the ip address to the NDIS WAN adapters but how can I do witht the others adapters ?
If I use the TDI notification, I have to make the association between the interface guid received in the TDI notification and the adapter in NDIS.
If I use the RequestCompleteHandler :
The OID_GEN_NETWORK_LAYER_ADDRESSES is not supported by all adapters.The OID_PNP_ADD_WAKE_UP_PATTERN seems to be used when the OID_GEN_NETWORK_LAYER_ADDRESSES is not supported and notify for new ip address on an adapter but the OID_PNP_REMOVE_WAKE_UP_PATTERN don’t notify the removal of alternate adress IP, only the main one. As we can have several ip address for the same adapter.
So, is there a way to associate the interfaces saw in TDI to the adapters in NDIS, or is there a way to obtain the ip address of the adapters directly in NDIS ?
any answer ? 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.