Home | History | Annotate | Download | only in drivers

Lines Matching refs:sock

41 	int sock; /* raw packet socket for driver access */
209 static void handle_read(int sock, void *eloop_ctx, void *sock_ctx)
215 len = recv(sock, buf, sizeof(buf), 0);
230 drv->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
231 if (drv->sock < 0) {
236 if (eloop_register_read_sock(drv->sock, handle_read, drv, NULL)) {
243 if (ioctl(drv->sock, SIOCGIFINDEX, &ifr) != 0) {
258 if (bind(drv->sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
263 return linux_get_ifhwaddr(drv->sock, drv->iface, own_addr);
275 res = send(drv->sock, msg, len, 0);
973 drv->ioctl_sock = drv->sock = -1;
1014 if (drv->sock >= 0)
1015 close(drv->sock);