Lines Matching defs:sock_fd

380 static int	has_wext(int sock_fd, const char *device, char *ebuf);
382 static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
638 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
645 ifindex = iface_get_id(sock_fd, device, handle->errbuf);
734 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
741 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf);
788 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device)
826 ret = add_mon_if(handle, sock_fd, &nlstate, device, mondevice);
874 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
878 del_mon_if(handle, sock_fd, &nlstate, device,
884 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
888 del_mon_if(handle, sock_fd, &nlstate, device,
922 int sock_fd;
965 sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
966 if (sock_fd == -1) {
977 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) != -1) {
981 close(sock_fd);
988 close(sock_fd);
991 close(sock_fd);
3011 int sock_fd = -1, arptype;
3024 sock_fd = is_any_device ?
3028 if (sock_fd == -1) {
3067 handlep->lo_ifindex = iface_get_id(sock_fd, "lo", handle->errbuf);
3091 err = enter_rfmon_mode(handle, sock_fd, device);
3094 close(sock_fd);
3102 close(sock_fd);
3115 arptype = iface_get_arptype(sock_fd, device, handle->errbuf);
3117 close(sock_fd);
3138 if (close(sock_fd) == -1) {
3143 sock_fd = socket(PF_PACKET, SOCK_DGRAM,
3145 if (sock_fd == -1) {
3200 handlep->ifindex = iface_get_id(sock_fd, device,
3203 close(sock_fd);
3207 if ((err = iface_bind(sock_fd, handlep->ifindex,
3209 close(sock_fd);
3223 close(sock_fd);
3269 if (setsockopt(sock_fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP,
3273 close(sock_fd);
3282 if (setsockopt(sock_fd, SOL_PACKET, PACKET_AUXDATA, &val,
3286 close(sock_fd);
3334 if (setsockopt(sock_fd, SOL_SOCKET, SO_TIMESTAMPNS, &nsec_tstamps, sizeof(nsec_tstamps)) < 0) {
3336 close(sock_fd);
3345 handle->fd = sock_fd;
4764 has_wext(int sock_fd, const char *device, char *ebuf)
4770 if (ioctl(sock_fd, SIOCGIWNAME, &ireq) >= 0)
4809 enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device)
4884 err = has_wext(sock_fd, device, handle->errbuf);
4910 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) != -1) {
4940 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) == -1) {
5109 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) == -1) {
5168 if (ioctl(sock_fd, cmd, &ireq) != -1) {
5196 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
5205 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5218 if (ioctl(sock_fd, SIOCSIWMODE, &ireq) == -1) {
5224 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5258 if (ioctl(sock_fd, cmd, &ireq) != -1)
5269 if (ioctl(sock_fd, cmd, &ireq) != -1)
5280 ioctl(sock_fd, cmd, &ireq);
5298 ioctl(sock_fd, cmd, &ireq);
5308 if (ioctl(sock_fd, SIOCGIWFREQ, &ireq) == -1) {
5326 ioctl(sock_fd, cmd, &ireq);
5339 ioctl(sock_fd, cmd, &ireq);
5351 ioctl(sock_fd, cmd, &ireq);
5364 ioctl(sock_fd, cmd, &ireq);
5376 ioctl(sock_fd, cmd, &ireq);
5385 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5425 enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device)
5432 ret = enter_rfmon_mode_mac80211(handle, sock_fd, device);
5440 ret = enter_rfmon_mode_wext(handle, sock_fd, device);