c07508e2 |
/*
* $Id$
*
*/
#ifndef route_struct_h
#define route_struct_h
enum { EXP_T=1, ELEM_T };
enum { AND_OP=1, OR_OP, NOT_OP };
enum { EQUAL_OP=10, MATCH_OP };
|
a15c363f |
enum { METHOD_O=1, URI_O, SRCIP_O, DSTIP_O, DEFAULT_O };
|
c07508e2 |
|
09e52ebb |
enum { FORWARD_T=1, SEND_T, DROP_T, LOG_T, ERROR_T, ROUTE_T, EXEC_T};
|
a15c363f |
enum { NOSUBTYPE=0, STRING_ST, NET_ST, NUMBER_ST, IP_ST, RE_ST, PROXY_ST };
|
c07508e2 |
struct expr{
int type; /* exp, exp_elem */
int op; /* and, or, not | ==, ~= */
int subtype;
union {
struct expr* expr;
int operand;
}l;
union {
struct expr* expr;
void* param;
|
09e52ebb |
int intval;
|
c07508e2 |
}r;
};
struct action{
int type; /* forward, drop, log, send ...*/
int p1_type;
int p2_type;
union {
int number;
char* string;
void* data;
}p1, p2;
struct action* next;
};
|
09e52ebb |
struct net{
unsigned long ip;
unsigned long mask;
};
|
c07508e2 |
struct expr* mk_exp(int op, struct expr* left, struct expr* right);
struct expr* mk_elem(int op, int subtype, int operand, void* param);
struct action* mk_action(int type, int p1_type, int p2_type, void* p1, void* p2);
|
09e52ebb |
struct action* append_action(struct action* a, struct action* b);
struct net* mk_net(unsigned long ip, unsigned long mask);
|
c07508e2 |
void print_action(struct action* a);
void print_expr(struct expr* exp);
#endif
|