Lines Matching refs:addr

11 static u_char *nxt_inet6_ntop(u_char *addr, u_char *buf, u_char *end);
14 static nxt_sockaddr_t *nxt_sockaddr_unix_parse(nxt_mp_t *mp, nxt_str_t *addr);
15 static nxt_sockaddr_t *nxt_sockaddr_inet6_parse(nxt_mp_t *mp, nxt_str_t *addr);
16 static nxt_sockaddr_t *nxt_sockaddr_inet_parse(nxt_mp_t *mp, nxt_str_t *addr);
435 nxt_inet6_ntop(u_char *addr, u_char *buf, u_char *end) in nxt_inet6_ntop() argument
455 if (addr[i] == 0 && addr[i + 1] == 0) { in nxt_inet6_ntop()
484 if ((zero_groups == 5 && addr[10] == 0xFF && addr[11] == 0xFF) in nxt_inet6_ntop()
488 || (zero_groups == 7 && addr[14] != 0 && addr[15] != 1)) in nxt_inet6_ntop()
505 p = nxt_sprintf(p, end, "%uxd", (addr[i] << 8) + addr[i + 1]); in nxt_inet6_ntop()
514 addr[12], addr[13], addr[14], addr[15]); in nxt_inet6_ntop()
524 nxt_sockaddr_parse(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_parse() argument
528 sa = nxt_sockaddr_parse_optport(mp, addr); in nxt_sockaddr_parse()
535 "The address \"%V\" must specify a port.", addr); in nxt_sockaddr_parse()
544 nxt_sockaddr_parse_optport(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_parse_optport() argument
548 if (addr->length == 0) { in nxt_sockaddr_parse_optport()
553 if (addr->length > 6 && nxt_memcmp(addr->start, "unix:", 5) == 0) { in nxt_sockaddr_parse_optport()
554 sa = nxt_sockaddr_unix_parse(mp, addr); in nxt_sockaddr_parse_optport()
556 } else if (addr->start[0] == '[' || nxt_inet6_probe(addr)) { in nxt_sockaddr_parse_optport()
557 sa = nxt_sockaddr_inet6_parse(mp, addr); in nxt_sockaddr_parse_optport()
560 sa = nxt_sockaddr_inet_parse(mp, addr); in nxt_sockaddr_parse_optport()
572 nxt_sockaddr_unix_parse(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_unix_parse() argument
592 length = addr->length - 5; in nxt_sockaddr_unix_parse()
593 path = addr->start + 5; in nxt_sockaddr_unix_parse()
598 addr); in nxt_sockaddr_unix_parse()
622 sa = nxt_sockaddr_alloc(mp, socklen, addr->length); in nxt_sockaddr_unix_parse()
634 "unix domain socket \"%V\" is not supported", addr); in nxt_sockaddr_unix_parse()
643 nxt_sockaddr_inet6_parse(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_inet6_parse() argument
651 if (addr->start[0] == '[') { in nxt_sockaddr_inet6_parse()
652 length = addr->length - 1; in nxt_sockaddr_inet6_parse()
653 start = addr->start + 1; in nxt_sockaddr_inet6_parse()
663 length = addr->length; in nxt_sockaddr_inet6_parse()
664 start = addr->start; in nxt_sockaddr_inet6_parse()
665 end = addr->start + addr->length; in nxt_sockaddr_inet6_parse()
676 addr); in nxt_sockaddr_inet6_parse()
683 nxt_thread_log_error(NXT_LOG_ERR, "invalid port in \"%V\"", addr); in nxt_sockaddr_inet6_parse()
697 addr); in nxt_sockaddr_inet6_parse()
709 addr); in nxt_sockaddr_inet6_parse()
717 nxt_sockaddr_inet_parse(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_inet_parse() argument
725 p = nxt_memchr(addr->start, ':', addr->length); in nxt_sockaddr_inet_parse()
728 length = addr->length; in nxt_sockaddr_inet_parse()
731 length = p - addr->start; in nxt_sockaddr_inet_parse()
736 if (length != 1 || addr->start[0] != '*') { in nxt_sockaddr_inet_parse()
737 inaddr = nxt_inet_addr(addr->start, length); in nxt_sockaddr_inet_parse()
739 nxt_thread_log_error(NXT_LOG_ERR, "invalid address \"%V\"", addr); in nxt_sockaddr_inet_parse()
748 length = (addr->start + addr->length) - p; in nxt_sockaddr_inet_parse()
753 nxt_thread_log_error(NXT_LOG_ERR, "invalid port in \"%V\"", addr); in nxt_sockaddr_inet_parse()
776 in_addr_t addr; in nxt_inet_addr() local
783 addr = 0; in nxt_inet_addr()
802 addr = (addr << 8) + octet; in nxt_inet_addr()
812 addr = (addr << 8) + octet; in nxt_inet_addr()
813 return htonl(addr); in nxt_inet_addr()
825 u_char c, *addr, *zero_start, *ipv4, *dst, *src, *end; in nxt_inet6_addr() local
838 addr = in6_addr->s6_addr; in nxt_inet6_addr()
852 *addr++ = (u_char) (group >> 8); in nxt_inet6_addr()
853 *addr++ = (u_char) (group & 0xFF); in nxt_inet6_addr()
865 zero_start = addr; in nxt_inet6_addr()
886 *addr++ = (u_char) ((group >> 24) & 0xFF); in nxt_inet6_addr()
887 *addr++ = (u_char) ((group >> 16) & 0xFF); in nxt_inet6_addr()
926 *addr++ = (u_char) (group >> 8); in nxt_inet6_addr()
927 *addr++ = (u_char) (group & 0xFF); in nxt_inet6_addr()
937 src = addr - 1; in nxt_inet6_addr()