summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2008-01-31 12:12:51 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2008-01-31 12:12:51 +0000
commitac20736c423a4be197e31b7d9daebbe9a4c511a5 (patch)
treed9a5e4555c5e01415f6c73673cbba74db755bc45 /usr.sbin
parentea0ee432b6d9a05c7ff18cd90304ca91cf56006e (diff)
add prefixes to names of structure elements to make it easier to grep
for code, next struct session; ok reyk@;
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/relayctl/relayctl.c22
-rw-r--r--usr.sbin/relayd/relay.c356
-rw-r--r--usr.sbin/relayd/relay_udp.c120
-rw-r--r--usr.sbin/relayd/relayd.c4
-rw-r--r--usr.sbin/relayd/relayd.h42
5 files changed, 272 insertions, 272 deletions
diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c
index 83aee0b65b2..d2db08a7af8 100644
--- a/usr.sbin/relayctl/relayctl.c
+++ b/usr.sbin/relayctl/relayctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayctl.c,v 1.32 2008/01/31 09:56:29 reyk Exp $ */
+/* $OpenBSD: relayctl.c,v 1.33 2008/01/31 12:12:50 thib Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -389,20 +389,20 @@ show_session_msg(struct imsg *imsg)
case IMSG_CTL_SESSION:
con = imsg->data;
- (void)print_host(&con->in.ss, a, sizeof(a));
- (void)print_host(&con->out.ss, b, sizeof(b));
+ (void)print_host(&con->se_in.ss, a, sizeof(a));
+ (void)print_host(&con->se_out.ss, b, sizeof(b));
printf("session %u:%u %s:%u -> %s:%u\t%s\n",
- imsg->hdr.peerid, con->id,
- a, ntohs(con->in.port), b, ntohs(con->out.port),
- con->done ? "DONE" : "RUNNING");
+ imsg->hdr.peerid, con->se_id,
+ a, ntohs(con->se_in.port), b, ntohs(con->se_out.port),
+ con->se_done ? "DONE" : "RUNNING");
if (gettimeofday(&tv_now, NULL))
fatal("show_session_msg: gettimeofday");
- print_time(&tv_now, &con->tv_start, a, sizeof(a));
- print_time(&tv_now, &con->tv_last, b, sizeof(b));
- printf("\tage %s, idle %s, relay %u", a, b, con->relayid);
- if (con->mark)
- printf(", mark %u", con->mark);
+ print_time(&tv_now, &con->se_tv_start, a, sizeof(a));
+ print_time(&tv_now, &con->se_tv_last, b, sizeof(b));
+ printf("\tage %s, idle %s, relay %u", a, b, con->se_relayid);
+ if (con->se_mark)
+ printf(", mark %u", con->se_mark);
printf("\n");
break;
case IMSG_CTL_END:
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index 900b8bd2659..5f01a3a5fe1 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.79 2008/01/31 09:56:28 reyk Exp $ */
+/* $OpenBSD: relay.c,v 1.80 2008/01/31 12:12:50 thib Exp $ */
/*
* Copyright (c) 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -557,7 +557,7 @@ relay_statistics(int fd, short events, void *arg)
con != NULL; con = next_con) {
next_con = SPLAY_NEXT(session_tree,
&rlay->rl_sessions, con);
- timersub(&tv_now, &con->tv_last, &tv);
+ timersub(&tv_now, &con->se_tv_last, &tv);
if (timercmp(&tv, &rlay->rl_conf.timeout, >=))
relay_close(con, "hard timeout");
}
@@ -739,7 +739,7 @@ void
relay_connected(int fd, short sig, void *arg)
{
struct session *con = (struct session *)arg;
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
struct protocol *proto = rlay->rl_proto;
evbuffercb outrd = relay_read;
evbuffercb outwr = relay_write;
@@ -758,7 +758,7 @@ relay_connected(int fd, short sig, void *arg)
/* Check the servers's HTTP response */
if (!RB_EMPTY(&rlay->rl_proto->response_tree)) {
outrd = relay_read_http;
- if ((con->out.nodes = calloc(proto->response_nodes,
+ if ((con->se_out.nodes = calloc(proto->response_nodes,
sizeof(u_int8_t))) == NULL) {
relay_close_http(con, 500,
"failed to allocate nodes", 0);
@@ -776,18 +776,18 @@ relay_connected(int fd, short sig, void *arg)
/*
* Relay <-> Server
*/
- bev = bufferevent_new(fd, outrd, outwr, relay_error, &con->out);
+ bev = bufferevent_new(fd, outrd, outwr, relay_error, &con->se_out);
if (bev == NULL) {
relay_close_http(con, 500,
"failed to allocate output buffer event", 0);
return;
}
evbuffer_free(bev->output);
- bev->output = con->out.output;
+ bev->output = con->se_out.output;
if (bev->output == NULL)
fatal("relay_connected: invalid output buffer");
- con->out.bev = bev;
+ con->se_out.bev = bev;
bufferevent_settimeout(bev,
rlay->rl_conf.timeout.tv_sec, rlay->rl_conf.timeout.tv_sec);
bufferevent_enable(bev, EV_READ|EV_WRITE);
@@ -796,7 +796,7 @@ relay_connected(int fd, short sig, void *arg)
void
relay_input(struct session *con)
{
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
struct protocol *proto = rlay->rl_proto;
evbuffercb inrd = relay_read;
evbuffercb inwr = relay_write;
@@ -807,7 +807,7 @@ relay_input(struct session *con)
if (!RB_EMPTY(&rlay->rl_proto->request_tree) ||
proto->lateconnect) {
inrd = relay_read_http;
- if ((con->in.nodes = calloc(proto->request_nodes,
+ if ((con->se_in.nodes = calloc(proto->request_nodes,
sizeof(u_int8_t))) == NULL) {
relay_close(con, "failed to allocate nodes");
return;
@@ -824,20 +824,20 @@ relay_input(struct session *con)
/*
* Client <-> Relay
*/
- con->in.bev = bufferevent_new(con->in.s, inrd, inwr,
- relay_error, &con->in);
- if (con->in.bev == NULL) {
+ con->se_in.bev = bufferevent_new(con->se_in.s, inrd, inwr,
+ relay_error, &con->se_in);
+ if (con->se_in.bev == NULL) {
relay_close(con, "failed to allocate input buffer event");
return;
}
/* Initialize the SSL wrapper */
- if ((rlay->rl_conf.flags & F_SSL) && con->in.ssl != NULL)
- relay_ssl_connected(&con->in);
+ if ((rlay->rl_conf.flags & F_SSL) && con->se_in.ssl != NULL)
+ relay_ssl_connected(&con->se_in);
- bufferevent_settimeout(con->in.bev,
+ bufferevent_settimeout(con->se_in.bev,
rlay->rl_conf.timeout.tv_sec, rlay->rl_conf.timeout.tv_sec);
- bufferevent_enable(con->in.bev, EV_READ|EV_WRITE);
+ bufferevent_enable(con->se_in.bev, EV_READ|EV_WRITE);
}
void
@@ -845,9 +845,9 @@ relay_write(struct bufferevent *bev, void *arg)
{
struct ctl_relay_event *cre = (struct ctl_relay_event *)arg;
struct session *con = (struct session *)cre->con;
- if (gettimeofday(&con->tv_last, NULL))
- con->done = 1;
- if (con->done)
+ if (gettimeofday(&con->se_tv_last, NULL))
+ con->se_done = 1;
+ if (con->se_done)
relay_close(con, "last write (done)");
}
@@ -873,15 +873,15 @@ relay_read(struct bufferevent *bev, void *arg)
struct session *con = (struct session *)cre->con;
struct evbuffer *src = EVBUFFER_INPUT(bev);
- if (gettimeofday(&con->tv_last, NULL))
+ if (gettimeofday(&con->se_tv_last, NULL))
goto done;
if (!EVBUFFER_LENGTH(src))
return;
if (relay_bufferevent_write_buffer(cre->dst, src) == -1)
goto fail;
- if (con->done)
+ if (con->se_done)
goto done;
- bufferevent_enable(con->in.bev, EV_READ);
+ bufferevent_enable(con->se_in.bev, EV_READ);
return;
done:
relay_close(con, "last read (done)");
@@ -898,7 +898,7 @@ relay_resolve(struct ctl_relay_event *cre,
char buf[READ_BUF_SIZE], *ptr;
int id;
- if (pn->mark && (pn->mark != con->mark))
+ if (pn->mark && (pn->mark != con->se_mark))
return (0);
switch (pn->action) {
@@ -962,7 +962,7 @@ char *
relay_expand_http(struct ctl_relay_event *cre, char *val, char *buf, size_t len)
{
struct session *con = (struct session *)cre->con;
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
char ibuf[128];
(void)strlcpy(buf, val, len);
@@ -1019,7 +1019,7 @@ relay_handle_http(struct ctl_relay_event *cre, struct protonode *proot,
/* Check if this action depends on a marked session */
if (pn->mark != 0)
- mark = pn->mark == con->mark ? 1 : -1;
+ mark = pn->mark == con->se_mark ? 1 : -1;
switch (pn->action) {
case NODE_ACTION_EXPECT:
@@ -1095,7 +1095,7 @@ relay_handle_http(struct ctl_relay_event *cre, struct protonode *proot,
case NODE_ACTION_HASH:
DPRINTF("relay_handle_http: hash '%s: %s'",
pn->key, pk->value);
- con->outkey = hash32_str(pk->value, con->outkey);
+ con->se_outkey = hash32_str(pk->value, con->se_outkey);
ret = PN_PASS;
break;
case NODE_ACTION_LOG:
@@ -1107,7 +1107,7 @@ relay_handle_http(struct ctl_relay_event *cre, struct protonode *proot,
DPRINTF("relay_handle_http: mark '%s: %s'",
pn->key, pk->value);
if (fnmatch(pn->value, pk->value, FNM_CASEFOLD) == 0)
- con->mark = pn->mark;
+ con->se_mark = pn->mark;
ret = PN_PASS;
break;
case NODE_ACTION_NONE:
@@ -1117,7 +1117,7 @@ relay_handle_http(struct ctl_relay_event *cre, struct protonode *proot,
bzero(buf, sizeof(buf));
if (snprintf(buf, sizeof(buf), " [%s: %s]",
pk->key, pk->value) == -1 ||
- evbuffer_add(con->log, buf, strlen(buf)) == -1)
+ evbuffer_add(con->se_log, buf, strlen(buf)) == -1)
goto fail;
}
@@ -1135,7 +1135,7 @@ relay_read_httpcontent(struct bufferevent *bev, void *arg)
struct evbuffer *src = EVBUFFER_INPUT(bev);
size_t size;
- if (gettimeofday(&con->tv_last, NULL))
+ if (gettimeofday(&con->se_tv_last, NULL))
goto done;
size = EVBUFFER_LENGTH(src);
DPRINTF("relay_read_httpcontent: size %d, to read %d",
@@ -1149,7 +1149,7 @@ relay_read_httpcontent(struct bufferevent *bev, void *arg)
cre->toread -= size;
DPRINTF("relay_read_httpcontent: done, size %d, to read %d",
size, cre->toread);
- if (con->done)
+ if (con->se_done)
goto done;
if (EVBUFFER_LENGTH(src) && bev->readcb != relay_read_httpcontent)
bev->readcb(bev, arg);
@@ -1172,7 +1172,7 @@ relay_read_httpchunks(struct bufferevent *bev, void *arg)
long lval;
size_t size;
- if (gettimeofday(&con->tv_last, NULL))
+ if (gettimeofday(&con->se_tv_last, NULL))
goto done;
size = EVBUFFER_LENGTH(src);
DPRINTF("relay_read_httpchunks: size %d, to read %d",
@@ -1245,7 +1245,7 @@ relay_read_httpchunks(struct bufferevent *bev, void *arg)
}
}
- if (con->done)
+ if (con->se_done)
goto done;
if (EVBUFFER_LENGTH(src) && bev->readcb != relay_read_httpchunks)
bev->readcb(bev, arg);
@@ -1264,7 +1264,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
{
struct ctl_relay_event *cre = (struct ctl_relay_event *)arg;
struct session *con = (struct session *)cre->con;
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
struct protocol *proto = rlay->rl_proto;
struct evbuffer *src = EVBUFFER_INPUT(bev);
struct protonode *pn, pk, *proot, *pnv = NULL, pkv;
@@ -1273,7 +1273,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
const char *errstr;
size_t size;
- if (gettimeofday(&con->tv_last, NULL))
+ if (gettimeofday(&con->se_tv_last, NULL))
goto done;
size = EVBUFFER_LENGTH(src);
DPRINTF("relay_read_http: size %d, to read %d", size, cre->toread);
@@ -1372,7 +1372,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
char buf[BUFSIZ];
if (snprintf(buf, sizeof(buf), " \"%s\"",
cre->path) == -1 ||
- evbuffer_add(con->log, buf, strlen(buf)) == -1) {
+ evbuffer_add(con->se_log, buf, strlen(buf)) == -1) {
free(line);
goto fail;
}
@@ -1527,7 +1527,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
return;
}
}
- if (con->done)
+ if (con->se_done)
goto done;
if (EVBUFFER_LENGTH(src) && bev->readcb != relay_read_http)
bev->readcb(bev, arg);
@@ -1773,8 +1773,8 @@ void
relay_close_http(struct session *con, u_int code, const char *msg,
u_int16_t labelid)
{
- struct relay *rlay = (struct relay *)con->relay;
- struct bufferevent *bev = con->in.bev;
+ struct relay *rlay = (struct relay *)con->se_relay;
+ struct bufferevent *bev = con->se_in.bev;
const char *httperr = print_httperror(code), *text = "";
char *httpmsg;
time_t t;
@@ -1842,7 +1842,7 @@ relay_close_http(struct session *con, u_int code, const char *msg,
goto done;
/* Dump the message without checking for success */
- relay_dump(&con->in, httpmsg, strlen(httpmsg));
+ relay_dump(&con->se_in, httpmsg, strlen(httpmsg));
free(httpmsg);
done:
@@ -1868,7 +1868,7 @@ relay_error(struct bufferevent *bev, short error, void *arg)
if (error & (EVBUFFER_READ|EVBUFFER_WRITE|EVBUFFER_EOF)) {
bufferevent_disable(bev, EV_READ|EV_WRITE);
- con->done = 1;
+ con->se_done = 1;
if (cre->dst->bev != NULL) {
dst = EVBUFFER_OUTPUT(cre->dst->bev);
if (EVBUFFER_LENGTH(dst))
@@ -1905,34 +1905,34 @@ relay_accept(int fd, short sig, void *arg)
calloc(1, sizeof(struct session))) == NULL)
goto err;
- con->in.s = s;
- con->in.ssl = NULL;
- con->out.s = -1;
- con->out.ssl = NULL;
- con->in.dst = &con->out;
- con->out.dst = &con->in;
- con->in.con = con;
- con->out.con = con;
- con->relay = rlay;
- con->id = ++relay_conid;
- con->relayid = rlay->rl_conf.id;
- con->outkey = rlay->rl_dstkey;
- con->in.tree = &proto->request_tree;
- con->out.tree = &proto->response_tree;
- con->in.dir = RELAY_DIR_REQUEST;
- con->out.dir = RELAY_DIR_RESPONSE;
- con->retry = rlay->rl_conf.dstretry;
- if (gettimeofday(&con->tv_start, NULL))
+ con->se_in.s = s;
+ con->se_in.ssl = NULL;
+ con->se_out.s = -1;
+ con->se_out.ssl = NULL;
+ con->se_in.dst = &con->se_out;
+ con->se_out.dst = &con->se_in;
+ con->se_in.con = con;
+ con->se_out.con = con;
+ con->se_relay = rlay;
+ con->se_id = ++relay_conid;
+ con->se_relayid = rlay->rl_conf.id;
+ con->se_outkey = rlay->rl_dstkey;
+ con->se_in.tree = &proto->request_tree;
+ con->se_out.tree = &proto->response_tree;
+ con->se_in.dir = RELAY_DIR_REQUEST;
+ con->se_out.dir = RELAY_DIR_RESPONSE;
+ con->se_retry = rlay->rl_conf.dstretry;
+ if (gettimeofday(&con->se_tv_start, NULL))
goto err;
- bcopy(&con->tv_start, &con->tv_last, sizeof(con->tv_last));
- bcopy(&ss, &con->in.ss, sizeof(con->in.ss));
- con->out.port = rlay->rl_conf.dstport;
+ bcopy(&con->se_tv_start, &con->se_tv_last, sizeof(con->se_tv_last));
+ bcopy(&ss, &con->se_in.ss, sizeof(con->se_in.ss));
+ con->se_out.port = rlay->rl_conf.dstport;
switch (ss.ss_family) {
case AF_INET:
- con->in.port = ((struct sockaddr_in *)&ss)->sin_port;
+ con->se_in.port = ((struct sockaddr_in *)&ss)->sin_port;
break;
case AF_INET6:
- con->in.port = ((struct sockaddr_in6 *)&ss)->sin6_port;
+ con->se_in.port = ((struct sockaddr_in6 *)&ss)->sin6_port;
break;
}
@@ -1943,15 +1943,15 @@ relay_accept(int fd, short sig, void *arg)
rlay->rl_stats[proc_id].last++;
/* Pre-allocate output buffer */
- con->out.output = evbuffer_new();
- if (con->out.output == NULL) {
+ con->se_out.output = evbuffer_new();
+ if (con->se_out.output == NULL) {
relay_close(con, "failed to allocate output buffer");
return;
}
/* Pre-allocate log buffer */
- con->log = evbuffer_new();
- if (con->log == NULL) {
+ con->se_log = evbuffer_new();
+ if (con->se_log == NULL) {
relay_close(con, "failed to allocate log buffer");
return;
}
@@ -1965,20 +1965,20 @@ relay_accept(int fd, short sig, void *arg)
}
if (rlay->rl_conf.flags & F_NATLOOK && cnl != NULL) {
- con->cnl = cnl;;
+ con->se_cnl = cnl;
bzero(cnl, sizeof(*cnl));
cnl->in = -1;
- cnl->id = con->id;
+ cnl->id = con->se_id;
cnl->proc = proc_id;
- bcopy(&con->in.ss, &cnl->src, sizeof(cnl->src));
+ bcopy(&con->se_in.ss, &cnl->src, sizeof(cnl->src));
bcopy(&rlay->rl_conf.ss, &cnl->dst, sizeof(cnl->dst));
imsg_compose(ibuf_pfe, IMSG_NATLOOK, 0, 0, -1, cnl,
sizeof(*cnl));
/* Schedule timeout */
- evtimer_set(&con->ev, relay_natlook, con);
+ evtimer_set(&con->se_ev, relay_natlook, con);
bcopy(&rlay->rl_conf.timeout, &tv, sizeof(tv));
- evtimer_add(&con->ev, &tv);
+ evtimer_add(&con->se_ev, &tv);
return;
}
@@ -2014,10 +2014,10 @@ relay_hash_addr(struct sockaddr_storage *ss, u_int32_t p)
int
relay_from_table(struct session *con)
{
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
struct host *host;
struct table *table = rlay->rl_dsttable;
- u_int32_t p = con->outkey;
+ u_int32_t p = con->se_outkey;
int idx = 0;
if (table->conf.check && !table->up) {
@@ -2032,7 +2032,7 @@ relay_from_table(struct session *con)
idx = (int)rlay->rl_dstkey;
break;
case RELAY_DSTMODE_LOADBALANCE:
- p = relay_hash_addr(&con->in.ss, p);
+ p = relay_hash_addr(&con->se_in.ss, p);
/* FALLTHROUGH */
case RELAY_DSTMODE_HASH:
p = relay_hash_addr(&rlay->rl_conf.ss, p);
@@ -2061,9 +2061,9 @@ relay_from_table(struct session *con)
found:
if (rlay->rl_conf.dstmode == RELAY_DSTMODE_ROUNDROBIN)
rlay->rl_dstkey = host->idx + 1;
- con->retry = host->conf.retry;
- con->out.port = table->conf.port;
- bcopy(&host->conf.ss, &con->out.ss, sizeof(con->out.ss));
+ con->se_retry = host->conf.retry;
+ con->se_out.port = table->conf.port;
+ bcopy(&host->conf.ss, &con->se_out.ss, sizeof(con->se_out.ss));
return (0);
}
@@ -2072,23 +2072,23 @@ void
relay_natlook(int fd, short event, void *arg)
{
struct session *con = (struct session *)arg;
- struct relay *rlay = (struct relay *)con->relay;
- struct ctl_natlook *cnl = con->cnl;
+ struct relay *rlay = (struct relay *)con->se_relay;
+ struct ctl_natlook *cnl = con->se_cnl;
if (cnl == NULL)
fatalx("invalid NAT lookup");
- if (con->out.ss.ss_family == AF_UNSPEC && cnl->in == -1 &&
+ if (con->se_out.ss.ss_family == AF_UNSPEC && cnl->in == -1 &&
rlay->rl_conf.dstss.ss_family == AF_UNSPEC && rlay->rl_dsttable == NULL) {
relay_close(con, "session NAT lookup failed");
return;
}
if (cnl->in != -1) {
- bcopy(&cnl->rdst, &con->out.ss, sizeof(con->out.ss));
- con->out.port = cnl->rdport;
+ bcopy(&cnl->rdst, &con->se_out.ss, sizeof(con->se_out.ss));
+ con->se_out.port = cnl->rdport;
}
- free(con->cnl);
- con->cnl = NULL;
+ free(con->se_cnl);
+ con->se_cnl = NULL;
relay_session(con);
}
@@ -2096,13 +2096,13 @@ relay_natlook(int fd, short event, void *arg)
void
relay_session(struct session *con)
{
- struct relay *rlay = (struct relay *)con->relay;
- struct ctl_relay_event *in = &con->in, *out = &con->out;
+ struct relay *rlay = (struct relay *)con->se_relay;
+ struct ctl_relay_event *in = &con->se_in, *out = &con->se_out;
if (bcmp(&rlay->rl_conf.ss, &out->ss, sizeof(out->ss)) == 0 &&
out->port == rlay->rl_conf.port) {
log_debug("relay_session: session %d: looping",
- con->id);
+ con->se_id);
relay_close(con, "session aborted");
return;
}
@@ -2134,40 +2134,40 @@ relay_session(struct session *con)
int
relay_connect(struct session *con)
{
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
- if (gettimeofday(&con->tv_start, NULL))
+ if (gettimeofday(&con->se_tv_start, NULL))
return (-1);
if (rlay->rl_dsttable != NULL) {
if (relay_from_table(con) != 0)
return (-1);
- } else if (con->out.ss.ss_family == AF_UNSPEC) {
- bcopy(&rlay->rl_conf.dstss, &con->out.ss, sizeof(con->out.ss));
- con->out.port = rlay->rl_conf.dstport;
+ } else if (con->se_out.ss.ss_family == AF_UNSPEC) {
+ bcopy(&rlay->rl_conf.dstss, &con->se_out.ss, sizeof(con->se_out.ss));
+ con->se_out.port = rlay->rl_conf.dstport;
}
retry:
- if ((con->out.s = relay_socket_connect(&con->out.ss, con->out.port,
+ if ((con->se_out.s = relay_socket_connect(&con->se_out.ss, con->se_out.port,
rlay->rl_proto)) == -1) {
- if (con->retry) {
- con->retry--;
+ if (con->se_retry) {
+ con->se_retry--;
log_debug("relay_connect: session %d: "
"forward failed: %s, %s",
- con->id, strerror(errno),
- con->retry ? "next retry" : "last retry");
+ con->se_id, strerror(errno),
+ con->se_retry ? "next retry" : "last retry");
goto retry;
}
log_debug("relay_connect: session %d: forward failed: %s",
- con->id, strerror(errno));
+ con->se_id, strerror(errno));
return (-1);
}
if (errno == EINPROGRESS)
- event_again(&con->ev, con->out.s, EV_WRITE|EV_TIMEOUT,
- relay_connected, &con->tv_start, &env->sc_timeout, con);
+ event_again(&con->se_ev, con->se_out.s, EV_WRITE|EV_TIMEOUT,
+ relay_connected, &con->se_tv_start, &env->sc_timeout, con);
else
- relay_connected(con->out.s, EV_WRITE, con);
+ relay_connected(con->se_out.s, EV_WRITE, con);
return (0);
}
@@ -2175,74 +2175,74 @@ relay_connect(struct session *con)
void
relay_close(struct session *con, const char *msg)
{
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
char ibuf[128], obuf[128], *ptr = NULL;
SPLAY_REMOVE(session_tree, &rlay->rl_sessions, con);
- event_del(&con->ev);
- if (con->in.bev != NULL)
- bufferevent_disable(con->in.bev, EV_READ|EV_WRITE);
- if (con->out.bev != NULL)
- bufferevent_disable(con->out.bev, EV_READ|EV_WRITE);
+ event_del(&con->se_ev);
+ if (con->se_in.bev != NULL)
+ bufferevent_disable(con->se_in.bev, EV_READ|EV_WRITE);
+ if (con->se_out.bev != NULL)
+ bufferevent_disable(con->se_out.bev, EV_READ|EV_WRITE);
if (env->sc_opts & RELAYD_OPT_LOGUPDATE) {
bzero(&ibuf, sizeof(ibuf));
bzero(&obuf, sizeof(obuf));
- (void)print_host(&con->in.ss, ibuf, sizeof(ibuf));
- (void)print_host(&con->out.ss, obuf, sizeof(obuf));
- if (EVBUFFER_LENGTH(con->log) &&
- evbuffer_add_printf(con->log, "\r\n") != -1)
- ptr = evbuffer_readline(con->log);
+ (void)print_host(&con->se_in.ss, ibuf, sizeof(ibuf));
+ (void)print_host(&con->se_out.ss, obuf, sizeof(obuf));
+ if (EVBUFFER_LENGTH(con->se_log) &&
+ evbuffer_add_printf(con->se_log, "\r\n") != -1)
+ ptr = evbuffer_readline(con->se_log);
log_info("relay %s, session %d (%d active), %d, %s -> %s:%d, "
- "%s%s%s", rlay->rl_conf.name, con->id, relay_sessions,
- con->mark, ibuf, obuf, ntohs(con->out.port), msg,
+ "%s%s%s", rlay->rl_conf.name, con->se_id, relay_sessions,
+ con->se_mark, ibuf, obuf, ntohs(con->se_out.port), msg,
ptr == NULL ? "" : ",", ptr == NULL ? "" : ptr);
if (ptr != NULL)
free(ptr);
}
- if (con->in.bev != NULL)
- bufferevent_free(con->in.bev);
- else if (con->in.output != NULL)
- evbuffer_free(con->in.output);
- if (con->in.ssl != NULL) {
+ if (con->se_in.bev != NULL)
+ bufferevent_free(con->se_in.bev);
+ else if (con->se_in.output != NULL)
+ evbuffer_free(con->se_in.output);
+ if (con->se_in.ssl != NULL) {
/* XXX handle non-blocking shutdown */
- if (SSL_shutdown(con->in.ssl) == 0)
- SSL_shutdown(con->in.ssl);
- SSL_free(con->in.ssl);
- }
- if (con->in.s != -1)
- close(con->in.s);
- if (con->in.path != NULL)
- free(con->in.path);
- if (con->in.buf != NULL)
- free(con->in.buf);
- if (con->in.nodes != NULL)
- free(con->in.nodes);
-
- if (con->out.bev != NULL)
- bufferevent_free(con->out.bev);
- else if (con->out.output != NULL)
- evbuffer_free(con->out.output);
- if (con->out.s != -1)
- close(con->out.s);
- if (con->out.path != NULL)
- free(con->out.path);
- if (con->out.buf != NULL)
- free(con->out.buf);
- if (con->out.nodes != NULL)
- free(con->out.nodes);
-
- if (con->log != NULL)
- evbuffer_free(con->log);
-
- if (con->cnl != NULL) {
+ if (SSL_shutdown(con->se_in.ssl) == 0)
+ SSL_shutdown(con->se_in.ssl);
+ SSL_free(con->se_in.ssl);
+ }
+ if (con->se_in.s != -1)
+ close(con->se_in.s);
+ if (con->se_in.path != NULL)
+ free(con->se_in.path);
+ if (con->se_in.buf != NULL)
+ free(con->se_in.buf);
+ if (con->se_in.nodes != NULL)
+ free(con->se_in.nodes);
+
+ if (con->se_out.bev != NULL)
+ bufferevent_free(con->se_out.bev);
+ else if (con->se_out.output != NULL)
+ evbuffer_free(con->se_out.output);
+ if (con->se_out.s != -1)
+ close(con->se_out.s);
+ if (con->se_out.path != NULL)
+ free(con->se_out.path);
+ if (con->se_out.buf != NULL)
+ free(con->se_out.buf);
+ if (con->se_out.nodes != NULL)
+ free(con->se_out.nodes);
+
+ if (con->se_log != NULL)
+ evbuffer_free(con->se_log);
+
+ if (con->se_cnl != NULL) {
#if 0
imsg_compose(ibuf_pfe, IMSG_KILLSTATES, 0, 0, -1,
cnl, sizeof(*cnl));
#endif
- free(con->cnl);
+ free(con->se_cnl);
}
free(con);
@@ -2347,16 +2347,16 @@ relay_dispatch_pfe(int fd, short event, void *ptr)
case IMSG_NATLOOK:
bcopy(imsg.data, &cnl, sizeof(cnl));
if ((con = session_find(env, cnl.id)) == NULL ||
- con->cnl == NULL) {
+ con->se_cnl == NULL) {
log_debug("relay_dispatch_pfe: "
"session expired");
break;
}
- bcopy(&cnl, con->cnl, sizeof(*con->cnl));
- evtimer_del(&con->ev);
- evtimer_set(&con->ev, relay_natlook, con);
+ bcopy(&cnl, con->se_cnl, sizeof(*con->se_cnl));
+ evtimer_del(&con->se_ev);
+ evtimer_set(&con->se_ev, relay_natlook, con);
bzero(&tv, sizeof(tv));
- evtimer_add(&con->ev, &tv);
+ evtimer_add(&con->se_ev, &tv);
break;
case IMSG_CTL_SESSION:
TAILQ_FOREACH(rlay, env->sc_relays, rl_entry)
@@ -2485,7 +2485,7 @@ relay_ssl_ctx_create(struct relay *rlay)
void
relay_ssl_transaction(struct session *con)
{
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
SSL *ssl;
ssl = SSL_new(rlay->rl_ssl_ctx);
@@ -2494,14 +2494,14 @@ relay_ssl_transaction(struct session *con)
if (!SSL_set_ssl_method(ssl, SSLv23_server_method()))
goto err;
- if (!SSL_set_fd(ssl, con->in.s))
+ if (!SSL_set_fd(ssl, con->se_in.s))
goto err;
SSL_set_accept_state(ssl);
- con->in.ssl = ssl;
+ con->se_in.ssl = ssl;
- event_again(&con->ev, con->in.s, EV_TIMEOUT|EV_READ,
- relay_ssl_accept, &con->tv_start, &env->sc_timeout, con);
+ event_again(&con->se_ev, con->se_in.s, EV_TIMEOUT|EV_READ,
+ relay_ssl_accept, &con->se_tv_start, &env->sc_timeout, con);
return;
err:
@@ -2514,7 +2514,7 @@ void
relay_ssl_accept(int fd, short event, void *arg)
{
struct session *con = (struct session *)arg;
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
int ret;
int ssl_err;
int retry_flag;
@@ -2526,9 +2526,9 @@ relay_ssl_accept(int fd, short event, void *arg)
retry_flag = ssl_err = 0;
- ret = SSL_accept(con->in.ssl);
+ ret = SSL_accept(con->se_in.ssl);
if (ret <= 0) {
- ssl_err = SSL_get_error(con->in.ssl, ret);
+ ssl_err = SSL_get_error(con->se_in.ssl, ret);
switch (ssl_err) {
case SSL_ERROR_WANT_READ:
@@ -2554,19 +2554,19 @@ relay_ssl_accept(int fd, short event, void *arg)
#ifdef DEBUG
log_info("relay %s, session %d established (%d active)",
- rlay->rl_conf.name, con->id, relay_sessions);
+ rlay->rl_conf.name, con->se_id, relay_sessions);
#else
log_debug("relay %s, session %d established (%d active)",
- rlay->rl_conf.name, con->id, relay_sessions);
+ rlay->rl_conf.name, con->se_id, relay_sessions);
#endif
relay_session(con);
return;
retry:
- DPRINTF("relay_ssl_accept: session %d: scheduling on %s", con->id,
+ DPRINTF("relay_ssl_accept: session %d: scheduling on %s", con->se_id,
(retry_flag == EV_READ) ? "EV_READ" : "EV_WRITE");
- event_again(&con->ev, fd, EV_TIMEOUT|retry_flag, relay_ssl_accept,
- &con->tv_start, &env->sc_timeout, con);
+ event_again(&con->se_ev, fd, EV_TIMEOUT|retry_flag, relay_ssl_accept,
+ &con->se_tv_start, &env->sc_timeout, con);
}
void
@@ -2588,7 +2588,7 @@ relay_ssl_readcb(int fd, short event, void *arg)
struct bufferevent *bufev = arg;
struct ctl_relay_event *cre = (struct ctl_relay_event *)bufev->cbarg;
struct session *con = (struct session *)cre->con;
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
int ret = 0, ssl_err = 0;
short what = EVBUFFER_READ;
size_t len;
@@ -2610,11 +2610,11 @@ relay_ssl_readcb(int fd, short event, void *arg)
switch (ssl_err) {
case SSL_ERROR_WANT_READ:
DPRINTF("relay_ssl_readcb: session %d: "
- "want read", con->id);
+ "want read", con->se_id);
goto retry;
case SSL_ERROR_WANT_WRITE:
DPRINTF("relay_ssl_readcb: session %d: "
- "want write", con->id);
+ "want write", con->se_id);
goto retry;
default:
if (ret == 0)
@@ -2662,7 +2662,7 @@ relay_ssl_writecb(int fd, short event, void *arg)
struct bufferevent *bufev = arg;
struct ctl_relay_event *cre = (struct ctl_relay_event *)bufev->cbarg;
struct session *con = (struct session *)cre->con;
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
int ret = 0, ssl_err;
short what = EVBUFFER_WRITE;
@@ -2689,11 +2689,11 @@ relay_ssl_writecb(int fd, short event, void *arg)
switch (ssl_err) {
case SSL_ERROR_WANT_READ:
DPRINTF("relay_ssl_writecb: session %d: "
- "want read", con->id);
+ "want read", con->se_id);
goto retry;
case SSL_ERROR_WANT_WRITE:
DPRINTF("relay_ssl_writecb: session %d: "
- "want write", con->id);
+ "want write", con->se_id);
goto retry;
default:
if (ret == 0)
@@ -2912,13 +2912,13 @@ RB_GENERATE(proto_tree, protonode, nodes, relay_proto_cmp);
int
relay_session_cmp(struct session *a, struct session *b)
{
- struct relay *rlay = (struct relay *)b->relay;
+ struct relay *rlay = (struct relay *)b->se_relay;
struct protocol *proto = rlay->rl_proto;
if (proto != NULL && proto->cmp != NULL)
return ((*proto->cmp)(a, b));
- return ((int)a->id - b->id);
+ return ((int)a->se_id - b->se_id);
}
-SPLAY_GENERATE(session_tree, session, nodes, relay_session_cmp);
+SPLAY_GENERATE(session_tree, session, se_nodes, relay_session_cmp);
diff --git a/usr.sbin/relayd/relay_udp.c b/usr.sbin/relayd/relay_udp.c
index 8837cb2e101..4122630abaa 100644
--- a/usr.sbin/relayd/relay_udp.c
+++ b/usr.sbin/relayd/relay_udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay_udp.c,v 1.6 2008/01/31 09:56:28 reyk Exp $ */
+/* $OpenBSD: relay_udp.c,v 1.7 2008/01/31 12:12:50 thib Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -202,31 +202,31 @@ relay_udp_server(int fd, short sig, void *arg)
calloc(1, sizeof(struct session))) == NULL)
return;
- con->key = key;
- con->in.s = -1;
- con->out.s = -1;
- con->in.dst = &con->out;
- con->out.dst = &con->in;
- con->in.con = con;
- con->out.con = con;
- con->relay = rlay;
- con->id = ++relay_conid;
- con->outkey = rlay->rl_dstkey;
- con->in.tree = &proto->request_tree;
- con->out.tree = &proto->response_tree;
- con->in.dir = RELAY_DIR_REQUEST;
- con->out.dir = RELAY_DIR_RESPONSE;
- con->retry = rlay->rl_conf.dstretry;
- gettimeofday(&con->tv_start, NULL);
- bcopy(&con->tv_start, &con->tv_last, sizeof(con->tv_last));
- bcopy(&ss, &con->in.ss, sizeof(con->in.ss));
- con->out.port = rlay->rl_conf.dstport;
+ con->se_key = key;
+ con->se_in.s = -1;
+ con->se_out.s = -1;
+ con->se_in.dst = &con->se_out;
+ con->se_out.dst = &con->se_in;
+ con->se_in.con = con;
+ con->se_out.con = con;
+ con->se_relay = rlay;
+ con->se_id = ++relay_conid;
+ con->se_outkey = rlay->rl_dstkey;
+ con->se_in.tree = &proto->request_tree;
+ con->se_out.tree = &proto->response_tree;
+ con->se_in.dir = RELAY_DIR_REQUEST;
+ con->se_out.dir = RELAY_DIR_RESPONSE;
+ con->se_retry = rlay->rl_conf.dstretry;
+ gettimeofday(&con->se_tv_start, NULL);
+ bcopy(&con->se_tv_start, &con->se_tv_last, sizeof(con->se_tv_last));
+ bcopy(&ss, &con->se_in.ss, sizeof(con->se_in.ss));
+ con->se_out.port = rlay->rl_conf.dstport;
switch (ss.ss_family) {
case AF_INET:
- con->in.port = ((struct sockaddr_in *)&ss)->sin_port;
+ con->se_in.port = ((struct sockaddr_in *)&ss)->sin_port;
break;
case AF_INET6:
- con->in.port = ((struct sockaddr_in6 *)&ss)->sin6_port;
+ con->se_in.port = ((struct sockaddr_in6 *)&ss)->sin6_port;
break;
}
@@ -237,15 +237,15 @@ relay_udp_server(int fd, short sig, void *arg)
rlay->rl_stats[proc_id].last++;
/* Pre-allocate output buffer */
- con->out.output = evbuffer_new();
- if (con->out.output == NULL) {
+ con->se_out.output = evbuffer_new();
+ if (con->se_out.output == NULL) {
relay_close(con, "failed to allocate output buffer");
return;
}
/* Pre-allocate log buffer */
- con->log = evbuffer_new();
- if (con->log == NULL) {
+ con->se_log = evbuffer_new();
+ if (con->se_log == NULL) {
relay_close(con, "failed to allocate log buffer");
return;
}
@@ -259,7 +259,7 @@ relay_udp_server(int fd, short sig, void *arg)
}
/* Save the received data */
- if (evbuffer_add(con->out.output, buf, len) == -1) {
+ if (evbuffer_add(con->se_out.output, buf, len) == -1) {
relay_close(con, "failed to store buffer");
if (cnl != NULL)
free(cnl);
@@ -267,20 +267,20 @@ relay_udp_server(int fd, short sig, void *arg)
}
if (rlay->rl_conf.flags & F_NATLOOK && cnl != NULL) {
- con->cnl = cnl;;
+ con->se_cnl = cnl;
bzero(cnl, sizeof(*cnl));
cnl->in = -1;
- cnl->id = con->id;
+ cnl->id = con->se_id;
cnl->proc = proc_id;
- bcopy(&con->in.ss, &cnl->src, sizeof(cnl->src));
+ bcopy(&con->se_in.ss, &cnl->src, sizeof(cnl->src));
bcopy(&rlay->rl_conf.ss, &cnl->dst, sizeof(cnl->dst));
imsg_compose(ibuf_pfe, IMSG_NATLOOK, 0, 0, -1, cnl,
sizeof(*cnl));
/* Schedule timeout */
- evtimer_set(&con->ev, relay_natlook, con);
+ evtimer_set(&con->se_ev, relay_natlook, con);
bcopy(&rlay->rl_conf.timeout, &tv, sizeof(tv));
- evtimer_add(&con->ev, &tv);
+ evtimer_add(&con->se_ev, &tv);
return;
}
@@ -332,7 +332,7 @@ relay_dns_log(struct session *con, u_int8_t *buf)
log_debug("relay_dns_log: session %d: %s id 0x%x "
"flags 0x%x:0x%x qd %u an %u ns %u ar %u",
- con->id,
+ con->se_id,
hdr->dns_flags0 & DNS_F0_QR ? "response" : "request",
ntohs(hdr->dns_id),
hdr->dns_flags0,
@@ -367,10 +367,10 @@ relay_dns_validate(struct relay *rlay, struct sockaddr_storage *ss,
* Lookup if this response is for a known session and if the
* remote host matches the original destination of the request.
*/
- lookup.key = *key;
+ lookup.se_key = *key;
if ((con = SPLAY_FIND(session_tree,
&rlay->rl_sessions, &lookup)) != NULL &&
- relay_cmp_af(ss, &con->out.ss) == 0)
+ relay_cmp_af(ss, &con->se_out.ss) == 0)
relay_dns_response(con, buf, len);
/*
@@ -382,9 +382,9 @@ relay_dns_validate(struct relay *rlay, struct sockaddr_storage *ss,
int
relay_dns_request(struct session *con)
{
- struct relay *rlay = (struct relay *)con->relay;
- u_int8_t *buf = EVBUFFER_DATA(con->out.output);
- size_t len = EVBUFFER_LENGTH(con->out.output);
+ struct relay *rlay = (struct relay *)con->se_relay;
+ u_int8_t *buf = EVBUFFER_DATA(con->se_out.output);
+ size_t len = EVBUFFER_LENGTH(con->se_out.output);
struct relay_dnshdr *hdr;
socklen_t slen;
@@ -393,47 +393,47 @@ relay_dns_request(struct session *con)
if (debug)
relay_dns_log(con, buf);
- if (gettimeofday(&con->tv_start, NULL))
+ if (gettimeofday(&con->se_tv_start, NULL))
return (-1);
if (rlay->rl_dsttable != NULL) {
if (relay_from_table(con) != 0)
return (-1);
- } else if (con->out.ss.ss_family == AF_UNSPEC) {
- bcopy(&rlay->rl_conf.dstss, &con->out.ss, sizeof(con->out.ss));
- con->out.port = rlay->rl_conf.dstport;
+ } else if (con->se_out.ss.ss_family == AF_UNSPEC) {
+ bcopy(&rlay->rl_conf.dstss, &con->se_out.ss, sizeof(con->se_out.ss));
+ con->se_out.port = rlay->rl_conf.dstport;
}
- if (relay_socket_af(&con->out.ss, con->out.port) == -1)
+ if (relay_socket_af(&con->se_out.ss, con->se_out.port) == -1)
return (-1);
- slen = con->out.ss.ss_len;
+ slen = con->se_out.ss.ss_len;
/*
* Replace the DNS request Id with a random Id.
*/
hdr = (struct relay_dnshdr *)buf;
- con->outkey = con->key;
- con->key = arc4random() & 0xffff;
- hdr->dns_id = htons(con->key);
+ con->se_outkey = con->se_key;
+ con->se_key = arc4random() & 0xffff;
+ hdr->dns_id = htons(con->se_key);
retry:
if (sendto(rlay->rl_s, buf, len, 0,
- (struct sockaddr *)&con->out.ss, slen) == -1) {
- if (con->retry) {
- con->retry--;
+ (struct sockaddr *)&con->se_out.ss, slen) == -1) {
+ if (con->se_retry) {
+ con->se_retry--;
log_debug("relay_dns_request: session %d: "
"forward failed: %s, %s",
- con->id, strerror(errno),
- con->retry ? "next retry" : "last retry");
+ con->se_id, strerror(errno),
+ con->se_retry ? "next retry" : "last retry");
goto retry;
}
log_debug("relay_dns_request: session %d: forward failed: %s",
- con->id, strerror(errno));
+ con->se_id, strerror(errno));
return (-1);
}
- event_again(&con->ev, con->out.s, EV_TIMEOUT,
- relay_udp_timeout, &con->tv_start, &env->sc_timeout, con);
+ event_again(&con->se_ev, con->se_out.s, EV_TIMEOUT,
+ relay_udp_timeout, &con->se_tv_start, &env->sc_timeout, con);
return (0);
}
@@ -441,7 +441,7 @@ relay_dns_request(struct session *con)
void
relay_dns_response(struct session *con, u_int8_t *buf, size_t len)
{
- struct relay *rlay = (struct relay *)con->relay;
+ struct relay *rlay = (struct relay *)con->se_relay;
struct relay_dnshdr *hdr;
socklen_t slen;
@@ -452,11 +452,11 @@ relay_dns_response(struct session *con, u_int8_t *buf, size_t len)
* Replace the random DNS request Id with the original Id
*/
hdr = (struct relay_dnshdr *)buf;
- hdr->dns_id = htons(con->outkey);
+ hdr->dns_id = htons(con->se_outkey);
- slen = con->out.ss.ss_len;
+ slen = con->se_out.ss.ss_len;
if (sendto(rlay->rl_s, buf, len, 0,
- (struct sockaddr *)&con->in.ss, slen) == -1) {
+ (struct sockaddr *)&con->se_in.ss, slen) == -1) {
relay_close(con, "response failed");
return;
}
@@ -467,5 +467,5 @@ relay_dns_response(struct session *con, u_int8_t *buf, size_t len)
int
relay_dns_cmp(struct session *a, struct session *b)
{
- return (memcmp(&a->key, &b->key, sizeof(a->key)));
+ return (memcmp(&a->se_key, &b->se_key, sizeof(a->se_key)));
}
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index ce24c3bed1d..e2942c3e0aa 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.68 2008/01/31 09:56:28 reyk Exp $ */
+/* $OpenBSD: relayd.c,v 1.69 2008/01/31 12:12:50 thib Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -776,7 +776,7 @@ session_find(struct relayd *env, objid_t id)
TAILQ_FOREACH(rlay, env->sc_relays, rl_entry)
SPLAY_FOREACH(con, session_tree, &rlay->rl_sessions)
- if (con->id == id)
+ if (con->se_id == id)
return (con);
return (NULL);
}
diff --git a/usr.sbin/relayd/relayd.h b/usr.sbin/relayd/relayd.h
index c280f595145..7796ec104a7 100644
--- a/usr.sbin/relayd/relayd.h
+++ b/usr.sbin/relayd/relayd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.h,v 1.92 2008/01/31 09:56:29 reyk Exp $ */
+/* $OpenBSD: relayd.h,v 1.93 2008/01/31 12:12:50 thib Exp $ */
/*
* Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -405,24 +405,24 @@ struct rdr {
TAILQ_HEAD(rdrlist, rdr);
struct session {
- objid_t id;
- u_int32_t key;
- objid_t relayid;
- struct ctl_relay_event in;
- struct ctl_relay_event out;
- u_int32_t outkey;
- struct event ev;
- struct timeval timeout;
- struct timeval tv_start;
- struct timeval tv_last;
- int done;
- int retry;
- u_int16_t mark;
- struct evbuffer *log;
- void *relay;
- struct ctl_natlook *cnl;
-
- SPLAY_ENTRY(session) nodes;
+ objid_t se_id;
+ u_int32_t se_key;
+ objid_t se_relayid;
+ struct ctl_relay_event se_in;
+ struct ctl_relay_event se_out;
+ u_int32_t se_outkey;
+ struct event se_ev;
+ struct timeval se_timeout;
+ struct timeval se_tv_start;
+ struct timeval se_tv_last;
+ int se_done;
+ int se_retry;
+ u_int16_t se_mark;
+ struct evbuffer *se_log;
+ void *se_relay;
+ struct ctl_natlook *se_cnl;
+
+ SPLAY_ENTRY(session) se_nodes;
};
SPLAY_HEAD(session_tree, session);
@@ -746,8 +746,8 @@ void relay_notify_done(struct host *, const char *);
int relay_session_cmp(struct session *, struct session *);
int relay_load_certfiles(struct relay *);
-RB_PROTOTYPE(proto_tree, protonode, nodes, relay_proto_cmp);
-SPLAY_PROTOTYPE(session_tree, session, nodes, relay_session_cmp);
+RB_PROTOTYPE(proto_tree, protonode, se_nodes, relay_proto_cmp);
+SPLAY_PROTOTYPE(session_tree, session, se_nodes, relay_session_cmp);
/* relay_udp.c */
void relay_udp_privinit(struct relayd *, struct relay *);