Lines Matching refs:sock
41 int sock; /* raw packet socket for driver access */
200 static void handle_read(int sock, void *eloop_ctx, void *sock_ctx)
206 len = recv(sock, buf, sizeof(buf), 0);
221 drv->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
222 if (drv->sock < 0) {
228 if (eloop_register_read_sock(drv->sock, handle_read, drv, NULL)) {
235 if (ioctl(drv->sock, SIOCGIFINDEX, &ifr) != 0) {
251 if (bind(drv->sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
256 return linux_get_ifhwaddr(drv->sock, drv->iface, own_addr);
270 res = send(drv->sock, msg, len, 0);
972 drv->ioctl_sock = drv->sock = -1;
1015 if (drv->sock >= 0)
1016 close(drv->sock);