diff --git a/CHANGES b/CHANGES index daf2f6d..26ac299 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,3 @@ -======= 0.0.2 (2019-12-14): - Add Mikrotik support - remove ASDDOT support diff --git a/README.md b/README.md index 861b735..7bf75c6 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,6 @@ Generate output in BIRD format (default: Cisco). Enable some debugging output. -#### -D - -Use asdot notation for Cisco as-path access-lists. - #### -E Generate extended access-list (Cisco) or policy-statement term using @@ -365,11 +361,9 @@ SEE ALSO -------- 1. [Routing Arbiter](http://www.radb.net/) -2. [draft-michaelson-4byte-as-representation-05](https://tools.ietf.org/html/draft-michaelson-4byte-as-representation-05) - for information on 'asdot' and 'asplain' notations. -3. [Cisco documentation](http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6554/ps6599/data_sheet_C78-521821.html) +2. [Cisco documentation](http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6554/ps6599/data_sheet_C78-521821.html) for information on Cisco implementation of ASN32. -4. [JunOS prefix-lists limitation](http://www.juniper.net/techpubs/en_US/junos11.4/topics/reference/configuration-statement/prefix-list-edit-policy-options.html) +3. [JunOS prefix-lists limitation](http://www.juniper.net/techpubs/en_US/junos11.4/topics/reference/configuration-statement/prefix-list-edit-policy-options.html) AUTHORS ------- diff --git a/bgpq4.8 b/bgpq4.8 index 203a312..c3c6dee 100644 --- a/bgpq4.8 +++ b/bgpq4.8 @@ -75,8 +75,6 @@ generate output in OpenBGPD format (default: Cisco) generate output in BIRD format (default: Cisco). .It Fl d enable some debugging output. -.It Fl D -use asdot notation for Cisco as-path access-lists. .It Fl E generate extended access-list (Cisco), policy-statement term using route-filters (Juniper), [ip|ipv6]-prefix-list (Nokia) or prefix-sets @@ -294,8 +292,6 @@ non-zero status. .Sh SEE ALSO .Sy http://www.radb.net/ Routing Arbiter project -.Sy http://tools.ietf.org/html/draft-michaelson-4byte-as-representation-05 -for information on 'asdot' and 'asplain' notations. .Sy http://www.cisco.com/en/US/docs/ios/12_0s/release/ntes/120SNEWF.html#wp3521658 for information on Cisco implementation of ASN32. .Sh AUTHORS diff --git a/bgpq4.c b/bgpq4.c index 03a0ee2..38aaabf 100644 --- a/bgpq4.c +++ b/bgpq4.c @@ -27,7 +27,7 @@ int usage(int ecode) { printf("\nUsage: bgpq4 [-h host[:port]] [-S sources] [-P|E|G |f |t]" - " [-2346ABbDdJjNnwXz] [-R len] ...\n"); + " [-2346ABbdJjNnwXz] [-R len] ...\n"); printf(" -2 : allow routes belonging to as23456 (transition-as) " "(default: false)\n"); printf(" -3 : assume that your device is asn32-safe\n"); @@ -36,7 +36,6 @@ usage(int ecode) printf(" -A : try to aggregate prefix-lists/route-filters\n"); printf(" -B : generate OpenBGPD output (Cisco IOS by default)\n"); printf(" -b : generate BIRD output (Cisco IOS by default)\n"); - printf(" -D : use asdot notation in as-path (Cisco only)\n"); printf(" -d : generate some debugging output\n"); printf(" -E : generate extended access-list(Cisco), " "route-filter(Juniper)\n" @@ -188,8 +187,6 @@ main(int argc, char* argv[]) expander.vendor=V_OPENBGPD; expander.asn32=1; break; - case 'D': expander.asdot=1; - break; case 'd': debug_expander++; break; case 'E': if(expander.generation) exclusive(); @@ -414,11 +411,6 @@ main(int argc, char* argv[]) "(-B) and BIRD (-b) output only\n"); }; - if(expander.asdot && expander.vendor!=V_CISCO) { - sx_report(SX_FATAL,"asdot notation supported only for Cisco, " - "other formats use asplain only\n"); - }; - if(!expander.asn32 && expander.asnumber>65535) { expander.asnumber=23456; }; diff --git a/bgpq4.h b/bgpq4.h index 7843711..e1f4d3a 100644 --- a/bgpq4.h +++ b/bgpq4.h @@ -52,7 +52,7 @@ struct bgpq_expander { int family; char* sources; uint32_t asnumber; - int aswidth, asdot; + int aswidth; char* name; bgpq_vendor_t vendor; bgpq_gen_t generation; diff --git a/bgpq4.html b/bgpq4.html index 211b028..a7ce0ee 100644 --- a/bgpq4.html +++ b/bgpq4.html @@ -54,10 +54,6 @@ supported).

Enable some debugging output.

-

-D

- -

Use asdot notation for Cisco as-path access-lists.

-

-E

Generate extended access-list (Cisco) or policy-statement term using @@ -288,8 +284,6 @@ each prefix-list Routing Arbiter -

  • draft-michaelson-4byte-as-representation-05.txt - for information on 'asdot' and 'asplain' notations.
  • Cisco documentation for information on Cisco implementation of ASN32.
  • JunOS prefix-lists limitation
  • diff --git a/bgpq4_printer.c b/bgpq4_printer.c index bec7631..4a32599 100644 --- a/bgpq4_printer.c +++ b/bgpq4_printer.c @@ -29,17 +29,10 @@ bgpq4_print_cisco_aspath(FILE* f, struct bgpq_expander* b) if(b->asn32s[b->asnumber/65536] && b->asn32s[b->asnumber/65536][(b->asnumber%65536)/8]& (0x80>>(b->asnumber%8))) { - if(b->asdot && b->asnumber>65535) { - fprintf(f,"ip as-path access-list %s permit ^%u.%u(_%u.%u)*$\n", - b->name?b->name:"NN",b->asnumber/65536,b->asnumber%65536, - b->asnumber/65536,b->asnumber%65536); - empty=0; - } else { fprintf(f,"ip as-path access-list %s permit ^%u(_%u)*$\n", b->name?b->name:"NN",b->asnumber,b->asnumber); empty=0; - }; - }; + }; for(k=0;k<65536;k++) { if(!b->asn32s[k]) continue; @@ -48,22 +41,12 @@ bgpq4_print_cisco_aspath(FILE* f, struct bgpq_expander* b) if(b->asn32s[k][i]&(0x80>>j)) { if(k*65536+i*8+j==b->asnumber) continue; if(!nc) { - if(b->asdot && k>0) { - fprintf(f,"ip as-path access-list %s permit" - " ^%u(_[0-9]+)*_(%u.%u", b->name?b->name:"NN", - b->asnumber,k,i*8+j); - empty=0; - } else { fprintf(f,"ip as-path access-list %s permit" " ^%u(_[0-9]+)*_(%u", b->name?b->name:"NN", b->asnumber,k*65536+i*8+j); empty=0; }; } else { - if(b->asdot && k>0) { - fprintf(f,"|%u.%u",k,i*8+j); - empty=0; - } else { fprintf(f,"|%u",k*65536+i*8+j); empty=0; }; @@ -75,8 +58,6 @@ bgpq4_print_cisco_aspath(FILE* f, struct bgpq_expander* b) }; }; }; - }; - }; if(nc) fprintf(f,")$\n"); if(empty) fprintf(f,"ip as-path access-list %s deny .*\n", b->name?b->name:"NN"); @@ -129,15 +110,10 @@ bgpq4_print_cisco_oaspath(FILE* f, struct bgpq_expander* b) if(b->asn32s[b->asnumber/65536] && b->asn32s[b->asnumber/65536][(b->asnumber%65536)/8]& (0x80>>(b->asnumber%8))) { - if(b->asdot && b->asnumber>65535) { - fprintf(f,"ip as-path access-list %s permit ^(_%u.%u)*$\n", - b->name?b->name:"NN",b->asnumber/65536,b->asnumber%65536); - } else { fprintf(f,"ip as-path access-list %s permit ^(_%u)*$\n", b->name?b->name:"NN",b->asnumber); }; empty=0; - }; for(k=0;k<65536;k++) { if(!b->asn32s[k]) continue; for(i=0;i<8192;i++) { @@ -145,22 +121,12 @@ bgpq4_print_cisco_oaspath(FILE* f, struct bgpq_expander* b) if(b->asn32s[k][i]&(0x80>>j)) { if(k*65536+i*8+j==b->asnumber) continue; if(!nc) { - if(b->asdot && k>0) { - fprintf(f,"ip as-path access-list %s permit" - " ^(_[0-9]+)*_(%u.%u", b->name?b->name:"NN", - k,i*8+j); - empty=0; - } else { fprintf(f,"ip as-path access-list %s permit" " ^(_[0-9]+)*_(%u", b->name?b->name:"NN", k*65536+i*8+j); empty=0; }; } else { - if(b->asdot && k>0) { - fprintf(f,"|%u.%u",k,i*8+j); - empty=0; - } else { fprintf(f,"|%u",k*65536+i*8+j); empty=0; }; @@ -172,8 +138,6 @@ bgpq4_print_cisco_oaspath(FILE* f, struct bgpq_expander* b) }; }; }; - }; - }; if(nc) fprintf(f,")$\n"); if(empty) fprintf(f,"ip as-path access-list %s deny .*\n", b->name?b->name:"NN");