summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/printconf.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-09-07 05:43:34 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-09-07 05:43:34 +0000
commitae9a4d385acb942df3b17ec97f7295d2e6106b3f (patch)
treef1d04553a554f01060644a41855abaa31750bf79 /usr.sbin/bgpd/printconf.c
parent7f2f3f8766805f6ee2291486a2fc78de71fb68ed (diff)
Implement as-set a fast lookup table to be used instead of long list of
AS numbers in source-as, AS and transit-as filterstatements. These table use bsearch to quickly verify if an AS is in the set or not. The filter syntax is not fully set in stone yet. OK denis@ benno@ and previously OK deraadt@
Diffstat (limited to 'usr.sbin/bgpd/printconf.c')
-rw-r--r--usr.sbin/bgpd/printconf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index 0690679cac2..c116a3c3eea 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.111 2018/09/05 17:32:43 claudio Exp $ */
+/* $OpenBSD: printconf.c,v 1.112 2018/09/07 05:43:33 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -606,6 +606,10 @@ print_announce(struct peer_config *p, const char *c)
void print_as(struct filter_rule *r)
{
+ if (r->match.as.flags & AS_FLAG_AS_SET_NAME) {
+ printf("as-set \"%s\" ", r->match.as.name);
+ return;
+ }
switch(r->match.as.op) {
case OP_RANGE:
printf("%s - ", log_as(r->match.as.as_min));
@@ -862,7 +866,7 @@ print_config(struct bgpd_config *conf, struct rib_names *rib_l,
}
printf("\n");
print_prefixsets(conf->prefixsets);
- printf("\n");
+ print_as_sets(conf->as_sets);
print_mrt(conf, 0, 0, "", "");
printf("\n");
print_groups(conf, peer_l);