diff --git a/bgpq4.8 b/bgpq4.8 index bd2aabb..2c282ee 100644 --- a/bgpq4.8 +++ b/bgpq4.8 @@ -40,7 +40,7 @@ .Fl H Ar asn .Fl t .Oc -.Op Fl 46ABbDdJjNnsXU +.Op Fl 46ABbDdJjNnpsXU .Op Fl a Ar asn .Op Fl r Ar len .Op Fl R Ar len @@ -111,6 +111,8 @@ extra match conditions for Juniper route-filters. generate config for Nokia SR OS MD-CLI (Cisco IOS by default) .It Fl N generate config for Nokia SR OS classic CLI (Cisco IOS by default). +.It Fl p +emit prefixes where the origin ASN is in the private ASN range (disabled by default). .It Fl r Ar len allow more specific routes starting with specified masklen too. .It Fl R Ar len diff --git a/expander.c b/expander.c index 9030091..2d37f6f 100644 --- a/expander.c +++ b/expander.c @@ -50,6 +50,7 @@ int debug_expander = 0; int pipelining = 1; +int expand_special_asn = 0; static inline int tentry_cmp(struct sx_tentry *a, struct sx_tentry *b) @@ -195,7 +196,8 @@ bgpq_expander_add_as(struct bgpq_expander *b, char *as) return 0; } - if (asno >= 4200000000ul || (asno >= 64496 && asno <= 65551)) { + if (!expand_special_asn && + (asno >= 4200000000ul || (asno >= 64496 && asno <= 65551))) { sx_report(SX_ERROR,"Invalid AS number: %u\n", asno); return 0; } diff --git a/main.c b/main.c index ad59652..c50cd34 100644 --- a/main.c +++ b/main.c @@ -45,12 +45,13 @@ extern int debug_expander; extern int debug_aggregation; extern int pipelining; +extern int expand_special_asn; static int usage(int ecode) { printf("\nUsage: bgpq4 [-h host[:port]] [-S sources] [-E|G|H " - "|f |t] [-46ABbdJjKNnwXz] [-R len] ... " + "|f |t] [-46ABbdJjKNnpwXz] [-R len] ... " "[EXCEPT ...]\n"); printf("\nVendor targets:\n"); printf(" no option : Cisco IOS Classic (default)\n"); @@ -197,7 +198,7 @@ main(int argc, char* argv[]) expander.sources=getenv("IRRD_SOURCES"); while ((c = getopt(argc, argv, - "467a:AbBdDEeF:S:jJKf:l:L:m:M:NnW:r:R:G:H:tTh:UuwXsvz")) != EOF) { + "467a:AbBdDEeF:S:jJKf:l:L:m:M:NnpW:r:R:G:H:tTh:UuwXsvz")) != EOF) { switch (c) { case '4': /* do nothing, expander already configured for IPv4 */ @@ -393,6 +394,9 @@ main(int argc, char* argv[]) vendor_exclusive(); expander.vendor = V_NOKIA_MD; break; + case 'p': + expand_special_asn = 1; + break; case 't': if (expander.generation) exclusive();