/dragonfly/tools/regression/sockets/sigpipe/ |
H A D | sigpipe.c | 254 int sock[2]; in main() local 274 sock[1]); in main() 280 sock[1]); in main() 286 sock[1]); in main() 292 sock[1]); in main() 299 tcp_pair(port, sock); in main() 301 sock[1]); in main() 304 tcp_pair(port, sock); in main() 306 sock[1]); in main() 311 sock[1]); in main() [all …]
|
/dragonfly/contrib/wpa_supplicant/wpa_supplicant/ |
H A D | ctrl_iface_unix.c | 36 int sock; member 46 int sock; member 211 if (sock < 0) { in wpa_supplicant_ctrl_iface_receive() 358 sock = priv->sock; in wpas_ctrl_msg_queue_timeout() 368 sock, gsock); in wpas_ctrl_msg_queue_timeout() 682 priv->sock = -1; in wpas_ctrl_iface_open_sock() 704 priv->sock = -1; in wpa_supplicant_ctrl_iface_init() 785 priv->sock = -1; in wpas_ctrl_iface_reinit() 814 priv->sock = -1; in wpa_supplicant_ctrl_iface_deinit() 1303 priv->sock = -1; in wpa_supplicant_global_ctrl_iface_init() [all …]
|
H A D | ctrl_iface_udp.c | 46 int sock; member 52 int sock; member 396 priv->sock = -1; 469 if (priv->sock >= 0) 470 close(priv->sock); 490 close(priv->sock); 491 priv->sock = -1; 711 priv->sock = -1; 767 if (priv->sock >= 0) 768 close(priv->sock); [all …]
|
/dragonfly/lib/libc/sysvipc/ |
H A D | sockets.c | 50 int sock; in init_socket() local 67 close(sock); in init_socket() 73 close(sock); in init_socket() 79 return (sock); in init_socket() 83 handle_new_connection(int sock) in handle_new_connection() argument 105 int sock, flags; in connect_to_daemon() local 122 close(sock); in connect_to_daemon() 127 return (sock); in connect_to_daemon() 131 send_fd(int sock, int fd) in send_fd() argument 184 receive_fd(int sock) in receive_fd() argument [all …]
|
/dragonfly/usr.bin/sockstat/ |
H A D | sockstat.c | 76 struct sock { struct 84 struct sock *next; argument 187 struct sock *sock; in gather_inet() local 267 if ((sock = calloc(1, sizeof *sock)) == NULL) in gather_inet() 273 sockaddr(&sock->laddr, sock->family, in gather_inet() 275 sockaddr(&sock->faddr, sock->family, in gather_inet() 279 sockaddr(&sock->laddr, sock->family, in gather_inet() 281 sockaddr(&sock->faddr, sock->family, in gather_inet() 298 struct sock *sock; in gather_unix() local 339 if ((sock = calloc(1, sizeof *sock)) == NULL) in gather_unix() [all …]
|
/dragonfly/usr.sbin/bthcid/ |
H A D | hci.c | 129 process_hci(int sock) in process_hci() argument 138 n = recvfrom(sock, buffer, sizeof(buffer), 0, in process_hci() 157 process_pin_code_request_event(sock, &addr, in process_hci() 162 process_link_key_request_event(sock, &addr, in process_hci() 167 process_link_key_notification_event(sock, &addr, in process_hci() 197 return send_pin_code_reply(sock, addr, bdaddr, pin); in process_pin_code_request_event() 201 return send_pin_code_reply(sock, addr, bdaddr, pin2); in process_pin_code_request_event() 205 return send_pin_code_reply(sock, addr, bdaddr, NULL); in process_pin_code_request_event() 227 return send_link_key_reply(sock, addr, bdaddr, key); in process_link_key_request_event() 233 return send_link_key_reply(sock, addr, bdaddr, NULL); in process_link_key_request_event() [all …]
|
/dragonfly/contrib/wpa_supplicant/src/drivers/ |
H A D | linux_ioctl.c | 24 if (sock < 0) in linux_set_iface_flags() 30 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { in linux_set_iface_flags() 47 if (ioctl(sock, SIOCSIFFLAGS, &ifr) != 0) { in linux_set_iface_flags() 64 if (sock < 0) in linux_iface_up() 70 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { in linux_iface_up() 87 if (ioctl(sock, SIOCGIFHWADDR, &ifr)) { in linux_get_ifhwaddr() 113 if (ioctl(sock, SIOCSIFHWADDR, &ifr)) { in linux_set_ifhwaddr() 125 if (ioctl(sock, SIOCBRADDBR, brname) < 0) { in linux_br_add() 140 if (ioctl(sock, SIOCBRDELBR, brname) < 0) { in linux_br_del() 162 if (ioctl(sock, SIOCBRADDIF, &ifr) < 0) { in linux_br_add_if() [all …]
|
H A D | linux_ioctl.h | 12 int linux_set_iface_flags(int sock, const char *ifname, int dev_up); 13 int linux_iface_up(int sock, const char *ifname); 14 int linux_get_ifhwaddr(int sock, const char *ifname, u8 *addr); 15 int linux_set_ifhwaddr(int sock, const char *ifname, const u8 *addr); 16 int linux_br_add(int sock, const char *brname); 17 int linux_br_del(int sock, const char *brname); 18 int linux_br_add_if(int sock, const char *brname, const char *ifname); 19 int linux_br_del_if(int sock, const char *brname, const char *ifname);
|
H A D | netlink.c | 19 int sock; member 36 static void netlink_receive(int sock, void *eloop_ctx, void *sock_ctx) in netlink_receive() argument 48 left = recvfrom(sock, buf, sizeof(buf), MSG_DONTWAIT, in netlink_receive() 100 netlink->sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in netlink_init() 101 if (netlink->sock < 0) { in netlink_init() 111 if (bind(netlink->sock, (struct sockaddr *) &local, sizeof(local)) < 0) in netlink_init() 119 eloop_register_read_sock(netlink->sock, netlink_receive, netlink, in netlink_init() 132 if (netlink->sock >= 0) { in netlink_deinit() 133 eloop_unregister_read_sock(netlink->sock); in netlink_deinit() 134 close(netlink->sock); in netlink_deinit() [all …]
|
H A D | driver_wired.c | 120 static void handle_read(int sock, void *eloop_ctx, void *sock_ctx) in handle_read() argument 125 len = recv(sock, buf, sizeof(buf), 0); in handle_read() 143 len = recv(sock, buf, sizeof(buf), 0); in handle_dhcp() 177 if (drv->common.sock < 0) { in wired_init_sockets() 183 if (eloop_register_read_sock(drv->common.sock, handle_read, in wired_init_sockets() 191 if (ioctl(drv->common.sock, SIOCGIFINDEX, &ifr) != 0) { in wired_init_sockets() 219 if (ioctl(drv->common.sock, SIOCGIFHWADDR, &ifr) != 0) { in wired_init_sockets() 313 res = send(drv->common.sock, (u8 *) hdr, len, 0); in wired_send_eapol() 356 if (drv->common.sock >= 0) { in wired_driver_hapd_deinit() 357 eloop_unregister_read_sock(drv->common.sock); in wired_driver_hapd_deinit() [all …]
|
H A D | driver_openbsd.c | 24 int sock; /* open socket for 802.11 ioctls */ member 38 if (ioctl(drv->sock, SIOCG80211NWID, &ifr) < 0 || in wpa_driver_openbsd_get_ssid() 53 if (ioctl(drv->sock, SIOCG80211BSSID, &id) < 0) in wpa_driver_openbsd_get_bssid() 88 if (ioctl(drv->sock, SIOCS80211KEYAVAIL, &keyavail) < 0) in wpa_driver_openbsd_set_key() 103 drv->sock = socket(PF_INET, SOCK_DGRAM, 0); in wpa_driver_openbsd_init() 104 if (drv->sock < 0) in wpa_driver_openbsd_init() 123 close(drv->sock); in wpa_driver_openbsd_deinit()
|
/dragonfly/crypto/openssh/ |
H A D | canohost.c | 68 get_socket_address(int sock, int remote, int flags) in get_socket_address() argument 80 if (getpeername(sock, (struct sockaddr *)&addr, &addrlen) != 0) in get_socket_address() 114 get_peer_ipaddr(int sock) in get_peer_ipaddr() argument 118 if ((p = get_socket_address(sock, 1, NI_NUMERICHOST)) != NULL) in get_peer_ipaddr() 124 get_local_ipaddr(int sock) in get_local_ipaddr() argument 128 if ((p = get_socket_address(sock, 0, NI_NUMERICHOST)) != NULL) in get_local_ipaddr() 156 get_sock_port(int sock, int local) in get_sock_port() argument 195 get_peer_port(int sock) in get_peer_port() argument 197 return get_sock_port(sock, 0); in get_peer_port() 201 get_local_port(int sock) in get_local_port() argument [all …]
|
H A D | authfd.c | 92 int sock, oerrno; in ssh_get_authentication_socket_path() local 104 if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1 || in ssh_get_authentication_socket_path() 107 close(sock); in ssh_get_authentication_socket_path() 112 *fdp = sock; in ssh_get_authentication_socket_path() 114 close(sock); in ssh_get_authentication_socket_path() 150 if (atomicio(vwrite, sock, buf, 4) != 4 || in ssh_request_reply() 158 if (atomicio(read, sock, buf, 4) != 4) in ssh_request_reply() 172 if (atomicio(read, sock, buf, l) != l) in ssh_request_reply() 208 ssh_close_authentication_socket(int sock) in ssh_close_authentication_socket() argument 211 close(sock); in ssh_close_authentication_socket() [all …]
|
H A D | authfd.h | 45 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, 60 int ssh_remove_all_identities(int sock, int version); 62 int ssh_agent_sign(int sock, const struct sshkey *key, 66 int ssh_agent_bind_hostkey(int sock, const struct sshkey *key,
|
H A D | channels.c | 457 c->sock = -1; in channel_close_fd() 1903 c->sock = c->rfd = c->wfd = sock; in channel_post_connecting() 2585 if (c->sock != -1 && c->rfd != c->sock) { in channel_prepare_pollfd() 2742 if (c->sock != -1 && c->sock != c->rfd && in channel_after_poll() 4523 return sock; in connect_to_helper() 4533 int sock; in connect_to() local 4615 int sock; in channel_connect_to_port() local 4764 int sock; in rdynamic_connect_finish() local 4790 channel_register_fds(ssh, c, sock, sock, -1, 0, 1, 0); in rdynamic_connect_finish() 4892 SSH_CHANNEL_X11_LISTENER, sock, sock, -1, in x11_create_display_inet() [all …]
|
/dragonfly/crypto/libressl/apps/openssl/ |
H A D | s_socket.c | 78 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 …]
|
/dragonfly/contrib/wpa_supplicant/src/utils/ |
H A D | eloop.c | 43 int sock; member 215 ev.data.fd = sock; in eloop_sock_queue() 274 if (sock > eloop.max_sock) in eloop_sock_table_add_sock() 275 new_max_sock = sock; in eloop_sock_table_add_sock() 360 tmp[table->count].sock = sock; in eloop_sock_table_add_sock() 394 if (table->table[i].sock == sock) in eloop_sock_table_remove_sock() 751 assert(sock >= 0); in eloop_register_sock() 1310 if (sock < 0) in eloop_wait_for_read_sock() 1314 pfd.fd = sock; in eloop_wait_for_read_sock() 1327 if (sock < 0) in eloop_wait_for_read_sock() [all …]
|
H A D | eloop.h | 43 typedef void (*eloop_sock_handler)(int sock, void *eloop_ctx, void *sock_ctx); 90 int eloop_register_read_sock(int sock, eloop_sock_handler handler, 100 void eloop_unregister_read_sock(int sock); 117 int eloop_register_sock(int sock, eloop_event_type type, 129 void eloop_unregister_sock(int sock, eloop_event_type type); 365 void eloop_wait_for_read_sock(int sock);
|
/dragonfly/usr.sbin/ppp/ |
H A D | tcp.c | 66 int sock; in tcp_OpenConnection() local 87 sock = socket(PF_INET, SOCK_STREAM, 0); in tcp_OpenConnection() 88 if (sock < 0) in tcp_OpenConnection() 91 if (connect(sock, (struct sockaddr *)&dest, sizeof dest) < 0) { in tcp_OpenConnection() 93 close(sock); in tcp_OpenConnection() 97 return sock; in tcp_OpenConnection() 185 struct sockaddr_in sock; in tcp_Create() local 186 struct sockaddr *sockp = (struct sockaddr *)&sock; in tcp_Create() 189 sz = sizeof sock; in tcp_Create() 191 sz != sizeof(struct sockaddr_in) || sock.sin_family != AF_INET) { in tcp_Create() [all …]
|
H A D | udp.c | 71 struct sockaddr_in sock; /* peer address */ member 97 sizeof dev->sock); in udp_Sendto() 120 sz = sizeof dev->sock; in udp_Recvfrom() 125 inet_ntoa(dev->sock.sin_addr), ntohs(dev->sock.sin_port)); in udp_Recvfrom() 212 dev->sock.sin_family = AF_INET; in udp_CreateDevice() 213 dev->sock.sin_addr = GetIpAddr(host); in udp_CreateDevice() 219 dev->sock.sin_port = htons(atoi(port)); in udp_CreateDevice() 220 if (dev->sock.sin_port == 0) { in udp_CreateDevice() 223 dev->sock.sin_port = sp->s_port; in udp_CreateDevice() 238 if (connect(p->fd, (struct sockaddr *)&dev->sock, sizeof dev->sock) == 0) { in udp_CreateDevice() [all …]
|
/dragonfly/sbin/dhclient/ |
H A D | dispatch.c | 223 int sock; in interface_link_forceup() local 225 if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) in interface_link_forceup() 231 close(sock); in interface_link_forceup() 245 close(sock); in interface_link_forceup() 248 close(sock); in interface_link_forceup() 251 close(sock); in interface_link_forceup() 260 int sock; in interface_status() local 262 if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) in interface_status() 268 if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1) { in interface_status() 306 close(sock); in interface_status() [all …]
|
/dragonfly/lib/libc/rpc/ |
H A D | svc.c | 99 int sock; in xprt_register() local 103 sock = xprt->xp_fd; in xprt_register() 113 if (sock < FD_SETSIZE) { in xprt_register() 115 FD_SET(sock, &svc_fdset); in xprt_register() 139 int sock; in __xprt_do_unregister() local 143 sock = xprt->xp_fd; in __xprt_do_unregister() 147 if ((sock < FD_SETSIZE) && (__svc_xports[sock] == xprt)) { in __xprt_do_unregister() 150 if (sock >= svc_maxfd) { in __xprt_do_unregister() 517 int sock; in svc_getreqset() local 522 for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) { in svc_getreqset() [all …]
|
/dragonfly/usr.sbin/ypbind/ |
H A D | yp_ping.c | 114 int sock = -1; in __pmap_getport() local 121 PMAPVERS, timeout, &sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); in __pmap_getport() 138 if (sock != -1) in __pmap_getport() 139 close(sock); in __pmap_getport() 220 int sock, dontblock = 1; in __yp_ping() local 253 sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); in __yp_ping() 254 clnt = clntudp_create(any, YPPROG, YPVERS, tv, &sock); in __yp_ping() 256 close(sock); in __yp_ping() 269 ioctl(sock, FIONBIO, &dontblock); in __yp_ping() 297 close(sock); in __yp_ping()
|
/dragonfly/stand/boot/common/ |
H A D | dev_net.c | 89 static int net_getparams(int sock); 208 net_getparams(int sock) in net_getparams() argument 224 bootp(sock, BOOTP_NONE); in net_getparams() 235 if (rarp_getipaddress(sock)) { in net_getparams() 242 if (bp_whoami(sock)) { in net_getparams() 254 if (bp_getfile(sock, "gateway", &gateip, buf) == 0) { in net_getparams() 266 if (bp_getfile(sock, "root", &rootip, rootpath)) { in net_getparams() 289 d = socktodesc(sock); in net_getparams()
|
/dragonfly/test/testcases/io/kqueue_1/ |
H A D | kqueue_1.c | 16 int sock[2]; in main() local 21 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sock) < 0) in main() 24 if (write(sock[0], foo, sizeof(foo)) < 0) in main() 27 close(sock[0]); in main() 29 EV_SET(&kc, sock[1], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); in main()
|