#ifndef __PACKET_MANGLER_H__
#define __PACKET_MANGLER_H__
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/syslog.h>
#include <netinet/in.h>
#include <stdint.h>
#ifdef BSD_KERNEL_PRIVATE
#include <sys/mbuf.h>
#include <sys/socketvar.h>
#endif
__BEGIN_DECLS
#ifdef PRIVATE
typedef enum {
INOUT,
IN,
OUT
} Pkt_Mnglr_Flow;
#define PACKET_MANGLER_CONTROL_NAME "com.apple.packet-mangler"
#define PKT_MNGLR_OPT_PROTO_ACT_MASK 1
#define PKT_MNGLR_OPT_IP_ACT_MASK 2
#define PKT_MNGLR_OPT_LOCAL_IP 3
#define PKT_MNGLR_OPT_REMOTE_IP 4
#define PKT_MNGLR_OPT_LOCAL_PORT 5
#define PKT_MNGLR_OPT_REMOTE_PORT 6
#define PKT_MNGLR_OPT_DIRECTION 7
#define PKT_MNGLR_OPT_PROTOCOL 8
#define PKT_MNGLR_OPT_ACTIVATE 0xFFFFFFFF
#define PKT_MNGLR_TCP_ACT_NOP_MPTCP 0x00000001
#define PKT_MNGLR_TCP_ACT_SWAP_L_PORT 0x00000002
#define PKT_MNGLR_TCP_ACT_SWAP_R_PORT 0x00000004
#define PKT_MNGLR_TCP_ACT_DSS_DROP 0x00000008
#define PKT_MNGLR_TCP_ACT_CHK_EXTENDED 0x80000000
#define PKT_MNGLR_IP_ACT_FLT_L_IP 0x00000001
#define PKT_MNGLR_IP_ACT_FLT_R_IP 0x00000002
#define PKT_MNGLR_IP_ACT_SWAP_L_IP 0x00000004
#define PKT_MNGLR_IP_ACT_SWAP_R_IP 0x00000008
#define PKT_MNGLR_IP_ACT_DROP_PACKET 0x00000010
#define PKT_MNGLR_IP_ACT_CHK_EXTENDED 0x80000000
#define PKT_MNGLR_MAX_FILTER_COUNT 1
#define PKT_MNGLR_VERSION_CURRENT 1
#endif
#ifdef BSD_KERNEL_PRIVATE
extern int pkt_mnglr_log_level;
#define PKT_MNGLR_LOG(level, fmt, ...) \
do { \
if (pkt_mnglr_log_level >= level) \
printf("%s:%d " fmt "\n",\
__FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
extern void pkt_mnglr_init(void);
__END_DECLS
#endif
#endif