From: Job Snijders Subject: Re: rpki-client: remove bird1, add bird3 To: tech@openbsd.org Date: Fri, 3 Jan 2025 01:33:38 +0000 On Fri, Dec 20, 2024 at 04:31:22PM +0000, Stuart Henderson wrote: > On 2024/12/19 16:31, Job Snijders wrote: > > Remove BIRD 1 output, because BIRD 1 no longer is maintained & > > supported. While there, add BIRD 3 support, which has ASPA. > > 2.16 has ASPA too. For simplicity bird3/output_bird3 probably do > make sense, but would it be worth a quick note in the manual? > > > .Pa bird > > (for bird2) > > +.Pa bird3 > > +(for bird3) > > (for bird 2.16 or newer) Ok, let's simplify things and output just one BIRD file while documenting 2.16 or higher is required. The below works with bird2 and bird3 in ports. OK? Index: extern.h =================================================================== RCS file: /cvs/src/usr.sbin/rpki-client/extern.h,v diff -u -p -r1.235 extern.h --- extern.h 2 Jan 2025 12:29:30 -0000 1.235 +++ extern.h 3 Jan 2025 01:27:48 -0000 @@ -969,9 +969,7 @@ int outputfiles(struct vrp_tree *v, st int outputheader(FILE *, struct stats *); int output_bgpd(FILE *, struct vrp_tree *, struct brk_tree *, struct vap_tree *, struct vsp_tree *, struct stats *); -int output_bird2(FILE *, struct vrp_tree *, struct brk_tree *, - struct vap_tree *, struct vsp_tree *, struct stats *); -int output_bird3(FILE *, struct vrp_tree *, struct brk_tree *, +int output_bird(FILE *, struct vrp_tree *, struct brk_tree *, struct vap_tree *, struct vsp_tree *, struct stats *); int output_csv(FILE *, struct vrp_tree *, struct brk_tree *, struct vap_tree *, struct vsp_tree *, struct stats *); Index: output-bird.c =================================================================== RCS file: /cvs/src/usr.sbin/rpki-client/output-bird.c,v diff -u -p -r1.20 output-bird.c --- output-bird.c 2 Jan 2025 12:29:30 -0000 1.20 +++ output-bird.c 3 Jan 2025 01:27:48 -0000 @@ -21,56 +21,7 @@ #include "extern.h" int -output_bird2(FILE *out, struct vrp_tree *vrps, struct brk_tree *brks, - struct vap_tree *vaps, struct vsp_tree *vsps, struct stats *st) -{ - extern const char *bird_tablename; - struct vrp *v; - time_t now = get_current_time(); - - if (outputheader(out, st) < 0) - return -1; - - if (fprintf(out, "\ndefine force_roa_table_update = %lld;\n\n" - "roa4 table %s4;\nroa6 table %s6;\n\n" - "protocol static {\n\troa4 { table %s4; };\n\n", - (long long)now, bird_tablename, bird_tablename, - bird_tablename) < 0) - return -1; - - RB_FOREACH(v, vrp_tree, vrps) { - char buf[64]; - - if (v->afi == AFI_IPV4) { - ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); - if (fprintf(out, "\troute %s max %u as %u;\n", buf, - v->maxlength, v->asid) < 0) - return -1; - } - } - - if (fprintf(out, "}\n\nprotocol static {\n\troa6 { table %s6; };\n\n", - bird_tablename) < 0) - return -1; - - RB_FOREACH(v, vrp_tree, vrps) { - char buf[64]; - - if (v->afi == AFI_IPV6) { - ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); - if (fprintf(out, "\troute %s max %u as %u;\n", buf, - v->maxlength, v->asid) < 0) - return -1; - } - } - - if (fprintf(out, "}\n") < 0) - return -1; - return 0; -} - -int -output_bird3(FILE *out, struct vrp_tree *vrps, struct brk_tree *brks, +output_bird(FILE *out, struct vrp_tree *vrps, struct brk_tree *brks, struct vap_tree *vaps, struct vsp_tree *vsps, struct stats *st) { extern const char *bird_tablename; @@ -78,6 +29,9 @@ output_bird3(FILE *out, struct vrp_tree struct vap *vap; time_t now = get_current_time(); size_t i; + + if (fprintf(out, "# For BIRD 2.16+\n#\n") < 0) + return -1; if (outputheader(out, st) < 0) return -1; Index: output.c =================================================================== RCS file: /cvs/src/usr.sbin/rpki-client/output.c,v diff -u -p -r1.37 output.c --- output.c 2 Jan 2025 12:29:30 -0000 1.37 +++ output.c 3 Jan 2025 01:27:48 -0000 @@ -67,8 +67,7 @@ static const struct outputs { struct vap_tree *, struct vsp_tree *, struct stats *); } outputs[] = { { FORMAT_OPENBGPD, "openbgpd", output_bgpd }, - { FORMAT_BIRD, "bird", output_bird2 }, - { FORMAT_BIRD, "bird3", output_bird3 }, + { FORMAT_BIRD, "bird", output_bird }, { FORMAT_CSV, "csv", output_csv }, { FORMAT_JSON, "json", output_json }, { FORMAT_OMETRIC, "metrics", output_ometric }, Index: rpki-client.8 =================================================================== RCS file: /cvs/src/usr.sbin/rpki-client/rpki-client.8,v diff -u -p -r1.117 rpki-client.8 --- rpki-client.8 2 Jan 2025 17:08:32 -0000 1.117 +++ rpki-client.8 3 Jan 2025 01:27:48 -0000 @@ -71,13 +71,15 @@ The default is not to include them. Exclude the ASPA-set from the output files that support it (JSON and OpenBGPD). .It Fl B -Create output in the files +Create output in the file .Pa bird -(for bird2) +in the output directory suitable for BIRD internet routing daemon version +2.16 and up. +The validated payload table names are +.Em ROAS4 , +.Em ROAS6 , and -.Pa bird3 -(for bird3) -in the output directory which is suitable for the BIRD internet routing daemon. +.Em ASPAS . .It Fl b Ar sourceaddr Tell the HTTP and rsync clients to use .Ar sourceaddr