Lines Matching defs:netaddr
29 #include <isc/netaddr.h>
127 isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target) {
135 REQUIRE(netaddr != NULL);
137 switch (netaddr->family) {
139 type = &netaddr->type.in;
142 type = &netaddr->type.in6;
146 alen = strlen(netaddr->type.un);
150 (const unsigned char *)(netaddr->type.un),
157 r = inet_ntop(netaddr->family, type, abuf, sizeof(abuf));
165 if (netaddr->family == AF_INET6 && netaddr->zone != 0) {
166 zlen = snprintf(zbuf, sizeof(zbuf), "%%%u", netaddr->zone);
288 isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina) {
289 memset(netaddr, 0, sizeof(*netaddr));
290 netaddr->family = AF_INET;
291 netaddr->type.in = *ina;
295 isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) {
296 memset(netaddr, 0, sizeof(*netaddr));
297 netaddr->family = AF_INET6;
298 netaddr->type.in6 = *ina6;
302 isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path) {
304 if (strlen(path) > sizeof(netaddr->type.un) - 1)
307 memset(netaddr, 0, sizeof(*netaddr));
308 netaddr->family = AF_UNIX;
309 strcpy(netaddr->type.un, path);
310 netaddr->zone = 0;
313 UNUSED(netaddr);
321 isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone) {
323 REQUIRE(netaddr->family == AF_INET6);
325 netaddr->zone = zone;
329 isc_netaddr_getzone(const isc_netaddr_t *netaddr) {
330 return (netaddr->zone);
362 isc_netaddr_any(isc_netaddr_t *netaddr) {
363 memset(netaddr, 0, sizeof(*netaddr));
364 netaddr->family = AF_INET;
365 netaddr->type.in.s_addr = INADDR_ANY;
369 isc_netaddr_any6(isc_netaddr_t *netaddr) {
370 memset(netaddr, 0, sizeof(*netaddr));
371 netaddr->family = AF_INET6;
372 netaddr->type.in6 = in6addr_any;