Lines Matching refs:sa
460 struct sockaddr **sal, **psal, *sa; in php_network_bind_socket_to_local_addr() local
472 sa = *sal; in php_network_bind_socket_to_local_addr()
474 switch (sa->sa_family) { in php_network_bind_socket_to_local_addr()
477 ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); in php_network_bind_socket_to_local_addr()
482 ((struct sockaddr_in *)sa)->sin_port = htons(port); in php_network_bind_socket_to_local_addr()
491 sock = socket(sa->sa_family, socktype, 0); in php_network_bind_socket_to_local_addr()
524 n = bind(sock, sa, socklen); in php_network_bind_socket_to_local_addr()
552 …rse_network_address_with_port(const char *addr, size_t addrlen, struct sockaddr *sa, socklen_t *sl) in php_network_parse_network_address_with_port() argument
558 struct sockaddr_in *in4 = (struct sockaddr_in*)sa; in php_network_parse_network_address_with_port()
563 struct sockaddr_in6 *in6 = (struct sockaddr_in6*)sa; in php_network_parse_network_address_with_port()
645 struct sockaddr *sa, socklen_t sl, in php_network_populate_name_from_sockaddr() argument
655 memcpy(*addr, sa, sl); in php_network_populate_name_from_sockaddr()
663 switch (sa->sa_family) { in php_network_populate_name_from_sockaddr()
666 buf = inet_ntop(AF_INET, &((struct sockaddr_in*)sa)->sin_addr, (char *)&abuf, sizeof(abuf)); in php_network_populate_name_from_sockaddr()
669 buf, ntohs(((struct sockaddr_in*)sa)->sin_port)); in php_network_populate_name_from_sockaddr()
676 …buf = (char*)inet_ntop(sa->sa_family, &((struct sockaddr_in6*)sa)->sin6_addr, (char *)&abuf, sizeo… in php_network_populate_name_from_sockaddr()
679 buf, ntohs(((struct sockaddr_in6*)sa)->sin6_port)); in php_network_populate_name_from_sockaddr()
687 struct sockaddr_un *ua = (struct sockaddr_un*)sa; in php_network_populate_name_from_sockaddr()
712 php_sockaddr_storage sa; in php_network_get_peer_name() local
713 socklen_t sl = sizeof(sa); in php_network_get_peer_name()
714 memset(&sa, 0, sizeof(sa)); in php_network_get_peer_name()
716 if (getpeername(sock, (struct sockaddr*)&sa, &sl) == 0) { in php_network_get_peer_name()
717 php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, in php_network_get_peer_name()
732 php_sockaddr_storage sa; in php_network_get_sock_name() local
733 socklen_t sl = sizeof(sa); in php_network_get_sock_name()
734 memset(&sa, 0, sizeof(sa)); in php_network_get_sock_name()
736 if (getsockname(sock, (struct sockaddr*)&sa, &sl) == 0) { in php_network_get_sock_name()
737 php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, in php_network_get_sock_name()
769 php_sockaddr_storage sa; in php_network_accept_incoming() local
779 sl = sizeof(sa); in php_network_accept_incoming()
781 clisock = accept(srvsock, (struct sockaddr*)&sa, &sl); in php_network_accept_incoming()
784 php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, in php_network_accept_incoming()
823 struct sockaddr **sal, **psal, *sa; in php_network_connect_socket_to_host() local
845 sa = *sal; in php_network_connect_socket_to_host()
847 switch (sa->sa_family) { in php_network_connect_socket_to_host()
851 ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); in php_network_connect_socket_to_host()
860 ((struct sockaddr_in *)sa)->sin_port = htons(port); in php_network_connect_socket_to_host()
873 sock = socket(sa->sa_family, socktype, 0); in php_network_connect_socket_to_host()
891 if (sa->sa_family == AF_INET) { in php_network_connect_socket_to_host()
894 local_address.in4.sin_family = sa->sa_family; in php_network_connect_socket_to_host()
902 local_address.in6.sin6_family = sa->sa_family; in php_network_connect_socket_to_host()
942 n = php_network_connect_socket(sock, sa, socklen, asynchronous, in php_network_connect_socket_to_host()