From 96e81280617112d5f683b5c78c010fd4843e2af0 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 9 Jun 2011 15:06:11 +0200 Subject: input: ipaccess: add preliminary BTS-side for A-bis over IP This patch adds the BTS-side for the ip.access driver for A-bis over IP communications. This patch adds one example under test/ so you can test the existing BSC and BTS sides over ip.access. Still incomplete, it requires to allow to register some callback in the BTS side to perform some action once we receive some message. This will come in next updates. --- src/input/ipaccess.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/input/ipaccess.c') diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 78b2533..4a86300 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -43,6 +43,7 @@ #include #include #include +#include #define PRIV_OML 1 #define PRIV_RSL 2 @@ -485,9 +486,12 @@ ipaccess_line_update(struct e1inp_line *line, enum e1inp_line_role role) switch(role) { case E1INP_LINE_R_BSC: + LOGP(DINP, LOGL_NOTICE, "enabling ipaccess BSC mode\n"); + /* Listen for OML connections */ ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, - "0.0.0.0", IPA_TCP_PORT_OML, 1); + "0.0.0.0", IPA_TCP_PORT_OML, + OSMO_SOCK_F_BIND); if (ret < 0) return ret; @@ -502,7 +506,8 @@ ipaccess_line_update(struct e1inp_line *line, enum e1inp_line_role role) } /* Listen for RSL connections */ ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, - "0.0.0.0", IPA_TCP_PORT_RSL, 1); + "0.0.0.0", IPA_TCP_PORT_RSL, + OSMO_SOCK_F_BIND); if (ret < 0) return ret; @@ -516,9 +521,25 @@ ipaccess_line_update(struct e1inp_line *line, enum e1inp_line_role role) return ret; } break; - case E1INP_LINE_R_BTS: - /* XXX: no implemented yet. */ + case E1INP_LINE_R_BTS: { + struct ipa_link *link; + + LOGP(DINP, LOGL_NOTICE, "enabling ipaccess BTS mode\n"); + + link = ipa_client_link_create(tall_ipa_ctx); + if (link == NULL) { + perror("ipa_client_link_create: "); + return -ENOMEM; + } + if (ipa_client_link_open(link) < 0) { + perror("ipa_client_link_open: "); + ipa_client_link_close(link); + ipa_client_link_destroy(link); + return -EIO; + } + ret = 0; break; + } default: break; } -- cgit v1.2.3-55-g7522