
#if HAVE_CONFIG_H
#include <config.h>
#endif

struct rpsl_ip { 
	struct in_addr addr;
	unsigned int len,len1,len2;
};

struct ro { 
	unsigned addr;
	unsigned mask;
	unsigned lastaddr;
	int masklen;
	char* text;
	char* as, *ovl;
	int type;
#define RO_RO 1
#define RO_AS 2
#define RO_MC 3
#define RO_RPSL 4
	int flag;
#define RO_OVL 1
#define RO_AGGR 2
	struct rpsl_ip* rpsl;
	struct ro* next;
};

struct ro* ro_init();
struct ro* ro_fixup(struct ro*);
int expansion_add(struct ro*,char* text,int type);
int expand(struct ro*,char*, int,struct ro*,char*);
int print_eacl(struct ro*,FILE*, char*,int);
int print_stacl(struct ro*,FILE*, char*,int);
int print_iacl(struct ro*,FILE*, char*,int);
int print_oacl(struct ro*,FILE*, char*,int);
int print_prefixlist(struct ro*,FILE*, char*,int);
int print_gated(struct ro*,FILE*, char*,int);
int print_aspath(struct ro*,FILE*, char*,int,int);
int print_oaspath(struct ro*,FILE*, char*,int,int);
int print_statistics(FILE*);
int print_formatted(struct ro* ro_head,FILE* f,char* name, char* format);


int rpsl_print_filter(FILE* whence, struct rpsl_ip* rpsl, int type);
struct rpsl_ip* rpsl_translate(char* addr);
int rpsl_filters(struct rpsl_ip* rp, unsigned long addr, int len);

int ro_aggregate(struct ro* head);
int ro_refinery(struct ro* head, int ref);

#ifndef HAVE_STRCASECMP
int strcasecmp(const char*, const char*);
#endif
#ifndef HAVE_STRNCASECMP
int strncasecmp(const char*, const char*, register size_t);
#endif

int ro_queue_free(struct ro* ro);
int rpsl_free(struct rpsl_ip* rpsl);
