--- main.c.orig 2024-02-12 17:57:03.000000000 +0100 +++ main.c 2025-02-22 23:15:48.928913000 +0100 @@ -68,6 +68,7 @@ printf(" -n2 : Nokia SR Linux\n"); printf(" -B : OpenBSD OpenBGPD\n"); printf(" -e : Arista EOS\n"); + printf(" -Z : FRRouting\n"); printf(" -F fmt : User defined format (example: '-F %%n/%%l')\n"); printf("\nInput filters:\n"); @@ -97,7 +98,7 @@ printf(" -p : allow special ASNs like 23456 or in the private range"); printf(" -R len : allow more specific routes up to specified masklen\n"); printf(" -r len : allow more specific routes from masklen specified\n"); - printf(" -s : generate sequence numbers in prefix-lists (IOS only)\n"); + printf(" -s : generate sequence numbers in prefix-lists (IOS,EOS,FRR only)\n"); printf(" -t : generate as-sets for OpenBGPD (OpenBGPD 6.4+), BIRD " "and JSON formats\n"); printf(" -z : generate route-filter-list (Junos only)\n"); @@ -201,7 +202,7 @@ expander.sources=getenv("IRRD_SOURCES"); while ((c = getopt(argc, argv, - "23467a:AbBdDEeF:S:jJKf:l:L:m:M:NnpW:r:R:G:H:tTh:UuwXsvz")) != EOF) { + "23467a:AbBdDEeF:S:jJKf:l:L:m:M:NnpW:r:R:G:H:tTh:UuwXsvZz")) != EOF) { switch (c) { case '2': if (expander.vendor != V_NOKIA_MD) { @@ -458,6 +459,11 @@ exclusive(); expander.generation = T_ROUTE_FILTER_LIST; break; + case 'Z': + if (expander.vendor) + vendor_exclusive(); + expander.vendor = V_FRR; + break; default: usage(1); } @@ -605,13 +611,19 @@ } if (expander.sequence - && (expander.vendor != V_CISCO && expander.vendor != V_ARISTA)) { + && (expander.vendor != V_CISCO && + expander.vendor != V_ARISTA && + expander.vendor != V_FRR )) { sx_report(SX_FATAL, "Sorry, prefix-lists sequencing (-s) supported" - " only for IOS and EOS\n"); + " only for IOS, EOS and FRR\n"); exit(1); } - if (expander.sequence && expander.generation < T_PREFIXLIST) { + if ( + (expander.sequence && expander.vendor != V_FRR ) && + (expander.sequence && + expander.generation < T_PREFIXLIST) + ) { sx_report(SX_FATAL, "Sorry, prefix-lists sequencing (-s) can't be " " used for non prefix-list\n"); exit(1);