Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 1 | #include <stdio.h> |
Harald Welte | 71d87b2 | 2011-07-18 14:49:56 +0200 | [diff] [blame] | 2 | #include <osmocom/core/talloc.h> |
Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 3 | #include <osmocom/abis/abis.h> |
| 4 | #include <osmocom/abis/e1_input.h> |
| 5 | #include <osmocom/abis/ipa_proxy.h> |
| 6 | #include <osmocom/core/logging.h> |
| 7 | #include <osmocom/core/application.h> |
| 8 | #include <osmocom/vty/vty.h> |
| 9 | #include <osmocom/vty/command.h> |
| 10 | #include <osmocom/vty/telnet_interface.h> |
Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 11 | |
| 12 | static void *tall_test; |
| 13 | |
Pablo Neira Ayuso | fe8ab0a | 2011-07-02 18:48:45 +0200 | [diff] [blame] | 14 | #define DIPA_PROXY_TEST 0 |
Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 15 | |
| 16 | struct log_info_cat ipa_proxy_test_cat[] = { |
| 17 | [DIPA_PROXY_TEST] = { |
Harald Welte | cc2241b | 2011-07-19 16:06:06 +0200 | [diff] [blame] | 18 | .name = "DLINP_IPA_PROXY_TEST", |
Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 19 | .description = "IPA proxy test", |
| 20 | .color = "\033[1;35m", |
| 21 | .enabled = 1, .loglevel = LOGL_NOTICE, |
| 22 | }, |
| 23 | }; |
| 24 | |
| 25 | const struct log_info ipa_proxy_test_log_info = { |
| 26 | .filter_fn = NULL, |
| 27 | .cat = ipa_proxy_test_cat, |
| 28 | .num_cat = ARRAY_SIZE(ipa_proxy_test_cat), |
| 29 | }; |
| 30 | |
Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 31 | static struct vty_app_info vty_info = { |
| 32 | .name = "ipa-proxy-test", |
Pablo Neira Ayuso | 8fc277b | 2011-09-08 13:22:26 +0200 | [diff] [blame] | 33 | .version = "1.0", |
Pablo Neira Ayuso | 130c4fb | 2011-06-23 21:15:53 +0200 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #define IPA_PROXY_TEST_TELNET_PORT 4260 |
| 37 | |
| 38 | int main(void) |
| 39 | { |
| 40 | tall_test = talloc_named_const(NULL, 1, "ipa proxy test"); |
| 41 | libosmo_abis_init(tall_test); |
| 42 | |
| 43 | osmo_init_logging(&ipa_proxy_test_log_info); |
| 44 | |
| 45 | vty_init(&vty_info); |
| 46 | ipa_proxy_vty_init(); |
| 47 | |
| 48 | telnet_init(tall_test, NULL, IPA_PROXY_TEST_TELNET_PORT); |
| 49 | |
| 50 | LOGP(DIPA_PROXY_TEST, LOGL_NOTICE, "entering main loop\n"); |
| 51 | |
| 52 | while (1) { |
| 53 | osmo_select_main(0); |
| 54 | } |
| 55 | } |