diff options
author | 2004-02-09 23:16:46 +0000 | |
---|---|---|
committer | 2004-02-09 23:16:46 +0000 | |
commit | 294d4e130725088882988d6e4009ecd9a2bf220c (patch) | |
tree | 6a2789fe9e35c9e780cf886c54eaafe59c1270b7 | |
parent | drain the list fluffier (diff) | |
download | wireguard-openbsd-294d4e130725088882988d6e4009ecd9a2bf220c.tar.xz wireguard-openbsd-294d4e130725088882988d6e4009ecd9a2bf220c.zip |
print networks too
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/printconf.c | 17 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 5 |
3 files changed, 19 insertions, 9 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 08937e3436e..2beedd33250 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.78 2004/02/09 23:10:04 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.79 2004/02/09 23:16:46 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -155,7 +155,7 @@ main(int argc, char *argv[]) if (conf.opts & BGPD_OPT_NOACTION) { if (conf.opts & BGPD_OPT_VERBOSE) - print_config(&conf, peer_l, rules_l); + print_config(&conf, &net_l, peer_l, rules_l); else fprintf(stderr, "configuration OK\n"); exit(0); @@ -522,5 +522,3 @@ send_imsg_session(int type, pid_t pid, void *data, u_int16_t datalen) { imsg_compose_pid(&ibuf_se, type, pid, data, datalen); } - - diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c index 5168cfbeb4e..281c88e0243 100644 --- a/usr.sbin/bgpd/printconf.c +++ b/usr.sbin/bgpd/printconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printconf.c,v 1.3 2004/02/09 01:46:34 henning Exp $ */ +/* $OpenBSD: printconf.c,v 1.4 2004/02/09 23:16:46 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -23,6 +23,7 @@ void print_op(enum comp_ops); void print_mainconf(struct bgpd_config *); +void print_network(struct network_config *); void print_peer(struct peer_config *); void print_rule(struct peer *, struct filter_rule *); @@ -80,6 +81,12 @@ print_mainconf(struct bgpd_config *conf) } void +print_network(struct network_config *n) +{ + printf("network %s/%u\n", log_addr(&n->prefix), n->prefixlen); +} + +void print_peer(struct peer_config *p) { const char *tab = "\t"; @@ -208,14 +215,18 @@ print_rule(struct peer *peer_l, struct filter_rule *r) } void -print_config(struct bgpd_config *conf, struct peer *peer_l, - struct filter_head *rules_l) +print_config(struct bgpd_config *conf, struct network_head *net_l, + struct peer *peer_l, struct filter_head *rules_l) { struct peer *p; struct filter_rule *r; + struct network *n; print_mainconf(conf); printf("\n"); + TAILQ_FOREACH(n, net_l, network_l) + print_network(&n->net); + printf("\n"); for (p = peer_l; p != NULL; p = p->next) print_peer(&p->conf); printf("\n"); diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 3e16d7e578b..237eb4bbec3 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.28 2004/02/09 01:38:55 henning Exp $ */ +/* $OpenBSD: session.h,v 1.29 2004/02/09 23:16:46 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -199,4 +199,5 @@ int pfkey_auth_remove(struct peer *p); int pfkey_init(void); /* printconf.c */ -void print_config(struct bgpd_config *, struct peer *, struct filter_head *); +void print_config(struct bgpd_config *, struct network_head *, struct peer *, + struct filter_head *); |