summaryrefslogtreecommitdiffstats
path: root/src/input/ipaccess.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-06-09 15:06:11 +0200
committerPablo Neira Ayuso2011-06-14 18:47:09 +0200
commit96e81280617112d5f683b5c78c010fd4843e2af0 (patch)
tree090f956d2bbfdea91da1ecd5d04e4e2eb02fb47b /src/input/ipaccess.c
parentsrc: add support for logging infrastructure in libosmo-abis (diff)
downloadlibosmo-abis-96e81280617112d5f683b5c78c010fd4843e2af0.tar.gz
libosmo-abis-96e81280617112d5f683b5c78c010fd4843e2af0.tar.xz
libosmo-abis-96e81280617112d5f683b5c78c010fd4843e2af0.zip
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.
Diffstat (limited to 'src/input/ipaccess.c')
-rw-r--r--src/input/ipaccess.c29
1 files changed, 25 insertions, 4 deletions
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 <osmocom/abis/ipaccess.h>
#include <osmocom/core/socket.h>
#include <osmocom/abis/logging.h>
+#include <osmocom/abis/ipa.h>
#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;
}