OK then, explain to me what the "mixed" return data is.
Are you stating that there could be sockaddr_in6 elements _and_
sockaddr_in elements returned? i.e. I can't index into the
"array" buy rather have to move the pointer down the appropriate
number of bytes depending on the record?
e.g.
struct sockaddr *addrs;
int count;
count = sctp_getpaddrs(sd, id, &addrs);
while (count-- >= 0)
{
if (addrs->sa_family == AF_INET)
{
struct sockaddr_in *sin = (struct sockaddr_in *)addrs;
/* Do something with returned address */
...
/* go to next addr */
addrs = (struct sockaddr *)(sin + 1)
}
else if (addrs->sa_family == AF_INET6)
{
struct sockaddr_in6 *sin6 =
(struct sockaddr_in6 *)addrs;
/* Do something with returned address */
...
/* go to next addr */
addrs = (struct sockaddr *)(sin6 + 1)
}
else
{
/* bogus family */
}
}
-- David Lehmann Ulticom, Inc. AOL/Yahoo IM: davidULCM 1020 Briggs Road 1-856-787-2729 Mt. Laurel, NJ 08054 USAReceived on Tue Feb 8 14:37:27 2005
This archive was generated by hypermail 2.1.8 : Mon Mar 13 2006 - 15:22:23 EST