summaryrefslogtreecommitdiff
path: root/sbin/ipsecctl
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2020-04-23 19:57:02 +0000
committertobhe <tobhe@cvs.openbsd.org>2020-04-23 19:57:02 +0000
commiteed9d5297e393aa212e99b0d044ac49035fa8f83 (patch)
treed645a9099d38c87f6ecb9acf5e2656607a8f5de4 /sbin/ipsecctl
parent597e7ab23581ec2c24c0686215d296ffa73a69f8 (diff)
Support SADB_X_EXT_RDOMAIN extension in pfkey dump (-m).
ok markus@, patrick@
Diffstat (limited to 'sbin/ipsecctl')
-rw-r--r--sbin/ipsecctl/pfkdump.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sbin/ipsecctl/pfkdump.c b/sbin/ipsecctl/pfkdump.c
index 3ab5ea17c4c..12611c28828 100644
--- a/sbin/ipsecctl/pfkdump.c
+++ b/sbin/ipsecctl/pfkdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkdump.c,v 1.49 2019/07/03 03:24:02 deraadt Exp $ */
+/* $OpenBSD: pfkdump.c,v 1.50 2020/04/23 19:57:01 tobhe Exp $ */
/*
* Copyright (c) 2003 Markus Friedl. All rights reserved.
@@ -56,6 +56,7 @@ static void print_life(struct sadb_ext *, struct sadb_msg *, int);
static void print_ident(struct sadb_ext *, struct sadb_msg *, int);
static void print_udpenc(struct sadb_ext *, struct sadb_msg *, int);
static void print_tag(struct sadb_ext *, struct sadb_msg *, int);
+static void print_rdomain(struct sadb_ext *, struct sadb_msg *, int);
static void print_tap(struct sadb_ext *, struct sadb_msg *, int);
static void print_satype(struct sadb_ext *, struct sadb_msg *, int);
static void print_counter(struct sadb_ext *, struct sadb_msg *, int);
@@ -106,6 +107,7 @@ struct idname ext_types[] = {
{ SADB_X_EXT_UDPENCAP, "udpencap", print_udpenc },
{ SADB_X_EXT_LIFETIME_LASTUSE, "lifetime_lastuse", print_life },
{ SADB_X_EXT_TAG, "tag", print_tag },
+ { SADB_X_EXT_RDOMAIN, "rdomain", print_rdomain },
{ SADB_X_EXT_TAP, "tap", print_tap },
{ SADB_X_EXT_SATYPE2, "satype2", print_satype },
{ SADB_X_EXT_COUNTER, "counter", print_counter },
@@ -582,6 +584,16 @@ print_udpenc(struct sadb_ext *ext, struct sadb_msg *msg, int opts)
printf("udpencap port %u", ntohs(x_udpencap->sadb_x_udpencap_port));
}
+/* ARGSUSED1 */
+static void
+print_rdomain(struct sadb_ext *ext, struct sadb_msg *msg, int opts)
+{
+ struct sadb_x_rdomain *srdomain = (struct sadb_x_rdomain *)ext;
+
+ printf("%d/%d", srdomain->sadb_x_rdomain_dom1,
+ srdomain->sadb_x_rdomain_dom2);
+}
+
static void
setup_extensions(struct sadb_msg *msg)
{