Support for NdisWirelesswan adapter for filter driver RRS feed

  • General discussion

  • I am developing a VPN application which is connecting to network via binding network adapter . This binding is done by MUX driver . This VPN is working pretty well with Wfi , Ethernet adapter . Now i am using NDIS dongle  ( NdisWirelesswan Medium) .

    After using Microsoft document

    i can bind this type of adapter with the help of "ppip" in Filter's INF file and </xmp>

    AttachParameters->MiniportMediaType != NdisMediumWirelessWan

    in filter attach routines . 

    Now i am facing packet send/receive problems through NIC . I have a virtual Ethernet  mini port driver which will send and receive packets . After studying about Mobile broadband adapter , i can see that this type of adapter sending "RAW IP" frames . In My understanding RAW IP means with out Ethernet header .  Is it ?

    In my filter SendNetBufferLists routine i am filtering my packet using Ethernet header   :

    filter.nEthProto = pEthHeader->nProto;
    ISystem::MCopyMemory(&afilter.aSrcMac, &pEthHeader->aSrcMac, 
    ISystem::MCopyMemory(&filter.aDstMac, &pEthHeader->aDstMac, 
    if (filter.nEthProto == ETH_PROTO_IPV4) {
    PPF_IPV4_HEADER pIpHeader = (PPF_IPV4_HEADER) (pBuffer + 
    /* IPV4 operations */
    else if (filter.nEthProto == ETH_PROTO_IPV6)
    PPF_IPV6_HEADER pIpHeader = (PPF_IPV6_HEADER) (pBuffer + 
    /* IPV6 operations */

    I analyzed this issue with MSDN document with NDIS_NBL_FLAGS_IS_IPV4. My question is where should i add this flag to my Net-buffer list to get IPV4?

    Is it in send / receive function of mini port driver or inside filter driver send/receive function ?

    So in case of Mobile broadband , this is adapter sending packet with out Ethernet header (RAW IP) , So how can i filter my packets ? 

    Next i want to know whether should i use " RAW Socket " for connecting with a server also Is Mobile broadband is Point -to-point protocol ? I am not using NdisMIndicateReceiveNetBufferLists function in my mini-port code .

    • Edited by vkp123 Tuesday, June 14, 2016 10:00 AM new code
    Tuesday, June 14, 2016 8:39 AM

All replies

  • If you bind to a mobile broadband adapter, then you need to handle "raw IP" frames. (This NDIS term is unrelated to the winsock term "raw socket".) A raw IP frame is a NET_BUFFER where the first byte of data is the first byte of the IP header. Or another way to look at it -- the layer 2 header is zero bytes.

    If your driver binds to different kinds of adapters, you can determine which data format you're getting by looking at the attach parameters.  The MediaType will be NdisMediumWirelessWan.

    Thursday, June 16, 2016 6:32 PM
  • @Jeffrey Tippet Thanks for your suggestion .

    How to know whether the Layer 2 header of  NET_BUFFER is zero byte ? Is it any NDIS command to analyze ? because previously  i am checking like :

    filter.nEthProto = pEthHeader->nProto;

    can i check size of Ethernet header to zero ? Is it a good way ? and another concern about MAC address , because i am connecting with a server using socket . 

    • Edited by vkp123 Monday, June 20, 2016 9:39 AM editing
    Monday, June 20, 2016 9:37 AM
  • @Jeffrey Tippet Thanks for your suggestion . 

    How to know whether the Layer 2 header of  NET_BUFFER is zero byte ? 

    Monday, June 20, 2016 2:40 PM