what are addresses of type in_addr_t inet_ntoa etc

Viewed 33474

Ok before posting this question I have checked threads here in_addr_t to string

my question is different.

I understand that inet_ntoa function is of following type

char * inet_ntoa (struct in_addr in);

What I want to know is what is in_addr_t

what will be the representation when it is used in a socket program.

I checked the structure definition in <netinet/in.h>

   typedef uint32_t in_addr_t;

   struct in_addr {
       in_addr_t s_addr;
   };

is of above type. I do not want to print in_addr_t to char * as inet_ntoa does. I want to see what is in_addr_t.So how can it be done or what exactly is in_addr_t and why is it used again and again in socket programming. If I am not mistaken it is defined as

typedef uint32_t in_addr_t;

So if in_addr_t is unsigned 32 bit int I want to see what is that and not the char * which prints 192.168.1.1 kind of output on stdout.

1 Answers
Related