Home
last modified time | relevance | path

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

1234567891011

/openbsd/gnu/usr.bin/perl/dist/IO/lib/IO/
H A DSocket.pm51 : $sock;
94 $sock;
114 my $sock = shift;
223 return bind($sock, $addr) ? $sock
233 return listen($sock, $queue) ? $sock
273 my($sock) = @_;
274 ${*$sock}{'io_socket_peername'} ||= getpeername($sock);
279 my($sock) = @_;
354 my($sock) = @_;
383 ${*$sock}{'io_socket_type'} = $sock->sockopt(Socket::SO_TYPE)
[all …]
/openbsd/gnu/usr.bin/perl/dist/IO/t/
H A Dio_sock.t69 $sock->close;
93 $sock->close;
121 if ($sock) {
143 if ($sock) {
160 if ($sock) {
247 if ($sock) {
256 $sock->close;
285 if ($sock) {
317 $sock->close;
333 $sock->close;
[all …]
H A Dio_unix.t36 unless eval { socket(my $sock, PF_UNIX, SOCK_STREAM, 0) };
91 my $sock = $listen->accept();
93 if (defined $sock) {
96 print $sock->getline();
98 print $sock "ok 4\n";
100 $sock->close;
114 my $sock = IO::Socket::UNIX->new(Peer => $PATH) or die "$!";
116 print $sock "ok 3\n";
118 print $sock->getline();
120 $sock->close;
H A Dio_multihomed.t38 my($sock,$addr_str, $multi) = @_;
89 my $sock = $listen->accept() or die "$!";
92 print $sock->getline();
93 print $sock "ok 7\n";
97 $sock->close;
103 my $sock = Multi->new(PeerPort => $port,
110 print $sock "ok 6\n";
112 print $sock->getline();
114 $sock->close;
/openbsd/usr.bin/dig/lib/isc/unix/
H A Dsocket.c415 UNUSED(sock); in process_cmsg()
622 if (sock->pf == AF_INET && sock->pktdscp) { in build_msghdr_send()
646 if (sock->pf == AF_INET6 && sock->pktdscp) { in build_msghdr_send()
1156 sock = malloc(sizeof(*sock)); in allocate_socket()
1189 NULL, sock, sock, NULL); in allocate_socket()
1192 NULL, sock, sock, NULL); in allocate_socket()
1218 free(sock); in free_socket()
1249 sock->fd = socket(sock->pf, SOCK_DGRAM, IPPROTO_UDP); in opensocket()
1374 manager->fds[sock->fd] = sock; in socket_create()
2099 select_poke(sock->manager, sock->fd, in socket_send()
[all …]
/openbsd/gnu/usr.bin/perl/dist/IO/lib/IO/Socket/
H A DINET.pm111 my $sock = shift;
117 $sock->close()
249 $sock;
255 my $sock = shift;
262 my $sock = shift;
268 my($sock) = @_;
275 my($sock) = @_;
282 my($sock) = @_;
289 my($sock) = @_;
296 my($sock) = @_;
[all …]
H A DUNIX.pm25 my($sock,$arg) = @_;
30 $sock->socket(AF_UNIX, $type, 0) or
34 $sock->blocking($arg->{Blocking}) or
39 $sock->bind($addr) or
43 $sock->listen($arg->{Listen} || 5) or
48 $sock->connect($addr) or
52 $sock;
/openbsd/gnu/usr.bin/perl/cpan/IO-Socket-IP/t/
H A D19no-addrs.t16 my $sock = IO::Socket::IP->new( Family => AF_INET );
18 ok( defined $sock, 'Constructor yields handle for Family => AF_INET' ) or
21 ok( defined $sock->fileno, '$sock->fileno for Family => AF_INET' );
22 is( $sock->sockdomain, AF_INET, '$sock->sockdomain for Family => AF_INET' );
23 is( $sock->socktype, SOCK_STREAM, '$sock->socktype for Family => AF_INET' );
33 my $sock = IO::Socket::IP->new( Family => $AF_INET6 );
35 ok( defined $sock, 'Constructor yields handle for Family => AF_INET6' ) or
38 ok( defined $sock->fileno, '$sock->fileno for Family => AF_INET6' );
46 my $sock = IO::Socket::IP->new( Type => SOCK_STREAM );
48 ok( defined $sock, 'Constructor yields handle for Type => SOCK_STREAM' ) or
[all …]
H A D11sockopts.t20 my $sock = IO::Socket::IP->new(
27 ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set' );
29 $sock = IO::Socket::IP->new(
38 ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set via Sockopts' );
49 my $sock = IO::Socket::IP->new(
56 ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
62 my $sock = IO::Socket::IP->new(
67 skip "Privileges required to set broadcast on datagram socket", 1 if !$sock and $! == EACCES;
68 die "Cannot socket() - $@" unless $sock;
70 ok( $sock->getsockopt( SOL_SOCKET, SO_BROADCAST ), 'SO_BROADCAST set' );
H A D15io-socket.t14 my $sock = IO::Socket->new(
22 isa_ok( $sock, "IO::Socket::IP", 'IO::Socket->new( Domain => AF_INET )' ) or
25 $sock = IO::Socket->new(
31 ok( !defined $sock, 'Domain => AF_INET, LocalHost => "::1" fails' );
41 my $sock = IO::Socket->new(
49 isa_ok( $sock, "IO::Socket::IP", 'IO::Socket->new( Domain => AF_INET6 )' ) or
52 $sock = IO::Socket->new(
58 ok( !defined $sock, 'Domain => AF_INET6, LocalHost => "127.0.0.1" fails' );
/openbsd/usr.bin/ssh/
H A Dcanohost.c40 get_socket_address(int sock, int remote, int flags) in get_socket_address() argument
47 if (sock < 0) in get_socket_address()
83 get_peer_ipaddr(int sock) in get_peer_ipaddr() argument
87 if ((p = get_socket_address(sock, 1, NI_NUMERICHOST)) != NULL) in get_peer_ipaddr()
93 get_local_ipaddr(int sock) in get_local_ipaddr() argument
125 get_sock_port(int sock, int local) in get_sock_port() argument
132 if (sock < 0) in get_sock_port()
162 get_peer_port(int sock) in get_peer_port() argument
164 return get_sock_port(sock, 0); in get_peer_port()
168 get_local_port(int sock) in get_local_port() argument
[all …]
H A Dauthfd.c90 int sock, oerrno; in ssh_get_authentication_socket_path() local
102 if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1 || in ssh_get_authentication_socket_path()
105 close(sock); in ssh_get_authentication_socket_path()
110 *fdp = sock; in ssh_get_authentication_socket_path()
112 close(sock); in ssh_get_authentication_socket_path()
148 if (atomicio(vwrite, sock, buf, 4) != 4 || in ssh_request_reply()
156 if (atomicio(read, sock, buf, 4) != 4) in ssh_request_reply()
170 if (atomicio(read, sock, buf, l) != l) in ssh_request_reply()
206 ssh_close_authentication_socket(int sock) in ssh_close_authentication_socket() argument
209 close(sock); in ssh_close_authentication_socket()
[all …]
H A Dauthfd.h45 void ssh_close_authentication_socket(int sock);
47 int ssh_lock_agent(int sock, int lock, const char *password);
48 int ssh_fetch_identitylist(int sock, struct ssh_identitylist **idlp);
50 int ssh_add_identity_constrained(int sock, struct sshkey *key,
54 int ssh_agent_has_key(int sock, const struct sshkey *key);
55 int ssh_remove_identity(int sock, const struct sshkey *key);
56 int ssh_update_card(int sock, int add, const char *reader_id,
61 int ssh_remove_all_identities(int sock, int version);
63 int ssh_agent_sign(int sock, const struct sshkey *key,
67 int ssh_agent_bind_hostkey(int sock, const struct sshkey *key,
/openbsd/regress/sys/kern/select/
H A Dselect_close.c37 static int sock[2]; variable
47 FD_SET(sock[1], &rfds); in thread_main()
50 assert(FD_ISSET(sock[1], &rfds)); in thread_main()
53 read(sock[1], &b, 1); in thread_main()
60 FD_SET(sock[1], &rfds); in thread_main()
94 write(sock[0], "x", 1); in main()
103 saved_fd = dup(sock[1]); in main()
104 close(sock[1]); in main()
105 dup2(saved_fd, sock[1]); in main()
115 close(sock[1]); in main()
[all …]
/openbsd/gnu/usr.bin/perl/t/io/
H A Dsocket.t42 socket(my $sock, PF_INET, SOCK_STREAM, $tcp)
44 ok(close($sock), "close the socket");
54 socket(my $sock, PF_INET, SOCK_STREAM, $udp)
267 my $sock;
269 socket($sock, PF_INET, SOCK_STREAM, $proto);
270 accept($sock, $sock);
276 my $sock;
278 my $sockfd = fileno($sock);
293 socket(my $sock, PF_INET, SOCK_STREAM, $tcp);
296 ok(setsockopt($sock, SOL_SOCKET, SO_REUSEADDR, 1),
[all …]
/openbsd/regress/sys/kern/poll/
H A Dpoll_close.c36 static int sock[2]; variable
46 pfd[0].fd = sock[1]; in thread_main()
53 read(sock[1], &b, 1); in thread_main()
60 pfd[0].fd = sock[1]; in thread_main()
82 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) == -1) in main()
95 write(sock[0], "x", 1); in main()
104 saved_fd = dup(sock[1]); in main()
105 close(sock[1]); in main()
106 dup2(saved_fd, sock[1]); in main()
116 close(sock[1]); in main()
[all …]
/openbsd/lib/libc/rpc/
H A Dsvc.c98 int sock = xprt->xp_sock; in __xprt_register() local
104 while (sock + 1 > size) in __xprt_register()
117 if (!svc_fd_insert(sock)) in __xprt_register()
119 xports[sock] = xprt; in __xprt_register()
132 svc_fd_insert(int sock) in svc_fd_insert() argument
192 if (sock < FD_SETSIZE) in svc_fd_insert()
207 svc_fd_remove(int sock) in svc_fd_remove() argument
277 xports[sock] = NULL; in xprt_unregister()
278 svc_fd_remove(sock); in xprt_unregister()
527 int bit, sock; in svc_getreqset2() local
[all …]
H A Dsvc_tcp.c136 if (sock == RPC_ANYSOCK) { in svctcp_create()
151 (void)close(sock); in svctcp_create()
157 (void)close(sock); in svctcp_create()
165 (void)close(sock); in svctcp_create()
174 xprt->xp_sock = sock; in svctcp_create()
177 (void)close(sock); in svctcp_create()
235 int sock; in rendezvous_request() local
264 close(sock); in rendezvous_request()
281 close(sock); in rendezvous_request()
335 int sock = xprt->xp_sock; in readtcp() local
[all …]
/openbsd/gnu/usr.bin/perl/cpan/libnet/t/
H A Dtime.t37 my $sock = Net::Time::_socket('foo', 2, 'bar');
38 ok( $sock->isa('IO::Socket::INET'), 'should be an IO::Socket::INET object' );
39 is( $sock->{sent}, "\n", 'should send \n with UDP protocol set' );
40 is( $sock->{timeout}, 120, 'timeout should default to 120' );
43 $sock = Net::Time::_socket('foo', 3, 'bar', 'tcp', 11);
44 ok( $sock->isa('IO::Socket::INET'), 'should be an IO::Socket::INET object' );
45 is( $sock->{sent}, undef, '_socket() should send nothing unless UDP protocol' );
46 is( $sock->{PeerAddr}, 'bar', '_socket() should set PeerAddr in socket' );
47 is( $sock->{timeout}, 11, '_socket() should respect custom timeout value' );
125 bless({sock => shift}, $class);
[all …]
/openbsd/usr.bin/openssl/
H A Ds_socket.c78 static int do_accept(int acc_sock, int *sock);
116 *sock = s; in init_client()
137 int sock; in do_server() local
156 sock = accept_socket; in do_server()
157 i = cb(sock, context); in do_server()
159 shutdown(sock, SHUT_RDWR); in do_server()
160 close(sock); in do_server()
211 *sock = s; in init_server_long()
222 init_server(int *sock, int port, int type) in init_server() argument
228 do_accept(int acc_sock, int *sock) in do_accept() argument
[all …]
/openbsd/regress/sys/netinet6/autoport/
H A Dautoport.pl81 socket(my $sock, $pf, SOCK_STREAM, getprotobyname("tcp"))
83 unless (connect($sock, $sin)) {
88 push @socka, $sock;
105 while (my $sock = pop @socka) {
106 close($sock)
136 socket(my $sock, $pf, SOCK_STREAM, getprotobyname("tcp"))
138 unless (connect($sock, $sin)) {
143 push @socka, $sock;
160 while (my $sock = pop @socka) {
161 close($sock)
/openbsd/usr.sbin/npppd/l2tp/
H A Dl2tpd.c176 plistener->sock = -1; in l2tpd_add_listener()
211 L2TPD_ASSERT(plsnr->sock == -1); in l2tpd_uninit()
263 int af, lvl, opt, sock, ival; in l2tpd_listener_start() local
267 sock = -1; in l2tpd_listener_start()
386 _this->sock = sock; in l2tpd_listener_start()
398 if (sock >= 0) in l2tpd_listener_start()
399 close(sock); in l2tpd_listener_start()
438 if (_this->sock >= 0) { in l2tpd_listener_stop()
440 close(_this->sock); in l2tpd_listener_stop()
445 _this->sock = -1; in l2tpd_listener_stop()
[all …]
/openbsd/regress/sys/kern/signal/sigio/
H A Dsigio_socket.c76 int cli, flags, sfd, sock; in test_socket_inherit() local
78 sock = socket(AF_INET, SOCK_STREAM, 0); in test_socket_inherit()
79 assert(sock != -1); in test_socket_inherit()
85 assert(bind(sock, (struct sockaddr *)&inaddr, sizeof(inaddr)) == 0); in test_socket_inherit()
86 assert(listen(sock, 1) == 0); in test_socket_inherit()
88 flags = fcntl(sock, F_GETFL); in test_socket_inherit()
89 assert(fcntl(sock, F_SETFL, flags | O_ASYNC) == 0); in test_socket_inherit()
93 cli = accept(sock, (struct sockaddr *)&inaddr, &inaddrlen); in test_socket_inherit()
98 assert(fcntl(sock, F_SETOWN, getpid()) == 0); in test_socket_inherit()
102 cli = accept(sock, (struct sockaddr *)&inaddr, &inaddrlen); in test_socket_inherit()
[all …]
/openbsd/usr.bin/sndiod/
H A Dlisten.c81 int sock, oldumask; in listen_new_un() local
85 sock = socket(AF_UNIX, SOCK_STREAM, 0); in listen_new_un()
86 if (sock == -1) { in listen_new_un()
99 if (bind(sock, (struct sockaddr *)&sockname, in listen_new_un()
105 if (listen(sock, 1) == -1) { in listen_new_un()
116 f->fd = sock; in listen_new_un()
121 close(sock); in listen_new_un()
229 int sock, opt; in listen_in() local
239 if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1) { in listen_in()
253 if (sock_new(sock) == NULL) in listen_in()
[all …]
/openbsd/regress/sys/kern/accept/
H A Daccept.c25 int listensock, sock; in main() local
69 sock = accept(listensock, (struct sockaddr *)&csun, &csunlen); in main()
71 if (!ischild && sock >= 0) in main()
73 if (ischild && sock < 0) in main()
85 int i, fd, sock; in child() local
91 if ((sock = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) in child()
98 if (connect(sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) in child()

1234567891011