summaryrefslogtreecommitdiff
path: root/sbin/ipsecctl/pfkey.c
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2005-06-30 18:27:15 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2005-06-30 18:27:15 +0000
commitbcab5e119c99fa4f9edaffe18b718acdb91e1ab8 (patch)
tree3782f6584718b8eb66e962348f8b322c2f57ff9d /sbin/ipsecctl/pfkey.c
parent684e3413fcdac5b7899b78631f55beaa4ee786de (diff)
Prepare for flow deletion, no functional change yet.
Diffstat (limited to 'sbin/ipsecctl/pfkey.c')
-rw-r--r--sbin/ipsecctl/pfkey.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sbin/ipsecctl/pfkey.c b/sbin/ipsecctl/pfkey.c
index 29c85f83e37..98749b8b24e 100644
--- a/sbin/ipsecctl/pfkey.c
+++ b/sbin/ipsecctl/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.8 2005/05/27 19:55:21 hshoexer Exp $ */
+/* $OpenBSD: pfkey.c,v 1.9 2005/06/30 18:27:14 hshoexer Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
* Copyright (c) 2003, 2004 Markus Friedl <markus@openbsd.org>
@@ -46,7 +46,7 @@ static int pfkey_flow(int, u_int8_t, u_int8_t, u_int8_t, struct ipsec_addr *,
struct ipsec_auth);
static int pfkey_reply(int);
int pfkey_ipsec_flush(void);
-int pfkey_ipsec_establish(struct ipsec_rule *);
+int pfkey_ipsec_establish(int, struct ipsec_rule *);
int pfkey_init(void);
static int
@@ -563,10 +563,18 @@ pfkey_parse(struct sadb_msg *msg, struct ipsec_rule *rule)
}
int
-pfkey_ipsec_establish(struct ipsec_rule *r)
+pfkey_ipsec_establish(int action, struct ipsec_rule *r)
{
- u_int8_t satype;
- u_int8_t direction;
+ u_int8_t satype, direction, sa_act;
+
+ switch (action) {
+ case PFK_ACTION_ADD:
+ sa_act = SADB_X_ADDFLOW;
+ break;
+ case PFK_ACTION_DELETE:
+ default:
+ return -1;
+ }
switch (r->proto) {
case IPSEC_ESP: