summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/printconf.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-05-08 17:40:54 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-05-08 17:40:54 +0000
commit28c7c148d800bbae6bf377af3648493f844624c9 (patch)
tree17f967d6bf06204cc19a4718e79bae4a4f2a1500 /usr.sbin/bgpd/printconf.c
parentb0dac668894a2468b9e9c4e09a27a01f21aac758 (diff)
add support for ipsec ah with manual keys, pfkey part already does so, and
flesh parser out a bit. also add support for printing ipsec ah with manual keys in printconf
Diffstat (limited to 'usr.sbin/bgpd/printconf.c')
-rw-r--r--usr.sbin/bgpd/printconf.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index e6b9d17c725..439d5bf7033 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.17 2004/04/28 04:34:46 henning Exp $ */
+/* $OpenBSD: printconf.c,v 1.18 2004/05/08 17:40:53 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -128,6 +128,7 @@ print_peer(struct peer_config *p)
const char *tab = "\t";
const char *nada = "";
const char *c;
+ char *method;
if (p->group[0]) {
printf("group \"%s\" {\n", p->group);
@@ -170,14 +171,19 @@ print_peer(struct peer_config *p)
if (p->auth.method == AUTH_MD5SIG)
printf("%s\ttcp md5sig\n", c);
- else if (p->auth.method == AUTH_IPSEC_MANUAL_ESP) {
- printf("%s\tipsec esp in spi %u %s XXXXXX", c, p->auth.spi_in,
+ else if (p->auth.method == AUTH_IPSEC_MANUAL_ESP || p->auth.method == AUTH_IPSEC_MANUAL_AH) {
+ if (p->auth.method == AUTH_IPSEC_MANUAL_ESP)
+ method = "esp";
+ else
+ method = "ah";
+
+ printf("%s\tipsec %s in spi %u %s XXXXXX", c, method, p->auth.spi_in,
print_auth_alg(p->auth.auth_alg_in));
if (p->auth.enc_alg_in)
printf(" %s XXXXXX", print_enc_alg(p->auth.enc_alg_in));
printf("\n");
- printf("%s\tipsec esp out spi %u %s XXXXXX", c, p->auth.spi_out,
+ printf("%s\tipsec %s out spi %u %s XXXXXX", c, method, p->auth.spi_out,
print_auth_alg(p->auth.auth_alg_out));
if (p->auth.enc_alg_out)
printf(" %s XXXXXX",