Home | History | Annotate | Download | only in drivers

Lines Matching refs:sock

57 	int sock; /* raw packet socket for driver access */
90 static int wired_multicast_membership(int sock, int ifindex,
96 if (sock < 0)
105 if (setsockopt(sock, SOL_PACKET,
159 static void handle_read(int sock, void *eloop_ctx, void *sock_ctx)
164 len = recv(sock, buf, sizeof(buf), 0);
174 static void handle_dhcp(int sock, void *eloop_ctx, void *sock_ctx)
182 len = recv(sock, buf, sizeof(buf), 0);
215 drv->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_PAE));
216 if (drv->sock < 0) {
221 if (eloop_register_read_sock(drv->sock, handle_read, drv->ctx, NULL)) {
228 if (ioctl(drv->sock, SIOCGIFINDEX, &ifr) != 0) {
239 if (bind(drv->sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
245 if (wired_multicast_membership(drv->sock, ifr.ifr_ifindex,
254 if (ioctl(drv->sock, SIOCGIFHWADDR, &ifr) != 0) {
341 res = send(drv->sock, (u8 *) hdr, len, 0);
382 if (drv->sock >= 0)
383 close(drv->sock);