From e2fbd3dee43bb3d47c53514200650db41b4f5ef7 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 29 Jun 2018 10:57:24 +0200 Subject: remove "channel" layer The "channel" layer on top of IPA client + server was introduced in 2011 but never used in any osmocom program/project so far. Contrary to the several other IPA multiplex related implementations in libosmo*, it did not deal properly with segmented IPA messages, i.e. where a single TCP segment (and hence recv/read call) does not contain a full IPA message. So rather than fixing it up and having yet another IPA related API in our libraries, let's remove it. Change-Id: I97c378750acb1637ee032fa88a968edf68d8979f --- examples/channel/abis_ipa_stream_client.c | 92 ------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 examples/channel/abis_ipa_stream_client.c (limited to 'examples/channel/abis_ipa_stream_client.c') diff --git a/examples/channel/abis_ipa_stream_client.c b/examples/channel/abis_ipa_stream_client.c deleted file mode 100644 index 8795cc6..0000000 --- a/examples/channel/abis_ipa_stream_client.c +++ /dev/null @@ -1,92 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -static void *tall_example; - -#define DEXAMPLE 0 - -struct log_info_cat example_cat[] = { - [DEXAMPLE] = { - .name = "DEXAMPLE", - .description = "example", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, -}; - -const struct log_info example_log_info = { - .filter_fn = NULL, - .cat = example_cat, - .num_cat = ARRAY_SIZE(example_cat), -}; - -void sighandler(int foo) -{ - LOGP(DEXAMPLE, LOGL_NOTICE, "closing test.\n"); - exit(EXIT_SUCCESS); -} - -static void signal_msg_cb(struct msgb *msg, int type) -{ - LOGP(DEXAMPLE, LOGL_NOTICE, "received signal message\n"); -} - -static struct osmo_chan *chan; - -int main(void) -{ - struct osmo_ipa_unit *unit; - - tall_example = talloc_named_const(NULL, 1, "example"); - msgb_talloc_ctx_init(tall_example, 0); - osmo_init_logging2(tall_example, &example_log_info); - log_set_log_level(osmo_stderr_target, LOGL_DEBUG); - - /* initialize channel infrastructure. */ - osmo_chan_init(tall_example); - - /* create channel. */ - chan = osmo_chan_create(OSMO_CHAN_ABIS_IPA_CLI, OSMO_SUBCHAN_STREAM); - if (chan == NULL) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create A-bis IPA client\n"); - exit(EXIT_FAILURE); - } - - /* set specific parameters (depends on channel type). */ - osmo_abis_ipa_cli_set_oml_addr(chan, "127.0.0.1"); - osmo_abis_ipa_cli_set_rsl_addr(chan, "127.0.0.1"); - - unit = osmo_ipa_unit_alloc(0); - if (unit == NULL) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create IPA unit\n"); - exit(EXIT_FAILURE); - } - osmo_ipa_unit_set_site_id(unit, 1801); - - osmo_abis_ipa_cli_set_unit(chan, unit); - osmo_abis_ipa_cli_set_cb_signalmsg(chan, signal_msg_cb); - - /* open channel. */ - if (osmo_chan_open(chan) < 0) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create A-bis IPA client\n"); - exit(EXIT_FAILURE); - } - - LOGP(DEXAMPLE, LOGL_NOTICE, "Entering main loop\n"); - - while(1) { - osmo_select_main(0); - } -} -- cgit v1.2.3