This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10114 ) Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... gsup_client: rename gsup_client_* to osmo_gsup_client_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: I294f8f96af4c5daa2b128962534426e04909290e --- M include/osmocom/gsupclient/gsup_client.h M src/gsupclient/gsup_client.c M src/gsupclient/gsup_test_client.c 3 files changed, 49 insertions(+), 50 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h index f4362df..981751b 100644 --- a/include/osmocom/gsupclient/gsup_client.h +++ b/include/osmocom/gsupclient/gsup_client.h @@ -27,22 +27,21 @@ /* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as * possible. Even one new connection attempt per second should be quite acceptable until the link is * re-established */ -#define GSUP_CLIENT_RECONNECT_INTERVAL 1 -#define GSUP_CLIENT_PING_INTERVAL 20 +#define OSMO_GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define OSMO_GSUP_CLIENT_PING_INTERVAL 20 struct msgb; struct ipa_client_conn; -struct gsup_client; +struct osmo_gsup_client; /* Expects message in msg->l2h */ -typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, - struct msgb *msg); +typedef int (*osmo_gsup_client_read_cb_t)(struct osmo_gsup_client *gsupc, struct msgb *msg); -struct gsup_client { +struct osmo_gsup_client { const char *unit_name; struct ipa_client_conn *link; - gsup_client_read_cb_t read_cb; + osmo_gsup_client_read_cb_t read_cb; void *data; struct osmo_oap_client_state oap_state; @@ -53,14 +52,14 @@ int got_ipa_pong; }; -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config); +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct osmo_oap_client_config *oapc_config); -void gsup_client_destroy(struct gsup_client *gsupc); -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -struct msgb *gsup_client_msgb_alloc(void); +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc); +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +struct msgb *osmo_gsup_client_msgb_alloc(void); diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c index 761e8bd..a7fdc5f 100644 --- a/src/gsupclient/gsup_client.c +++ b/src/gsupclient/gsup_client.c @@ -32,11 +32,11 @@ #include <errno.h> #include <string.h> -static void start_test_procedure(struct gsup_client *gsupc); +static void start_test_procedure(struct osmo_gsup_client *gsupc); -static void gsup_client_send_ping(struct gsup_client *gsupc) +static void gsup_client_send_ping(struct osmo_gsup_client *gsupc) { - struct msgb *msg = gsup_client_msgb_alloc(); + struct msgb *msg = osmo_gsup_client_msgb_alloc(); msg->l2h = msgb_put(msg, 1); msg->l2h[0] = IPAC_MSGT_PING; @@ -44,7 +44,7 @@ ipa_client_conn_send(gsupc->link, msg); } -static int gsup_client_connect(struct gsup_client *gsupc) +static int gsup_client_connect(struct osmo_gsup_client *gsupc) { int rc; @@ -82,7 +82,7 @@ return rc; osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", gsupc->link->addr, gsupc->link->port); @@ -92,7 +92,7 @@ static void connect_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; if (gsupc->is_connected) return; @@ -100,7 +100,7 @@ gsup_client_connect(gsupc); } -static void client_send(struct gsup_client *gsupc, int proto_ext, +static void client_send(struct osmo_gsup_client *gsupc, int proto_ext, struct msgb *msg_tx) { ipa_prepend_header_ext(msg_tx, proto_ext); @@ -109,7 +109,7 @@ /* msg_tx is now queued and will be freed. */ } -static void gsup_client_oap_register(struct gsup_client *gsupc) +static void gsup_client_oap_register(struct osmo_gsup_client *gsupc) { struct msgb *msg_tx; int rc; @@ -125,7 +125,7 @@ static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) { - struct gsup_client *gsupc = link->data; + struct osmo_gsup_client *gsupc = link->data; LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", link->addr, link->port, up ? "UP" : "DOWN"); @@ -143,11 +143,11 @@ osmo_timer_del(&gsupc->ping_timer); osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); } } -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +static int gsup_client_oap_handle(struct osmo_gsup_client *gsupc, struct msgb *msg_rx) { int rc; struct msgb *msg_tx; @@ -168,7 +168,7 @@ { struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; + struct osmo_gsup_client *gsupc = (struct osmo_gsup_client *)link->data; int rc; struct ipaccess_unit ipa_dev = { /* see gsup_client_create() on const vs non-const */ @@ -234,7 +234,7 @@ static void ping_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", gsupc->is_connected ? "connected" : "not connected", @@ -252,27 +252,27 @@ gsup_client_connect(gsupc); } -static void start_test_procedure(struct gsup_client *gsupc) +static void start_test_procedure(struct osmo_gsup_client *gsupc) { osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + osmo_timer_schedule(&gsupc->ping_timer, OSMO_GSUP_CLIENT_PING_INTERVAL, 0); LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); gsup_client_send_ping(gsupc); } -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config) +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct osmo_oap_client_config *oapc_config) { - struct gsup_client *gsupc; + struct osmo_gsup_client *gsupc; int rc; - gsupc = talloc_zero(talloc_ctx, struct gsup_client); + gsupc = talloc_zero(talloc_ctx, struct osmo_gsup_client); OSMO_ASSERT(gsupc); /* struct ipaccess_unit has a non-const unit_name, so let's copy to be @@ -309,11 +309,11 @@ return gsupc; failed: - gsup_client_destroy(gsupc); + osmo_gsup_client_destroy(gsupc); return NULL; } -void gsup_client_destroy(struct gsup_client *gsupc) +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc) { osmo_timer_del(&gsupc->connect_timer); osmo_timer_del(&gsupc->ping_timer); @@ -326,7 +326,7 @@ talloc_free(gsupc); } -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { if (!gsupc || !gsupc->is_connected) { LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); @@ -339,7 +339,7 @@ return 0; } -struct msgb *gsup_client_msgb_alloc(void) +struct msgb *osmo_gsup_client_msgb_alloc(void) { return msgb_alloc_headroom(4000, 64, __func__); } diff --git a/src/gsupclient/gsup_test_client.c b/src/gsupclient/gsup_test_client.c index cfbd55e..b0362ad 100644 --- a/src/gsupclient/gsup_test_client.c +++ b/src/gsupclient/gsup_test_client.c @@ -13,7 +13,7 @@ #include <osmocom/gsupclient/gsup_client.h> -static struct gsup_client *g_gc; +static struct osmo_gsup_client *g_gc; /*********************************************************************** @@ -117,7 +117,7 @@ return rc; } - return gsup_client_send(g_gc, msg); + return osmo_gsup_client_send(g_gc, msg); } /* allocate + generate + send Send-Auth-Info */ @@ -137,7 +137,7 @@ return rc; } - return gsup_client_send(g_gc, msg); + return osmo_gsup_client_send(g_gc, msg); } static int resp_isd(struct imsi_op *io) @@ -157,7 +157,7 @@ imsi_op_release(io); - return gsup_client_send(g_gc, msg); + return osmo_gsup_client_send(g_gc, msg); } /* receive an incoming GSUP message */ @@ -214,7 +214,7 @@ } } -static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +static int gsupc_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg) { struct osmo_gsup_message gsup_msg = {0}; struct imsi_op *io = NULL; @@ -293,8 +293,8 @@ osmo_init_logging2(ctx, &gsup_test_client_log_info); - g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, - gsupc_read_cb, NULL); + g_gc = osmo_gsup_client_create(ctx, "GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); signal(SIGINT, sig_cb); -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte <laforge at gnumonks.org> Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180730/c0ac619d/attachment.htm>