History log of /openbsd-current/usr.sbin/bgpctl/parser.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.46 21-Apr-2023 claudio

Implement flowspec add and delete to add/remove flowspec rules dynamically.
OK tb@


# 1.45 20-Apr-2023 claudio

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 tags: OPENBSD_7_3_BASE
# 1.44 17-Oct-2022 claudio

SHOW_METRICS for the actions enum. Just to match the rest.


# 1.43 17-Oct-2022 claudio

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 tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.42 06-Feb-2022 claudio

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


Revision tags: OPENBSD_7_0_BASE
# 1.41 09-Aug-2021 claudio

Make it possible to match on path-id in bgpctl show rib outputs.
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@


Revision tags: OPENBSD_6_9_BASE
# 1.40 16-Feb-2021 claudio

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


# 1.39 30-Dec-2020 claudio

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


Revision tags: OPENBSD_6_8_BASE
# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.44 17-Oct-2022 claudio

SHOW_METRICS for the actions enum. Just to match the rest.


# 1.43 17-Oct-2022 claudio

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 tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.42 06-Feb-2022 claudio

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


Revision tags: OPENBSD_7_0_BASE
# 1.41 09-Aug-2021 claudio

Make it possible to match on path-id in bgpctl show rib outputs.
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@


Revision tags: OPENBSD_6_9_BASE
# 1.40 16-Feb-2021 claudio

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


# 1.39 30-Dec-2020 claudio

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


Revision tags: OPENBSD_6_8_BASE
# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.42 06-Feb-2022 claudio

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


Revision tags: OPENBSD_7_0_BASE
# 1.41 09-Aug-2021 claudio

Make it possible to match on path-id in bgpctl show rib outputs.
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@


Revision tags: OPENBSD_6_9_BASE
# 1.40 16-Feb-2021 claudio

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


# 1.39 30-Dec-2020 claudio

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


Revision tags: OPENBSD_6_8_BASE
# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.41 09-Aug-2021 claudio

Make it possible to match on path-id in bgpctl show rib outputs.
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@


Revision tags: OPENBSD_6_9_BASE
# 1.40 16-Feb-2021 claudio

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


# 1.39 30-Dec-2020 claudio

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


Revision tags: OPENBSD_6_8_BASE
# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.40 16-Feb-2021 claudio

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


# 1.39 30-Dec-2020 claudio

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


Revision tags: OPENBSD_6_8_BASE
# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.39 30-Dec-2020 claudio

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


Revision tags: OPENBSD_6_8_BASE
# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.38 10-May-2020 deraadt

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 tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.37 25-Jun-2019 claudio

Remove irrfilter from bgpctl. The current code is not very useful.
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@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.36 17-Jun-2019 claudio

Adjust and sync the code with the new struct community code from bgpd.
OK benno@


Revision tags: OPENBSD_6_5_BASE
# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.35 11-Feb-2019 claudio

Adjust to last bgpd commit changing the MPLS VPN configuration.
Sync the community handling code to be in sync with parsing code of bgpd.
To inject networks into MPLS VPN it is required to specify the route
distinguisher as part of the attributes.
With and OK dlg@, OK denis@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.34 20-Jan-2019 claudio

Allow 'neighbor descripton' to be used like neighbor group description
which will match all neighbors in that group. Works for
bgpctl neighbor group <name> [clear|destroy|down|refresh|up]
bgpctl show neighbor group <name> [messages|terse|timers]
bgpctl show rib neighbor group <name> ...
Manpage bits from sthen@
OK benno@ sthen@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.33 19-Dec-2018 claudio

Adjust bgpctl now that filter_extcommunity is no more.
OK benno@


# 1.32 28-Nov-2018 claudio

Adjust bgpctl to handle the community changes done in bgpd.
OK job@, phessler@


Revision tags: OPENBSD_6_4_BASE
# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


# 1.31 01-Oct-2018 job

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@


Revision tags: OPENBSD_6_2_BASE
# 1.30 10-Aug-2017 benno

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@


Revision tags: OPENBSD_6_1_BASE
# 1.29 13-Jan-2017 phessler

Add support for draft-ietf-idr-shutdown

BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@


# 1.28 14-Oct-2016 phessler

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@


Revision tags: OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.27 17-Apr-2015 phessler

parse_prefix in parse.c got changed but the declaration in bgpctl.c
wasn't updated, so we would crash when doing `bgpctl net bulk` commands.

Fix by moving parse_prefix into a header, since we use it in more than
one file.

crash found by henning@
underlying problem found by blambert@

OK sthen@ deraadt@ claudio@ henning@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
# 1.26 09-Oct-2013 phessler

Allow us to bulk add / delete routes with the same attributes. Really
useful for distributing IP lists.

OK beck@, claudio@, henning@


Revision tags: OPENBSD_5_4_BASE
# 1.25 07-Mar-2013 claudio

Implement a bgpctl nei foo destroy that will remove the specified cloned
neighbor. The neighbor must be set down before calling this function.
OK phessler


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.24 27-May-2012 claudio

Make it possible to load mrt table dumps into bgpd. This is a debug tool but
it allows anyone to use MRT table dumps to load prefixes into a bgpd instance.
For example you can download the RIPE dumps and load full-feeds onto your
laptop until the poor thing dies.
OK henning@ sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.23 21-Sep-2011 claudio

Make it possible to parse MRT table dumps (all 3 formats) and display
them like the show rib / show rib detail output. It is also possible
to filter the output. e.g.
bgpctl show mrt file ./bview.20110914.1600 as 22512 204.209.0.0/16 all
OK sthen@, put it in henning@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.22 03-May-2010 claudio

Adjustments for multiple kroute table support. This adds a few new command
arguments (show tables and show fib table 1, etc).
Tested by sthen@, OK to move on by henning@


Revision tags: OPENBSD_4_7_BASE
# 1.21 10-Jan-2010 claudio

ribreq uses now a AID, use AID also on the parsing side and convert to
AF when necessary. OK henning@


# 1.20 02-Nov-2009 claudio

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea


Revision tags: OPENBSD_4_6_BASE
# 1.19 06-Jun-2009 claudio

bgpctl part of allowing alternate RIBs to be shown. Had to use the
keyword table because show rib rib foo is strange.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.18 07-Jun-2008 henning

teach the command lineparser about getopt style options after commands
use that for irrfilter mode.
hints from theo a year ago, code by me a year ago, ok claudio a year ago


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.17 06-Apr-2007 claudio

Implement "bgpctl show neighbor <peer> terse" this will print all statistics
in an easily parseable form. This output can be used to implement SNMP MIBs
or rrdtool/mrtg update scripts. OK henning@


# 1.16 28-Mar-2007 henning

add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio


Revision tags: OPENBSD_4_1_BASE
# 1.15 03-Mar-2007 henning

add irrfilter mode.
generates bgpd filter rules from the Internet Routing Registry aka IRR aka
the aut-num, as-set and route objects in the RIPE, ARIN, APNIC ... databases
accessed via whois, using the Routing Policy Specificaion Language RPSL.
implement the whois query interface, an RPSL parser (of course only the
parts we need), recursive as-set resolver, prefixes per AS lookup,
and an ouput module to make up the rules.
work in progress, not ready for general consumption yet.
import agreed by theo & claudio


Revision tags: OPENBSD_4_0_BASE
# 1.14 23-Aug-2006 claudio

Extend show rib command. Following new options are added:
in: show the unfiltered input of a neighbor aka adj-rib-in
out: show only the prefixes that are sent to a specified neighbor (adj-rib-out)
neighbor <IP>: limit the output of the command to prefixes sent by the
specified neighbor

OK henning@ manpage with help by jmc@ but the show rib section needs some
rework because it starts to be confusing. Actually the parser needs to get
smarter.


# 1.13 15-Jun-2006 claudio

Shuffle some vars to make the struct ordered by size.


# 1.12 23-May-2006 henning

support requesting route refresh from a neighbor


Revision tags: OPENBSD_3_9_BASE
# 1.11 24-Jan-2006 henning

introduce "bgpctl show summary terse", shows summary in an easy to parse
format, intended for monitoring puposes. claudio ok


# 1.10 03-Jan-2006 claudio

Show RIB statistics via "bgpctl show rib mem".


Revision tags: OPENBSD_3_8_BASE
# 1.9 06-Jun-2005 henning

add support for a "family" token, allows to select address families


# 1.8 23-May-2005 claudio

Make it possible to dynamicaly add networks with attributes like communities
or metrics. Requested by beck@ OK henning@


Revision tags: OPENBSD_3_7_BASE
# 1.7 23-Dec-2004 henning

allow "bgpctl neighbor" to take the peer's descr as argument as well
as its address
so "bgpctl neighbor upstream1 clear" now works and you don't have to
remember IPs
claudio ok


# 1.6 19-Nov-2004 claudio

Rename struct as_filter to struct filter_as.


Revision tags: OPENBSD_3_6_BASE
# 1.5 20-Aug-2004 henning

add support for "bgpctl neighbor 1.2.3.4 clear", takes session down & up again
claudio ok


# 1.4 21-May-2004 claudio

Make it possible to add, delete, flush and show network announcements.
OK henning@


Revision tags: OPENBSD_3_5_BASE
# 1.3 02-Mar-2004 claudio

show rib A.B.C.D and show rib A.B.C.D/N [all] support. Now the most important
show commands are available. OK henning@


# 1.2 26-Feb-2004 claudio

Implement "show rib" and "show rib <astype> <AS>" commands to dump the
RIB. OK henning@


# 1.1 21-Jan-2004 henning

new parser.
completely table driven and not wired into the action code like the
previous parser...
i wanted to do this for some time, and now it was just due.

ok claudio@