Parse 'SOURCE::' to only use a specific source for an AS-SET or Route Set

This extension allows operators to specify what IRR source to use when expanding an AS-SET.

For example: `bgpq4 RIPE::AS15562:AS-SNIJDERS`

The notation is also used in databases like PeeringDB.

Authored-by: James Bensley <jwbensley@gmail.com>
This commit is contained in:
James Bensley
2022-11-03 11:09:29 +01:00
committed by GitHub
parent 24c3e08f0e
commit 08b81f7d19
5 changed files with 384 additions and 66 deletions

View File

@@ -91,6 +91,8 @@ struct bgpq_expander {
struct sx_radix_tree *tree;
int family;
char *sources;
char *defaultsources;
unsigned int usesource;
uint32_t asnumber;
int aswidth;
char *name;
@@ -126,6 +128,10 @@ int bgpq_expander_add_prefix(struct bgpq_expander *b, char *prefix);
int bgpq_expander_add_prefix_range(struct bgpq_expander *b, char *prefix);
int bgpq_expander_add_stop(struct bgpq_expander *b, char *object);
char* bgpq_get_asset(char *object);
char* bgpq_get_rset(char *object);
char* bgpq_get_source(char *object);
int bgpq_expand(struct bgpq_expander *b);
void bgpq4_print_prefixlist(FILE *f, struct bgpq_expander *b);