Lines Matching refs:sa
39 struct sockaddr_in6 sa; in ConnectAndAccept() local
46 memset(&sa, 0, sizeof(sa)); in ConnectAndAccept()
52 inet_pton(AF_INET6, "::1", &sa.sin6_addr); in ConnectAndAccept()
54 inet_pton(AF_INET6, "::ffff:127.0.0.1", &sa.sin6_addr); in ConnectAndAccept()
56 if (!inet_ntop(AF_INET6, &sa.sin6_addr, buf, INET6_ADDRSTRLEN)) { in ConnectAndAccept()
60 addr_len = sizeof(sa); in ConnectAndAccept()
61 sa.sin6_family = AF_INET6; in ConnectAndAccept()
62 sa.sin6_port = port; in ConnectAndAccept()
63 if (connect(client_fd, (struct sockaddr*)(&sa), in ConnectAndAccept()
87 addr_len = sizeof(sa); in ConnectAndAccept()
89 (struct sockaddr*)(&sa), &addr_len)) == -1) { in ConnectAndAccept()
99 struct sockaddr_in6 sa; in CreateServer() local
102 memset(&sa, 0, sizeof(sa)); in CreateServer()
107 addr_len = sizeof(sa); in CreateServer()
108 sa.sin6_family = AF_INET6; in CreateServer()
109 sa.sin6_addr = in6addr_any; in CreateServer()
110 sa.sin6_port = 0; in CreateServer()
111 if (bind(*server_fd, (struct sockaddr*)(&sa), sizeof(sa)) == -1) { in CreateServer()
115 if (getsockname(*server_fd, (struct sockaddr*)(&sa), &addr_len) == -1) { in CreateServer()
123 *port = sa.sin6_port; in CreateServer()
128 struct sockaddr_in6 sa; in CreateServerConnectAndAccept() local
136 addr_len = sizeof(sa); in CreateServerConnectAndAccept()
137 memset(&sa, 0, sizeof(sa)); in CreateServerConnectAndAccept()
138 sa.sin6_family = AF_INET6; in CreateServerConnectAndAccept()
139 sa.sin6_addr = in6addr_any; in CreateServerConnectAndAccept()
140 sa.sin6_port = 0; in CreateServerConnectAndAccept()
141 if (bind(server_fd, (struct sockaddr*)(&sa), sizeof(sa)) == -1) { in CreateServerConnectAndAccept()
145 if (getsockname(server_fd, (struct sockaddr*)(&sa), &addr_len) == -1) { in CreateServerConnectAndAccept()
161 inet_pton(AF_INET6, "::1", &sa.sin6_addr); in CreateServerConnectAndAccept()
163 inet_pton(AF_INET6, "::ffff:127.0.0.1", &sa.sin6_addr); in CreateServerConnectAndAccept()
165 if (!inet_ntop(AF_INET6, &sa.sin6_addr, buf, INET6_ADDRSTRLEN)) { in CreateServerConnectAndAccept()
169 connect_rc = connect(client_fd, (struct sockaddr*)(&sa), in CreateServerConnectAndAccept()
182 sa4.sin_port = sa.sin6_port; in CreateServerConnectAndAccept()
191 addr_len = sizeof(sa); in CreateServerConnectAndAccept()
193 (struct sockaddr*)(&sa), &addr_len)) == -1) { in CreateServerConnectAndAccept()
220 struct sockaddr_in6 sa; in ThreadedStartServer() local
221 socklen_t addr_len = sizeof(sa); in ThreadedStartServer()
230 memset(&sa, 0, sizeof(sa)); in ThreadedStartServer()
231 sa.sin6_family = AF_INET6; in ThreadedStartServer()
232 sa.sin6_addr = in6addr_any; in ThreadedStartServer()
233 sa.sin6_port = 0; in ThreadedStartServer()
236 if (bind(threaded_server_fd, (struct sockaddr*)(&sa), sizeof(sa)) == -1) { in ThreadedStartServer()
252 if ((accept_fd = accept(threaded_server_fd, (struct sockaddr*)(&sa), in ThreadedStartServer()
269 struct sockaddr_in6 sa; in ThreadedCreateServerConnectAndAccept() local
270 socklen_t addr_len = sizeof(sa); in ThreadedCreateServerConnectAndAccept()
277 memset(&sa, 0, sizeof(sa)); in ThreadedCreateServerConnectAndAccept()
278 if (getsockname(server_fd, (struct sockaddr*)(&sa), &addr_len) == -1) { in ThreadedCreateServerConnectAndAccept()
292 if (!inet_ntop(AF_INET6, &sa.sin6_addr, buf, INET6_ADDRSTRLEN)) { in ThreadedCreateServerConnectAndAccept()
302 inet_pton(AF_INET6, "::1", &sa.sin6_addr); in ThreadedCreateServerConnectAndAccept()
304 inet_pton(AF_INET6, "::ffff:127.0.0.1", &sa.sin6_addr); in ThreadedCreateServerConnectAndAccept()
306 if (connect(client_fd, (struct sockaddr*)(&sa), in ThreadedCreateServerConnectAndAccept()
322 sa4.sin_port = sa.sin6_port; in ThreadedCreateServerConnectAndAccept()