summaryrefslogtreecommitdiff
path: root/sbin/iked/ikev2.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2010-06-11 12:47:19 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2010-06-11 12:47:19 +0000
commitb4a97bb0f97a73489e0fb62607cf537f02bc68ce (patch)
tree827a114e3f3ace8118b7ab8b6472235e13a385ee /sbin/iked/ikev2.c
parent35c47ac69946b4f4f8b51f9723733f8f8a19518a (diff)
add some infrastructure to support timers and initiator mode later.
Diffstat (limited to 'sbin/iked/ikev2.c')
-rw-r--r--sbin/iked/ikev2.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c
index 778508a4ac2..e7c5adfd4df 100644
--- a/sbin/iked/ikev2.c
+++ b/sbin/iked/ikev2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2.c,v 1.5 2010/06/10 14:08:37 reyk Exp $ */
+/* $OpenBSD: ikev2.c,v 1.6 2010/06/11 12:47:18 reyk Exp $ */
/* $vantronix: ikev2.c,v 1.101 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -57,6 +57,7 @@ struct iked_sa *
void ikev2_cb(int, short, void *);
void ikev2_recv(struct iked *, struct iked_message *);
+void ikev2_initiator(struct iked *, struct iked_policy *);
int ikev2_resp_ike_sa_init(struct iked *, struct iked_message *);
int ikev2_resp_ike_auth(struct iked *, struct iked_sa *);
@@ -105,7 +106,13 @@ ikev2_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
return (config_getcoupled(env, imsg->hdr.type));
case IMSG_CTL_ACTIVE:
case IMSG_CTL_PASSIVE:
- return (config_getmode(env, imsg->hdr.type));
+ if (config_getmode(env, imsg->hdr.type) == -1)
+ return (0); /* ignore error */
+ if (env->sc_passive)
+ timer_unregister_initiator(env);
+ else
+ timer_register_initiator(env, ikev2_initiator);
+ return (0);
case IMSG_UDP_SOCKET:
return (config_getsocket(env, imsg, ikev2_msg_cb));
case IMSG_PFKEY_SOCKET:
@@ -464,6 +471,13 @@ ikev2_recv(struct iked *env, struct iked_message *msg)
sa_free(env, msg->msg_sa);
}
+void
+ikev2_initiator(struct iked *env, struct iked_policy *pol)
+{
+ /* XXX */
+ log_debug("%s: not implemented", __func__);
+}
+
int
ikev2_policy2id(struct iked_static_id *polid, struct iked_id *id, int srcid)
{