Home
last modified time | relevance | path

Searched refs:sock (Results 1 – 25 of 137) sorted by relevance

123456

/titanic_50/usr/src/lib/libsocket/socket/
H A Dweaks.c82 _bind(int sock, struct sockaddr *addr, int addrlen) in _bind() argument
84 return (_so_bind(sock, addr, addrlen, SOV_SOCKBSD)); in _bind()
88 _listen(int sock, int backlog) in _listen() argument
90 return (_so_listen(sock, backlog, SOV_DEFAULT)); in _listen()
94 _accept(int sock, struct sockaddr *addr, int *addrlen) in _accept() argument
96 return (_so_accept(sock, addr, addrlen, SOV_DEFAULT, 0)); in _accept()
100 _accept4(int sock, struct sockaddr *addr, int *addrlen, int flags) in _accept4() argument
102 return (_so_accept(sock, addr, addrlen, SOV_DEFAULT, flags)); in _accept4()
106 _connect(int sock, struct sockaddr *addr, int addrlen) in _connect() argument
108 return (_so_connect(sock, addr, addrlen, SOV_DEFAULT)); in _connect()
[all …]
/titanic_50/usr/src/cmd/ssh/ssh-http-proxy-connect/
H A Dssh-http-proxy-connect.c98 int retval, err_code, sock, ssh_port; in main() local
201 if ((sock = socket(ai->ai_family, SOCK_STREAM, 0)) < 0) { in main()
207 if (connect(sock, ai->ai_addr, ai->ai_addrlen) == -1) { in main()
210 (void) close(sock); in main()
216 if (write(sock, &connect_str, strlen(connect_str)) < 0) { in main()
218 (void) close(sock); in main()
222 if (read(sock, connect_reply, sizeof (connect_reply)) == -1) { in main()
224 (void) close(sock); in main()
232 (void) close(sock); in main()
241 (void) close(sock); in main()
[all …]
/titanic_50/usr/src/cmd/fs.d/nfs/lib/
H A Dselfcheck.c117 int sock; in getmyaddrs() local
123 if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { in getmyaddrs()
131 if (ioctl(sock, SIOCGLIFNUM, (char *)&lifn) < 0) { in getmyaddrs()
143 (void) close(sock); in getmyaddrs()
150 (void) close(sock); in getmyaddrs()
160 if (ioctl(sock, SIOCGLIFCONF, (char *)lifc) < 0) { in getmyaddrs()
162 (void) close(sock); in getmyaddrs()
168 (void) close(sock); in getmyaddrs()
176 int sock; in Is_ipv6present() local
179 sock = socket(AF_INET6, SOCK_DGRAM, 0); in Is_ipv6present()
[all …]
/titanic_50/usr/src/uts/common/fs/smbsrv/
H A Dsmb_opipe.c51 ksocket_t sock; in smb_opipe_alloc() local
53 if (ksocket_socket(&sock, AF_UNIX, SOCK_STREAM, 0, in smb_opipe_alloc()
65 opipe->p_socket = sock; in smb_opipe_alloc()
278 ksocket_t sock; in smb_opipe_close() local
286 sock = opipe->p_socket; in smb_opipe_close()
290 (void) ksocket_shutdown(sock, SHUT_RDWR, of->f_cr); in smb_opipe_close()
291 (void) ksocket_close(sock, of->f_cr); in smb_opipe_close()
308 ksocket_t sock; in smb_opipe_write() local
318 sock = opipe->p_socket; in smb_opipe_write()
319 if (sock != NULL) in smb_opipe_write()
[all …]
/titanic_50/usr/src/cmd/ssh/ssh-socks5-proxy-connect/
H A Dssh-socks5-proxy-connect.c244 int retval, err_code, sock; in main() local
322 if ((sock = socket(ai->ai_family, SOCK_STREAM, 0)) < 0) { in main()
328 if (connect(sock, ai->ai_addr, ai->ai_addrlen) == 0) { in main()
331 if (do_version_exchange(sock) > 0) { in main()
333 send_request(sock, ssh_host, ssh_host_len, &ssh_port); in main()
337 (void) close(sock); in main()
342 (void) close(sock); in main()
347 fds[1].fd = sock; /* Poll the socket for data. */ in main()
353 (void) close(sock); in main()
359 if (proxy_read_write_loop(STDIN_FILENO, sock) == 0) { in main()
[all …]
/titanic_50/usr/src/lib/libbsm/common/
H A Daudit_settid.c45 struct sockaddr_in6 sock; in audit_settid() local
47 int socklen = sizeof (sock); in audit_settid()
61 if (getsockname(fd, (struct sockaddr *)&sock, (socklen_t *)&socklen) in audit_settid()
67 rv = do_ipv6_address(&peer, &sock); in audit_settid()
70 (struct sockaddr_in *)&sock); in audit_settid()
76 do_ipv6_address(struct sockaddr_in6 *peer, struct sockaddr_in6 *sock) in do_ipv6_address() argument
96 ai.ai_termid.at_port = ((peer->sin6_port<<16) | (sock->sin6_port)); in do_ipv6_address()
108 do_ipv4_address(struct sockaddr_in *peer, struct sockaddr_in *sock) in do_ipv4_address() argument
124 ai.ai_termid.port = (peer->sin_port<<16 | sock->sin_port); in do_ipv4_address()
/titanic_50/usr/src/ucblib/librpcsoc/
H A Dsvc_tcp.c108 svctcp_create(sock, sendsize, recvsize) in svctcp_create() argument
109 register int sock; in svctcp_create()
119 if (sock == RPC_ANYSOCK) {
120 if ((sock = _socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
129 if (bindresvport(sock, &addr)) {
131 (void) _bind(sock, (struct sockaddr *)&addr, len);
133 if ((_getsockname(sock, (struct sockaddr *)&addr, &len) != 0) ||
134 (_listen(sock, 2) != 0)) {
138 (void) close(sock);
145 (void) close(sock);
[all …]
H A Dsvc_udp.c105 svcudp_bufcreate(sock, sendsz, recvsz) in svcudp_bufcreate() argument
106 register int sock; in svcudp_bufcreate()
115 if (sock == RPC_ANYSOCK) {
116 if ((sock = _socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
125 if (bindresvport(sock, &addr)) {
127 (void) _bind(sock, (struct sockaddr *)&addr, len);
129 if (_getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
133 (void) close(sock);
140 (void) close(sock);
148 (void) close(sock);
[all …]
/titanic_50/usr/src/lib/libproc/common/
H A Dpr_getsockname.c41 int syscall, int sock, struct sockaddr *name, socklen_t *namelen) in get_sock_peer_name() argument
49 adp->arg_value = sock; in get_sock_peer_name()
95 int sock, struct sockaddr *name, socklen_t *namelen) in pr_getsockname() argument
98 return (_so_getsockname(sock, name, namelen, SOV_DEFAULT)); in pr_getsockname()
100 return (get_sock_peer_name(Pr, SYS_getsockname, sock, name, namelen)); in pr_getsockname()
108 int sock, struct sockaddr *name, socklen_t *namelen) in pr_getpeername() argument
111 return (_so_getpeername(sock, name, namelen, SOV_DEFAULT)); in pr_getpeername()
113 return (get_sock_peer_name(Pr, SYS_getpeername, sock, name, namelen)); in pr_getpeername()
118 int sock, int level, int optname, void *optval, int *optlen) in pr_getsockopt() argument
126 return (_so_getsockopt(sock, level, optname, optval, optlen)); in pr_getsockopt()
[all …]
/titanic_50/usr/src/cmd/ssh/libssh/common/
H A Dchannels.c178 c->sock = (rfd == wfd) ? rfd : -1; in channel_register_fds()
316 channel_close_fd(&c->sock); in channel_close_fds()
340 if (c->sock != -1) in channel_free()
341 shutdown(c->sock, SHUT_RDWR); in channel_free()
397 channel_close_fd(&c->sock); in channel_stop_listening()
700 FD_SET(c->sock, readset); in channel_pre_listener()
707 FD_SET(c->sock, writeset); in channel_pre_connecting()
714 FD_SET(c->sock, readset); in channel_pre_open_13()
716 FD_SET(c->sock, writeset); in channel_pre_open_13()
771 FD_SET(c->sock, writeset); in channel_pre_output_draining()
[all …]
H A Dauthfd.c87 int sock; in ssh_get_authentication_socket() local
97 sock = socket(AF_UNIX, SOCK_STREAM, 0); in ssh_get_authentication_socket()
98 if (sock < 0) in ssh_get_authentication_socket()
102 if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1) { in ssh_get_authentication_socket()
103 close(sock); in ssh_get_authentication_socket()
106 if (connect(sock, (struct sockaddr *) &sunaddr, sizeof sunaddr) < 0) { in ssh_get_authentication_socket()
107 close(sock); in ssh_get_authentication_socket()
111 return sock; in ssh_get_authentication_socket()
178 ssh_close_authentication_socket(int sock) in ssh_close_authentication_socket() argument
181 close(sock); in ssh_close_authentication_socket()
[all …]
/titanic_50/usr/src/lib/libsendfile/common/
H A Dsendfile.c45 _sendfilev(int sock, const struct sendfilevec *vec, int sfvcnt, size_t *xferred) in _sendfilev() argument
50 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV, sock, vec, in _sendfilev()
63 _sendfile(int sock, int fd, off_t *off, size_t len) in _sendfile() argument
74 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV, sock, &sfv, in _sendfile()
93 _sendfilev64(int sock, const struct sendfilevec64 *vec, int sfvcnt, in _sendfilev64() argument
99 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV64, sock, vec, in _sendfilev64()
112 _sendfile64(int sock, int fd, off64_t *off, size_t len) in _sendfile64() argument
123 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV64, sock, &sfv, in _sendfile64()
/titanic_50/usr/src/lib/libkmf/libkmf/common/
H A Dclient.c127 send_ocsp_request(int sock, char *reqfile, char *hostname) in send_ocsp_request() argument
160 if ((n = write(sock, req_header, bytes)) < 0) { in send_ocsp_request()
167 if ((n = write(sock, buf, bytes)) < 0) { in send_ocsp_request()
216 get_encoded_response(int sock, KMF_RESPONSE_TYPE resptype, int filefd, in get_encoded_response() argument
247 if ((sock_flag = fcntl(sock, F_GETFL, 0)) == -1) { in get_encoded_response()
251 if (fcntl(sock, F_SETFL, sock_flag) == -1) { in get_encoded_response()
256 pfd.fd = sock; in get_encoded_response()
288 bytes = read(sock, buf + offset, buf_incre); in get_encoded_response()
446 bytes = read(sock, buf + offset, buf_incre); in get_encoded_response()
487 int sock, respfd; in kmf_get_encoded_ocsp_response() local
[all …]
/titanic_50/usr/src/lib/print/libpapi-lpd/common/
H A Dlpd-port.c108 sock_connect(int sock, char *host, int timeout) in sock_connect() argument
164 if (connect(sock, (struct sockaddr *)&sin, sizeof (sin)) < 0) { in sock_connect()
179 return (sock); in sock_connect()
411 send_data_file(int sock, char *dfname, char *name) in send_data_file() argument
430 if (send_lpd_message(sock, "\003%d %s\n", st.st_size, dfname) < 0) in send_data_file()
435 if (sendfile(sock, fd, &off, st.st_size) != st.st_size) in send_data_file()
441 if (send_lpd_message(sock, "") < 0) in send_data_file()
449 send_control_file(int sock, char *data, int id) in send_control_file() argument
479 if (send_lpd_message(sock, "\002%d cfA%.3d%s\n", len, id, host) < 0) in send_control_file()
483 if (write(sock, data, len) != len) in send_control_file()
[all …]
/titanic_50/usr/src/cmd/krb5/krb5kdc/
H A Dnetwork.c114 setreuseaddr(int sock, int value) in setreuseaddr() argument
116 return setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)); in setreuseaddr()
121 setv6only(int sock, int value) in setv6only() argument
123 return setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &value, sizeof(value)); in setv6only()
285 add_fd (struct socksetup *data, int sock, enum kdc_conn_type conntype, in add_fd() argument
307 newconn->fd = sock; in add_fd()
317 add_udp_fd (struct socksetup *data, int sock) in add_udp_fd() argument
319 return add_fd(data, sock, CONN_UDP, process_packet); in add_udp_fd()
323 add_tcp_listener_fd (struct socksetup *data, int sock) in add_tcp_listener_fd() argument
325 return add_fd(data, sock, CONN_TCP_LISTENER, accept_tcp_connection); in add_tcp_listener_fd()
[all …]
/titanic_50/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/
H A Dstartup.c388 int sock; in setup_listen_sock() local
396 sock = socket(AF_INET6, SOCK_DGRAM, 0); in setup_listen_sock()
397 if (sock == -1) in setup_listen_sock()
400 if (setsockopt(sock, IPPROTO_IPV6, IPV6_BOUND_IF, (char *)&ifindex, in setup_listen_sock()
408 if (setsockopt(sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, (char *)&hops, in setup_listen_sock()
415 if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&hops, in setup_listen_sock()
422 if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (char *)&off, in setup_listen_sock()
431 if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, in setup_listen_sock()
441 if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, (char *)&on, in setup_listen_sock()
448 if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, in setup_listen_sock()
[all …]
/titanic_50/usr/src/lib/libsctp/common/
H A Dsctp.c66 sctp_bindx(int sock, void *addrs, int addrcnt, int flags) in sctp_bindx() argument
90 return (setsockopt(sock, IPPROTO_SCTP, SCTP_ADD_ADDR, addrs, in sctp_bindx()
93 return (setsockopt(sock, IPPROTO_SCTP, SCTP_REM_ADDR, addrs, in sctp_bindx()
105 sctp_getpaddrs(int sock, sctp_assoc_t id, void **addrs) in sctp_getpaddrs() argument
123 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getpaddrs()
141 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getpaddrs()
166 sctp_getladdrs(int sock, sctp_assoc_t id, void **addrs) in sctp_getladdrs() argument
184 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getladdrs()
202 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getladdrs()
227 sctp_opt_info(int sock, sctp_assoc_t id, int opt, void *arg, socklen_t *len) in sctp_opt_info() argument
[all …]
/titanic_50/usr/src/lib/gss_mechs/mech_krb5/krb5/os/
H A Dforeachaddr.c197 int sock; in foreach_localaddr() member
214 P.sock = -1; in foreach_localaddr()
221 P.sock = socket (P.af, USE_TYPE, USE_PROTO); in foreach_localaddr()
222 if (P.sock < 0) { in foreach_localaddr()
231 code = ioctl (P.sock, SIOCGLIFNUM, &P.lifnum); in foreach_localaddr()
247 code = get_lifconf (P.af, P.sock, &P.buf_size, P.buf); in foreach_localaddr()
262 if (ioctl (P.sock, SIOCGLIFFLAGS, (char *)&lifreq) < 0) { in foreach_localaddr()
312 if (P.sock != -1) in foreach_localaddr()
323 if (P.sock >= 0) { in foreach_localaddr()
341 closesocket(P.sock); in foreach_localaddr()
/titanic_50/usr/src/uts/common/fs/sockfs/
H A Dsocksyscalls.c173 getsonode(int sock, int *errorp, file_t **fpp) in getsonode() argument
179 if ((fp = getf(sock)) == NULL) { in getsonode()
187 releasef(sock); in getsonode()
202 releasef(sock); in getsonode()
557 bind(int sock, struct sockaddr *name, socklen_t namelen, int version) in bind() argument
563 sock, (void *)name, namelen)); in bind()
565 if ((so = getsonode(sock, &error, NULL)) == NULL) in bind()
577 releasef(sock); in bind()
597 releasef(sock); in bind()
608 listen(int sock, int backlog, int version) in listen() argument
[all …]
/titanic_50/usr/src/lib/libresolv2/common/isc/
H A Dctl_srvr.c88 int sock; member
112 int sock; member
209 ctx->sock = socket(sap->sa_family, SOCK_STREAM, PF_UNSPEC); in ctl_server()
210 if (ctx->sock > evHighestFD(ctx->ev)) { in ctl_server()
211 ctx->sock = -1; in ctl_server()
214 if (ctx->sock < 0) { in ctl_server()
222 if (ctx->sock > evHighestFD(lev)) { in ctl_server()
223 close(ctx->sock); in ctl_server()
232 if (setsockopt(ctx->sock, SOL_SOCKET, SO_REUSEADDR, in ctl_server()
238 if (bind(ctx->sock, sap, sap_len) < 0) { in ctl_server()
[all …]
H A Dctl_clnt.c86 int sock; member
177 ctx->sock = socket(sap->sa_family, SOCK_STREAM, PF_UNSPEC); in ctl_client()
178 if (ctx->sock > evHighestFD(ctx->ev)) { in ctl_client()
179 ctx->sock = -1; in ctl_client()
182 if (ctx->sock < 0) { in ctl_client()
188 if (setsockopt(ctx->sock, SOL_SOCKET, SO_REUSEADDR, in ctl_client()
195 if (bind(ctx->sock, captmp, cap_len) < 0) { in ctl_client()
201 if (evConnect(lev, ctx->sock, (const struct sockaddr *)sap, sap_len, in ctl_client()
204 me, ctx->sock, strerror(errno)); in ctl_client()
207 if (ctx->sock >= 0) in ctl_client()
[all …]
/titanic_50/usr/src/cmd/cmd-inet/usr.lib/wpad/
H A Deloop.c42 eloop_register_read_sock(int sock, in eloop_register_read_sock() argument
43 void (*handler)(int sock, void *eloop_ctx, in eloop_register_read_sock() argument
53 tmp[eloop.reader_count].sock = sock; in eloop_register_read_sock()
59 if (sock > eloop.max_sock) in eloop_register_read_sock()
60 eloop.max_sock = sock; in eloop_register_read_sock()
66 eloop_unregister_read_sock(int sock) in eloop_unregister_read_sock() argument
74 if (eloop.readers[i].sock == sock) in eloop_unregister_read_sock()
257 pfds[i].fd = eloop.readers[i].sock; in eloop_run()
286 eloop.readers[i].sock, in eloop_run()
/titanic_50/usr/src/cmd/cmd-inet/usr.sbin/
H A Dipaddrsel.c76 int opt, status, sock, count; in main() local
111 if ((sock = socket(PF_INET6, SOCK_DGRAM, 0)) == -1) { in main()
120 status = setpolicy(sock, policy_table, count); in main()
124 status = setpolicy(sock, NULL, 0); in main()
128 status = printpolicy(sock); in main()
132 (void) close(sock); in main()
336 setpolicy(int sock, ip6_asp_t *new_policy, int count) in setpolicy() argument
338 if (strioctl(sock, SIOCSIP6ADDRPOLICY, new_policy, in setpolicy()
355 printpolicy(int sock) in printpolicy() argument
362 if ((count = strioctl(sock, SIOCGIP6ADDRPOLICY, policy_ptr, in printpolicy()
[all …]
/titanic_50/usr/src/lib/libvrrpadm/common/
H A Dlibvrrpadm.c129 int sock, flags; in vrrp_cmd_request() local
134 if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) in vrrp_cmd_request()
140 flags = fcntl(sock, F_GETFL, 0); in vrrp_cmd_request()
141 (void) fcntl(sock, F_SETFL, (flags | O_NONBLOCK)); in vrrp_cmd_request()
150 if (connect(sock, (const struct sockaddr *)&to, sizeof (to)) < 0) { in vrrp_cmd_request()
151 (void) close(sock); in vrrp_cmd_request()
159 len = write(sock, (char *)cmd + cur_size, csize - cur_size); in vrrp_cmd_request()
166 (void) close(sock); in vrrp_cmd_request()
175 len = read(sock, (char *)&ret + cur_size, in vrrp_cmd_request()
184 (void) close(sock); in vrrp_cmd_request()
[all …]
/titanic_50/usr/src/lib/libwrap/
H A Dworkarounds.c129 int fix_recvfrom(sock, buf, buflen, flags, from, fromlen) in fix_recvfrom() argument
130 int sock; in fix_recvfrom()
141 if ((ret = recvfrom(sock, buf, buflen, flags, from, fromlen)) >= 0) {
169 int fix_getpeername(sock, sa, len) in fix_getpeername() argument
170 int sock; in fix_getpeername()
177 if ((ret = getpeername(sock, sa, len)) >= 0

123456