title: Get all IP-Addresses in C
body: <p>I have the following problem. I have to write a Plugin for Pidgin in the Language C. I am completely new to C.
  I found the following Code.</p>
  
  <pre><code>  WORD wVersionRequested;
    WSADATA wsaData;
    char name[255];
    char* ip;
    PHOSTENT hostinfo;
    wVersionRequested = MAKEWORD( 2, 0 );
  
    if ( WSAStartup( wVersionRequested, &amp;wsaData ) == 0 )  {
          if( gethostname ( name, sizeof(name)) == 0) {
                if((hostinfo = gethostbyname(name)) != NULL) {
                      ip = inet_ntoa (*(struct in_addr *)*hostinfo-&gt;h_addr_list);
                }
          }
          WSACleanup( );
    } 
  </code></pre>
  
  <p>I have the IP-Address 
  172.28.52.220
  But because of my VMWare I also have the IP 10.0.1.3.
  In my Plugin now the IP 10.0.1.3 is assigned to my variable.
  i need the IP to find out in which location of my company I am. I need hte 172... </p>
  
  <p>Now I could find in the winsock2.h that *hostinfo->h_addr_list contains the list of Ip addresses. How can I assign the 172. Address to my IP_Variable?</p>
  
  <p>Thank you in advance for your help!</p>
  
  <hr>
  
  <p>Edit:
  Just to clarify: I don´t want to have my external IP address. I need my internals.</p>