2007-03-22 18:12:32 +00:00
|
|
|
#ifndef BGPQ3_H_
|
|
|
|
#define BGPQ3_H_
|
|
|
|
|
|
|
|
#include "sx_prefix.h"
|
|
|
|
#include "sx_slentry.h"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
V_CISCO = 0,
|
2011-07-15 11:48:34 +00:00
|
|
|
V_JUNIPER,
|
|
|
|
V_CISCO_XR
|
2007-03-22 18:12:32 +00:00
|
|
|
} bgpq_vendor_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
T_NONE = 0,
|
|
|
|
T_ASPATH,
|
|
|
|
T_OASPATH,
|
2008-06-02 11:32:25 +00:00
|
|
|
T_PREFIXLIST,
|
|
|
|
T_EACL
|
2007-03-22 18:12:32 +00:00
|
|
|
} bgpq_gen_t;
|
|
|
|
|
2008-05-19 13:33:32 +00:00
|
|
|
struct bgpq_prequest {
|
|
|
|
struct bgpq_prequest* next;
|
|
|
|
char request[128];
|
|
|
|
int (*callback)(char*, void*);
|
|
|
|
void *udata;
|
|
|
|
};
|
|
|
|
|
2007-03-22 18:12:32 +00:00
|
|
|
struct bgpq_expander {
|
|
|
|
struct sx_radix_tree* tree;
|
|
|
|
struct sx_slentry* macroses;
|
2008-06-02 11:32:25 +00:00
|
|
|
struct sx_slentry* rsets;
|
2007-03-22 18:12:32 +00:00
|
|
|
int family;
|
|
|
|
char* sources;
|
2009-03-27 13:57:18 +00:00
|
|
|
uint32_t asnumber;
|
|
|
|
int aswidth, asdot;
|
2007-03-22 18:12:32 +00:00
|
|
|
char* name;
|
|
|
|
bgpq_vendor_t vendor;
|
|
|
|
bgpq_gen_t generation;
|
2008-05-14 15:09:13 +00:00
|
|
|
int identify;
|
2008-05-16 15:19:09 +00:00
|
|
|
unsigned char asn32;
|
|
|
|
unsigned char* asn32s[65536];
|
2008-05-19 13:33:32 +00:00
|
|
|
struct bgpq_prequest* firstpipe, *lastpipe;
|
|
|
|
int piped;
|
2008-08-08 09:29:53 +00:00
|
|
|
char* match;
|
2008-12-19 17:39:15 +00:00
|
|
|
char* server;
|
2007-03-22 18:12:32 +00:00
|
|
|
};
|
|
|
|
|
2008-05-19 13:33:32 +00:00
|
|
|
|
2007-03-22 18:12:32 +00:00
|
|
|
int bgpq_expander_init(struct bgpq_expander* b, int af);
|
|
|
|
int bgpq_expander_add_asset(struct bgpq_expander* b, char* set);
|
2008-06-02 11:32:25 +00:00
|
|
|
int bgpq_expander_add_rset(struct bgpq_expander* b, char* set);
|
2007-03-22 18:12:32 +00:00
|
|
|
int bgpq_expander_add_as(struct bgpq_expander* b, char* as);
|
|
|
|
int bgpq_expander_add_prefix(struct bgpq_expander* b, char* prefix);
|
|
|
|
|
2007-03-23 12:47:28 +00:00
|
|
|
int bgpq_expand(struct bgpq_expander* b);
|
|
|
|
|
|
|
|
int bgpq3_print_prefixlist(FILE* f, struct bgpq_expander* b);
|
2008-06-02 11:32:25 +00:00
|
|
|
int bgpq3_print_eacl(FILE* f, struct bgpq_expander* b);
|
2007-03-23 12:47:28 +00:00
|
|
|
int bgpq3_print_aspath(FILE* f, struct bgpq_expander* b);
|
2007-04-04 13:15:20 +00:00
|
|
|
int bgpq3_print_oaspath(FILE* f, struct bgpq_expander* b);
|
2007-03-23 12:47:28 +00:00
|
|
|
|
2008-05-20 15:31:56 +00:00
|
|
|
#ifndef HAVE_STRLCPY
|
|
|
|
size_t strlcpy(char* dst, const char* src, size_t size);
|
|
|
|
#endif
|
2007-03-23 12:47:28 +00:00
|
|
|
|
2007-03-22 18:12:32 +00:00
|
|
|
#endif
|
|
|
|
|