Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6592535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:34:01+00:00 2026-05-25T17:34:01+00:00

I have the following the functions: This function will get every IP Addresses from

  • 0

I have the following the functions:

This function will get every IP Addresses from the local machine

void GetIP()
{
WORD wVersionRequested;
WSADATA wsaData;
char name[ 255 ];
PHOSTENT hostinfo;
wVersionRequested = MAKEWORD( 1, 1 );
char *ip;

if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
{
    if( gethostname ( name, sizeof( name ) ) == 0 )
    {
        if ( ( hostinfo = gethostbyname( name ) ) != NULL )
        {
            int nCount = 0;
            while ( hostinfo->h_addr_list[ nCount ] )
            {
                ip = inet_ntoa( *(struct in_addr *)hostinfo->h_addr_list[ nCount ] );

                //printf( "IP #%d: %s\n", ++nCount, ip );
                printf( "IP                 : %s\n", ip );
                ++nCount;
            }
        }
    }
}
}//GetIP

And here is my second function, which will get every MAC Address from the local machine:

void GetMACaddress()
{
IP_ADAPTER_INFO AdapterInfo[ 16 ];              // Allocate information for up to 16 NICs
DWORD dwBufLen = sizeof( AdapterInfo );         // Save the memory size of buffer

DWORD dwStatus = GetAdaptersInfo(               // Call GetAdapterInfo
                                        AdapterInfo,// [out] buffer to receive data
                                        &dwBufLen   // [in] size of receive data buffer
                                    );  

    assert( dwStatus == ERROR_SUCCESS );            // Verify return value is valid, no buffer overflow

    PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;    // Contains pointer to current adapter info

    do 
    {
        printf( "MAC                : %02X:%02X:%02X:%02X:%02X:%02X\n", pAdapterInfo->Address[ 0 ], 
                                                                    pAdapterInfo->Address[ 1 ], 
                                                                    pAdapterInfo->Address[ 2 ], 
                                                                    pAdapterInfo->Address[ 3 ], 
                                                                    pAdapterInfo->Address[ 4 ], 
                                                                    pAdapterInfo->Address[ 5 ]  );
                    pAdapterInfo = pAdapterInfo->Next;          // Progress through linked list

    }while( pAdapterInfo );                         // Terminate if last adapter
}//GetMACaddress

So my question is:
How do i know if the queried MAC Address and the queried IP Address belongs to a WiFi?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:34:01+00:00Added an answer on May 25, 2026 at 5:34 pm

    That code you have for querying MAC addresses, also fetches the interface type.

    Starting with Vista, for a WiFi interface, the Type field will be IF_TYPE_IEEE80211 You can also identify dial-up (MIB_IF_TYPE_PPP) connections and loopback (MIB_IF_TYPE_LOOPBACK) virtual interfaces.

    As Remy says, you should pull the IP addresses out of that same data structure (there’s an IpAddressList field).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following piece of code from a book. There is this function
I have the following simple function: private void EnableDisable941ScheduleBButton() { if (this._uosDepositorFrequency.Value != null)
I have the following function. $(function() { $(.sectionHeader:gt(0)).click(function() { $(this).next(.fieldset).slideToggle(fast); }); $(img[alt='minimize']).click(function(e) { $(this).closest(table).next(.fieldset).slideUp(fast);
I have the following within an XHTML document: <script type=text/javascript id=JSBALLOONS> function() { this.init
I have the following jQuery: $(#toolbar).hover(function () { $(.logo).fadeOut(slow, function () { $(this).addClass(logohover) $(this).parent().addClass(logohover).fadeIn(slow,
I have the following code: $(document).ready(function(){ $(.yearInner).hide(); $(.year, this).hover( function () { $(.yearInner, this).slideToggle();
I have the following jQuery which I need adapting: $(document).ready(function(){ $(.rss-popup a).hover(function() { $(this).next(em).stop(true,
I have the following javascript function: <script type=text/javascript> function quickCardRegister_OnCompleteSave() { publishContent('This is a
I have this timer function, it gives me following exception. Collection was modified; enumeration
I have the following bit of code, simply: $(function() { $('a.add-photos-link').live('click', function(e) { $(this).colorbox({

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.