Re: getaddrinfo Reading IP Address value from res->ai_addr

2012-01-13 Thread Mark Andrews
Note that the actual data returned may be bigger than what will fit in a struct sockaddr. If you need to save the results use struct sockaddr_storage or family specific structures. Mark -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742

Re: getaddrinfo Reading IP Address value from res->ai_addr

2012-01-13 Thread Marc Majka
The value is a struct sockaddr, which is commonly used by IP networking code to hold an address. The definition of a "struct sockaddr" (see ) is mostly a storage container. It specifies what kind of address is in the container (the "address family"), and then just has a buffer that holds the

getaddrinfo Reading IP Address value from res->ai_addr

2012-01-13 Thread Martin McCormick
I am experimenting with getaddrinfo and getnameinfo and have gotten a little confused as to the best way to extract the IP address recovered after the function runs. The element in the structure res->ai_addr is a socket address which, if I am reading the documentation correctly, will give me the b