Lines Matching full:sa

40  * Set `sa' to the unitialized address of address family `af'
44 socket_set_any (struct sockaddr *sa, int af) in socket_set_any() argument
48 struct sockaddr_in *sin4 = (struct sockaddr_in *)sa; in socket_set_any()
58 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; in socket_set_any()
68 errx (1, "unknown address family %d", sa->sa_family); in socket_set_any()
74 * set `sa' to (`ptr', `port')
78 socket_set_address_and_port (struct sockaddr *sa, const void *ptr, int port) in socket_set_address_and_port() argument
80 switch (sa->sa_family) { in socket_set_address_and_port()
82 struct sockaddr_in *sin4 = (struct sockaddr_in *)sa; in socket_set_address_and_port()
92 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; in socket_set_address_and_port()
102 errx (1, "unknown address family %d", sa->sa_family); in socket_set_address_and_port()
108 * Return the size of an address of the type in `sa'
112 socket_addr_size (const struct sockaddr *sa) in socket_addr_size() argument
114 switch (sa->sa_family) { in socket_addr_size()
127 * Return the size of a `struct sockaddr' in `sa'.
131 socket_sockaddr_size (const struct sockaddr *sa) in socket_sockaddr_size() argument
133 switch (sa->sa_family) { in socket_sockaddr_size()
146 * Return the binary address of `sa'.
150 socket_get_address (const struct sockaddr *sa) in socket_get_address() argument
152 switch (sa->sa_family) { in socket_get_address()
154 const struct sockaddr_in *sin4 = (const struct sockaddr_in *)sa; in socket_get_address()
159 const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa; in socket_get_address()
169 * Return the port number from `sa'.
173 socket_get_port (const struct sockaddr *sa) in socket_get_port() argument
175 switch (sa->sa_family) { in socket_get_port()
177 const struct sockaddr_in *sin4 = (const struct sockaddr_in *)sa; in socket_get_port()
182 const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa; in socket_get_port()
192 * Set the port in `sa' to `port'.
196 socket_set_port (struct sockaddr *sa, int port) in socket_set_port() argument
198 switch (sa->sa_family) { in socket_set_port()
200 struct sockaddr_in *sin4 = (struct sockaddr_in *)sa; in socket_set_port()
206 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; in socket_set_port()
212 errx (1, "unknown address family %d", sa->sa_family); in socket_set_port()