route.h
512dcd98
 /*
  * $Id$
  */
 
 #ifndef route_h
 #define route_h
 
 #include <sys/types.h>
 #include <regex.h>
 #include <netdb.h>
 
a15c363f
 #include "config.h"
 #include "error.h"
 #include "route_struct.h"
 #include "msg_parser.h"
 
 /*#include "cfg_parser.h" */
 
512dcd98
 
 
 struct route_elem{
 	struct route_elem* next;
a15c363f
 
 	struct expr* condition;
 	struct action* actions;
 
512dcd98
 	int ok; /* set to 0 if an error was found sendig a pkt*/
 	/*counters*/
 	int errors;
 	int tx;
 	int tx_bytes;
 };
 
 /* main "routing table" */
a15c363f
 extern struct route_elem* rlist[RT_NO];
512dcd98
 
 
 void free_re(struct route_elem* re);
 struct route_elem* init_re();
 void push(struct route_elem* re, struct route_elem** head);
 void clear_rlist(struct route_elem** rl);
a15c363f
 int add_rule(struct expr* e, struct action* a, struct route_elem** head);
 struct route_elem* route_match(struct sip_msg* msg,struct route_elem** rl);
 void print_rl();
512dcd98
 
 
 
 
 
 #endif