Lines Matching refs:sock_fd
385 static int has_wext(int sock_fd, const char *device, char *ebuf);
387 static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
639 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, argument
646 ifindex = iface_get_id(sock_fd, device, handle->errbuf);
735 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, argument
742 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf);
789 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device) argument
827 ret = add_mon_if(handle, sock_fd, &nlstate, device, mondevice);
875 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
879 del_mon_if(handle, sock_fd, &nlstate, device,
885 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
889 del_mon_if(handle, sock_fd, &nlstate, device,
923 int sock_fd; local
966 sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
967 if (sock_fd == -1) {
979 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) != -1) {
983 close(sock_fd);
990 close(sock_fd);
993 close(sock_fd);
3001 int sock_fd = -1, arptype; local
3014 sock_fd = is_any_device ?
3018 if (sock_fd == -1) {
3057 handlep->lo_ifindex = iface_get_id(sock_fd, "lo", handle->errbuf);
3081 err = enter_rfmon_mode(handle, sock_fd, device);
3084 close(sock_fd);
3092 close(sock_fd);
3105 arptype = iface_get_arptype(sock_fd, device, handle->errbuf);
3107 close(sock_fd);
3127 if (close(sock_fd) == -1) {
3132 sock_fd = socket(PF_PACKET, SOCK_DGRAM,
3134 if (sock_fd == -1) {
3188 handlep->ifindex = iface_get_id(sock_fd, device,
3191 close(sock_fd);
3195 if ((err = iface_bind(sock_fd, handlep->ifindex,
3197 close(sock_fd);
3256 if (setsockopt(sock_fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP,
3260 close(sock_fd);
3269 if (setsockopt(sock_fd, SOL_PACKET, PACKET_AUXDATA, &val,
3273 close(sock_fd);
3318 handle->fd = sock_fd;
4731 has_wext(int sock_fd, const char *device, char *ebuf) argument
4738 if (ioctl(sock_fd, SIOCGIWNAME, &ireq) >= 0)
4777 enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device) argument
4852 err = has_wext(sock_fd, device, handle->errbuf);
4879 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) != -1) {
4909 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) == -1) {
5079 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) == -1) {
5139 if (ioctl(sock_fd, cmd, &ireq) != -1) {
5167 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
5176 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5190 if (ioctl(sock_fd, SIOCSIWMODE, &ireq) == -1) {
5196 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5231 if (ioctl(sock_fd, cmd, &ireq) != -1)
5243 if (ioctl(sock_fd, cmd, &ireq) != -1)
5255 ioctl(sock_fd, cmd, &ireq);
5274 ioctl(sock_fd, cmd, &ireq);
5285 if (ioctl(sock_fd, SIOCGIWFREQ, &ireq) == -1) {
5304 ioctl(sock_fd, cmd, &ireq);
5318 ioctl(sock_fd, cmd, &ireq);
5331 ioctl(sock_fd, cmd, &ireq);
5345 ioctl(sock_fd, cmd, &ireq);
5358 ioctl(sock_fd, cmd, &ireq);
5367 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5407 enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device) argument
5414 ret = enter_rfmon_mode_mac80211(handle, sock_fd, device);
5422 ret = enter_rfmon_mode_wext(handle, sock_fd, device);