gettin the private address

Discussion in 'C' started by juliaprocess, Dec 19, 2006.

  1. juliaprocess

    juliaprocess New Member

    Joined:
    Aug 16, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    hello,

    how do i find my private address assigned by the NAT box? Like when you type ipconfig

    I can get the public address and I tried to use getsockName to get the private, but it just returns the 127.0.0...... instead of what the nat assigned, i looked for it all over the place , any suggestions?
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    I'm working off a memory that's reaching far into the past. Have you tried "gethostbyname" or "getaddr info"?
     
  3. juliaprocess

    juliaprocess New Member

    Joined:
    Aug 16, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    Excellent, thanks for providing the link. Incidentally, the structures used by the functions I mentioned are equipped to store multiple names and addresses, if I recall correctly. Have you read Beej's stuff on socket programming? It primarily addresses the issue from the point of Unix derivatives, but almost everything there is applicable to Windows, as well, and he even has some commentary regarding that.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice