2 8f795179 2022-08-06 thomas #include <sys/socket.h>
3 8f795179 2022-08-06 thomas #include <netinet/in.h>
5 8f795179 2022-08-06 thomas #include <string.h>
7 8f795179 2022-08-06 thomas #include "got_sockaddr.h"
9 8f795179 2022-08-06 thomas /* These calls are found in lib/socketaddr.c, but are overriden here for
10 8f795179 2022-08-06 thomas * platform-specific reasons.
14 8f795179 2022-08-06 thomas got_sockaddr_inet_init(struct sockaddr_in *in, struct in_addr *ina)
16 8f795179 2022-08-06 thomas in->sin_family = AF_INET;
17 8f795179 2022-08-06 thomas in->sin_addr.s_addr = ina->s_addr;
21 8f795179 2022-08-06 thomas got_sockaddr_inet6_init(struct sockaddr_in6 *in6, struct in6_addr *in6a,
22 8f795179 2022-08-06 thomas uint32_t sin6_scope_id)
24 8f795179 2022-08-06 thomas in6->sin6_family = AF_INET6;
25 8f795179 2022-08-06 thomas memcpy(&in6->sin6_addr, in6a, sizeof(in6->sin6_addr));
26 8f795179 2022-08-06 thomas in6->sin6_scope_id = sin6_scope_id;