IP address of a certain network interface [SOLVED]

2 posts / 0 new
Last post
Massi
Massi's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2012-03-28 17:16
IP address of a certain network interface [SOLVED]

According to bsdsocket.doc autodoc, the following should retrieve the IP address associated with a certain network interface.

ISocket->QueryInterfaceTags()
IFQ_Address (struct sockaddr *)

struct sockaddr {
u_char sa_len;
u_char sa_family;
char sa_data[14];
};

1) How the IP address value is returned?
2) Is it possible that a statically set IP address is unknown to its configured network interface?

Massi
Massi's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2012-03-28 17:16
Post SOLVED. I got it to

Post SOLVED.
I got it to work, the ip address value returned by QueryInterfaceTags() has to be casted to struct sockaddr_in* before using it.
Well this is not documented at all.
Regards

Log in or register to post comments