Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   gettin the private address (http://www.go4expert.com/forums/gettin-private-address-t2288/)

juliaprocess 19Dec2006 10:43

gettin the private address
 
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?

DaWei 19Dec2006 17:44

Re: gettin the private address
 
I'm working off a memory that's reaching far into the past. Have you tried "gethostbyname" or "getaddr info"?

juliaprocess 19Dec2006 22:09

Re: gettin the private address
 
no, but i'll give it a try, for the benefit of other people i also found this

http://tangentsoft.net/wskfaq/examples/ipaddr.html

DaWei 19Dec2006 23:17

Re: gettin the private address
 
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.


All times are GMT +5.5. The time now is 14:11.