summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2013-06-01 18:16:36 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2013-06-01 18:16:36 +0000
commit2076baea62b2344c9604e5f404b38ac9f906efce (patch)
tree88b2aa93713242f403c1a737e53c4f86f59ab811 /usr.sbin/ldpd
parent94855cb90cba1d4f1af8a561b0c90ea0d9ddd2d9 (diff)
After returning from accept, we got a TCP connection not a LDP session.
Rename event/actions in the discovery FSM to avoid confusion * NBR_EVT_SESSION_UP -> NBR_EVT_CONNECT_UP * NBR_ACT_SESSION_EST -> NBR_ACT_CONNECT_SETUP * nbr_act_session_establish -> nbr_act_connect_setup * NBR_ACT_INIT_SEND -> NBR_ACT_PASSIVE_INIT * NBR_ACT_STRT_KTIMER -> NBR_ACT_SESSION_EST Diff by Renato Westphal
Diffstat (limited to 'usr.sbin/ldpd')
-rw-r--r--usr.sbin/ldpd/ldpd.h10
-rw-r--r--usr.sbin/ldpd/ldpe.h4
-rw-r--r--usr.sbin/ldpd/neighbor.c30
-rw-r--r--usr.sbin/ldpd/packet.c4
4 files changed, 24 insertions, 24 deletions
diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h
index a41f6c39df6..d1780268727 100644
--- a/usr.sbin/ldpd/ldpd.h
+++ b/usr.sbin/ldpd/ldpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.h,v 1.30 2013/05/31 14:11:31 claudio Exp $ */
+/* $OpenBSD: ldpd.h,v 1.31 2013/06/01 18:16:35 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -150,7 +150,7 @@ enum iface_type {
enum nbr_event {
NBR_EVT_NOTHING,
NBR_EVT_HELLO_RCVD,
- NBR_EVT_SESSION_UP,
+ NBR_EVT_CONNECT_UP,
NBR_EVT_CLOSE_SESSION,
NBR_EVT_INIT_RCVD,
NBR_EVT_KEEPALIVE_RCVD,
@@ -165,10 +165,10 @@ enum nbr_action {
NBR_ACT_STRT_ITIMER,
NBR_ACT_RST_ITIMER,
NBR_ACT_RST_KTIMEOUT,
- NBR_ACT_STRT_KTIMER,
- NBR_ACT_RST_KTIMER,
NBR_ACT_SESSION_EST,
- NBR_ACT_INIT_SEND,
+ NBR_ACT_RST_KTIMER,
+ NBR_ACT_CONNECT_SETUP,
+ NBR_ACT_PASSIVE_INIT,
NBR_ACT_KEEPALIVE_SEND,
NBR_ACT_CLOSE_SESSION
};
diff --git a/usr.sbin/ldpd/ldpe.h b/usr.sbin/ldpd/ldpe.h
index 0cd8367daaf..f45a27aeb5a 100644
--- a/usr.sbin/ldpd/ldpe.h
+++ b/usr.sbin/ldpd/ldpe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpe.h,v 1.18 2013/06/01 01:34:57 claudio Exp $ */
+/* $OpenBSD: ldpe.h,v 1.19 2013/06/01 18:16:35 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -177,7 +177,7 @@ int nbr_pending_idtimer(struct nbr *);
int nbr_pending_connect(struct nbr *);
int nbr_establish_connection(struct nbr *);
-int nbr_act_session_establish(struct nbr *, int);
+int nbr_act_connect_setup(struct nbr *, int);
void nbr_mapping_add(struct nbr *, struct mapping_head *,
struct map *);
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index 9ab7cdaa74a..b189ad6a2e9 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.27 2013/06/01 01:34:57 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.28 2013/06/01 18:16:35 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -98,9 +98,9 @@ struct {
{NBR_STA_DOWN, NBR_EVT_HELLO_RCVD, NBR_ACT_STRT_ITIMER, NBR_STA_PRESENT},
{NBR_STA_SESSION, NBR_EVT_HELLO_RCVD, NBR_ACT_RST_ITIMER, 0},
/* Passive Role */
- {NBR_STA_PRESENT, NBR_EVT_SESSION_UP, NBR_ACT_SESSION_EST, NBR_STA_INITIAL},
- {NBR_STA_INITIAL, NBR_EVT_INIT_RCVD, NBR_ACT_INIT_SEND, NBR_STA_OPENREC},
- {NBR_STA_OPENREC, NBR_EVT_KEEPALIVE_RCVD, NBR_ACT_STRT_KTIMER, NBR_STA_OPER},
+ {NBR_STA_PRESENT, NBR_EVT_CONNECT_UP, NBR_ACT_CONNECT_SETUP, NBR_STA_INITIAL},
+ {NBR_STA_INITIAL, NBR_EVT_INIT_RCVD, NBR_ACT_PASSIVE_INIT, NBR_STA_OPENREC},
+ {NBR_STA_OPENREC, NBR_EVT_KEEPALIVE_RCVD, NBR_ACT_SESSION_EST, NBR_STA_OPER},
/* Active Role */
{NBR_STA_PRESENT, NBR_EVT_INIT_SENT, NBR_ACT_NOTHING, NBR_STA_OPENSENT},
{NBR_STA_OPENSENT, NBR_EVT_INIT_RCVD, NBR_ACT_KEEPALIVE_SEND, NBR_STA_OPER},
@@ -115,7 +115,7 @@ struct {
const char * const nbr_event_names[] = {
"NOTHING",
"HELLO RECEIVED",
- "SESSION UP",
+ "CONNECTION UP",
"SESSION CLOSE",
"INIT RECEIVED",
"KEEPALIVE RECEIVED",
@@ -129,10 +129,10 @@ const char * const nbr_action_names[] = {
"START INACTIVITY TIMER",
"RESET INACTIVITY TIMER",
"RESET KEEPALIVE TIMEOUT",
- "START KEEPALIVE TIMER",
- "RESET KEEPALIVE TIMER",
"START NEIGHBOR SESSION",
- "SEND INIT",
+ "RESET KEEPALIVE TIMER",
+ "SETUP NEIGHBOR CONNECTION",
+ "SEND INIT AND KEEPALIVE",
"SEND KEEPALIVE",
"CLOSE SESSION"
};
@@ -178,17 +178,17 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event)
case NBR_ACT_RST_KTIMER:
nbr_start_ktimer(nbr);
break;
- case NBR_ACT_STRT_KTIMER:
+ case NBR_ACT_SESSION_EST:
nbr_act_session_operational(nbr);
nbr_start_ktimer(nbr);
nbr_start_ktimeout(nbr);
send_address(nbr, NULL);
nbr_send_labelmappings(nbr);
break;
- case NBR_ACT_SESSION_EST:
- ret = nbr_act_session_establish(nbr, 0);
+ case NBR_ACT_CONNECT_SETUP:
+ ret = nbr_act_connect_setup(nbr, 0);
break;
- case NBR_ACT_INIT_SEND:
+ case NBR_ACT_PASSIVE_INIT:
send_init(nbr);
send_keepalive(nbr);
break;
@@ -522,7 +522,7 @@ nbr_connect_cb(int fd, short event, void *arg)
return;
}
- nbr_act_session_establish(nbr, 1);
+ nbr_act_connect_setup(nbr, 1);
}
int
@@ -574,11 +574,11 @@ nbr_establish_connection(struct nbr *nbr)
}
/* connection completed immediately */
- return (nbr_act_session_establish(nbr, 1));
+ return (nbr_act_connect_setup(nbr, 1));
}
int
-nbr_act_session_establish(struct nbr *nbr, int active)
+nbr_act_connect_setup(struct nbr *nbr, int active)
{
evbuf_init(&nbr->wbuf, nbr->fd, session_write, nbr);
event_set(&nbr->rev, nbr->fd, EV_READ | EV_PERSIST, session_read, nbr);
diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c
index a9b9be8b8a0..544d9d4e201 100644
--- a/usr.sbin/ldpd/packet.c
+++ b/usr.sbin/ldpd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.19 2013/06/01 01:39:04 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.20 2013/06/01 18:16:35 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -293,7 +293,7 @@ session_accept(int fd, short event, void *bula)
}
nbr->fd = newfd;
- nbr_fsm(nbr, NBR_EVT_SESSION_UP);
+ nbr_fsm(nbr, NBR_EVT_CONNECT_UP);
}
void