summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-08 21:28:29 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-13 14:54:01 +0000
commitef022783c37c459d0ccb5aa6f165d4d4dc6c0815 (patch)
tree1286419cf8a301129b8f327c5035d5dd6d18e8a1
parenteaaee92db5f29fa280ad89ef8b89d9062abcfa48 (diff)
gsup client, gsup_test_client: move logging to DLGSUP category
Use the DLGSUP logging category for GSUP. Bump the required version of libosmocore to 0.9.5 to benefit from the DLGSUP logging category fix in core/logging.[hc]. (Id974c7be158e4d60421a98110f5c807aefd31119) Todo: we're using a "Library" logging category, which is not really what the library category was intended for. Instead, the GSUP client should probably be given a logging category like DVLR or DGPRS in its initialization API. Related: OS#1592 Change-Id: Id3938267fa062e1a997d3704cd678874306f86ee
-rw-r--r--openbsc/configure.ac2
-rw-r--r--openbsc/src/gprs/gprs_gsup_client.c28
-rw-r--r--openbsc/src/gprs/gsup_test_client.c15
3 files changed, 20 insertions, 25 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 123048f..4fe1050 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -30,7 +30,7 @@ AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
AC_SUBST(LIBRARY_DL)
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.4)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.4)
diff --git a/openbsc/src/gprs/gprs_gsup_client.c b/openbsc/src/gprs/gprs_gsup_client.c
index 6195fa6..b991563 100644
--- a/openbsc/src/gprs/gprs_gsup_client.c
+++ b/openbsc/src/gprs/gprs_gsup_client.c
@@ -55,29 +55,29 @@ static int gsup_client_connect(struct gsup_client *gsupc)
return 0;
if (osmo_timer_pending(&gsupc->connect_timer)) {
- LOGP(DLINP, LOGL_DEBUG,
+ LOGP(DLGSUP, LOGL_DEBUG,
"GSUP connect: connect timer already running\n");
osmo_timer_del(&gsupc->connect_timer);
}
if (osmo_timer_pending(&gsupc->ping_timer)) {
- LOGP(DLINP, LOGL_DEBUG,
+ LOGP(DLGSUP, LOGL_DEBUG,
"GSUP connect: ping timer already running\n");
osmo_timer_del(&gsupc->ping_timer);
}
if (ipa_client_conn_clear_queue(gsupc->link) > 0)
- LOGP(DLINP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n");
+ LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n");
rc = ipa_client_conn_open(gsupc->link);
if (rc >= 0) {
- LOGP(DGPRS, LOGL_INFO, "GSUP connecting to %s:%d\n",
+ LOGP(DLGSUP, LOGL_INFO, "GSUP connecting to %s:%d\n",
gsupc->link->addr, gsupc->link->port);
return 0;
}
- LOGP(DGPRS, LOGL_INFO, "GSUP failed to connect to %s:%d: %s\n",
+ LOGP(DLGSUP, LOGL_INFO, "GSUP failed to connect to %s:%d: %s\n",
gsupc->link->addr, gsupc->link->port, strerror(-rc));
if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT ||
@@ -87,7 +87,7 @@ static int gsup_client_connect(struct gsup_client *gsupc)
osmo_timer_schedule(&gsupc->connect_timer,
GSUP_CLIENT_RECONNECT_INTERVAL, 0);
- LOGP(DGPRS, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n",
+ LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n",
gsupc->link->addr, gsupc->link->port);
return 0;
@@ -119,7 +119,7 @@ static void gsup_client_oap_register(struct gsup_client *gsupc)
rc = oap_register(&gsupc->oap_state, &msg_tx);
if ((rc < 0) || (!msg_tx)) {
- LOGP(DGPRS, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n");
+ LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n");
return;
}
@@ -130,7 +130,7 @@ static void gsup_client_updown_cb(struct ipa_client_conn *link, int up)
{
struct gsup_client *gsupc = link->data;
- LOGP(DGPRS, LOGL_INFO, "GSUP link to %s:%d %s\n",
+ LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n",
link->addr, link->port, up ? "UP" : "DOWN");
gsupc->is_connected = up;
@@ -181,7 +181,7 @@ static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg)
rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg);
if (rc < 0) {
- LOGP(DGPRS, LOGL_NOTICE,
+ LOGP(DLGSUP, LOGL_NOTICE,
"GSUP received an invalid IPA/CCM message from %s:%d\n",
link->addr, link->port);
/* Link has been closed */
@@ -194,7 +194,7 @@ static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg)
uint8_t msg_type = *(msg->l2h);
/* CCM message */
if (msg_type == IPAC_MSGT_PONG) {
- LOGP(DGPRS, LOGL_DEBUG, "GSUP receiving PONG\n");
+ LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n");
gsupc->got_ipa_pong = 1;
}
@@ -223,7 +223,7 @@ static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg)
return 0;
invalid:
- LOGP(DGPRS, LOGL_NOTICE,
+ LOGP(DLGSUP, LOGL_NOTICE,
"GSUP received an invalid IPA message from %s:%d, size = %d\n",
link->addr, link->port, msgb_length(msg));
@@ -235,7 +235,7 @@ static void ping_timer_cb(void *gsupc_)
{
struct gsup_client *gsupc = gsupc_;
- LOGP(DGPRS, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n",
+ LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n",
gsupc->is_connected ? "connected" : "not connected",
gsupc->got_ipa_pong ? "got" : "didn't get");
@@ -244,7 +244,7 @@ static void ping_timer_cb(void *gsupc_)
return;
}
- LOGP(DGPRS, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n");
+ LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n");
ipa_client_conn_close(gsupc->link);
gsupc->is_connected = 0;
@@ -258,7 +258,7 @@ static void start_test_procedure(struct gsup_client *gsupc)
gsupc->got_ipa_pong = 0;
osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0);
- LOGP(DGPRS, LOGL_DEBUG, "GSUP sending PING\n");
+ LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n");
gsup_client_send_ping(gsupc);
}
diff --git a/openbsc/src/gprs/gsup_test_client.c b/openbsc/src/gprs/gsup_test_client.c
index c8ed03d..1889c6f 100644
--- a/openbsc/src/gprs/gsup_test_client.c
+++ b/openbsc/src/gprs/gsup_test_client.c
@@ -260,17 +260,12 @@ static void sig_cb(int sig)
void *tall_bsc_ctx = NULL;
/* default categories */
-static struct log_info_cat gprs_categories[] = {
- [DGPRS] = {
- .name = "DGPRS",
- .description = "GPRS Packet Service",
- .enabled = 1, .loglevel = LOGL_INFO,
- },
+static struct log_info_cat default_categories[] = {
};
-static const struct log_info gprs_log_info = {
- .cat = gprs_categories,
- .num_cat = ARRAY_SIZE(gprs_categories),
+static const struct log_info gsup_test_client_log_info = {
+ .cat = default_categories,
+ .num_cat = ARRAY_SIZE(default_categories),
};
int main(int argc, char **argv)
@@ -279,7 +274,7 @@ int main(int argc, char **argv)
char *server_host = "127.0.0.1";
uint16_t server_port = 2222;
- osmo_init_logging(&gprs_log_info);
+ osmo_init_logging(&gsup_test_client_log_info);
g_gc = gsup_client_create(server_host, server_port, gsupc_read_cb,
NULL);