Lines Matching refs:addr

254 int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) {  in uv_ip4_addr()  argument
255 memset(addr, 0, sizeof(*addr)); in uv_ip4_addr()
256 addr->sin_family = AF_INET; in uv_ip4_addr()
257 addr->sin_port = htons(port); in uv_ip4_addr()
259 addr->sin_len = sizeof(*addr); in uv_ip4_addr()
261 return uv_inet_pton(AF_INET, ip, &(addr->sin_addr.s_addr)); in uv_ip4_addr()
265 int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { in uv_ip6_addr() argument
270 memset(addr, 0, sizeof(*addr)); in uv_ip6_addr()
271 addr->sin6_family = AF_INET6; in uv_ip6_addr()
272 addr->sin6_port = htons(port); in uv_ip6_addr()
274 addr->sin6_len = sizeof(*addr); in uv_ip6_addr()
290 addr->sin6_scope_id = atoi(zone_index); in uv_ip6_addr()
292 addr->sin6_scope_id = if_nametoindex(zone_index); in uv_ip6_addr()
296 return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr); in uv_ip6_addr()
325 const struct sockaddr* addr, in uv_tcp_bind() argument
334 if (addr->sa_family == AF_INET) in uv_tcp_bind()
336 else if (addr->sa_family == AF_INET6) in uv_tcp_bind()
341 return uv__tcp_bind(handle, addr, addrlen, flags); in uv_tcp_bind()
376 const struct sockaddr* addr, in uv_udp_bind() argument
383 if (addr->sa_family == AF_INET) in uv_udp_bind()
385 else if (addr->sa_family == AF_INET6) in uv_udp_bind()
390 return uv__udp_bind(handle, addr, addrlen, flags); in uv_udp_bind()
396 const struct sockaddr* addr, in uv_tcp_connect() argument
403 if (addr->sa_family == AF_INET) in uv_tcp_connect()
405 else if (addr->sa_family == AF_INET6) in uv_tcp_connect()
410 return uv__tcp_connect(req, handle, addr, addrlen, cb); in uv_tcp_connect()
414 int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr) { in uv_udp_connect() argument
421 if (addr == NULL) { in uv_udp_connect()
428 if (addr->sa_family == AF_INET) in uv_udp_connect()
430 else if (addr->sa_family == AF_INET6) in uv_udp_connect()
438 return uv__udp_connect(handle, addr, addrlen); in uv_udp_connect()
443 struct sockaddr_storage addr; in uv__udp_is_connected() local
448 addrlen = sizeof(addr); in uv__udp_is_connected()
449 if (uv_udp_getpeername(handle, (struct sockaddr*) &addr, &addrlen) != 0) in uv__udp_is_connected()
456 int uv__udp_check_before_send(uv_udp_t* handle, const struct sockaddr* addr) { in uv__udp_check_before_send() argument
462 if (addr != NULL && (handle->flags & UV_HANDLE_UDP_CONNECTED)) in uv__udp_check_before_send()
465 if (addr == NULL && !(handle->flags & UV_HANDLE_UDP_CONNECTED)) in uv__udp_check_before_send()
468 if (addr != NULL) { in uv__udp_check_before_send()
469 if (addr->sa_family == AF_INET) in uv__udp_check_before_send()
471 else if (addr->sa_family == AF_INET6) in uv__udp_check_before_send()
474 else if (addr->sa_family == AF_UNIX) in uv__udp_check_before_send()
491 const struct sockaddr* addr, in uv_udp_send() argument
495 addrlen = uv__udp_check_before_send(handle, addr); in uv_udp_send()
499 return uv__udp_send(req, handle, bufs, nbufs, addr, addrlen, send_cb); in uv_udp_send()
506 const struct sockaddr* addr) { in uv_udp_try_send() argument
509 addrlen = uv__udp_check_before_send(handle, addr); in uv_udp_try_send()
513 return uv__udp_try_send(handle, bufs, nbufs, addr, addrlen); in uv_udp_try_send()