This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-maat/include/maat/maat.h

40 lines
997 B
C
Raw Normal View History

2022-10-26 14:41:22 +08:00
#pragma once
2022-10-27 17:58:52 +08:00
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
#include <netinet/in.h>
2022-10-26 14:41:22 +08:00
struct maat_feather;
2022-10-27 17:58:52 +08:00
2022-10-26 14:41:22 +08:00
/* network-order */
struct ipv4_tuple4{
2022-10-27 17:58:52 +08:00
uint32_t saddr; /* network order */
uint32_t daddr; /* network order */
uint16_t source; /* network order */
uint16_t dest; /* network order */
2022-10-26 14:41:22 +08:00
};
#define IPV6_ADDR_LEN (sizeof(struct in6_addr))
struct ipv6_tuple4
{
2022-10-27 17:58:52 +08:00
uint8_t saddr[IPV6_ADDR_LEN] ;
uint8_t daddr[IPV6_ADDR_LEN] ;
uint16_t source; /* network order */
uint16_t dest; /* network order */
2022-10-26 14:41:22 +08:00
};
2022-10-27 17:58:52 +08:00
2022-10-26 14:41:22 +08:00
struct maat_scan_state;
2022-10-27 17:58:52 +08:00
int maat_scan_ipv4(struct maat_feather *feather, int table_id, struct maat_scan_state *state,
const struct ipv4_tuple4 *tuple4, unsigned int *matched_ids, size_t n_match_id);
int maat_scan_string(struct maat_feather *feather, int table_id, struct maat_scan_state *state,
const char *data, size_t length);
2022-10-26 14:41:22 +08:00
2022-10-27 17:58:52 +08:00
#ifdef __cpluscplus
}
#endif