blob: f0154435722291bc06af667e9da64f389781ff98 [file] [log] [blame]
Pablo Neira Ayuso54b49792011-06-07 12:15:26 +02001/* (C) 2011 by Harald Welte <laforge@gnumonks.org>
2 * All Rights Reserved
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 */
18#include "internal.h"
Pablo Neira Ayusoe19c70a2011-06-12 15:15:30 +020019#include <osmocom/core/utils.h>
20#include <osmocom/abis/logging.h>
Pablo Neira Ayuso54b49792011-06-07 12:15:26 +020021#include <talloc.h>
22
23void *libosmo_abis_ctx;
24
Pablo Neira Ayusoe19c70a2011-06-12 15:15:30 +020025struct log_info_cat libosmo_abis_default_categories[] = {
26 [DINP] = {
27 .name = "DINP",
28 .description = "A-bis Intput Subsystem",
29 .enabled = 1, .loglevel = LOGL_NOTICE,
30 },
31 [DMUX] = {
32 .name = "DMUX",
33 .description = "A-bis B-Subchannel TRAU Frame Multiplex",
34 .enabled = 1, .loglevel = LOGL_NOTICE,
35 },
36 [DMI] = {
37 .name = "DMI",
38 .description = "A-bis Input Driver for Signalling",
39 .enabled = 0, .loglevel = LOGL_NOTICE,
40 },
41 [DMIB] = {
42 .name = "DMIB",
43 .description = "A-bis Input Driver for B-Channels (voice)",
44 .enabled = 0, .loglevel = LOGL_NOTICE,
45 },
46 [DRSL] = {
47 .name = "DRSL",
48 .description = "A-bis Radio Siganlling Link (RSL)",
49 .color = "\033[1;35m",
50 .enabled = 1, .loglevel = LOGL_NOTICE,
51 },
52 [DNM] = {
53 .name = "DNM",
54 .description = "A-bis Network Management / O&M (NM/OML)",
55 .color = "\033[1;36m",
56 .enabled = 1, .loglevel = LOGL_INFO,
57 },
58};
59
60const struct log_info libosmo_abis_log_info = {
61 .filter_fn = NULL, /* the application should set this. */
62 .cat = libosmo_abis_default_categories,
63 .num_cat = ARRAY_SIZE(libosmo_abis_default_categories),
64};
65
Pablo Neira Ayuso54b49792011-06-07 12:15:26 +020066void libosmo_abis_init(void *ctx)
67{
Pablo Neira Ayusoe19c70a2011-06-12 15:15:30 +020068 log_init(&libosmo_abis_log_info);
Pablo Neira Ayuso54b49792011-06-07 12:15:26 +020069 libosmo_abis_ctx = talloc_named_const(ctx, 0, "abis");
70 e1inp_init();
71}