summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpctl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* off by one in bounds testjsg2021-03-012-4/+4
| | | | ok claudio@
* Add `bgpctl show rtr` to display basic information about RTR sessions.claudio2021-02-167-23/+134
| | | | OK job@
* Adjust code since bgpd added an extra argument to aspath_verify() toclaudio2021-01-252-6/+6
| | | | | reject AS_SET segments. In bgpctl this is always off. OK benno@
* Adjust code to the change of struct bgpd_addr in bgpd.claudio2021-01-181-5/+5
| | | | OK denis@
* Add 'bgpctl show sets' to display information about the roa-set, as-sets,claudio2020-12-306-5/+74
| | | | | and prefix-sets loaded into bgpd. OK benno@
* Include endian.h for htobe64().claudio2020-10-212-2/+4
|
* No need to include sys/cdefs.h hereclaudio2020-10-211-1/+0
|
* Remove unused token BULK and for PREFIX and ADDRESS the table value is alwaysclaudio2020-05-121-14/+2
| | | | | | NULL so there is no need to change action in those cases. This was used some time ago by the show rib code. OK kn@, sthen@, benno@, deraadt@
* Add support for VPNv6 in the family keyword of show ribclaudio2020-05-111-2/+8
| | | | OK benno@ phessler@
* In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')deraadt2020-05-106-42/+47
| | | | | | to be more generic, then change 'reload' to take take a '[reason]' also, which will be logged by bgpd. ok kn claudio
* Using int64_t together with printf %llu is not portable. Either add aclaudio2020-05-042-4/+4
| | | | | | | cast in the printf to unsigned long long or just use unsigned long long from the start. In this case it is better to switch the type. Similar changes had been done before. OK deraadt@
* Correctly name max_out_prefix and don't clobber the max_prefix value.claudio2020-05-031-2/+4
| | | | | | Also include the group name in the general neighbor description. Both issues reported by Patrick Velder OK deraadt@
* Minimal documentation of JSON output.claudio2020-05-021-3/+5
|
* Add support to output data in JSON. This is still work in progress andclaudio2020-05-026-6/+1218
| | | | | | 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@
* Adjust fmt_attr() to pass in -1 for flags to tell it you don't careclaudio2020-05-022-5/+4
| | | | | about the flags of the attribute. Part of the JSON output diff. OK job@, benno@, deraadt@
* Indirect the output functions through function pointers so that theyclaudio2020-05-023-47/+82
| | | | | can be changed easily. This will be used later on to add JSON output. OK benno@, job@, deraadt@
* Cleanup the output functions a bit. show_neighbor_full() should print someclaudio2020-05-021-48/+73
| | | | | | | | 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
* Reshuffle code more to separate out the output functions into output.c.claudio2020-03-203-612/+621
| | | | | Rewrite some functions to return a string instead of calling printf directly. OK benno@
* Extend 'bgpctl show neighbor' to include the received and sent prefixclaudio2020-01-242-3/+13
| | | | | count. Also show the max-prefix out limit if one is set. OK job@
* delete wasteful ;;deraadt2020-01-221-4/+4
| | | | ok tedu
* Report sent or received errors (normally not both at the same time).claudio2020-01-211-3/+7
| | | | | | With this the last notfication causing a session teardown will be shown in bgpctl show neighbor output. OK denis@ deraadt@
* Update get_errstr() to report errors like log_notification() in bgpd.claudio2020-01-211-14/+46
| | | | | With this suberrors of cease will be reported which is very helpful. OK denis@ deraadt@
* when parsing ASN, don't \0-split the original string, as it may be neededderaadt2020-01-161-5/+7
| | | | | for error reporting. ok benno
* Adjust time printing to the changes done in bgpd. Most timestamps areclaudio2020-01-093-17/+26
| | | | | | now relative only last_updown, last_read and lastwrite are still based on CLOCK_MONOTONIC. OK denis@
* Rename print_timer() to show_timer() and move it to output.cclaudio2019-12-313-15/+15
| | | | | | 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.
* Split out show functions into a new file called output.cclaudio2019-12-204-533/+577
| | | | OK benno@
* Shuffle the fmt_timeframe functions and change fmt_timeframe() to avoidclaudio2019-12-201-24/+28
| | | | | | printing negative time frames (caused by jumping the system clock back in time). OK benno@
* Change show_mrt_dump() to call show_rib() instead of the internalclaudio2019-12-201-4/+7
| | | | | show_rib_detail() and show_rib_brief() functions. OK benno@
* Change the way individual show functions are called. Up until now an imsgclaudio2019-12-191-551/+398
| | | | | | | | 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@
* Remove some more show_*_head() functions. Compiler agrees.claudio2019-12-131-54/+1
|
* Remove show_rib_summary_head() it is no longer used.claudio2019-12-131-13/+1
| | | | Reminded by denis@
* First step of refactoring the output processing of bgpctl. Moveclaudio2019-12-131-118/+175
| | | | | | header printing into show_head() and printing of the data into show(), these are now the only entrypoints where data is printed. OK denis@
* Adjust after changing the struct ctl_show_rib (removal of aspath_len)claudio2019-11-271-15/+20
| | | | OK benno@
* The size limit of the shutdown reason was relaxed to 255 characters butclaudio2019-10-191-8/+2
| | | | | | instead of mentioning the limit, remove it. bgpctl will properly error out if the reason is too long. OK job@ sthen@
* Implement 'bgpctl show rib 8.8.8.8 or-shorter' to show all routes coveringclaudio2019-09-273-14/+36
| | | | | 8.8.8.8. Additionally add 'or-longer' as an alias for 'all'. OK job@ sthen@
* also show peer AS and description in "bgpctl sh nei group XXX terse" outputsthen2019-09-252-7/+9
| | | | ok deraadt@ claudio@
* add the neighbour's address, to disambiguate peers in the output fromsthen2019-09-242-6/+22
| | | | "bgpctl sh nei group XX terse". feedback benno@ ok claudio@
* Add a comment why network_bulk() is not using send_filterset(). Usingclaudio2019-08-051-1/+5
| | | | | send_filterset() would result in a use after free because send_filterset() frees the set after sending but network_bulk() runs in a loop.
* Add a default case to subtype switch in the table v2 parser.claudio2019-07-031-1/+3
| | | | If a unknown subtype is encountered it is better to fail.
* Remove unneccessary type castclaudio2019-07-031-2/+2
|
* The bgpctl parser can not handle neighbor and neighbors at the same time.claudio2019-06-282-5/+5
| | | | | It will always complain that neighbor is ambiguous. Switch neighbors to peers to resolve the issue.
* Implement the bits and pieces that are needed to dump MRT_DUMP_V2_RIB_GENERICclaudio2019-06-281-109/+120
| | | | | messages and BGP MPLS VPNs. OK benno@
* Remove irrfilter from bgpctl. The current code is not very useful.claudio2019-06-2512-1681/+7
| | | | | | | 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@
* Cleanup some spaces here as well. Again no binary change.claudio2019-06-173-18/+18
|
* Adjust and sync the code with the new struct community code from bgpd.claudio2019-06-173-142/+266
| | | | OK benno@
* similar to note recently added to bgpd.conf(5), mention in docs forsthen2019-05-311-2/+9
| | | | | "bgpctl reload" that ipsec/md5sig and "export none/default-route" only take effect when the session is reset. sounds good to claudio
* Implement bgpctl show mrt neighbors, a command to print the neighbor tableclaudio2019-05-233-6/+35
| | | | | | | 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@
* make "bgpctl sh rib detail *out*" look less confusingbenno2019-05-141-2/+2
| | | | ok claudio@
* missing breakjsg2019-05-031-1/+2
| | | | ok benno@
* Adjust the MRT notification parser similar to bgpd to support extendedclaudio2019-04-251-7/+7
| | | | shutdown communication messages.