Interface without IP connection status











up vote
-1
down vote

favorite












I'm on Win7 and Qt and I need to track local network interfaces. The problem is - some of them don't have IP layer but I want to know if they are connected or not.
I've tried




QNetworkInterface::allInterfaces() from Qt




and




GetInterfaceInfo() from iphlpapi.h




But both work only for interfaces with IP assigned. Duh.
I've also tried




pcap library




But pcap_if_t has no fields to track connection status, only MAC and others.
I feel stuck between two layers and don't know how to handle this.
I suppose there is a way with WMI query but it seems to be an overkill.










share|improve this question






















  • What do you mean by "connected"? Do you mean physically present on your local machine? That sounds like something for device manager functions.
    – o_weisman
    Nov 7 at 12:10










  • Look at the Win32 GetAdaptersInfo() or GetAdaptersAddresses() function. They will give you detailed information and statuses of every installed network adapter.
    – Remy Lebeau
    Nov 7 at 19:37

















up vote
-1
down vote

favorite












I'm on Win7 and Qt and I need to track local network interfaces. The problem is - some of them don't have IP layer but I want to know if they are connected or not.
I've tried




QNetworkInterface::allInterfaces() from Qt




and




GetInterfaceInfo() from iphlpapi.h




But both work only for interfaces with IP assigned. Duh.
I've also tried




pcap library




But pcap_if_t has no fields to track connection status, only MAC and others.
I feel stuck between two layers and don't know how to handle this.
I suppose there is a way with WMI query but it seems to be an overkill.










share|improve this question






















  • What do you mean by "connected"? Do you mean physically present on your local machine? That sounds like something for device manager functions.
    – o_weisman
    Nov 7 at 12:10










  • Look at the Win32 GetAdaptersInfo() or GetAdaptersAddresses() function. They will give you detailed information and statuses of every installed network adapter.
    – Remy Lebeau
    Nov 7 at 19:37















up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I'm on Win7 and Qt and I need to track local network interfaces. The problem is - some of them don't have IP layer but I want to know if they are connected or not.
I've tried




QNetworkInterface::allInterfaces() from Qt




and




GetInterfaceInfo() from iphlpapi.h




But both work only for interfaces with IP assigned. Duh.
I've also tried




pcap library




But pcap_if_t has no fields to track connection status, only MAC and others.
I feel stuck between two layers and don't know how to handle this.
I suppose there is a way with WMI query but it seems to be an overkill.










share|improve this question













I'm on Win7 and Qt and I need to track local network interfaces. The problem is - some of them don't have IP layer but I want to know if they are connected or not.
I've tried




QNetworkInterface::allInterfaces() from Qt




and




GetInterfaceInfo() from iphlpapi.h




But both work only for interfaces with IP assigned. Duh.
I've also tried




pcap library




But pcap_if_t has no fields to track connection status, only MAC and others.
I feel stuck between two layers and don't know how to handle this.
I suppose there is a way with WMI query but it seems to be an overkill.







c++ qt winapi network-programming osi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 7 at 11:29









Alexandr

20111




20111












  • What do you mean by "connected"? Do you mean physically present on your local machine? That sounds like something for device manager functions.
    – o_weisman
    Nov 7 at 12:10










  • Look at the Win32 GetAdaptersInfo() or GetAdaptersAddresses() function. They will give you detailed information and statuses of every installed network adapter.
    – Remy Lebeau
    Nov 7 at 19:37




















  • What do you mean by "connected"? Do you mean physically present on your local machine? That sounds like something for device manager functions.
    – o_weisman
    Nov 7 at 12:10










  • Look at the Win32 GetAdaptersInfo() or GetAdaptersAddresses() function. They will give you detailed information and statuses of every installed network adapter.
    – Remy Lebeau
    Nov 7 at 19:37


















What do you mean by "connected"? Do you mean physically present on your local machine? That sounds like something for device manager functions.
– o_weisman
Nov 7 at 12:10




What do you mean by "connected"? Do you mean physically present on your local machine? That sounds like something for device manager functions.
– o_weisman
Nov 7 at 12:10












Look at the Win32 GetAdaptersInfo() or GetAdaptersAddresses() function. They will give you detailed information and statuses of every installed network adapter.
– Remy Lebeau
Nov 7 at 19:37






Look at the Win32 GetAdaptersInfo() or GetAdaptersAddresses() function. They will give you detailed information and statuses of every installed network adapter.
– Remy Lebeau
Nov 7 at 19:37














1 Answer
1






active

oldest

votes

















up vote
0
down vote













I found out that internal interface status can be checked with the Win32 GetIfTable() function.
This example helped me a lot.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53188615%2finterface-without-ip-connection-status%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I found out that internal interface status can be checked with the Win32 GetIfTable() function.
    This example helped me a lot.






    share|improve this answer

























      up vote
      0
      down vote













      I found out that internal interface status can be checked with the Win32 GetIfTable() function.
      This example helped me a lot.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I found out that internal interface status can be checked with the Win32 GetIfTable() function.
        This example helped me a lot.






        share|improve this answer












        I found out that internal interface status can be checked with the Win32 GetIfTable() function.
        This example helped me a lot.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 at 8:24









        Alexandr

        20111




        20111






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53188615%2finterface-without-ip-connection-status%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()