Home | History | Annotate | Download | only in libpcap

Lines Matching refs:sock_fd

472 static int	has_wext(int sock_fd, const char *device, char *ebuf);
474 static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
720 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
724 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
732 ifindex = iface_get_id(sock_fd, device, handle->errbuf);
821 del_mon_if(handle, sock_fd, state, device, mondevice);
835 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
842 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf);
889 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device)
927 ret = add_mon_if(handle, sock_fd, &nlstate, device, mondevice);
970 del_mon_if(handle, sock_fd, &nlstate, device,
981 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
985 del_mon_if(handle, sock_fd, &nlstate, device,
991 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
995 del_mon_if(handle, sock_fd, &nlstate, device,
1071 int sock_fd;
1114 sock_fd = socket(PF_PACKET, SOCK_RAW, pcap_protocol(handle));
1115 if (sock_fd == -1) {
1121 if (is_bonding_device(sock_fd, handle->opt.device)) {
1123 close(sock_fd);
1132 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) != -1) {
1136 close(sock_fd);
1143 close(sock_fd);
1146 close(sock_fd);
3064 is_wifi(int sock_fd
3097 if (has_wext(sock_fd, device, errbuf) == 1) {
3126 static void map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype,
3169 if (!is_wifi(sock_fd, device)) {
3576 int sock_fd = -1, arptype;
3593 sock_fd = is_any_device ?
3597 if (sock_fd == -1) {
3636 handlep->lo_ifindex = iface_get_id(sock_fd, "lo", handle->errbuf);
3660 err = enter_rfmon_mode(handle, sock_fd, device);
3663 close(sock_fd);
3671 close(sock_fd);
3684 arptype = iface_get_arptype(sock_fd, device, handle->errbuf);
3686 close(sock_fd);
3689 map_arphrd_to_dlt(handle, sock_fd, arptype, device, 1);
3707 if (close(sock_fd) == -1) {
3712 sock_fd = socket(PF_PACKET, SOCK_DGRAM, protocol);
3713 if (sock_fd == -1) {
3768 handlep->ifindex = iface_get_id(sock_fd, device,
3771 close(sock_fd);
3775 if ((err = iface_bind(sock_fd, handlep->ifindex,
3777 close(sock_fd);
3791 close(sock_fd);
3837 if (setsockopt(sock_fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP,
3841 close(sock_fd);
3850 if (setsockopt(sock_fd, SOL_PACKET, PACKET_AUXDATA, &val,
3854 close(sock_fd);
3911 if (setsockopt(sock_fd, SOL_SOCKET, SO_TIMESTAMPNS, &nsec_tstamps, sizeof(nsec_tstamps)) < 0) {
3913 close(sock_fd);
3922 handle->fd = sock_fd;
3930 if (getsockopt(sock_fd, SOL_SOCKET, SO_BPF_EXTENSIONS,
5602 has_wext(int sock_fd, const char *device, char *ebuf)
5606 if (is_bonding_device(sock_fd, device))
5611 if (ioctl(sock_fd, SIOCGIWNAME, &ireq) >= 0)
5650 enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device)
5725 err = has_wext(sock_fd, device, handle->errbuf);
5751 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) != -1) {
5780 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) == -1) {
5948 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) == -1) {
6007 if (ioctl(sock_fd, cmd, &ireq) != -1) {
6035 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
6044 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
6058 if (ioctl(sock_fd, SIOCSIWMODE, &ireq) == -1) {
6064 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
6099 if (ioctl(sock_fd, cmd, &ireq) != -1)
6110 if (ioctl(sock_fd, cmd, &ireq) != -1)
6121 ioctl(sock_fd, cmd, &ireq);
6139 ioctl(sock_fd, cmd, &ireq);
6149 if (ioctl(sock_fd, SIOCGIWFREQ, &ireq) == -1) {
6166 ioctl(sock_fd, cmd, &ireq);
6179 ioctl(sock_fd, cmd, &ireq);
6191 ioctl(sock_fd, cmd, &ireq);
6204 ioctl(sock_fd, cmd, &ireq);
6216 ioctl(sock_fd, cmd, &ireq);
6225 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
6266 enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device)
6273 ret = enter_rfmon_mode_mac80211(handle, sock_fd, device);
6281 ret = enter_rfmon_mode_wext(handle, sock_fd, device);