4 * Copyright (C) 2012 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * @(#)ip_fil.h 1.35 6/5/96
12 typedef struct ipmon_msg_s {
21 typedef void (*ims_destroy_func_t)(void *);
22 typedef void *(*ims_dup_func_t)(void *);
23 typedef int (*ims_match_func_t)(void *, void *);
24 typedef void *(*ims_parse_func_t)(char **);
25 typedef void (*ims_print_func_t)(void *);
26 typedef int (*ims_store_func_t)(void *, ipmon_msg_t *);
28 typedef struct ipmon_saver_s {
30 ims_destroy_func_t ims_destroy;
31 ims_dup_func_t ims_dup;
32 ims_match_func_t ims_match;
33 ims_parse_func_t ims_parse;
34 ims_print_func_t ims_print;
35 ims_store_func_t ims_store;
38 typedef struct ipmon_saver_int_s {
39 struct ipmon_saver_int_s *imsi_next;
40 ipmon_saver_t *imsi_stor;
44 typedef struct ipmon_doing_s {
45 struct ipmon_doing_s *ipmd_next;
47 ipmon_saver_t *ipmd_saver;
49 * ipmd_store is "cached" in this structure to avoid a double
50 * deref when doing saves....
52 int (*ipmd_store)(void *, ipmon_msg_t *);
56 typedef struct ipmon_action {
57 struct ipmon_action *ac_next;
58 int ac_mflag; /* collection of things to compare */
59 int ac_dflag; /* flags to compliment the doing fields */
62 char ac_group[FR_GROUPLEN];
65 int ac_type; /* nat/state/ipf */
79 * used with ac_packet/ac_second
81 struct timeval ac_last;
84 * What to do with matches
86 ipmon_doing_t *ac_doing;
89 #define ac_lastsec ac_last.tv_sec
90 #define ac_lastusec ac_last.tv_usec
93 * Flags indicating what fields to do matching upon (ac_mflag).
95 #define IPMAC_DIRECTION 0x0001
96 #define IPMAC_DSTIP 0x0002
97 #define IPMAC_DSTPORT 0x0004
98 #define IPMAC_EVERY 0x0008
99 #define IPMAC_GROUP 0x0010
100 #define IPMAC_INTERFACE 0x0020
101 #define IPMAC_LOGTAG 0x0040
102 #define IPMAC_NATTAG 0x0080
103 #define IPMAC_PROTOCOL 0x0100
104 #define IPMAC_RESULT 0x0200
105 #define IPMAC_RULE 0x0400
106 #define IPMAC_SRCIP 0x0800
107 #define IPMAC_SRCPORT 0x1000
108 #define IPMAC_TYPE 0x2000
109 #define IPMAC_WITH 0x4000
113 #define IPMR_NOMATCH 3
116 #define IPMON_SYSLOG 0x001
117 #define IPMON_RESOLVE 0x002
118 #define IPMON_HEXBODY 0x004
119 #define IPMON_HEXHDR 0x010
120 #define IPMON_TAIL 0x020
121 #define IPMON_VERBOSE 0x040
122 #define IPMON_NAT 0x080
123 #define IPMON_STATE 0x100
124 #define IPMON_FILTER 0x200
125 #define IPMON_PORTNUM 0x400
126 #define IPMON_LOGALL (IPMON_NAT|IPMON_STATE|IPMON_FILTER)
127 #define IPMON_LOGBODY 0x800
129 #define HOSTNAME_V4(a,b) hostname((a), 4, (u_32_t *)&(b))
132 #define LOGFAC LOG_LOCAL0
135 extern void dump_config __P((void));
136 extern int load_config __P((char *));
137 extern void unload_config __P((void));
138 extern void dumphex __P((FILE *, int, char *, int));
139 extern int check_action __P((char *, char *, int, int));
140 extern char *getword __P((int));
141 extern void *add_doing __P((ipmon_saver_t *));