Lines Matching refs:fd
23 int fd; /* packet socket for EAPOL frames */ member
125 ret = send(l2->fd, buf, len, 0); in l2_packet_send()
137 ret = sendto(l2->fd, buf, len, 0, (struct sockaddr *) &ll, in l2_packet_send()
292 l2->fd = socket(PF_PACKET, l2_hdr ? SOCK_RAW : SOCK_DGRAM, in l2_packet_init()
294 if (l2->fd < 0) { in l2_packet_init()
302 if (ioctl(l2->fd, SIOCGIFINDEX, &ifr) < 0) { in l2_packet_init()
305 close(l2->fd); in l2_packet_init()
316 bind(l2->fd, (struct sockaddr *) &ll, sizeof(ll)) < 0) { in l2_packet_init()
319 close(l2->fd); in l2_packet_init()
324 if (ioctl(l2->fd, SIOCGIFHWADDR, &ifr) < 0) { in l2_packet_init()
327 close(l2->fd); in l2_packet_init()
334 eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL); in l2_packet_init()
430 if (l2->fd >= 0) { in l2_packet_deinit()
431 eloop_unregister_read_sock(l2->fd); in l2_packet_deinit()
432 close(l2->fd); in l2_packet_deinit()
506 if (setsockopt(l2->fd, SOL_SOCKET, SO_ATTACH_FILTER, in l2_packet_set_packet_filter()