OpenBSD CVS

CVS log for src/usr.sbin/bgpctl/output.c


[BACK] Up to [local] / src / usr.sbin / bgpctl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.51 / (download) - annotate - [select for diffs], Wed May 22 08:42:34 2024 UTC (2 weeks, 5 days ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

Adjust code since remote_bgpid, bgpid and clusterid changed to
host byte order.
OK tb@

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jan 31 11:23:20 2024 UTC (4 months, 1 week ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.49: +101 -142 lines
Diff to previous 1.49 (colored)

Convert IMSG_CTL_SHOW_RIB_ATTR over to the new ibuf API.

This converts show_attr() and json_attr() and with that also the
community specific functions. This removes some hacks inside of
show_attr() that where added before.

OK tb@

Revision 1.49 / (download) - annotate - [select for diffs], Tue Jan 30 13:51:13 2024 UTC (4 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.48: +20 -21 lines
Diff to previous 1.48 (colored)

Adjust bgpctl to work with the modified aspath functions from util.c

While doing that convert IMSG_CTL_SHOW_RIB over to the new ibuf api.
OK tb@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Jan 25 09:54:21 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.47: +12 -12 lines
Diff to previous 1.47 (colored)

Siwtch IMSG_CTL_SHOW_RIB_COMMUNITIES over to the new ibuf api.

Adjust fmt_ext_community() to take a uint64_t as argument instead of
passing a pointer.
OK tb@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jan 23 16:16:15 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.46: +18 -25 lines
Diff to previous 1.46 (colored)

Adopt bgpctl code to the ibuf changes done in bgpd.

Adjust code that calls nlri_get_prefix() and friends to work with
an ibuf. show_mrt_update() is mostly converted because of this.
The output functions and the rest of the mrtparser are just
minimally touched to keep the diff reasonable.
OK tb@

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jan 11 14:34:49 2024 UTC (4 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.45: +5 -5 lines
Diff to previous 1.45 (colored)

Move the 'Last received shutdown reason:' output a bit down where it makes
more sense.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jan 11 13:09:41 2024 UTC (4 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.44: +3 -2 lines
Diff to previous 1.44 (colored)

Display the exported rtr session state and fix a missing indent.
OK tb@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jan 10 14:59:41 2024 UTC (4 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

Add missing newlines in printf.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Dec 19 10:32:20 2023 UTC (5 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Show the RTR protocol version in the `bgpctl show rtr` output.

Knowing the version is essential to understand if ASPA PDUs are included
or not.
OK tb@

Revision 1.42 / (download) - annotate - [select for diffs], Mon Nov 20 14:18:21 2023 UTC (6 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

KNF

Revision 1.41 / (download) - annotate - [select for diffs], Fri Apr 28 13:24:25 2023 UTC (13 months, 1 week ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.40: +10 -7 lines
Diff to previous 1.40 (colored)

Same change as in bgpd:
Add explicit default labels in switch() statements with error handling.
Right now these are not reachable. Should also clear some gcc warnings.
OK tb@

Revision 1.40 / (download) - annotate - [select for diffs], Fri Apr 21 10:49:01 2023 UTC (13 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.39: +2 -3 lines
Diff to previous 1.39 (colored)

Adjust ext community handling to support the generic transitive communities
introduced with flowspec.
OK tb@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Apr 20 14:01:50 2023 UTC (13 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.38: +106 -1 lines
Diff to previous 1.38 (colored)

Implement bgpctl show flowspec and bgpctl flowspec flush.

This uses the flowspec.c file from bgpd and implements the output
for flowspec only for the text printer for now. That code uses a lot
of code from printconf.c
OK tb@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Mar 28 12:07:09 2023 UTC (14 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.37: +3 -5 lines
Diff to previous 1.37 (colored)

Use pt_size from struct rde_memstats instead of computing it by hand.
OK tb@

Revision 1.37 / (download) - annotate - [select for diffs], Thu Mar 9 13:13:14 2023 UTC (15 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.36: +11 -9 lines
Diff to previous 1.36 (colored)

Add role output to bgpctl, also adjust the capability output.
Note, this changes the JSON output of neighbors a bit.

Part of the large RFC9234 rework in bgpd.
OK tb@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jan 31 14:32:43 2023 UTC (16 months, 1 week ago) by job
Branch: MAIN
Changes since 1.35: +4 -4 lines
Diff to previous 1.35 (colored)

Improve whitespace alignment of RTR error reports

OK claudio@

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jan 24 15:50:10 2023 UTC (16 months, 2 weeks ago) by job
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Fix typo

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jan 24 11:29:34 2023 UTC (16 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.33: +10 -6 lines
Diff to previous 1.33 (colored)

Print the ASPA validation state (avs) in various show rib outputs.
OK tb@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jan 17 16:09:34 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Teach bgpctl about ASPA tables.
OK tb@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Nov 9 14:20:11 2022 UTC (19 months ago) by claudio
Branch: MAIN
Changes since 1.31: +3 -1 lines
Diff to previous 1.31 (colored)

Show the MPLS label of a L3VPN route in show fib output.
OK tb@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Nov 7 11:33:24 2022 UTC (19 months ago) by mbuhl
Branch: MAIN
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (colored)

Fix some spelling errors.
OK claudio@

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 17 12:01:19 2022 UTC (19 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@

Revision 1.29 / (download) - annotate - [select for diffs], Wed Aug 31 15:00:53 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.28: +1 -16 lines
Diff to previous 1.28 (colored)

Remove the hash statistics print code. The RDE no longer sends these
imsgs.
OK tb@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Aug 29 18:19:21 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.27: +2 -4 lines
Diff to previous 1.27 (colored)

aspath_refs is gone, adjust code

Revision 1.27 / (download) - annotate - [select for diffs], Mon Aug 29 14:58:15 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.26: +9 -6 lines
Diff to previous 1.26 (colored)

report pending update and withdraw routes in the show neighbor output.
OK tb@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Aug 10 10:21:47 2022 UTC (22 months ago) by claudio
Branch: MAIN
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

fixup header for bgpctl show network so it lines up again.
OK tb@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jul 28 10:40:25 2022 UTC (22 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.24: +5 -5 lines
Diff to previous 1.24 (colored)

Adjust bgpctl show fib output.

Remove F_DOWN from flags since kroutes can no longer be marked down.
Also clean up the flag printing code and printf() and increase the size
of destionation and gateway so that more IPv6 addrs fit.

OK tb@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jul 8 16:12:11 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

Use AID_MIN instead of 0 == AID_UNSPEC as foo loop start value where apropriate

OK tb@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jun 27 13:27:38 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.22: +20 -3 lines
Diff to previous 1.22 (colored)

bgpctl bits for RFC 9234 support.
OK tb@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 22 14:49:51 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.21: +10 -30 lines
Diff to previous 1.21 (colored)

Adjust code after changing struct ctl_show_nexthop to embed a struct kroute_full
OK tb@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jun 15 10:10:50 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Adjust after chaning F_BGPD_INSERTED to F_BGPD and removal of F_DYNAMIC

Revision 1.20 / (download) - annotate - [select for diffs], Sun Feb 6 09:52:32 2022 UTC (2 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.19: +38 -38 lines
Diff to previous 1.19 (colored)

Switch from u_intX_t types to stdint.h uintX_t like it was done in bgpd.
OK florian@ tb@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jul 30 09:45:52 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.18: +7 -7 lines
Diff to previous 1.18 (colored)

Fix the show rib detail output. The add_path condition was totally wrong.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jul 27 07:42:37 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.17: +19 -4 lines
Diff to previous 1.17 (colored)

Implemnt the RFC8050 in the MRT parser. With this MRT dumps containing
add-path information will be dumped properly.

There is one bit where this implementation is not in line with the RFC.
The encoding of DUMP_V2_RIB_GENERIC_ADDPATH for non IPv4 or IPv6 prefixes
is implemented the way gobgp did it (which seems to be the only other BGP
implementation that supports generic encoding). The RFC puts the path_id
in the NLRI for generic encoding instead of adding it to RIB entry struct
like in the IPv4 and IPv6 encoding. This is an open discussion point with
the RFC author.

OK benno@

Revision 1.17 / (download) - annotate - [select for diffs], Thu May 27 08:29:07 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.16: +69 -12 lines
Diff to previous 1.16 (colored)

Add the bits needed in bgpctl to show the new ADD-PATH and enhanced
route refresh capabilities in the neighbor output.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Apr 26 18:23:20 2021 UTC (3 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.15: +26 -11 lines
Diff to previous 1.15 (colored)

Print out both the sent "Neighbor capabilities" and the "Negotiated
capabilities" for a session. Especially the multiprotocol capability
can confuse because both sides need to allow a protocol to enable it.
The JSON code dumps all the capabilities for local, remote and negotiated.
OK denis@, sthen@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Apr 15 14:12:05 2021 UTC (3 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Fix bgpctl show mrt for UPDATE messages. The call to output->attr() was
incorrect. Adjust output->attr() to take a reqflag argument instead of
a struct parse_result pointer since that is the only bit needed.
Found by and OK procter@, OK deraadt@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Mar 1 08:02:34 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

off by one in bounds test
ok claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Feb 16 08:30:21 2021 UTC (3 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.12: +43 -3 lines
Diff to previous 1.12 (colored)

Add `bgpctl show rtr` to display basic information about RTR sessions.
OK job@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jan 25 09:17:33 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Adjust code since bgpd added an extra argument to aspath_verify() to
reject AS_SET segments. In bgpctl this is always off.
OK benno@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Dec 30 07:31:19 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.10: +22 -1 lines
Diff to previous 1.10 (colored)

Add 'bgpctl show sets' to display information about the roa-set, as-sets,
and prefix-sets loaded into bgpd.
OK benno@

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 21 06:52:45 2020 UTC (3 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

Include endian.h for htobe64().

Revision 1.9 / (download) - annotate - [select for diffs], Sun May 10 13:38:46 2020 UTC (4 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')
to be more generic,  then change 'reload' to take take a '[reason]' also,
which will be logged by bgpd.
ok kn claudio

Revision 1.8 / (download) - annotate - [select for diffs], Sat May 2 14:28:10 2020 UTC (4 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.7: +39 -15 lines
Diff to previous 1.7 (colored)

Indirect the output functions through function pointers so that they
can be changed easily. This will be used later on to add JSON output.
OK benno@, job@, deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Sat May 2 14:20:54 2020 UTC (4 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.6: +72 -47 lines
Diff to previous 1.6 (colored)

Cleanup the output functions a bit. show_neighbor_full() should print some
values only if the session is established or show it unconditonally (for
shutdown message and last notficiation error codes. Adjust show_attr()
a bit, print ORIGIN as string and add support for AID_VPN_IPv6.
General add some warning if length checks fail.
OK job@, benno@, deraadt@ as part of a bigger diff

Revision 1.6 / (download) - annotate - [select for diffs], Fri Mar 20 07:56:34 2020 UTC (4 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.5: +426 -29 lines
Diff to previous 1.5 (colored)

Reshuffle code more to separate out the output functions into output.c.
Rewrite some functions to return a string instead of calling printf directly.
OK benno@

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jan 24 05:46:00 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.4: +10 -2 lines
Diff to previous 1.4 (colored)

Extend 'bgpctl show neighbor' to include the received and sent prefix
count. Also show the max-prefix out limit if one is set.
OK job@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jan 21 11:16:35 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.3: +7 -3 lines
Diff to previous 1.3 (colored)

Report sent or received errors (normally not both at the same time).
With this the last notfication causing a session teardown will be shown
in bgpctl show neighbor output.
OK denis@ deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jan 9 11:57:04 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.2: +7 -6 lines
Diff to previous 1.2 (colored)

Adjust time printing to the changes done in bgpd. Most timestamps are
now relative only last_updown, last_read and lastwrite are still based
on CLOCK_MONOTONIC.
OK denis@

Revision 1.2 / (download) - annotate - [select for diffs], Tue Dec 31 14:09:27 2019 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.1: +12 -1 lines
Diff to previous 1.1 (colored)

Rename print_timer() to show_timer() and move it to output.c
Currently this needs a bit of a hack because fmt_timeframe()
does not really print a timeframe but instead needs a timestamp
relative to now. This needs to be adjusted but will be done later.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Dec 20 09:16:05 2019 UTC (4 years, 5 months ago) by claudio
Branch: MAIN

Split out show functions into a new file called output.c
OK benno@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.