TDI ip and bindings changes notifications

Home Forums Discussions General TDI ip and bindings changes notifications

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4983
    jb.lernout
    Participant

      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

      #5921
      Vadim Smirnov
      Keymaster

        Well, 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

        #5922
        jb.lernout
        Participant

          NdisOpenAdapter 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.

          #5923
          Vadim Smirnov
          Keymaster

            NDISWAN 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?

            #5924
            jb.lernout
            Participant

              Correct 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.

              #5925
              Vadim Smirnov
              Keymaster

                Ahh, 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.

                #5926
                jb.lernout
                Participant

                  Does 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 ?

                  #5927
                  Vadim Smirnov
                  Keymaster

                    I have never tried to compare, may be someone else know…

                    #5928
                    jb.lernout
                    Participant

                      thanks for your help, I will try to find out a way with the wan line up

                      #5929
                      jb.lernout
                      Participant

                        Well 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 ? 🙂

                      Viewing 10 posts - 1 through 10 (of 10 total)
                      • You must be logged in to reply to this topic.