Home | History | Annotate | Download | only in libpcap

Lines Matching defs:sock_fd

430 static int	has_wext(int sock_fd, const char *device, char *ebuf);
432 static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
679 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
683 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
691 ifindex = iface_get_id(sock_fd, device, handle->errbuf);
780 del_mon_if(handle, sock_fd, state, device, mondevice);
794 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
801 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf);
848 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device)
886 ret = add_mon_if(handle, sock_fd, &nlstate, device, mondevice);
929 del_mon_if(handle, sock_fd, &nlstate, device,
940 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
944 del_mon_if(handle, sock_fd, &nlstate, device,
950 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
954 del_mon_if(handle, sock_fd, &nlstate, device,
1019 int sock_fd;
1062 sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
1063 if (sock_fd == -1) {
1069 if (is_bonding_device(sock_fd
1071 close(sock_fd);
1080 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) != -1) {
1084 close(sock_fd);
1091 close(sock_fd);
1094 close(sock_fd);
2816 is_wifi(int sock_fd
2849 if (has_wext(sock_fd, device, errbuf) == 1) {
2878 static void map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype,
2921 if (!is_wifi(sock_fd, device)) {
3320 int sock_fd = -1, arptype;
3337 sock_fd = is_any_device ?
3341 if (sock_fd == -1) {
3380 handlep->lo_ifindex = iface_get_id(sock_fd, "lo", handle->errbuf);
3404 err = enter_rfmon_mode(handle, sock_fd, device);
3407 close(sock_fd);
3415 close(sock_fd);
3428 arptype = iface_get_arptype(sock_fd, device, handle->errbuf);
3430 close(sock_fd);
3433 map_arphrd_to_dlt(handle, sock_fd, arptype, device, 1);
3451 if (close(sock_fd) == -1) {
3456 sock_fd = socket(PF_PACKET, SOCK_DGRAM,
3458 if (sock_fd == -1) {
3513 handlep->ifindex = iface_get_id(sock_fd, device,
3516 close(sock_fd);
3520 if ((err = iface_bind(sock_fd, handlep->ifindex,
3522 close(sock_fd);
3536 close(sock_fd);
3582 if (setsockopt(sock_fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP,
3586 close(sock_fd);
3595 if (setsockopt(sock_fd, SOL_PACKET, PACKET_AUXDATA, &val,
3599 close(sock_fd);
3656 if (setsockopt(sock_fd, SOL_SOCKET, SO_TIMESTAMPNS, &nsec_tstamps, sizeof(nsec_tstamps)) < 0) {
3658 close(sock_fd);
3667 handle->fd = sock_fd;
3675 if (getsockopt(sock_fd, SOL_SOCKET, SO_BPF_EXTENSIONS,
5335 has_wext(int sock_fd, const char *device, char *ebuf)
5339 if (is_bonding_device(sock_fd, device))
5344 if (ioctl(sock_fd, SIOCGIWNAME, &ireq) >= 0)
5383 enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device)
5458 err = has_wext(sock_fd, device, handle->errbuf);
5484 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) != -1) {
5514 if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) == -1) {
5683 if (ioctl(sock_fd, SIOCGIWMODE, &ireq) == -1) {
5742 if (ioctl(sock_fd, cmd, &ireq) != -1) {
5770 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) {
5779 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5792 if (ioctl(sock_fd, SIOCSIWMODE, &ireq) == -1) {
5798 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5832 if (ioctl(sock_fd, cmd, &ireq) != -1)
5843 if (ioctl(sock_fd, cmd, &ireq) != -1)
5854 ioctl(sock_fd, cmd, &ireq);
5872 ioctl(sock_fd, cmd, &ireq);
5882 if (ioctl(sock_fd, SIOCGIWFREQ, &ireq) == -1) {
5900 ioctl(sock_fd, cmd, &ireq);
5913 ioctl(sock_fd, cmd, &ireq);
5925 ioctl(sock_fd, cmd, &ireq);
5938 ioctl(sock_fd, cmd, &ireq);
5950 ioctl(sock_fd, cmd, &ireq);
5959 if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr) == -1) {
5999 enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device)
6006 ret = enter_rfmon_mode_mac80211(handle, sock_fd, device);
6014 ret = enter_rfmon_mode_wext(handle, sock_fd, device);