Skip to content

Commit

Permalink
RPSL <address-prefix-range> routes now supported too. Can be found in
Browse files Browse the repository at this point in the history
rs-esnetcustomers.
  • Loading branch information
snar committed Feb 19, 2015
1 parent 43233d6 commit d787382
Show file tree
Hide file tree
Showing 10 changed files with 509 additions and 400 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.1.26 (2015-02-19)
- RPSL <address-prefix-range> support, can be found in rs-esnetcustomers.
Thanks to Kris O'Connell for reporting.

0.1.25 (2014-10-29)
- JSON support extended to handle "as-paths" too. Well, actually, as
there are no defined format for as-path in json, bgpq3 just creates
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2007-2014 Alexandre Snarskii <snar@snar.spb.ru>
* Copyright (c) 2007-2015 Alexandre Snarskii <snar@snar.spb.ru>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion bgpq3.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" Copyright (c) 2007-2014 Alexandre Snarskii
.\" Copyright (c) 2007-2015 Alexandre Snarskii
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
Expand Down
11 changes: 9 additions & 2 deletions bgpq3.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ main(int argc, char* argv[])
};
};
if(expander.generation<T_PREFIXLIST) {
if(refine) {
if(refine) {
sx_report(SX_FATAL, "Sorry, more-specific filter (-R %u) "
"supported only with prefix-list generation\n", refine);
} else {
Expand All @@ -373,6 +373,10 @@ main(int argc, char* argv[])
* be accepted, so save some CPU cycles :) */
expander.maxlen = maxlen;
};
} else if (expander.family==AF_INET) {
expander.maxlen = 32;
} else if (expander.family==AF_INET6) {
expander.maxlen = 128;
};

if(expander.generation==T_EACL && expander.vendor==V_CISCO &&
Expand Down Expand Up @@ -409,7 +413,10 @@ main(int argc, char* argv[])
bgpq_expander_add_as(&expander,argv[0]);
};
} else {
if(!bgpq_expander_add_prefix(&expander,argv[0]))
char* c = strchr(argv[0], '^');
if (!c && !bgpq_expander_add_prefix(&expander,argv[0]))
exit(1);
else if (!bgpq_expander_add_prefix_range(&expander,argv[0]))
exit(1);
};
argv++;
Expand Down
1 change: 1 addition & 0 deletions bgpq3.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int bgpq_expander_add_asset(struct bgpq_expander* b, char* set);
int bgpq_expander_add_rset(struct bgpq_expander* b, char* set);
int bgpq_expander_add_as(struct bgpq_expander* b, char* as);
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_expand(struct bgpq_expander* b);

Expand Down
Loading

0 comments on commit d787382

Please sign in to comment.