diff options
Diffstat (limited to 'include/sniffer.h')
| -rw-r--r-- | include/sniffer.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/sniffer.h b/include/sniffer.h new file mode 100644 index 0000000..8b85100 --- /dev/null +++ b/include/sniffer.h @@ -0,0 +1,44 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> + +#include "agent_context.h" +#include "net.h" + +#ifndef TH_FIN +#define TH_FIN 0x01 +#endif + +#ifndef TH_SYN +#define TH_SYN 0x02 +#endif + +#ifndef TH_RST +#define TH_RST 0x04 +#endif + +#ifndef TH_PUSH +#define TH_PUSH 0x08 +#endif + +#ifndef TH_ACK +#define TH_ACK 0x10 +#endif + +#ifndef TH_URG +#define TH_URG 0x20 +#endif + +#ifndef TH_ECE +#define TH_ECE 0x40 +#endif + +#ifndef TH_CWR +#define TH_CWR 0x80 +#endif + +sock_t sniffer_init_interface(const char *interface, bool promisc); +void sniffer_handle_packet(sock_t sniffer, agent_context_t *ctx); + +pid_t match_udp_inode(uint32_t ip_be, uint16_t port_be); |
