summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2011-05-05 12:17:11 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2011-05-05 12:17:11 +0000
commit8aa1be5fb418a5449e5c1c44fd36b61cd6550336 (patch)
treef373768d13d79d8664334fe30c2395f1e41eeaca /sbin/iked
parent3507176bda3b5c66ab178e2eab9e1daf6502a7c3 (diff)
rename iked_proc* to privsep_proc*. no functional change.
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/ca.c24
-rw-r--r--sbin/iked/config.c14
-rw-r--r--sbin/iked/iked.c16
-rw-r--r--sbin/iked/iked.h53
-rw-r--r--sbin/iked/ikev1.c18
-rw-r--r--sbin/iked/ikev2.c18
-rw-r--r--sbin/iked/imsg_util.c10
-rw-r--r--sbin/iked/pfkey.c4
-rw-r--r--sbin/iked/proc.c30
-rw-r--r--sbin/iked/types.h4
10 files changed, 96 insertions, 95 deletions
diff --git a/sbin/iked/ca.c b/sbin/iked/ca.c
index 7d64f5b7c87..3dbb093fda1 100644
--- a/sbin/iked/ca.c
+++ b/sbin/iked/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.12 2010/12/22 17:53:54 reyk Exp $ */
+/* $OpenBSD: ca.c,v 1.13 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: ca.c,v 1.29 2010/06/02 12:22:58 reyk Exp $ */
/*
@@ -67,11 +67,11 @@ struct ibuf *
int ca_x509_subjectaltname_cmp(X509 *, struct iked_static_id *);
int ca_x509_subjectaltname(X509 *cert, struct iked_id *);
int ca_key_serialize(EVP_PKEY *, struct iked_id *);
-int ca_dispatch_parent(int, struct iked_proc *, struct imsg *);
-int ca_dispatch_ikev1(int, struct iked_proc *, struct imsg *);
-int ca_dispatch_ikev2(int, struct iked_proc *, struct imsg *);
+int ca_dispatch_parent(int, struct privsep_proc *, struct imsg *);
+int ca_dispatch_ikev1(int, struct privsep_proc *, struct imsg *);
+int ca_dispatch_ikev2(int, struct privsep_proc *, struct imsg *);
-static struct iked_proc procs[] = {
+static struct privsep_proc procs[] = {
{ "parent", PROC_PARENT, ca_dispatch_parent },
{ "ikev1", PROC_IKEV1, ca_dispatch_ikev1 },
{ "ikev2", PROC_IKEV2, ca_dispatch_ikev2 }
@@ -88,7 +88,7 @@ struct ca_store {
};
pid_t
-caproc(struct iked *env, struct iked_proc *p)
+caproc(struct iked *env, struct privsep_proc *p)
{
struct ca_store *store;
FILE *fp = NULL;
@@ -142,7 +142,7 @@ ca_reset(struct iked *env, void *arg)
}
int
-ca_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
+ca_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
struct ca_store *store = env->sc_priv;
@@ -165,13 +165,13 @@ ca_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-ca_dispatch_ikev1(int fd, struct iked_proc *p, struct imsg *imsg)
+ca_dispatch_ikev1(int fd, struct privsep_proc *p, struct imsg *imsg)
{
return (-1);
}
int
-ca_dispatch_ikev2(int fd, struct iked_proc *p, struct imsg *imsg)
+ca_dispatch_ikev2(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
@@ -194,7 +194,7 @@ ca_dispatch_ikev2(int fd, struct iked_proc *p, struct imsg *imsg)
int
ca_setcert(struct iked *env, struct iked_sahdr *sh, struct iked_id *id,
- u_int8_t type, u_int8_t *data, size_t len, enum iked_procid procid)
+ u_int8_t type, u_int8_t *data, size_t len, enum privsep_procid procid)
{
struct iovec iov[4];
int iovcnt = 0;
@@ -237,7 +237,7 @@ ca_setcert(struct iked *env, struct iked_sahdr *sh, struct iked_id *id,
int
ca_setreq(struct iked *env, struct iked_sahdr *sh,
struct iked_static_id *localid, u_int8_t type, u_int8_t *data,
- size_t len, enum iked_procid procid)
+ size_t len, enum privsep_procid procid)
{
struct iovec iov[4];
int iovcnt = 0;
@@ -282,7 +282,7 @@ ca_setreq(struct iked *env, struct iked_sahdr *sh,
int
ca_setauth(struct iked *env, struct iked_sa *sa,
- struct ibuf *authmsg, enum iked_procid id)
+ struct ibuf *authmsg, enum privsep_procid id)
{
struct iovec iov[3];
int iovcnt = 3;
diff --git a/sbin/iked/config.c b/sbin/iked/config.c
index eb1911acbcb..d83e95b5c08 100644
--- a/sbin/iked/config.c
+++ b/sbin/iked/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.10 2011/04/18 08:45:43 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.11 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: config.c,v 1.30 2010/05/28 15:34:35 reyk Exp $ */
/*
@@ -432,7 +432,7 @@ config_getmode(struct iked *env, u_int type)
}
int
-config_setreset(struct iked *env, u_int mode, enum iked_procid id)
+config_setreset(struct iked *env, u_int mode, enum privsep_procid id)
{
imsg_compose_proc(env, id, IMSG_CTL_RESET, -1, &mode, sizeof(mode));
return (0);
@@ -482,7 +482,7 @@ config_getreset(struct iked *env, struct imsg *imsg)
int
config_setsocket(struct iked *env, struct sockaddr_storage *ss,
- in_port_t port, enum iked_procid id)
+ in_port_t port, enum privsep_procid id)
{
int s;
@@ -532,7 +532,7 @@ config_getsocket(struct iked *env, struct imsg *imsg,
}
int
-config_setpfkey(struct iked *env, enum iked_procid id)
+config_setpfkey(struct iked *env, enum privsep_procid id)
{
int s;
@@ -551,7 +551,7 @@ config_getpfkey(struct iked *env, struct imsg *imsg)
}
int
-config_setuser(struct iked *env, struct iked_user *usr, enum iked_procid id)
+config_setuser(struct iked *env, struct iked_user *usr, enum privsep_procid id)
{
if (env->sc_opts & IKED_OPT_NOACTION) {
print_user(usr);
@@ -580,7 +580,7 @@ config_getuser(struct iked *env, struct imsg *imsg)
int
config_setpolicy(struct iked *env, struct iked_policy *pol,
- enum iked_procid id)
+ enum privsep_procid id)
{
struct iked_proposal *prop;
struct iked_flow *flow;
@@ -703,7 +703,7 @@ config_getpolicy(struct iked *env, struct imsg *imsg)
}
int
-config_setcompile(struct iked *env, enum iked_procid id)
+config_setcompile(struct iked *env, enum privsep_procid id)
{
if (env->sc_opts & IKED_OPT_NOACTION)
return (0);
diff --git a/sbin/iked/iked.c b/sbin/iked/iked.c
index 4b21c05d459..dda14f25123 100644
--- a/sbin/iked/iked.c
+++ b/sbin/iked/iked.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.c,v 1.8 2011/01/21 11:56:00 reyk Exp $ */
+/* $OpenBSD: iked.c,v 1.9 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: iked.c,v 1.22 2010/06/02 14:43:30 reyk Exp $ */
/*
@@ -49,12 +49,12 @@ __dead void usage(void);
void parent_shutdown(struct iked *);
void parent_sig_handler(int, short, void *);
-int parent_dispatch_ikev1(int, struct iked_proc *, struct imsg *);
-int parent_dispatch_ikev2(int, struct iked_proc *, struct imsg *);
-int parent_dispatch_ca(int, struct iked_proc *, struct imsg *);
+int parent_dispatch_ikev1(int, struct privsep_proc *, struct imsg *);
+int parent_dispatch_ikev2(int, struct privsep_proc *, struct imsg *);
+int parent_dispatch_ca(int, struct privsep_proc *, struct imsg *);
int parent_configure(struct iked *);
-static struct iked_proc procs[] = {
+static struct privsep_proc procs[] = {
{ "ikev1", PROC_IKEV1, parent_dispatch_ikev1, ikev1 },
{ "ikev2", PROC_IKEV2, parent_dispatch_ikev2, ikev2 },
{ "ca", PROC_CERT, parent_dispatch_ca, caproc, IKED_CA }
@@ -314,7 +314,7 @@ parent_sig_handler(int sig, short event, void *p)
}
int
-parent_dispatch_ikev1(int fd, struct iked_proc *p, struct imsg *imsg)
+parent_dispatch_ikev1(int fd, struct privsep_proc *p, struct imsg *imsg)
{
switch (imsg->hdr.type) {
default:
@@ -325,7 +325,7 @@ parent_dispatch_ikev1(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-parent_dispatch_ikev2(int fd, struct iked_proc *p, struct imsg *imsg)
+parent_dispatch_ikev2(int fd, struct privsep_proc *p, struct imsg *imsg)
{
switch (imsg->hdr.type) {
default:
@@ -336,7 +336,7 @@ parent_dispatch_ikev2(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-parent_dispatch_ca(int fd, struct iked_proc *p, struct imsg *imsg)
+parent_dispatch_ca(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
int v;
diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h
index 3eb0eb0463e..cbf320432fa 100644
--- a/sbin/iked/iked.h
+++ b/sbin/iked/iked.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.h,v 1.37 2011/05/02 12:39:18 mikeb Exp $ */
+/* $OpenBSD: iked.h,v 1.38 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: iked.h,v 1.61 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -90,7 +90,7 @@ struct ctl_conn {
TAILQ_HEAD(ctl_connlist, ctl_conn);
extern struct ctl_connlist ctl_conns;
-enum iked_procid iked_process;
+enum privsep_procid privsep_process;
/*
* Runtime structures
@@ -484,11 +484,12 @@ struct iked {
struct event sc_evsigpipe;
};
-struct iked_proc {
+struct privsep_proc {
const char *title;
- enum iked_procid id;
- int (*cb)(int, struct iked_proc *, struct imsg *);
- pid_t (*init)(struct iked *, struct iked_proc *);
+ enum privsep_procid id;
+ int (*cb)(int, struct privsep_proc *,
+ struct imsg *);
+ pid_t (*init)(struct iked *, struct privsep_proc *);
const char *chroot;
struct iked *env;
};
@@ -534,20 +535,20 @@ int config_setcoupled(struct iked *, u_int);
int config_getcoupled(struct iked *, u_int);
int config_setmode(struct iked *, u_int);
int config_getmode(struct iked *, u_int);
-int config_setreset(struct iked *, u_int, enum iked_procid);
+int config_setreset(struct iked *, u_int, enum privsep_procid);
int config_getreset(struct iked *, struct imsg *);
int config_setpolicy(struct iked *, struct iked_policy *,
- enum iked_procid);
+ enum privsep_procid);
int config_getpolicy(struct iked *, struct imsg *);
int config_setsocket(struct iked *, struct sockaddr_storage *, in_port_t,
- enum iked_procid);
+ enum privsep_procid);
int config_getsocket(struct iked *env, struct imsg *,
void (*cb)(int, short, void *));
-int config_setpfkey(struct iked *, enum iked_procid);
+int config_setpfkey(struct iked *, enum privsep_procid);
int config_getpfkey(struct iked *, struct imsg *);
-int config_setuser(struct iked *, struct iked_user *, enum iked_procid);
+int config_setuser(struct iked *, struct iked_user *, enum privsep_procid);
int config_getuser(struct iked *, struct imsg *);
-int config_setcompile(struct iked *, enum iked_procid);
+int config_setcompile(struct iked *, enum privsep_procid);
int config_getcompile(struct iked *, struct imsg *);
/* policy.c */
@@ -629,10 +630,10 @@ ssize_t dsa_sign_final(struct iked_dsa *, void *, size_t);
ssize_t dsa_verify_final(struct iked_dsa *, void *, size_t);
/* ikev1.c */
-pid_t ikev1(struct iked *, struct iked_proc *);
+pid_t ikev1(struct iked *, struct privsep_proc *);
/* ikev2.c */
-pid_t ikev2(struct iked *, struct iked_proc *);
+pid_t ikev2(struct iked *, struct privsep_proc *);
void ikev2_recv(struct iked *, struct iked_message *);
int ikev2_init_ike_sa(struct iked *, struct iked_policy *);
int ikev2_sa_negotiate(struct iked_sa *, struct iked_proposals *,
@@ -714,13 +715,13 @@ int pfkey_socket(void);
void pfkey_init(struct iked *, int fd);
/* ca.c */
-pid_t caproc(struct iked *, struct iked_proc *);
+pid_t caproc(struct iked *, struct privsep_proc *);
int ca_setreq(struct iked *, struct iked_sahdr *, struct iked_static_id *,
- u_int8_t, u_int8_t *, size_t, enum iked_procid);
+ u_int8_t, u_int8_t *, size_t, enum privsep_procid);
int ca_setcert(struct iked *, struct iked_sahdr *, struct iked_id *,
- u_int8_t, u_int8_t *, size_t, enum iked_procid);
+ u_int8_t, u_int8_t *, size_t, enum privsep_procid);
int ca_setauth(struct iked *, struct iked_sa *,
- struct ibuf *, enum iked_procid);
+ struct ibuf *, enum privsep_procid);
void ca_sslinit(void);
void ca_sslerror(void);
char *ca_asn1_name(u_int8_t *, size_t);
@@ -732,14 +733,14 @@ void timer_register_initiator(struct iked *,
void timer_unregister_initiator(struct iked *);
/* proc.c */
-void init_procs(struct iked *, struct iked_proc *, u_int);
+void init_procs(struct iked *, struct privsep_proc *, u_int);
void kill_procs(struct iked *);
void init_pipes(struct iked *);
-void config_pipes(struct iked *, struct iked_proc *, u_int);
-void config_procs(struct iked *, struct iked_proc *, u_int);
+void config_pipes(struct iked *, struct privsep_proc *, u_int);
+void config_procs(struct iked *, struct privsep_proc *, u_int);
void purge_config(struct iked *, u_int8_t);
void dispatch_proc(int, short event, void *);
-pid_t run_proc(struct iked *, struct iked_proc *, struct iked_proc *,
+pid_t run_proc(struct iked *, struct privsep_proc *, struct privsep_proc *,
u_int, void (*)(struct iked *, void *), void *);
/* util.c */
@@ -781,13 +782,13 @@ int imsg_compose_event(struct imsgev *, u_int16_t, u_int32_t,
pid_t, int, void *, u_int16_t);
int imsg_composev_event(struct imsgev *, u_int16_t, u_int32_t,
pid_t, int, const struct iovec *, int);
-int imsg_compose_proc(struct iked *, enum iked_procid,
+int imsg_compose_proc(struct iked *, enum privsep_procid,
u_int16_t, int, void *, u_int16_t);
-int imsg_composev_proc(struct iked *, enum iked_procid,
+int imsg_composev_proc(struct iked *, enum privsep_procid,
u_int16_t, int, const struct iovec *, int);
int imsg_forward_proc(struct iked *, struct imsg *,
- enum iked_procid);
-void imsg_flush_proc(struct iked *, enum iked_procid);
+ enum privsep_procid);
+void imsg_flush_proc(struct iked *, enum privsep_procid);
struct ibuf *
ibuf_new(void *, size_t);
struct ibuf *
diff --git a/sbin/iked/ikev1.c b/sbin/iked/ikev1.c
index 5edb0614f7b..1b4a80ced25 100644
--- a/sbin/iked/ikev1.c
+++ b/sbin/iked/ikev1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev1.c,v 1.6 2011/01/21 11:56:00 reyk Exp $ */
+/* $OpenBSD: ikev1.c,v 1.7 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: ikev1.c,v 1.13 2010/05/28 15:34:35 reyk Exp $ */
/*
@@ -44,27 +44,27 @@
#include "iked.h"
#include "ikev2.h"
-int ikev1_dispatch_parent(int, struct iked_proc *, struct imsg *);
-int ikev1_dispatch_ikev2(int, struct iked_proc *, struct imsg *);
-int ikev1_dispatch_cert(int, struct iked_proc *, struct imsg *);
+int ikev1_dispatch_parent(int, struct privsep_proc *, struct imsg *);
+int ikev1_dispatch_ikev2(int, struct privsep_proc *, struct imsg *);
+int ikev1_dispatch_cert(int, struct privsep_proc *, struct imsg *);
void ikev1_msg_cb(int, short, void *);
void ikev1_recv(struct iked *, struct iked_message *);
-static struct iked_proc procs[] = {
+static struct privsep_proc procs[] = {
{ "parent", PROC_PARENT, ikev1_dispatch_parent },
{ "ikev2", PROC_IKEV2, ikev1_dispatch_ikev2 },
{ "certstore", PROC_CERT, ikev1_dispatch_cert }
};
pid_t
-ikev1(struct iked *env, struct iked_proc *p)
+ikev1(struct iked *env, struct privsep_proc *p)
{
return (run_proc(env, p, procs, nitems(procs), NULL, NULL));
}
int
-ikev1_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
+ikev1_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
@@ -90,7 +90,7 @@ ikev1_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-ikev1_dispatch_ikev2(int fd, struct iked_proc *p, struct imsg *imsg)
+ikev1_dispatch_ikev2(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
struct iked_message msg;
@@ -123,7 +123,7 @@ ikev1_dispatch_ikev2(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-ikev1_dispatch_cert(int fd, struct iked_proc *p, struct imsg *imsg)
+ikev1_dispatch_cert(int fd, struct privsep_proc *p, struct imsg *imsg)
{
return (-1);
}
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c
index c989cafc9c7..aca3d855d83 100644
--- a/sbin/iked/ikev2.c
+++ b/sbin/iked/ikev2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2.c,v 1.51 2011/05/02 12:39:18 mikeb Exp $ */
+/* $OpenBSD: ikev2.c,v 1.52 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: ikev2.c,v 1.101 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -47,9 +47,9 @@
#include "eap.h"
#include "dh.h"
-int ikev2_dispatch_parent(int, struct iked_proc *, struct imsg *);
-int ikev2_dispatch_ikev1(int, struct iked_proc *, struct imsg *);
-int ikev2_dispatch_cert(int, struct iked_proc *, struct imsg *);
+int ikev2_dispatch_parent(int, struct privsep_proc *, struct imsg *);
+int ikev2_dispatch_ikev1(int, struct privsep_proc *, struct imsg *);
+int ikev2_dispatch_cert(int, struct privsep_proc *, struct imsg *);
struct iked_sa *
ikev2_getimsgdata(struct iked *, struct imsg *, struct iked_sahdr *,
@@ -100,20 +100,20 @@ ssize_t ikev2_add_ts_payload(struct ibuf *, u_int, struct iked_sa *);
int ikev2_add_data(struct ibuf *, void *, size_t);
int ikev2_add_buf(struct ibuf *buf, struct ibuf *);
-static struct iked_proc procs[] = {
+static struct privsep_proc procs[] = {
{ "parent", PROC_PARENT, ikev2_dispatch_parent },
{ "ikev1", PROC_IKEV1, ikev2_dispatch_ikev1 },
{ "certstore", PROC_CERT, ikev2_dispatch_cert }
};
pid_t
-ikev2(struct iked *env, struct iked_proc *p)
+ikev2(struct iked *env, struct privsep_proc *p)
{
return (run_proc(env, p, procs, nitems(procs), NULL, NULL));
}
int
-ikev2_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
+ikev2_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
@@ -147,7 +147,7 @@ ikev2_dispatch_parent(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-ikev2_dispatch_ikev1(int fd, struct iked_proc *p, struct imsg *imsg)
+ikev2_dispatch_ikev1(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
struct iked_message msg;
@@ -180,7 +180,7 @@ ikev2_dispatch_ikev1(int fd, struct iked_proc *p, struct imsg *imsg)
}
int
-ikev2_dispatch_cert(int fd, struct iked_proc *p, struct imsg *imsg)
+ikev2_dispatch_cert(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct iked *env = p->env;
struct iked_sahdr sh;
diff --git a/sbin/iked/imsg_util.c b/sbin/iked/imsg_util.c
index 6307752871a..5274d942c52 100644
--- a/sbin/iked/imsg_util.c
+++ b/sbin/iked/imsg_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg_util.c,v 1.1 2010/12/22 17:43:10 reyk Exp $ */
+/* $OpenBSD: imsg_util.c,v 1.2 2011/05/05 12:17:10 reyk Exp $ */
/*
* Copyright (c) 2010 Reyk Floeter <reyk@vantronix.net>
@@ -85,7 +85,7 @@ imsg_composev_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid,
}
int
-imsg_compose_proc(struct iked *env, enum iked_procid id,
+imsg_compose_proc(struct iked *env, enum privsep_procid id,
u_int16_t type, int fd, void *data, u_int16_t datalen)
{
return (imsg_compose_event(&env->sc_ievs[id],
@@ -93,7 +93,7 @@ imsg_compose_proc(struct iked *env, enum iked_procid id,
}
int
-imsg_composev_proc(struct iked *env, enum iked_procid id,
+imsg_composev_proc(struct iked *env, enum privsep_procid id,
u_int16_t type, int fd, const struct iovec *iov, int iovcnt)
{
return (imsg_composev_event(&env->sc_ievs[id],
@@ -102,14 +102,14 @@ imsg_composev_proc(struct iked *env, enum iked_procid id,
int
imsg_forward_proc(struct iked *env, struct imsg *imsg,
- enum iked_procid id)
+ enum privsep_procid id)
{
return (imsg_compose_proc(env, id, imsg->hdr.type,
imsg->fd, imsg->data, IMSG_DATA_SIZE(imsg)));
}
void
-imsg_flush_proc(struct iked *env, enum iked_procid id)
+imsg_flush_proc(struct iked *env, enum privsep_procid id)
{
imsg_flush(&env->sc_ievs[id].ibuf);
}
diff --git a/sbin/iked/pfkey.c b/sbin/iked/pfkey.c
index f034af4caf4..85a4e3f739c 100644
--- a/sbin/iked/pfkey.c
+++ b/sbin/iked/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.14 2011/01/26 16:59:24 mikeb Exp $ */
+/* $OpenBSD: pfkey.c,v 1.15 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: pfkey.c,v 1.11 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -1200,7 +1200,7 @@ pfkey_socket(void)
{
int fd;
- if (iked_process != PROC_PARENT)
+ if (privsep_process != PROC_PARENT)
fatal("pfkey_socket: called from unprivileged process");
if ((fd = socket(PF_KEY, SOCK_RAW, PF_KEY_V2)) == -1)
diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c
index 401431a8d5c..32ca6327a7d 100644
--- a/sbin/iked/proc.c
+++ b/sbin/iked/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.2 2010/09/16 09:27:35 mikeb Exp $ */
+/* $OpenBSD: proc.c,v 1.3 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: proc.c,v 1.11 2010/06/01 16:45:56 jsg Exp $ */
/*
@@ -37,15 +37,15 @@
#include "iked.h"
-void proc_shutdown(struct iked_proc *);
+void proc_shutdown(struct privsep_proc *);
void proc_sig_handler(int, short, void *);
void
-init_procs(struct iked *env, struct iked_proc *p, u_int nproc)
+init_procs(struct iked *env, struct privsep_proc *p, u_int nproc)
{
u_int i;
- iked_process = PROC_PARENT;
+ privsep_process = PROC_PARENT;
init_pipes(env);
for (i = 0; i < nproc; i++, p++) {
@@ -59,7 +59,7 @@ kill_procs(struct iked *env)
{
u_int i;
- if (iked_process != PROC_PARENT)
+ if (privsep_process != PROC_PARENT)
return;
for (i = 0; i < PROC_MAX; i++) {
@@ -89,12 +89,12 @@ init_pipes(struct iked *env)
}
void
-config_pipes(struct iked *env, struct iked_proc *p, u_int nproc)
+config_pipes(struct iked *env, struct privsep_proc *p, u_int nproc)
{
u_int i, j, k, found;
for (i = 0; i < PROC_MAX; i++) {
- if (i != iked_process) {
+ if (i != privsep_process) {
for (j = 0; j < PROC_MAX; j++) {
close(env->sc_pipes[i][j]);
env->sc_pipes[i][j] = -1;
@@ -115,7 +115,7 @@ config_pipes(struct iked *env, struct iked_proc *p, u_int nproc)
}
void
-config_procs(struct iked *env, struct iked_proc *p, u_int nproc)
+config_procs(struct iked *env, struct privsep_proc *p, u_int nproc)
{
u_int src, dst, i;
@@ -123,7 +123,7 @@ config_procs(struct iked *env, struct iked_proc *p, u_int nproc)
* listen on appropriate pipes
*/
for (i = 0; i < nproc; i++, p++) {
- src = iked_process;
+ src = privsep_process;
dst = p->id;
p->env = env;
@@ -143,7 +143,7 @@ config_procs(struct iked *env, struct iked_proc *p, u_int nproc)
}
void
-proc_shutdown(struct iked_proc *p)
+proc_shutdown(struct privsep_proc *p)
{
struct iked *env = p->env;
@@ -160,7 +160,7 @@ proc_sig_handler(int sig, short event, void *arg)
switch (sig) {
case SIGINT:
case SIGTERM:
- proc_shutdown((struct iked_proc *)arg);
+ proc_shutdown((struct privsep_proc *)arg);
break;
case SIGCHLD:
case SIGHUP:
@@ -174,8 +174,8 @@ proc_sig_handler(int sig, short event, void *arg)
}
pid_t
-run_proc(struct iked *env, struct iked_proc *p,
- struct iked_proc *procs, u_int nproc,
+run_proc(struct iked *env, struct privsep_proc *p,
+ struct privsep_proc *procs, u_int nproc,
void (*init)(struct iked *, void *), void *arg)
{
pid_t pid;
@@ -220,7 +220,7 @@ run_proc(struct iked *env, struct iked_proc *p,
}
#endif
- iked_process = p->id;
+ privsep_process = p->id;
setproctitle("%s", p->title);
#ifndef DEBUG
@@ -269,7 +269,7 @@ run_proc(struct iked *env, struct iked_proc *p,
void
dispatch_proc(int fd, short event, void *arg)
{
- struct iked_proc *p = (struct iked_proc *)arg;
+ struct privsep_proc *p = (struct privsep_proc *)arg;
struct iked *env = p->env;
struct imsgev *iev;
struct imsgbuf *ibuf;
diff --git a/sbin/iked/types.h b/sbin/iked/types.h
index 69b9cceb4c0..ec4da810c03 100644
--- a/sbin/iked/types.h
+++ b/sbin/iked/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.9 2011/01/21 11:56:00 reyk Exp $ */
+/* $OpenBSD: types.h,v 1.10 2011/05/05 12:17:10 reyk Exp $ */
/* $vantronix: types.h,v 1.24 2010/05/11 12:05:56 reyk Exp $ */
/*
@@ -101,7 +101,7 @@ enum imsg_type {
IMSG_AUTH
};
-enum iked_procid {
+enum privsep_procid {
PROC_PARENT = 0,
PROC_IKEV1,
PROC_IKEV2,