pespin has uploaded this change for review.

View Change

Rename CBSP,SABP,SBcAP structs and APIs

Rename osmo_*_cbc -> cbc_*_mgr:
Now they only hold TCP/SCTP server related conns, but will also hold
TCP/SCTP client conns in the near future.

Rename osmo_cbc_*_client -> cbc_*_link:
The term "client" is confusing, since it doesn't exist in CBSP/SBcAP,
and will later support connecting to server at TCP/SCTP level.
Let's use "link" instead, similar to what's used in osmo-bsc which
already supports both TCP client and server modes.

Change-Id: Ia9d26dc1593c8ee08dce348fe9f5f4c9398ea2a5
---
M include/osmocom/cbc/cbc_peer.h
M include/osmocom/cbc/cbsp_server.h
M include/osmocom/cbc/sbcap_server.h
M src/cbc_main.c
M src/cbc_peer.c
M src/cbc_vty.c
M src/cbsp_server.c
M src/cbsp_server_fsm.c
M src/message_handling.c
M src/sbcap_server.c
M src/sbcap_server_fsm.c
M src/smscb_peer_fsm.c
12 files changed, 89 insertions(+), 89 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-cbc refs/changes/00/28700/1
diff --git a/include/osmocom/cbc/cbc_peer.h b/include/osmocom/cbc/cbc_peer.h
index adfa32d..785ea09 100644
--- a/include/osmocom/cbc/cbc_peer.h
+++ b/include/osmocom/cbc/cbc_peer.h
@@ -3,9 +3,9 @@
#include <stdbool.h>
#include <osmocom/core/linuxlist.h>

-struct osmo_cbsp_cbc_client;
-struct osmo_sabp_cbc_client;
-struct osmo_sbcap_cbc_client;
+struct cbc_cbsp_link;
+struct cbc_sabp_link;
+struct cbc_sbcap_link;

#define CBC_MAX_REM_ADDRS 8

@@ -30,10 +30,10 @@

enum cbc_peer_protocol proto;
union {
- struct osmo_cbsp_cbc_client *cbsp;
- struct osmo_sabp_cbc_client *sabp;
- struct osmo_sbcap_cbc_client *sbcap;
- } client;
+ struct cbc_cbsp_link *cbsp;
+ struct cbc_sabp_link *sabp;
+ struct cbc_sbcap_link *sbcap;
+ } link;
};

extern const struct value_string cbc_peer_proto_name[];
diff --git a/include/osmocom/cbc/cbsp_server.h b/include/osmocom/cbc/cbsp_server.h
index e3caf0c..9356c75 100644
--- a/include/osmocom/cbc/cbsp_server.h
+++ b/include/osmocom/cbc/cbsp_server.h
@@ -5,15 +5,15 @@

#include <osmocom/cbc/cbc_data.h>

-#define LOGPCC(client, level, fmt, args...) \
- LOGP(DCBSP, level, "%s: " fmt, cbsp_cbc_client_name(client), ## args)
+#define LOGPCC(link, level, fmt, args...) \
+ LOGP(DCBSP, level, "%s: " fmt, cbc_cbsp_link_name(link), ## args)

-struct osmo_cbsp_cbc_client;
+struct cbc_cbsp_link;
struct osmo_fsm_inst;
struct cbc_peer;

-/* a CBC server */
-struct osmo_cbsp_cbc {
+/* Holder of all CBSP conn related information: */
+struct cbc_cbsp_mgr {
/* libosmo-netif stream server */
struct osmo_stream_srv_link *link;

@@ -21,13 +21,13 @@
struct llist_head clients;

/* receive call-back; called for every received message */
- int (*rx_cb)(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec);
+ int (*rx_cb)(struct cbc_cbsp_link *client, struct osmo_cbsp_decoded *dec);
};

-struct osmo_cbsp_cbc *cbsp_cbc_create(void *ctx);
+struct cbc_cbsp_mgr *cbc_cbsp_mgr_create(void *ctx);

/* a single (remote) client connected to the (local) CBC server */
-struct osmo_cbsp_cbc_client {
+struct cbc_cbsp_link {
/* entry in osmo_cbsp_cbc.clients */
struct llist_head list;
/* stream server connection for this client */
@@ -40,7 +40,7 @@
struct cbc_peer *peer;
};

-const char *cbsp_cbc_client_name(const struct osmo_cbsp_cbc_client *client);
-void cbsp_cbc_client_tx(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *cbsp);
-void cbsp_cbc_client_close(struct osmo_cbsp_cbc_client *client);
-int cbsp_cbc_client_rx_cb(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec);
+const char *cbc_cbsp_link_name(const struct cbc_cbsp_link *link);
+void cbc_cbsp_link_tx(struct cbc_cbsp_link *link, struct osmo_cbsp_decoded *cbsp);
+void cbc_cbsp_link_close(struct cbc_cbsp_link *link);
+int cbc_cbsp_link_rx_cb(struct cbc_cbsp_link *link, struct osmo_cbsp_decoded *dec);
diff --git a/include/osmocom/cbc/sbcap_server.h b/include/osmocom/cbc/sbcap_server.h
index a5568ad..82b2d21 100644
--- a/include/osmocom/cbc/sbcap_server.h
+++ b/include/osmocom/cbc/sbcap_server.h
@@ -8,15 +8,15 @@

#define SBcAP_SCTP_PORT 29168
typedef struct SBcAP_SBC_AP_PDU SBcAP_SBC_AP_PDU_t;
-#define LOGPSBCAPC(client, level, fmt, args...) \
- LOGP(DSBcAP, level, "%s: " fmt, sbcap_cbc_client_name(client), ## args)
+#define LOGPSBCAPC(link, level, fmt, args...) \
+ LOGP(DSBcAP, level, "%s: " fmt, cbc_sbcap_link_name(link), ## args)

-struct osmo_sbcap_cbc_client;
+struct cbc_sbcap_link;
struct osmo_fsm_inst;
struct cbc_peer;

-/* a CBC server */
-struct osmo_sbcap_cbc {
+/* Holder of all SBc-AP conn related information: */
+struct cbc_sbcap_mgr {
/* libosmo-netif stream server */
struct osmo_stream_srv_link *link;

@@ -24,12 +24,12 @@
struct llist_head clients;

/* receive call-back; called for every received message */
- int (*rx_cb)(struct osmo_sbcap_cbc_client *client, SBcAP_SBC_AP_PDU_t *pdu);
+ int (*rx_cb)(struct cbc_sbcap_link *client, SBcAP_SBC_AP_PDU_t *pdu);
};
-struct osmo_sbcap_cbc *sbcap_cbc_create(void *ctx);
+struct cbc_sbcap_mgr *cbc_sbcap_mgr_create(void *ctx);

/* a single (remote) client connected to the (local) CBC server */
-struct osmo_sbcap_cbc_client {
+struct cbc_sbcap_link {
/* entry in osmo_sbcap_cbc.clients */
struct llist_head list;
/* stream server connection for this client */
@@ -38,7 +38,7 @@
struct cbc_peer *peer;
};

-const char *sbcap_cbc_client_name(const struct osmo_sbcap_cbc_client *client);
-void sbcap_cbc_client_tx(struct osmo_sbcap_cbc_client *client, SBcAP_SBC_AP_PDU_t *pdu);
-void sbcap_cbc_client_close(struct osmo_sbcap_cbc_client *client);
-int sbcap_cbc_client_rx_cb(struct osmo_sbcap_cbc_client *client, SBcAP_SBC_AP_PDU_t *pdu);
+const char *cbc_sbcap_link_name(const struct cbc_sbcap_link *link);
+void cbc_sbcap_link_tx(struct cbc_sbcap_link *link, SBcAP_SBC_AP_PDU_t *pdu);
+void cbc_sbcap_link_close(struct cbc_sbcap_link *link);
+int cbc_sbcap_link_rx_cb(struct cbc_sbcap_link *link, SBcAP_SBC_AP_PDU_t *pdu);
diff --git a/src/cbc_main.c b/src/cbc_main.c
index eaf0ebe..211d8c6 100644
--- a/src/cbc_main.c
+++ b/src/cbc_main.c
@@ -277,12 +277,12 @@
exit(1);
}

- if (cbsp_cbc_create(tall_cbc_ctx) == NULL) {
+ if (cbc_cbsp_mgr_create(tall_cbc_ctx) == NULL) {
perror("Error binding CBSP port");
exit(1);
}

- if (sbcap_cbc_create(tall_cbc_ctx) == NULL) {
+ if (cbc_sbcap_mgr_create(tall_cbc_ctx) == NULL) {
perror("Error binding SBc-AP port\n");
exit(1);
}
diff --git a/src/cbc_peer.c b/src/cbc_peer.c
index a9aa12d..4a6e06b 100644
--- a/src/cbc_peer.c
+++ b/src/cbc_peer.c
@@ -66,12 +66,12 @@
/* close any existing client connection */
switch (peer->proto) {
case CBC_PEER_PROTO_CBSP:
- if (peer->client.cbsp)
- cbsp_cbc_client_close(peer->client.cbsp);
+ if (peer->link.cbsp)
+ cbc_cbsp_link_close(peer->link.cbsp);
break;
case CBC_PEER_PROTO_SBcAP:
- if (peer->client.sbcap)
- sbcap_cbc_client_close(peer->client.sbcap);
+ if (peer->link.sbcap)
+ cbc_sbcap_link_close(peer->link.sbcap);
break;
case CBC_PEER_PROTO_SABP:
default:
diff --git a/src/cbc_vty.c b/src/cbc_vty.c
index e35a48a..2a6f28b 100644
--- a/src/cbc_vty.c
+++ b/src/cbc_vty.c
@@ -46,14 +46,14 @@

switch (peer->proto) {
case CBC_PEER_PROTO_CBSP:
- if (peer->client.cbsp)
- state = osmo_fsm_inst_state_name(peer->client.cbsp->fi);
+ if (peer->link.cbsp)
+ state = osmo_fsm_inst_state_name(peer->link.cbsp->fi);
break;
case CBC_PEER_PROTO_SABP:
break;
case CBC_PEER_PROTO_SBcAP:
- if (peer->client.sbcap)
- state = osmo_fsm_inst_state_name(peer->client.sbcap->fi);
+ if (peer->link.sbcap)
+ state = osmo_fsm_inst_state_name(peer->link.sbcap->fi);
break;
}

diff --git a/src/cbsp_server.c b/src/cbsp_server.c
index 116242f..d459687 100644
--- a/src/cbsp_server.c
+++ b/src/cbsp_server.c
@@ -45,7 +45,7 @@
#endif


-const char *cbsp_cbc_client_name(const struct osmo_cbsp_cbc_client *client)
+const char *cbc_cbsp_link_name(const struct cbc_cbsp_link *client)
{
OSMO_ASSERT(client);

@@ -61,8 +61,8 @@
static int cbsp_cbc_read_cb(struct osmo_stream_srv *conn)
{
struct osmo_stream_srv_link *link = osmo_stream_srv_get_master(conn);
- struct osmo_cbsp_cbc_client *client = osmo_stream_srv_get_data(conn);
- struct osmo_cbsp_cbc *cbc = osmo_stream_srv_link_get_data(link);
+ struct cbc_cbsp_link *client = osmo_stream_srv_get_data(conn);
+ struct cbc_cbsp_mgr *cbc = osmo_stream_srv_link_get_data(link);
struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn);
struct osmo_cbsp_decoded *decoded;
struct msgb *msg = NULL;
@@ -104,11 +104,11 @@
/* connection from BSC to CBC has been closed */
static int cbsp_cbc_closed_cb(struct osmo_stream_srv *conn)
{
- struct osmo_cbsp_cbc_client *client = osmo_stream_srv_get_data(conn);
+ struct cbc_cbsp_link *client = osmo_stream_srv_get_data(conn);
LOGPCC(client, LOGL_NOTICE, "connection closed\n");

if (client->peer)
- client->peer->client.cbsp = NULL;
+ client->peer->link.cbsp = NULL;
client->conn = NULL;
if (client->fi)
osmo_fsm_inst_dispatch(client->fi, CBSP_SRV_E_CMD_CLOSE, NULL);
@@ -119,8 +119,8 @@
/* new connection from BSC has arrived at CBC */
static int cbsp_cbc_accept_cb(struct osmo_stream_srv_link *link, int fd)
{
- struct osmo_cbsp_cbc *cbc = osmo_stream_srv_link_get_data(link);
- struct osmo_cbsp_cbc_client *client = talloc_zero(cbc, struct osmo_cbsp_cbc_client);
+ struct cbc_cbsp_mgr *cbc = osmo_stream_srv_link_get_data(link);
+ struct cbc_cbsp_link *client = talloc_zero(cbc, struct cbc_cbsp_link);
char remote_ip[INET6_ADDRSTRLEN], portbuf[6];
int remote_port;
OSMO_ASSERT(client);
@@ -164,19 +164,19 @@
return -1;
}
} else {
- if (client->peer->client.cbsp) {
+ if (client->peer->link.cbsp) {
LOGPCC(client, LOGL_ERROR, "We already have a connection for peer %s\n",
client->peer->name);
/* FIXME */
}
- client->peer->client.cbsp = client;
+ client->peer->link.cbsp = client;
}

osmo_fsm_inst_dispatch(client->fi, CBSP_SRV_E_CMD_RESET, NULL);
return 0;
}

-void cbsp_cbc_client_tx(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *cbsp)
+void cbc_cbsp_link_tx(struct cbc_cbsp_link *client, struct osmo_cbsp_decoded *cbsp)
{
struct msgb *msg;

@@ -200,15 +200,15 @@
osmo_stream_srv_send(client->conn, msg);
}

-void cbsp_cbc_client_close(struct osmo_cbsp_cbc_client *client)
+void cbc_cbsp_link_close(struct cbc_cbsp_link *client)
{
osmo_stream_srv_destroy(client->conn);
}

/* initialize the CBC-side CBSP server */
-struct osmo_cbsp_cbc *cbsp_cbc_create(void *ctx)
+struct cbc_cbsp_mgr *cbc_cbsp_mgr_create(void *ctx)
{
- struct osmo_cbsp_cbc *cbc = talloc_zero(ctx, struct osmo_cbsp_cbc);
+ struct cbc_cbsp_mgr *cbc = talloc_zero(ctx, struct cbc_cbsp_mgr);
int rc;
char *bind_ip = g_cbc->config.cbsp.local_host;
int bind_port = g_cbc->config.cbsp.local_port;
@@ -217,7 +217,7 @@
bind_port = CBSP_TCP_PORT;

OSMO_ASSERT(cbc);
- cbc->rx_cb = cbsp_cbc_client_rx_cb;
+ cbc->rx_cb = cbc_cbsp_link_rx_cb;
INIT_LLIST_HEAD(&cbc->clients);
cbc->link = osmo_stream_srv_link_create(cbc);
osmo_stream_srv_link_set_data(cbc->link, cbc);
diff --git a/src/cbsp_server_fsm.c b/src/cbsp_server_fsm.c
index d1be036..0ebcbe1 100644
--- a/src/cbsp_server_fsm.c
+++ b/src/cbsp_server_fsm.c
@@ -74,7 +74,7 @@

static void cbsp_server_s_reset_pending_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
{
- struct osmo_cbsp_cbc_client *client = (struct osmo_cbsp_cbc_client *) fi->priv;
+ struct cbc_cbsp_link *client = (struct cbc_cbsp_link *) fi->priv;
struct osmo_cbsp_decoded *cbspd;

if (prev_state == CBSP_SRV_S_RESET_PENDING)
@@ -86,7 +86,7 @@
cbspd->u.reset.cell_list.id_discr = CELL_IDENT_BSS;
INIT_LLIST_HEAD(&cbspd->u.reset.cell_list.list);

- cbsp_cbc_client_tx(client, cbspd);
+ cbc_cbsp_link_tx(client, cbspd);
/* wait for response */
osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_RESET_PENDING, T_WAIT_RESET_RESP_SECS,
T_WAIT_RESET_RESP);
@@ -136,7 +136,7 @@

static int cbsp_server_fsm_timer_cb(struct osmo_fsm_inst *fi)
{
- struct osmo_cbsp_cbc_client *client = (struct osmo_cbsp_cbc_client *) fi->priv;
+ struct cbc_cbsp_link *client = (struct cbc_cbsp_link *) fi->priv;
struct osmo_cbsp_decoded *cbspd;

switch (fi->T) {
@@ -146,7 +146,7 @@
OSMO_ASSERT(cbspd);
cbspd->msg_type = CBSP_MSGT_KEEP_ALIVE;
cbspd->u.keep_alive.repetition_period = T_KEEPALIVE_SECS;
- cbsp_cbc_client_tx(client, cbspd);
+ cbc_cbsp_link_tx(client, cbspd);
/* wait for response */
osmo_fsm_inst_state_chg(fi, CBSP_SRV_S_KEEPALIVE_PENDING, T_WAIT_KEEPALIVE_RESP_SECS,
T_WAIT_KEEPALIVE_RESP);
@@ -162,7 +162,7 @@

static void cbsp_server_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
- struct osmo_cbsp_cbc_client *client = (struct osmo_cbsp_cbc_client *) fi->priv;
+ struct cbc_cbsp_link *client = (struct cbc_cbsp_link *) fi->priv;
struct osmo_cbsp_decoded *dec;

switch (event) {
@@ -194,7 +194,7 @@

static void cbsp_server_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
{
- struct osmo_cbsp_cbc_client *client = (struct osmo_cbsp_cbc_client *) fi->priv;
+ struct cbc_cbsp_link *client = (struct cbc_cbsp_link *) fi->priv;

if (client->conn)
osmo_stream_srv_destroy(client->conn);
@@ -273,7 +273,7 @@
}

/* message was received from remote CBSP peer (BSC) */
-int cbsp_cbc_client_rx_cb(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec)
+int cbc_cbsp_link_rx_cb(struct cbc_cbsp_link *client, struct osmo_cbsp_decoded *dec)
{
struct cbc_message *smscb;
struct cbc_message_peer *mp;
diff --git a/src/message_handling.c b/src/message_handling.c
index 39d8cfe..e18a181 100644
--- a/src/message_handling.c
+++ b/src/message_handling.c
@@ -137,7 +137,7 @@
switch (peer->proto) {
case CBC_PEER_PROTO_CBSP:
/* skip peers without any current CBSP connection */
- if (!peer->client.cbsp) {
+ if (!peer->link.cbsp) {
LOGP(DCBSP, LOGL_NOTICE, "[%s] Tx CBSP: not connected\n",
peer->name);
return -ENOTCONN;
@@ -147,11 +147,11 @@
peer->name);
return -EINVAL;
}
- cbsp_cbc_client_tx(peer->client.cbsp, cbsp);
+ cbc_cbsp_link_tx(peer->link.cbsp, cbsp);
break;
case CBC_PEER_PROTO_SBcAP:
/* skip peers without any current SBc-AP connection */
- if (!peer->client.sbcap) {
+ if (!peer->link.sbcap) {
LOGP(DSBcAP, LOGL_NOTICE, "[%s] Tx SBc-AP: not connected\n",
peer->name);
return -ENOTCONN;
@@ -161,7 +161,7 @@
peer->name);
return -EINVAL;
}
- sbcap_cbc_client_tx(peer->client.sbcap, sbcap);
+ cbc_sbcap_link_tx(peer->link.sbcap, sbcap);
break;
case CBC_PEER_PROTO_SABP:
LOGP(DLGLOBAL, LOGL_ERROR, "Sending message to peer proto %s not implemented!\n",
diff --git a/src/sbcap_server.c b/src/sbcap_server.c
index 72c94a1..cddbd6f 100644
--- a/src/sbcap_server.c
+++ b/src/sbcap_server.c
@@ -41,7 +41,7 @@
#include <osmocom/cbc/cbc_peer.h>
#include <osmocom/cbc/debug.h>

-const char *sbcap_cbc_client_name(const struct osmo_sbcap_cbc_client *client)
+const char *cbc_sbcap_link_name(const struct cbc_sbcap_link *client)
{
struct osmo_fd *ofd;
OSMO_ASSERT(client);
@@ -58,8 +58,8 @@
static int sbcap_cbc_read_cb(struct osmo_stream_srv *conn)
{
struct osmo_stream_srv_link *link = osmo_stream_srv_get_master(conn);
- struct osmo_sbcap_cbc_client *client = osmo_stream_srv_get_data(conn);
- struct osmo_sbcap_cbc *cbc = osmo_stream_srv_link_get_data(link);
+ struct cbc_sbcap_link *client = osmo_stream_srv_get_data(conn);
+ struct cbc_sbcap_mgr *cbc = osmo_stream_srv_link_get_data(link);
struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn);
SBcAP_SBC_AP_PDU_t *pdu;
struct msgb *msg = msgb_alloc_c(g_cbc, 1500, "SBcAP-rx");
@@ -124,11 +124,11 @@
/* connection from MME to CBC has been closed */
static int sbcap_cbc_closed_cb(struct osmo_stream_srv *conn)
{
- struct osmo_sbcap_cbc_client *client = osmo_stream_srv_get_data(conn);
+ struct cbc_sbcap_link *client = osmo_stream_srv_get_data(conn);
LOGPSBCAPC(client, LOGL_NOTICE, "connection closed\n");

if (client->peer)
- client->peer->client.sbcap = NULL;
+ client->peer->link.sbcap = NULL;
client->conn = NULL;
if (client->fi)
osmo_fsm_inst_dispatch(client->fi, SBcAP_SRV_E_CMD_CLOSE, NULL);
@@ -139,8 +139,8 @@
/* new connection from MME has arrived at CBC */
static int sbcap_cbc_accept_cb(struct osmo_stream_srv_link *link, int fd)
{
- struct osmo_sbcap_cbc *cbc = osmo_stream_srv_link_get_data(link);
- struct osmo_sbcap_cbc_client *client = talloc_zero(cbc, struct osmo_sbcap_cbc_client);
+ struct cbc_sbcap_mgr *cbc = osmo_stream_srv_link_get_data(link);
+ struct cbc_sbcap_link *client = talloc_zero(cbc, struct cbc_sbcap_link);
char remote_ip[INET6_ADDRSTRLEN], portbuf[6];
int remote_port;
OSMO_ASSERT(client);
@@ -184,19 +184,19 @@
return -1;
}
} else {
- if (client->peer->client.sbcap) {
+ if (client->peer->link.sbcap) {
LOGPSBCAPC(client, LOGL_ERROR, "We already have a connection for peer %s\n",
client->peer->name);
/* FIXME */
}
- client->peer->client.sbcap = client;
+ client->peer->link.sbcap = client;
}

osmo_fsm_inst_dispatch(client->fi, SBcAP_SRV_E_CMD_RESET, NULL);
return 0;
}

-void sbcap_cbc_client_tx(struct osmo_sbcap_cbc_client *client, SBcAP_SBC_AP_PDU_t *pdu)
+void cbc_sbcap_link_tx(struct cbc_sbcap_link *client, SBcAP_SBC_AP_PDU_t *pdu)
{
struct msgb *msg;

@@ -221,15 +221,15 @@
sbcap_pdu_free(pdu);
}

-void sbcap_cbc_client_close(struct osmo_sbcap_cbc_client *client)
+void cbc_sbcap_link_close(struct cbc_sbcap_link *client)
{
osmo_stream_srv_destroy(client->conn);
}

/* initialize the CBC-side SBc-AP server */
-struct osmo_sbcap_cbc *sbcap_cbc_create(void *ctx)
+struct cbc_sbcap_mgr *cbc_sbcap_mgr_create(void *ctx)
{
- struct osmo_sbcap_cbc *cbc = talloc_zero(ctx, struct osmo_sbcap_cbc);
+ struct cbc_sbcap_mgr *cbc = talloc_zero(ctx, struct cbc_sbcap_mgr);
int rc;
int bind_port = g_cbc->config.sbcap.local_port;

@@ -237,7 +237,7 @@
bind_port = SBcAP_SCTP_PORT;

OSMO_ASSERT(cbc);
- cbc->rx_cb = sbcap_cbc_client_rx_cb;
+ cbc->rx_cb = cbc_sbcap_link_rx_cb;
INIT_LLIST_HEAD(&cbc->clients);
cbc->link = osmo_stream_srv_link_create(cbc);
osmo_stream_srv_link_set_proto(cbc->link, IPPROTO_SCTP);
diff --git a/src/sbcap_server_fsm.c b/src/sbcap_server_fsm.c
index fe2f022..e0e4001 100644
--- a/src/sbcap_server_fsm.c
+++ b/src/sbcap_server_fsm.c
@@ -72,7 +72,7 @@

static void sbcap_server_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
- struct osmo_sbcap_cbc_client *client = (struct osmo_sbcap_cbc_client *) fi->priv;
+ struct cbc_sbcap_link *client = (struct cbc_sbcap_link *) fi->priv;
//SBcAP_SBC_AP_PDU_t *pdu;

switch (event) {
@@ -92,7 +92,7 @@

static void sbcap_server_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
{
- struct osmo_sbcap_cbc_client *client = (struct osmo_sbcap_cbc_client *) fi->priv;
+ struct cbc_sbcap_link *client = (struct cbc_sbcap_link *) fi->priv;

if (client->conn)
osmo_stream_srv_destroy(client->conn);
@@ -146,7 +146,7 @@
return NULL;
}

-static SBcAP_Message_Identifier_t *get_msg_id_ie(struct osmo_sbcap_cbc_client *client,
+static SBcAP_Message_Identifier_t *get_msg_id_ie(struct cbc_sbcap_link *client,
const SBcAP_SBC_AP_PDU_t *pdu)
{
A_SEQUENCE_OF(void) *as_pdu = NULL;
@@ -204,7 +204,7 @@
}
}

-static int get_msg_id(struct osmo_sbcap_cbc_client *client, const SBcAP_SBC_AP_PDU_t *pdu)
+static int get_msg_id(struct cbc_sbcap_link *client, const SBcAP_SBC_AP_PDU_t *pdu)
{
SBcAP_Message_Identifier_t *ie = get_msg_id_ie(client, pdu);
if (!ie)
@@ -217,7 +217,7 @@
}

/* message was received from remote SBcAP peer (BSC) */
-int sbcap_cbc_client_rx_cb(struct osmo_sbcap_cbc_client *client, SBcAP_SBC_AP_PDU_t *pdu)
+int cbc_sbcap_link_rx_cb(struct cbc_sbcap_link *client, SBcAP_SBC_AP_PDU_t *pdu)
{
struct cbc_message *smscb;
struct cbc_message_peer *mp;
diff --git a/src/smscb_peer_fsm.c b/src/smscb_peer_fsm.c
index 32e6f54..054ecbc 100644
--- a/src/smscb_peer_fsm.c
+++ b/src/smscb_peer_fsm.c
@@ -362,7 +362,7 @@
/* TODO: we assume that the replace will always affect all original cells */
cbsp_append_cell_list(&cbsp->u.write_replace.cell_list, cbsp, mp);
// TODO: ALL OTHER DATA
- cbsp_cbc_client_tx(mp->peer->client.cbsp, cbsp);
+ cbc_cbsp_link_tx(mp->peer->link.cbsp, cbsp);
osmo_fsm_inst_state_chg(fi, SMSCB_S_WAIT_REPLACE_ACK, 10, T_WAIT_REPLACE_ACK);
break;
case SMSCB_E_STATUS: /* send MSG-STATUS-QUERY to BSC */
@@ -372,7 +372,7 @@
cbsp->u.msg_status_query.old_serial_nr = mp->cbcmsg->msg.serial_nr;
cbsp_append_cell_list(&cbsp->u.msg_status_query.cell_list, cbsp, mp);
cbsp->u.msg_status_query.channel_ind = CBSP_CHAN_IND_BASIC;
- cbsp_cbc_client_tx(mp->peer->client.cbsp, cbsp);
+ cbc_cbsp_link_tx(mp->peer->link.cbsp, cbsp);
osmo_fsm_inst_state_chg(fi, SMSCB_S_WAIT_STATUS_ACK, 10, T_WAIT_STATUS_ACK);
break;
default:
@@ -558,11 +558,11 @@
OSMO_ASSERT(cbsp->u.kill.channel_ind);
*(cbsp->u.kill.channel_ind) = CBSP_CHAN_IND_BASIC;
}
- cbsp_cbc_client_tx(mp->peer->client.cbsp, cbsp);
+ cbc_cbsp_link_tx(mp->peer->link.cbsp, cbsp);
break;
case CBC_PEER_PROTO_SBcAP:
if ((sbcap = sbcap_gen_stop_warning_req(mp->peer, mp->cbcmsg))) {
- sbcap_cbc_client_tx(mp->peer->client.sbcap, sbcap);
+ cbc_sbcap_link_tx(mp->peer->link.sbcap, sbcap);
} else {
LOGP(DSBcAP, LOGL_ERROR,
"[%s] Tx SBc-AP Stop-Warning-Request: msg gen failed\n",

To view, visit change 28700. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d26dc1593c8ee08dce348fe9f5f4c9398ea2a5
Gerrit-Change-Number: 28700
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange