laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-cbc/+/28702 )
Change subject: Rename {cbsp,sbcap}_server(_fsm).h s/server/link/
......................................................................
Rename {cbsp,sbcap}_server(_fsm).h s/server/link/
Change-Id: I1e56dd1fcba23f6efd209e9d4dcdc88c8866d250
---
M include/osmocom/cbc/Makefile.am
R include/osmocom/cbc/cbsp_link.h
A include/osmocom/cbc/cbsp_link_fsm.h
D include/osmocom/cbc/cbsp_server_fsm.h
R include/osmocom/cbc/sbcap_link.h
A include/osmocom/cbc/sbcap_link_fsm.h
D include/osmocom/cbc/sbcap_server_fsm.h
M src/Makefile.am
M src/cbc_main.c
M src/cbc_peer.c
M src/cbc_vty.c
R src/cbsp_link.c
R src/cbsp_link_fsm.c
M src/message_handling.c
R src/sbcap_link.c
R src/sbcap_link_fsm.c
M src/sbcap_msg.c
M src/smscb_message_fsm.c
M src/smscb_peer_fsm.c
19 files changed, 170 insertions(+), 170 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/cbc/Makefile.am b/include/osmocom/cbc/Makefile.am
index 72af597..b345434 100644
--- a/include/osmocom/cbc/Makefile.am
+++ b/include/osmocom/cbc/Makefile.am
@@ -3,13 +3,13 @@
cbc_peer.h \
cbc_message.h \
cbc_vty.h \
- cbsp_server.h \
- cbsp_server_fsm.h \
+ cbsp_link.h \
+ cbsp_link_fsm.h \
charset.h \
debug.h \
sbcap_msg.h \
- sbcap_server.h \
- sbcap_server_fsm.h \
+ sbcap_link.h \
+ sbcap_link_fsm.h \
rest_it_op.h \
smscb_message_fsm.h \
$(NULL)
diff --git a/include/osmocom/cbc/cbsp_server.h b/include/osmocom/cbc/cbsp_link.h
similarity index 100%
rename from include/osmocom/cbc/cbsp_server.h
rename to include/osmocom/cbc/cbsp_link.h
diff --git a/include/osmocom/cbc/cbsp_link_fsm.h b/include/osmocom/cbc/cbsp_link_fsm.h
new file mode 100644
index 0000000..8b48f76
--- /dev/null
+++ b/include/osmocom/cbc/cbsp_link_fsm.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <stdint.h>
+#include <osmocom/core/fsm.h>
+
+extern struct osmo_fsm cbsp_link_fsm;
+
+enum cbsp_link_event {
+ CBSP_LINK_E_RX_RST_COMPL, /* reset complete received */
+ CBSP_LINK_E_RX_RST_FAIL, /* reset failure received */
+ CBSP_LINK_E_RX_KA_COMPL, /* keep-alive complete received */
+ CBSP_LINK_E_RX_RESTART, /* restart received */
+ CBSP_LINK_E_CMD_RESET, /* RESET command from CBC */
+ CBSP_LINK_E_CMD_CLOSE, /* CLOSE command from CBC */
+};
diff --git a/include/osmocom/cbc/cbsp_server_fsm.h
b/include/osmocom/cbc/cbsp_server_fsm.h
deleted file mode 100644
index 7f16fc6..0000000
--- a/include/osmocom/cbc/cbsp_server_fsm.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-#include <osmocom/core/fsm.h>
-
-extern struct osmo_fsm cbsp_server_fsm;
-
-enum cbsp_server_event {
- CBSP_SRV_E_RX_RST_COMPL, /* reset complete received */
- CBSP_SRV_E_RX_RST_FAIL, /* reset failure received */
- CBSP_SRV_E_RX_KA_COMPL, /* keep-alive complete received */
- CBSP_SRV_E_RX_RESTART, /* restart received */
- CBSP_SRV_E_CMD_RESET, /* RESET command from CBC */
- CBSP_SRV_E_CMD_CLOSE, /* CLOSE command from CBC */
-};
diff --git a/include/osmocom/cbc/sbcap_server.h b/include/osmocom/cbc/sbcap_link.h
similarity index 100%
rename from include/osmocom/cbc/sbcap_server.h
rename to include/osmocom/cbc/sbcap_link.h
diff --git a/include/osmocom/cbc/sbcap_link_fsm.h b/include/osmocom/cbc/sbcap_link_fsm.h
new file mode 100644
index 0000000..e41f1d2
--- /dev/null
+++ b/include/osmocom/cbc/sbcap_link_fsm.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <stdint.h>
+#include <osmocom/core/fsm.h>
+
+extern struct osmo_fsm sbcap_link_fsm;
+
+enum sbcap_link_event {
+ SBcAP_LINK_E_RX_RST_COMPL, /* reset complete received */
+ SBcAP_LINK_E_RX_RST_FAIL, /* reset failure received */
+ SBcAP_LINK_E_RX_KA_COMPL, /* keep-alive complete received */
+ SBcAP_LINK_E_RX_RESTART, /* restart received */
+ SBcAP_LINK_E_CMD_RESET, /* RESET command from CBC */
+ SBcAP_LINK_E_CMD_CLOSE, /* CLOSE command from CBC */
+};
diff --git a/include/osmocom/cbc/sbcap_server_fsm.h
b/include/osmocom/cbc/sbcap_server_fsm.h
deleted file mode 100644
index 46bd29d..0000000
--- a/include/osmocom/cbc/sbcap_server_fsm.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-#include <osmocom/core/fsm.h>
-
-extern struct osmo_fsm sbcap_server_fsm;
-
-enum sbcap_server_event {
- SBcAP_SRV_E_RX_RST_COMPL, /* reset complete received */
- SBcAP_SRV_E_RX_RST_FAIL, /* reset failure received */
- SBcAP_SRV_E_RX_KA_COMPL, /* keep-alive complete received */
- SBcAP_SRV_E_RX_RESTART, /* restart received */
- SBcAP_SRV_E_CMD_RESET, /* RESET command from CBC */
- SBcAP_SRV_E_CMD_CLOSE, /* CLOSE command from CBC */
-};
diff --git a/src/Makefile.am b/src/Makefile.am
index e3458e5..32cccd7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,15 +14,15 @@
cbc_message.c \
cbc_peer.c \
cbc_vty.c \
- cbsp_server.c \
- cbsp_server_fsm.c \
+ cbsp_link.c \
+ cbsp_link_fsm.c \
rest_api.c \
charset.c \
message_handling.c \
rest_it_op.c \
sbcap_msg.c \
- sbcap_server.c \
- sbcap_server_fsm.c \
+ sbcap_link.c \
+ sbcap_link_fsm.c \
smscb_peer_fsm.c \
smscb_message_fsm.c \
$(NULL)
diff --git a/src/cbc_main.c b/src/cbc_main.c
index 211d8c6..dcc1725 100644
--- a/src/cbc_main.c
+++ b/src/cbc_main.c
@@ -46,8 +46,8 @@
#include <osmocom/cbc/debug.h>
#include <osmocom/cbc/rest_it_op.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/sbcap_server.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/sbcap_link.h>
#include <osmocom/cbc/cbc_data.h>
#include <osmocom/cbc/cbc_vty.h>
diff --git a/src/cbc_peer.c b/src/cbc_peer.c
index 366da16..e8b79f9 100644
--- a/src/cbc_peer.c
+++ b/src/cbc_peer.c
@@ -30,8 +30,8 @@
#include <osmocom/cbc/cbc_message.h>
#include <osmocom/cbc/cbc_peer.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/sbcap_server.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/sbcap_link.h>
const struct value_string cbc_peer_proto_name[] = {
{ CBC_PEER_PROTO_CBSP, "CBSP" },
diff --git a/src/cbc_vty.c b/src/cbc_vty.c
index 2a6f28b..e27423e 100644
--- a/src/cbc_vty.c
+++ b/src/cbc_vty.c
@@ -34,8 +34,8 @@
#include <osmocom/cbc/cbc_message.h>
#include <osmocom/cbc/cbc_peer.h>
#include <osmocom/cbc/cbc_vty.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/sbcap_server.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/sbcap_link.h>
static void dump_one_cbc_peer(struct vty *vty, const struct cbc_peer *peer)
{
diff --git a/src/cbsp_server.c b/src/cbsp_link.c
similarity index 95%
rename from src/cbsp_server.c
rename to src/cbsp_link.c
index e9dc882..355d345 100644
--- a/src/cbsp_server.c
+++ b/src/cbsp_link.c
@@ -33,8 +33,8 @@
#include <osmocom/netif/stream.h>
#include <osmocom/cbc/debug.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/cbsp_server_fsm.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/cbsp_link_fsm.h>
#include <osmocom/cbc/cbc_peer.h>
const char *cbc_cbsp_link_name(const struct cbc_cbsp_link *link)
@@ -103,7 +103,7 @@
link->peer->link.cbsp = NULL;
link->conn = NULL;
if (link->fi)
- osmo_fsm_inst_dispatch(link->fi, CBSP_SRV_E_CMD_CLOSE, NULL);
+ osmo_fsm_inst_dispatch(link->fi, CBSP_LINK_E_CMD_CLOSE, NULL);
return 0;
}
@@ -131,7 +131,7 @@
talloc_free(link);
return -1;
}
- link->fi = osmo_fsm_inst_alloc(&cbsp_server_fsm, link, link, LOGL_DEBUG, NULL);
+ link->fi = osmo_fsm_inst_alloc(&cbsp_link_fsm, link, link, LOGL_DEBUG, NULL);
if (!link->fi) {
LOGPCC(link, LOGL_ERROR, "Unable to allocate FSM\n");
osmo_stream_srv_destroy(link->conn);
@@ -164,7 +164,7 @@
link->peer->link.cbsp = link;
}
- osmo_fsm_inst_dispatch(link->fi, CBSP_SRV_E_CMD_RESET, NULL);
+ osmo_fsm_inst_dispatch(link->fi, CBSP_LINK_E_CMD_RESET, NULL);
return 0;
}
diff --git a/src/cbsp_server_fsm.c b/src/cbsp_link_fsm.c
similarity index 69%
rename from src/cbsp_server_fsm.c
rename to src/cbsp_link_fsm.c
index b35a458..3526901 100644
--- a/src/cbsp_server_fsm.c
+++ b/src/cbsp_link_fsm.c
@@ -24,8 +24,8 @@
#include <osmocom/cbc/cbc_message.h>
#include <osmocom/cbc/cbc_peer.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/cbsp_server_fsm.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/cbsp_link_fsm.h>
#include <osmocom/cbc/debug.h>
#include <osmocom/cbc/smscb_message_fsm.h>
@@ -40,44 +40,44 @@
#define T_WAIT_RESET_RESP 3
#define T_WAIT_RESET_RESP_SECS 5
-enum cbsp_server_state {
+enum cbsp_link_state {
/* initial state after link TCP connection established */
- CBSP_SRV_S_INIT,
+ CBSP_LINK_S_INIT,
/* RESET has been sent to BSC, waiting for response */
- CBSP_SRV_S_RESET_PENDING,
+ CBSP_LINK_S_RESET_PENDING,
/* Keep-Alive has been sent, waiting for response */
- CBSP_SRV_S_KEEPALIVE_PENDING,
+ CBSP_LINK_S_KEEPALIVE_PENDING,
/* normal operation (idle) */
- CBSP_SRV_S_IDLE,
+ CBSP_LINK_S_IDLE,
};
-static const struct value_string cbsp_server_event_names[] = {
- { CBSP_SRV_E_RX_RST_COMPL, "Rx Reset Complete" },
- { CBSP_SRV_E_RX_RST_FAIL, "Rx Reset Failure" },
- { CBSP_SRV_E_RX_KA_COMPL, "Rx Keep-Alive Complete" },
- { CBSP_SRV_E_RX_RESTART, "Rx Restart" },
- { CBSP_SRV_E_CMD_RESET, "RESET.cmd" },
- { CBSP_SRV_E_CMD_CLOSE, "CLOSE.cmd" },
+static const struct value_string cbsp_link_event_names[] = {
+ { CBSP_LINK_E_RX_RST_COMPL, "Rx Reset Complete" },
+ { CBSP_LINK_E_RX_RST_FAIL, "Rx Reset Failure" },
+ { CBSP_LINK_E_RX_KA_COMPL, "Rx Keep-Alive Complete" },
+ { CBSP_LINK_E_RX_RESTART, "Rx Restart" },
+ { CBSP_LINK_E_CMD_RESET, "RESET.cmd" },
+ { CBSP_LINK_E_CMD_CLOSE, "CLOSE.cmd" },
{ 0, NULL }
};
-static void cbsp_server_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+static void cbsp_link_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch (event) {
- case CBSP_SRV_E_CMD_RESET:
- osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_RESET_PENDING, 0, 0);
+ case CBSP_LINK_E_CMD_RESET:
+ osmo_fsm_inst_state_chg(fi, CBSP_LINK_S_RESET_PENDING, 0, 0);
break;
default:
OSMO_ASSERT(0);
}
}
-static void cbsp_server_s_reset_pending_onenter(struct osmo_fsm_inst *fi, uint32_t
prev_state)
+static void cbsp_link_s_reset_pending_onenter(struct osmo_fsm_inst *fi, uint32_t
prev_state)
{
struct cbc_cbsp_link *link = (struct cbc_cbsp_link *) fi->priv;
struct osmo_cbsp_decoded *cbspd;
- if (prev_state == CBSP_SRV_S_RESET_PENDING)
+ if (prev_state == CBSP_LINK_S_RESET_PENDING)
return;
cbspd = talloc_zero(fi, struct osmo_cbsp_decoded);
@@ -88,29 +88,29 @@
cbc_cbsp_link_tx(link, cbspd);
/* wait for response */
- osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_RESET_PENDING, T_WAIT_RESET_RESP_SECS,
+ osmo_fsm_inst_state_chg(fi, CBSP_LINK_S_RESET_PENDING, T_WAIT_RESET_RESP_SECS,
T_WAIT_RESET_RESP);
}
-static void cbsp_server_s_reset_pending(struct osmo_fsm_inst *fi, uint32_t event, void
*data)
+static void cbsp_link_s_reset_pending(struct osmo_fsm_inst *fi, uint32_t event, void
*data)
{
switch (event) {
- case CBSP_SRV_E_RX_RST_COMPL:
- osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_IDLE, 0, 0);
+ case CBSP_LINK_E_RX_RST_COMPL:
+ osmo_fsm_inst_state_chg(fi, CBSP_LINK_S_IDLE, 0, 0);
break;
- case CBSP_SRV_E_RX_RST_FAIL:
- osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_IDLE, 0, 0);
+ case CBSP_LINK_E_RX_RST_FAIL:
+ osmo_fsm_inst_state_chg(fi, CBSP_LINK_S_IDLE, 0, 0);
break;
default:
OSMO_ASSERT(0);
}
}
-static void cbsp_server_s_keepalive_pending(struct osmo_fsm_inst *fi, uint32_t event,
void *data)
+static void cbsp_link_s_keepalive_pending(struct osmo_fsm_inst *fi, uint32_t event, void
*data)
{
switch (event) {
- case CBSP_SRV_E_RX_KA_COMPL:
- osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_IDLE, 0, 0);
+ case CBSP_LINK_E_RX_KA_COMPL:
+ osmo_fsm_inst_state_chg(fi, CBSP_LINK_S_IDLE, 0, 0);
break;
default:
OSMO_ASSERT(0);
@@ -120,13 +120,13 @@
/* a bit of a hack to ensure the keep-aliver timer is started every time we enter
* the IDLE state, without putting the burden on the caller of
* osmo_fsm_inst_state_chg() to specify T_KEEPALIVE + T_KEEPALIVE_SECS */
-static void cbsp_server_s_idle_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
+static void cbsp_link_s_idle_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
{
fi->T = T_KEEPALIVE;
osmo_timer_schedule(&fi->timer, T_KEEPALIVE_SECS, 0);
}
-static void cbsp_server_s_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+static void cbsp_link_s_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch (event) {
default:
@@ -134,7 +134,7 @@
}
}
-static int cbsp_server_fsm_timer_cb(struct osmo_fsm_inst *fi)
+static int cbsp_link_fsm_timer_cb(struct osmo_fsm_inst *fi)
{
struct cbc_cbsp_link *link = (struct cbc_cbsp_link *) fi->priv;
struct osmo_cbsp_decoded *cbspd;
@@ -148,7 +148,7 @@
cbspd->u.keep_alive.repetition_period = T_KEEPALIVE_SECS;
cbc_cbsp_link_tx(link, cbspd);
/* wait for response */
- osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_KEEPALIVE_PENDING, T_WAIT_KEEPALIVE_RESP_SECS,
+ osmo_fsm_inst_state_chg(fi, CBSP_LINK_S_KEEPALIVE_PENDING, T_WAIT_KEEPALIVE_RESP_SECS,
T_WAIT_KEEPALIVE_RESP);
return 0;
case T_WAIT_KEEPALIVE_RESP:
@@ -160,16 +160,16 @@
}
}
-static void cbsp_server_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void
*data)
+static void cbsp_link_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct cbc_cbsp_link *link = (struct cbc_cbsp_link *) fi->priv;
struct osmo_cbsp_decoded *dec;
switch (event) {
- case CBSP_SRV_E_CMD_CLOSE:
+ case CBSP_LINK_E_CMD_CLOSE:
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, NULL);
break;
- case CBSP_SRV_E_RX_RESTART:
+ case CBSP_LINK_E_RX_RESTART:
dec = data;
/* if BSC has _not_ lost messages, skip */
if (dec->u.restart.recovery_ind == 0)
@@ -192,7 +192,7 @@
}
}
-static void cbsp_server_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause
cause)
+static void cbsp_link_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause
cause)
{
struct cbc_cbsp_link *link = (struct cbc_cbsp_link *) fi->priv;
@@ -207,49 +207,49 @@
talloc_free(link);
}
-static const struct osmo_fsm_state cbsp_server_fsm_states[] = {
- [CBSP_SRV_S_INIT] = {
+static const struct osmo_fsm_state cbsp_link_fsm_states[] = {
+ [CBSP_LINK_S_INIT] = {
.name = "INIT",
- .in_event_mask = S(CBSP_SRV_E_CMD_RESET),
- .out_state_mask = S(CBSP_SRV_S_RESET_PENDING),
- .action = cbsp_server_s_init,
+ .in_event_mask = S(CBSP_LINK_E_CMD_RESET),
+ .out_state_mask = S(CBSP_LINK_S_RESET_PENDING),
+ .action = cbsp_link_s_init,
},
- [CBSP_SRV_S_RESET_PENDING] = {
+ [CBSP_LINK_S_RESET_PENDING] = {
.name = "RESET_PENDING",
- .in_event_mask = S(CBSP_SRV_E_RX_RST_COMPL) |
- S(CBSP_SRV_E_RX_RST_FAIL),
- .out_state_mask = S(CBSP_SRV_S_IDLE) |
- S(CBSP_SRV_S_RESET_PENDING),
- .action = cbsp_server_s_reset_pending,
- .onenter = cbsp_server_s_reset_pending_onenter,
+ .in_event_mask = S(CBSP_LINK_E_RX_RST_COMPL) |
+ S(CBSP_LINK_E_RX_RST_FAIL),
+ .out_state_mask = S(CBSP_LINK_S_IDLE) |
+ S(CBSP_LINK_S_RESET_PENDING),
+ .action = cbsp_link_s_reset_pending,
+ .onenter = cbsp_link_s_reset_pending_onenter,
},
- [CBSP_SRV_S_KEEPALIVE_PENDING] = {
+ [CBSP_LINK_S_KEEPALIVE_PENDING] = {
.name = "KEEPALIVE_PENDING",
- .in_event_mask = S(CBSP_SRV_E_RX_KA_COMPL),
- .out_state_mask = S(CBSP_SRV_S_IDLE) |
- S(CBSP_SRV_S_KEEPALIVE_PENDING),
- .action = cbsp_server_s_keepalive_pending,
+ .in_event_mask = S(CBSP_LINK_E_RX_KA_COMPL),
+ .out_state_mask = S(CBSP_LINK_S_IDLE) |
+ S(CBSP_LINK_S_KEEPALIVE_PENDING),
+ .action = cbsp_link_s_keepalive_pending,
},
- [CBSP_SRV_S_IDLE] = {
+ [CBSP_LINK_S_IDLE] = {
.name = "IDLE",
.in_event_mask = 0,
- .out_state_mask = S(CBSP_SRV_S_KEEPALIVE_PENDING),
- .action = cbsp_server_s_idle,
- .onenter = cbsp_server_s_idle_onenter,
+ .out_state_mask = S(CBSP_LINK_S_KEEPALIVE_PENDING),
+ .action = cbsp_link_s_idle,
+ .onenter = cbsp_link_s_idle_onenter,
},
};
-struct osmo_fsm cbsp_server_fsm = {
- .name = "CBSP-SERVER",
- .states = cbsp_server_fsm_states,
- .num_states = ARRAY_SIZE(cbsp_server_fsm_states),
- .allstate_event_mask = S(CBSP_SRV_E_CMD_CLOSE) |
- S(CBSP_SRV_E_RX_RESTART),
- .allstate_action = cbsp_server_fsm_allstate,
- .timer_cb = cbsp_server_fsm_timer_cb,
+struct osmo_fsm cbsp_link_fsm = {
+ .name = "CBSP-Link",
+ .states = cbsp_link_fsm_states,
+ .num_states = ARRAY_SIZE(cbsp_link_fsm_states),
+ .allstate_event_mask = S(CBSP_LINK_E_CMD_CLOSE) |
+ S(CBSP_LINK_E_RX_RESTART),
+ .allstate_action = cbsp_link_fsm_allstate,
+ .timer_cb = cbsp_link_fsm_timer_cb,
.log_subsys = DCBSP,
- .event_names = cbsp_server_event_names,
- .cleanup = cbsp_server_fsm_cleanup,
+ .event_names = cbsp_link_event_names,
+ .cleanup = cbsp_link_fsm_cleanup,
};
static int get_msg_id(const struct osmo_cbsp_decoded *dec)
@@ -282,10 +282,10 @@
/* messages without reference to a specific SMSCB message */
switch (dec->msg_type) {
case CBSP_MSGT_RESTART:
- osmo_fsm_inst_dispatch(link->fi, CBSP_SRV_E_RX_RESTART, dec);
+ osmo_fsm_inst_dispatch(link->fi, CBSP_LINK_E_RX_RESTART, dec);
return 0;
case CBSP_MSGT_KEEP_ALIVE_COMPL:
- osmo_fsm_inst_dispatch(link->fi, CBSP_SRV_E_RX_KA_COMPL, dec);
+ osmo_fsm_inst_dispatch(link->fi, CBSP_LINK_E_RX_KA_COMPL, dec);
return 0;
case CBSP_MSGT_FAILURE:
LOGPCC(link, LOGL_ERROR, "CBSP FAILURE (bcast_msg_type=%u)\n",
@@ -299,9 +299,9 @@
/* TODO: old/new serial number, channel_ind */
return 0;
case CBSP_MSGT_RESET_COMPL:
- return osmo_fsm_inst_dispatch(link->fi, CBSP_SRV_E_RX_RST_COMPL, dec);
+ return osmo_fsm_inst_dispatch(link->fi, CBSP_LINK_E_RX_RST_COMPL, dec);
case CBSP_MSGT_RESET_FAIL:
- return osmo_fsm_inst_dispatch(link->fi, CBSP_SRV_E_RX_RST_FAIL, dec);
+ return osmo_fsm_inst_dispatch(link->fi, CBSP_LINK_E_RX_RST_FAIL, dec);
case CBSP_MSGT_KEEP_ALIVE:
case CBSP_MSGT_LOAD_QUERY_COMPL:
case CBSP_MSGT_LOAD_QUERY_FAIL:
@@ -366,5 +366,5 @@
static __attribute__((constructor)) void on_dso_load_cbsp_srv_fsm(void)
{
- OSMO_ASSERT(osmo_fsm_register(&cbsp_server_fsm) == 0);
+ OSMO_ASSERT(osmo_fsm_register(&cbsp_link_fsm) == 0);
}
diff --git a/src/message_handling.c b/src/message_handling.c
index e18a181..73898e1 100644
--- a/src/message_handling.c
+++ b/src/message_handling.c
@@ -28,8 +28,8 @@
#include <osmocom/gsm/cbsp.h>
#include <osmocom/cbc/cbc_data.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/sbcap_server.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/sbcap_link.h>
#include <osmocom/cbc/sbcap_msg.h>
#include <osmocom/cbc/rest_it_op.h>
#include <osmocom/cbc/debug.h>
diff --git a/src/sbcap_server.c b/src/sbcap_link.c
similarity index 95%
rename from src/sbcap_server.c
rename to src/sbcap_link.c
index 1066ddc..502eaca 100644
--- a/src/sbcap_server.c
+++ b/src/sbcap_link.c
@@ -36,8 +36,8 @@
#include <osmocom/sbcap/sbcap_common.h>
#include <osmocom/cbc/cbc_data.h>
-#include <osmocom/cbc/sbcap_server.h>
-#include <osmocom/cbc/sbcap_server_fsm.h>
+#include <osmocom/cbc/sbcap_link.h>
+#include <osmocom/cbc/sbcap_link_fsm.h>
#include <osmocom/cbc/cbc_peer.h>
#include <osmocom/cbc/debug.h>
@@ -131,7 +131,7 @@
link->peer->link.sbcap = NULL;
link->conn = NULL;
if (link->fi)
- osmo_fsm_inst_dispatch(link->fi, SBcAP_SRV_E_CMD_CLOSE, NULL);
+ osmo_fsm_inst_dispatch(link->fi, SBcAP_LINK_E_CMD_CLOSE, NULL);
return 0;
}
@@ -159,7 +159,7 @@
talloc_free(link);
return -1;
}
- link->fi = osmo_fsm_inst_alloc(&sbcap_server_fsm, link, link, LOGL_DEBUG, NULL);
+ link->fi = osmo_fsm_inst_alloc(&sbcap_link_fsm, link, link, LOGL_DEBUG, NULL);
if (!link->fi) {
LOGPSBCAPC(link, LOGL_ERROR, "Unable to allocate FSM\n");
osmo_stream_srv_destroy(link->conn);
@@ -192,7 +192,7 @@
link->peer->link.sbcap = link;
}
- osmo_fsm_inst_dispatch(link->fi, SBcAP_SRV_E_CMD_RESET, NULL);
+ osmo_fsm_inst_dispatch(link->fi, SBcAP_LINK_E_CMD_RESET, NULL);
return 0;
}
diff --git a/src/sbcap_server_fsm.c b/src/sbcap_link_fsm.c
similarity index 83%
rename from src/sbcap_server_fsm.c
rename to src/sbcap_link_fsm.c
index 883080f..f8d23cd 100644
--- a/src/sbcap_server_fsm.c
+++ b/src/sbcap_link_fsm.c
@@ -26,43 +26,43 @@
#include <osmocom/sbcap/sbcap_common.h>
#include <osmocom/cbc/cbc_message.h>
-#include <osmocom/cbc/sbcap_server.h>
-#include <osmocom/cbc/sbcap_server_fsm.h>
+#include <osmocom/cbc/sbcap_link.h>
+#include <osmocom/cbc/sbcap_link_fsm.h>
#include <osmocom/cbc/debug.h>
#include <osmocom/cbc/cbc_peer.h>
#include <osmocom/cbc/smscb_message_fsm.h>
#define S(x) (1 << (x))
-enum sbcap_server_state {
+enum sbcap_link_state {
/* initial state after link SCTP connection established */
- SBcAP_SRV_S_INIT,
+ SBcAP_LINK_S_INIT,
/* normal operation (idle) */
- SBcAP_SRV_S_IDLE,
+ SBcAP_LINK_S_IDLE,
};
-static const struct value_string sbcap_server_event_names[] = {
- { SBcAP_SRV_E_RX_RST_COMPL, "Rx Reset Complete" },
- { SBcAP_SRV_E_RX_RST_FAIL, "Rx Reset Failure" },
- { SBcAP_SRV_E_RX_KA_COMPL, "Rx Keep-Alive Complete" },
- { SBcAP_SRV_E_RX_RESTART, "Rx Restart" },
- { SBcAP_SRV_E_CMD_RESET, "RESET.cmd" },
- { SBcAP_SRV_E_CMD_CLOSE, "CLOSE.cmd" },
+static const struct value_string sbcap_link_event_names[] = {
+ { SBcAP_LINK_E_RX_RST_COMPL, "Rx Reset Complete" },
+ { SBcAP_LINK_E_RX_RST_FAIL, "Rx Reset Failure" },
+ { SBcAP_LINK_E_RX_KA_COMPL, "Rx Keep-Alive Complete" },
+ { SBcAP_LINK_E_RX_RESTART, "Rx Restart" },
+ { SBcAP_LINK_E_CMD_RESET, "RESET.cmd" },
+ { SBcAP_LINK_E_CMD_CLOSE, "CLOSE.cmd" },
{ 0, NULL }
};
-static void sbcap_server_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+static void sbcap_link_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch (event) {
- case SBcAP_SRV_E_CMD_RESET:
- osmo_fsm_inst_state_chg(fi, SBcAP_SRV_S_IDLE, 0, 0);
+ case SBcAP_LINK_E_CMD_RESET:
+ osmo_fsm_inst_state_chg(fi, SBcAP_LINK_S_IDLE, 0, 0);
break;
default:
OSMO_ASSERT(0);
}
}
-static void sbcap_server_s_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+static void sbcap_link_s_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch (event) {
default:
@@ -70,16 +70,16 @@
}
}
-static void sbcap_server_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void
*data)
+static void sbcap_link_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void
*data)
{
struct cbc_sbcap_link *link = (struct cbc_sbcap_link *) fi->priv;
//SBcAP_SBC_AP_PDU_t *pdu;
switch (event) {
- case SBcAP_SRV_E_CMD_CLOSE:
+ case SBcAP_LINK_E_CMD_CLOSE:
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, NULL);
break;
- case SBcAP_SRV_E_RX_RESTART:
+ case SBcAP_LINK_E_RX_RESTART:
//pdu = data;
/* TODO: delete any CBS state we have for this peer */
/* TODO: re-send messages we have matching the scope of the peer */
@@ -90,7 +90,7 @@
}
}
-static void sbcap_server_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause
cause)
+static void sbcap_link_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause
cause)
{
struct cbc_sbcap_link *link = (struct cbc_sbcap_link *) fi->priv;
@@ -105,31 +105,31 @@
talloc_free(link);
}
-static const struct osmo_fsm_state sbcap_server_fsm_states[] = {
- [SBcAP_SRV_S_INIT] = {
+static const struct osmo_fsm_state sbcap_link_fsm_states[] = {
+ [SBcAP_LINK_S_INIT] = {
.name = "INIT",
- .in_event_mask = S(SBcAP_SRV_E_CMD_RESET),
- .out_state_mask = S(SBcAP_SRV_S_IDLE),
- .action = sbcap_server_s_init,
+ .in_event_mask = S(SBcAP_LINK_E_CMD_RESET),
+ .out_state_mask = S(SBcAP_LINK_S_IDLE),
+ .action = sbcap_link_s_init,
},
- [SBcAP_SRV_S_IDLE] = {
+ [SBcAP_LINK_S_IDLE] = {
.name = "IDLE",
.in_event_mask = 0,
.out_state_mask = 0,
- .action = sbcap_server_s_idle,
+ .action = sbcap_link_s_idle,
},
};
-struct osmo_fsm sbcap_server_fsm = {
- .name = "SBcAP-SERVER",
- .states = sbcap_server_fsm_states,
- .num_states = ARRAY_SIZE(sbcap_server_fsm_states),
- .allstate_event_mask = S(SBcAP_SRV_E_CMD_CLOSE) |
- S(SBcAP_SRV_E_RX_RESTART),
- .allstate_action = sbcap_server_fsm_allstate,
+struct osmo_fsm sbcap_link_fsm = {
+ .name = "SBcAP-Link",
+ .states = sbcap_link_fsm_states,
+ .num_states = ARRAY_SIZE(sbcap_link_fsm_states),
+ .allstate_event_mask = S(SBcAP_LINK_E_CMD_CLOSE) |
+ S(SBcAP_LINK_E_RX_RESTART),
+ .allstate_action = sbcap_link_fsm_allstate,
.log_subsys = DSBcAP,
- .event_names = sbcap_server_event_names,
- .cleanup = sbcap_server_fsm_cleanup,
+ .event_names = sbcap_link_event_names,
+ .cleanup = sbcap_link_fsm_cleanup,
};
static void *sbcap_as_find_ie(void *void_list, SBcAP_ProtocolIE_ID_t ie_id)
@@ -234,7 +234,7 @@
pdu->choice.initiatingMessage.procedureCode);
return -EINVAL;
case SBcAP_ProcedureId_PWS_Restart_Indication:
- return osmo_fsm_inst_dispatch(link->fi, SBcAP_SRV_E_RX_RESTART, pdu);
+ return osmo_fsm_inst_dispatch(link->fi, SBcAP_LINK_E_RX_RESTART, pdu);
case SBcAP_ProcedureId_Stop_Warning_Indication:
case SBcAP_ProcedureId_Write_Replace_Warning_Indication:
break; /* Handle msg id below */
@@ -330,5 +330,5 @@
static __attribute__((constructor)) void on_dso_load_sbcap_srv_fsm(void)
{
- OSMO_ASSERT(osmo_fsm_register(&sbcap_server_fsm) == 0);
+ OSMO_ASSERT(osmo_fsm_register(&sbcap_link_fsm) == 0);
}
diff --git a/src/sbcap_msg.c b/src/sbcap_msg.c
index 661f0d1..d38f861 100644
--- a/src/sbcap_msg.c
+++ b/src/sbcap_msg.c
@@ -32,7 +32,7 @@
#include <osmocom/sbcap/sbcap_common.h>
#include <osmocom/cbc/cbc_message.h>
-#include <osmocom/cbc/sbcap_server.h>
+#include <osmocom/cbc/sbcap_link.h>
#include <osmocom/cbc/debug.h>
/* 3GPP TS 36.413 9.2.1.53 */
diff --git a/src/smscb_message_fsm.c b/src/smscb_message_fsm.c
index 0fb91e0..025acb7 100644
--- a/src/smscb_message_fsm.c
+++ b/src/smscb_message_fsm.c
@@ -31,7 +31,7 @@
#include <osmocom/gsm/cbsp.h>
#include <osmocom/cbc/cbc_data.h>
-#include <osmocom/cbc/cbsp_server.h>
+#include <osmocom/cbc/cbsp_link.h>
#include <osmocom/cbc/debug.h>
#include <osmocom/cbc/rest_it_op.h>
#include <osmocom/cbc/smscb_message_fsm.h>
diff --git a/src/smscb_peer_fsm.c b/src/smscb_peer_fsm.c
index 054ecbc..f8bc34d 100644
--- a/src/smscb_peer_fsm.c
+++ b/src/smscb_peer_fsm.c
@@ -36,8 +36,8 @@
#include <osmocom/cbc/cbc_message.h>
#include <osmocom/cbc/cbc_peer.h>
-#include <osmocom/cbc/cbsp_server.h>
-#include <osmocom/cbc/sbcap_server.h>
+#include <osmocom/cbc/cbsp_link.h>
+#include <osmocom/cbc/sbcap_link.h>
#include <osmocom/cbc/sbcap_msg.h>
#include <osmocom/cbc/debug.h>
#include <osmocom/cbc/smscb_message_fsm.h>
--
To view, visit
https://gerrit.osmocom.org/c/osmo-cbc/+/28702
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I1e56dd1fcba23f6efd209e9d4dcdc88c8866d250
Gerrit-Change-Number: 28702
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged