diff --git a/lib/libcasper/services/cap_net/cap_net.h b/lib/libcasper/services/cap_net/cap_net.h --- a/lib/libcasper/services/cap_net/cap_net.h +++ b/lib/libcasper/services/cap_net/cap_net.h @@ -93,6 +93,12 @@ int af); struct hostent *cap_gethostbyaddr(cap_channel_t *chan, const void *addr, socklen_t len, int af); + +/* Structure packing functions. */ +nvlist_t *addrinfo_pack(const struct addrinfo *ai); +struct addrinfo *addrinfo_unpack(const nvlist_t *nvl); +void hostent_pack(const struct hostent *hp, nvlist_t *nvl, bool addtocache); +struct hostent *hostent_unpack(const nvlist_t *nvl, struct hostent *hp); #else /* Capability functions. */ #define cap_bind(chan, s, addr, addrlen) \ diff --git a/lib/libcasper/services/cap_net/cap_net.c b/lib/libcasper/services/cap_net/cap_net.c --- a/lib/libcasper/services/cap_net/cap_net.c +++ b/lib/libcasper/services/cap_net/cap_net.c @@ -91,7 +91,7 @@ } } -static struct hostent * +struct hostent * hostent_unpack(const nvlist_t *nvl, struct hostent *hp) { unsigned int ii, nitems; @@ -247,7 +247,7 @@ return (hp); } -static struct addrinfo * +struct addrinfo * addrinfo_unpack(const nvlist_t *nvl) { struct addrinfo *ai; @@ -744,7 +744,7 @@ return (false); } -static void +void hostent_pack(const struct hostent *hp, nvlist_t *nvl, bool addtocache) { unsigned int ii; @@ -938,7 +938,7 @@ return (error); } -static nvlist_t * +nvlist_t * addrinfo_pack(const struct addrinfo *ai) { nvlist_t *nvl;