summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/bgpctl.c
AgeCommit message (Collapse)Author
9 daysConvert simple stuff in usr.sbin over to new imsgbuf_init behaviourClaudio Jeker
OK tb@
9 daysUnify error reporting in various control programs.Claudio Jeker
Just use "read error" since the code also uses "write error" for the imsg_flush case. OK tb@
9 daysRename imsg_init, imsg_clear, imsg_read, imsg_write and imsg_flush toClaudio Jeker
imsgbuf_init, imsgbuf_clear, imsgbuf_read, imsgbuf_write and imsgbuf_flush. This separates the imsgbuf API from the per-imsg API. OK tb@
9 daysUse imsg_flush() instead of implementing the same by hand.Claudio Jeker
OK tb@
2024-08-14Add 'bgpctl show rib filtered' support.Claudio Jeker
OK tb@
2024-05-22Adjust code since remote_bgpid, bgpid and clusterid changed toClaudio Jeker
host byte order. OK tb@
2024-02-01Convert the mrtparser to use ibufs in many places.Claudio Jeker
More is possible but for now this covers most of the message parsers. OK tb@
2024-01-31Convert IMSG_CTL_SHOW_RIB_ATTR over to the new ibuf API.Claudio Jeker
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@
2024-01-30Adjust bgpctl to work with the modified aspath functions from util.cClaudio Jeker
While doing that convert IMSG_CTL_SHOW_RIB over to the new ibuf api. OK tb@
2024-01-25Siwtch IMSG_CTL_SHOW_RIB_COMMUNITIES over to the new ibuf api.Claudio Jeker
Adjust fmt_ext_community() to take a uint64_t as argument instead of passing a pointer. OK tb@
2024-01-23Adopt bgpctl code to the ibuf changes done in bgpd.Claudio Jeker
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@
2024-01-18Convert the simple imsgs to use imsg_get_data().Claudio Jeker
OK tb@
2024-01-08Simplify the IMSG_CTL_KROUTE after the change in bgpd.Claudio Jeker
OK tb@
2023-11-20Rename struct imsgbuf *ibuf to *imsgbuf. Same was done in bgpd.Claudio Jeker
OK tb@
2023-11-20KNF, fix long line.Claudio Jeker
OK tb@
2023-09-06Add missing <sys/time.h> include for timespecsub()Claudio Jeker
2023-04-28Same change as in bgpd:Claudio Jeker
Add explicit default labels in switch() statements with error handling. Right now these are not reachable. Should also clear some gcc warnings. OK tb@
2023-04-23For FLOWSPEC_SHOW conver the AID form regular inet/inet6 to flowspec versions.Claudio Jeker
OK tb@
2023-04-21Adjust ext community handling to support the generic transitive communitiesClaudio Jeker
introduced with flowspec. OK tb@
2023-04-21Implement flowspec add and delete to add/remove flowspec rules dynamically.Claudio Jeker
OK tb@
2023-04-20Implement bgpctl show flowspec and bgpctl flowspec flush.Claudio Jeker
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@
2023-03-13Extend bgpctl show rib with two new options:Claudio Jeker
- invalid: show only routes that are not valid - leaked: show only routes where a route leak was detected OK tb@
2023-01-24Print the ASPA validation state (avs) in various show rib outputs.Claudio Jeker
OK tb@
2023-01-17Teach bgpctl about ASPA tables.Claudio Jeker
OK tb@
2022-10-18Fix some spelling errorsJob Snijders
Thanks Marco D'Itri for spotting them OK claudio@
2022-10-17SHOW_METRICS for the actions enum. Just to match the rest.Claudio Jeker
2022-10-17Implement openmetric output via bgpctl show metric commandClaudio Jeker
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@
2022-10-07Kill extra space in ext community ovs output.Claudio Jeker
Noticed by job@, OK tb@
2022-08-31Remove the hash statistics print code. The RDE no longer sends theseClaudio Jeker
imsgs. OK tb@
2022-08-17Use memset() instead of bzero().Claudio Jeker
OK tb@ deraadt@
2022-07-28Adjust bgpctl show fib output.Claudio Jeker
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@
2022-07-07Print dmetric for prefixes, this may still change in the future.Claudio Jeker
OK tb@
2022-06-27bgpctl bits for RFC 9234 support.Claudio Jeker
OK tb@
2022-06-23fmt_timeframe() cleanup. Remove the ring buffer, it is not required.Claudio Jeker
Ensure that the time_t is positive and print increadibly long timeframes of over 19 years just as weeks. OK tb@
2022-06-15Adjust after chaning F_BGPD_INSERTED to F_BGPD and removal of F_DYNAMICClaudio Jeker
2022-03-21Adjust to renaming of F_CTL_ACTIVE/F_PREF_ACTIVE to F_CTL_ACTIVE/F_PREF_BESTClaudio Jeker
OK tb@
2022-02-06Switch from u_intX_t types to stdint.h uintX_t like it was done in bgpd.Claudio Jeker
OK florian@ tb@
2022-02-04Rename sockaddr_un sun to sa_un since sun is defined on illumos systems.Claudio Jeker
OK dlg@
2021-08-09Make it possible to match on path-id in bgpctl show rib outputs.Claudio Jeker
To work properly also a neighbor needs to be selected. The assumption here is that the peer will use the same path-id for the same peer accross all its routes. The RFC does not require this and it is valid to assign path-ids randomly. The path-id only matters for one specific path but most BGP implementations seem to assign the same path-id to multiple routes when originated from the same source. OK benno@
2021-08-02Show if add_path was used when decoding the BGP message in MRT format.Claudio Jeker
This may help to spot encoding errors a bit more easily.
2021-07-27Implemnt the RFC8050 in the MRT parser. With this MRT dumps containingClaudio Jeker
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@
2021-07-20Also add missing -V to usageClaudio Jeker
2021-06-16Add command line option to show the versionjob
OK claudio@
2021-05-27Add the bits needed in bgpctl to show the new ADD-PATH and enhancedClaudio Jeker
route refresh capabilities in the neighbor output.
2021-05-03Print the timestamps both formatted and as a time in seconds field inClaudio Jeker
the various JSON object that have time values. OK benno@
2021-04-15Fix bgpctl show mrt for UPDATE messages. The call to output->attr() wasClaudio Jeker
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@
2021-02-16Add `bgpctl show rtr` to display basic information about RTR sessions.Claudio Jeker
OK job@
2020-12-30Add 'bgpctl show sets' to display information about the roa-set, as-sets,Claudio Jeker
and prefix-sets loaded into bgpd. OK benno@
2020-05-10In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')Theo de Raadt
to be more generic, then change 'reload' to take take a '[reason]' also, which will be logged by bgpd. ok kn claudio
2020-05-02Add support to output data in JSON. This is still work in progress andClaudio Jeker
the output structures may still change but it should be a good starting point for poeple to start playing with it. OK benno@, job@, deraadt@