9.7 sctp_getladdrs Function


9.7 sctp_getladdrs Function

The sctp_getladdrs function can be used to retrieve the local addresses that are part of an association. This function is often necessary when a local endpoint wishes to know exactly which local addresses are in use (which may be a proper subset of the system's addresses).

#include <netinet/sctp.h>

int sctp_getladdrs(int sockfd , sctp_assoc_t id , struct sockaddr ** addrs );

Returns: the number of local addresses stored in addrs , “1 on error

The sockfd is the socket descriptor returned by the socket function. id is the association identification for a one-to-many-style socket. If the socket is using the one-to-one style, the id field is ignored. The addrs parameter is an address of a pointer that sctp_getladdrs will fill in with a locally allocated, packed list of addresses. See Figures 9.4 and 23.12 for details on the structure of this return value. The caller should use sctp_freeladdrs to free resources allocated by sctp_getladdrs when finished with them.



UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net