summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/bgpctl.c
AgeCommit message (Collapse)Author
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@
2020-05-02Adjust fmt_attr() to pass in -1 for flags to tell it you don't careClaudio Jeker
about the flags of the attribute. Part of the JSON output diff. OK job@, benno@, deraadt@
2020-05-02Indirect the output functions through function pointers so that theyClaudio Jeker
can be changed easily. This will be used later on to add JSON output. OK benno@, job@, deraadt@
2020-03-20Reshuffle code more to separate out the output functions into output.c.Claudio Jeker
Rewrite some functions to return a string instead of calling printf directly. OK benno@
2020-01-24Extend 'bgpctl show neighbor' to include the received and sent prefixClaudio Jeker
count. Also show the max-prefix out limit if one is set. OK job@
2020-01-21Update get_errstr() to report errors like log_notification() in bgpd.Claudio Jeker
With this suberrors of cease will be reported which is very helpful. OK denis@ deraadt@
2020-01-09Adjust time printing to the changes done in bgpd. Most timestamps areClaudio Jeker
now relative only last_updown, last_read and lastwrite are still based on CLOCK_MONOTONIC. OK denis@
2019-12-31Rename print_timer() to show_timer() and move it to output.cClaudio Jeker
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.
2019-12-20Split out show functions into a new file called output.cClaudio Jeker
OK benno@
2019-12-20Shuffle the fmt_timeframe functions and change fmt_timeframe() to avoidClaudio Jeker
printing negative time frames (caused by jumping the system clock back in time). OK benno@
2019-12-20Change show_mrt_dump() to call show_rib() instead of the internalClaudio Jeker
show_rib_detail() and show_rib_brief() functions. OK benno@
2019-12-19Change the way individual show functions are called. Up until now an imsgClaudio Jeker
was passed to each function and output happened based on the imsg type. Now show() will look at the imsg and based on the type call the right function to output this type. Because of this every show function is now only displaying one specific object. OK benno@
2019-12-13Remove some more show_*_head() functions. Compiler agrees.Claudio Jeker
2019-12-13Remove show_rib_summary_head() it is no longer used.Claudio Jeker
Reminded by denis@
2019-12-13First step of refactoring the output processing of bgpctl. MoveClaudio Jeker
header printing into show_head() and printing of the data into show(), these are now the only entrypoints where data is printed. OK denis@
2019-11-27Adjust after changing the struct ctl_show_rib (removal of aspath_len)Claudio Jeker
OK benno@
2019-09-27Implement 'bgpctl show rib 8.8.8.8 or-shorter' to show all routes coveringClaudio Jeker
8.8.8.8. Additionally add 'or-longer' as an alias for 'all'. OK job@ sthen@
2019-09-25also show peer AS and description in "bgpctl sh nei group XXX terse" outputStuart Henderson
ok deraadt@ claudio@
2019-09-24add the neighbour's address, to disambiguate peers in the output fromStuart Henderson
"bgpctl sh nei group XX terse". feedback benno@ ok claudio@
2019-08-05Add a comment why network_bulk() is not using send_filterset(). UsingClaudio Jeker
send_filterset() would result in a use after free because send_filterset() frees the set after sending but network_bulk() runs in a loop.
2019-07-03Remove unneccessary type castClaudio Jeker
2019-06-25Remove irrfilter from bgpctl. The current code is not very useful.Claudio Jeker
Trying to parse RPSL has shown to be impossible. For now tools like bgpq3 (in ports) can be used to generate AS and prefix sets based on IRR data. OK job@ deraadt@ sthen@ benno@
2019-06-17Cleanup some spaces here as well. Again no binary change.Claudio Jeker
2019-06-17Adjust and sync the code with the new struct community code from bgpd.Claudio Jeker
OK benno@
2019-05-23Implement bgpctl show mrt neighbors, a command to print the neighbor tableClaudio Jeker
of MRT TABLE_DUMP_V2 dumps. It only works with TABLE_DUMP_V2 dumps on other table dumps the neighbor of the first entry is printed since those table dumps don't have a neighbor table. OK sthen@ benno@