You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
987B

  1. #ifndef OWL_IO_H
  2. #define OWL_IO_H
  3. #include <stdint.h>
  4. #include <pcap/pcap.h>
  5. #include <net/if.h>
  6. #ifdef __APPLE__
  7. #include <net/ethernet.h>
  8. #else
  9. #include <netinet/ether.h>
  10. #endif
  11. struct io_state {
  12. pcap_t *wlan_handle;
  13. char wlan_ifname[IFNAMSIZ]; /* name of WLAN iface */
  14. int wlan_ifindex; /* index of WLAN iface */
  15. char host_ifname[IFNAMSIZ]; /* name of host iface */
  16. int host_ifindex; /* index of host iface */
  17. struct ether_addr if_ether_addr; /* MAC address of WLAN and host iface */
  18. int wlan_fd;
  19. int host_fd;
  20. char *dumpfile;
  21. char wlan_no_monitor_mode;
  22. };
  23. int io_state_init(struct io_state *state, const char *wlan, const char *host, const struct ether_addr *bssid_filter);
  24. void io_state_free(struct io_state *state);
  25. int wlan_send(const struct io_state *state, const uint8_t *buf, int len);
  26. int host_send(const struct io_state *state, const uint8_t *buf, int len);
  27. int host_recv(const struct io_state *state, uint8_t *buf, int *len);
  28. #endif /* OWL_IO_H */