Lines Matching refs:netaddr

29 #include <isc/netaddr.h>
128 isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target) {
136 REQUIRE(netaddr != NULL);
138 switch (netaddr->family) {
140 type = &netaddr->type.in;
143 type = &netaddr->type.in6;
147 alen = strlen(netaddr->type.un);
151 (const unsigned char *)(netaddr->type.un),
158 r = inet_ntop(netaddr->family, type, abuf, sizeof(abuf));
166 if (netaddr->family == AF_INET6 && netaddr->zone != 0) {
167 zlen = snprintf(zbuf, sizeof(zbuf), "%%%u", netaddr->zone);
289 isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina) {
290 memset(netaddr, 0, sizeof(*netaddr));
291 netaddr->family = AF_INET;
292 netaddr->type.in = *ina;
296 isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) {
297 memset(netaddr, 0, sizeof(*netaddr));
298 netaddr->family = AF_INET6;
299 netaddr->type.in6 = *ina6;
303 isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path) {
305 if (strlen(path) > sizeof(netaddr->type.un) - 1)
308 memset(netaddr, 0, sizeof(*netaddr));
309 netaddr->family = AF_UNIX;
310 strlcpy(netaddr->type.un, path, sizeof(netaddr->type.un));
311 netaddr->zone = 0;
314 UNUSED(netaddr);
322 isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone) {
324 REQUIRE(netaddr->family == AF_INET6);
326 netaddr->zone = zone;
330 isc_netaddr_getzone(const isc_netaddr_t *netaddr) {
331 return (netaddr->zone);
363 isc_netaddr_any(isc_netaddr_t *netaddr) {
364 memset(netaddr, 0, sizeof(*netaddr));
365 netaddr->family = AF_INET;
366 netaddr->type.in.s_addr = INADDR_ANY;
370 isc_netaddr_any6(isc_netaddr_t *netaddr) {
371 memset(netaddr, 0, sizeof(*netaddr));
372 netaddr->family = AF_INET6;
373 netaddr->type.in6 = in6addr_any;