aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-18 22:45:53 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-27 15:41:54 +0200
commit0a216cda006e5f3f47a65f1ddb5a745088195217 (patch)
treeeb49807d8fd5f51ad9e16ce4e16ee6afdb703623
parentc9295ea2dd1f52931f8670e706a7b0d4b3ac536b (diff)
e1_input: Allow IPA on non-standard TCP ports for OML and RSLlaforge/oml-router
This unfortunately breaks the ABI in a suble way, without breaking API.
-rw-r--r--include/osmocom/abis/e1_input.h2
-rw-r--r--src/input/ipaccess.c17
2 files changed, 12 insertions, 7 deletions
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index fe5d624..341a2ba 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -146,6 +146,8 @@ struct e1inp_line_ops {
struct {
enum e1inp_line_role role; /* BSC or BTS mode. */
const char *addr; /* IP address .*/
+ uint16_t oml_port; /* Port number */
+ uint16_t rsl_port; /* Port number */
void *dev; /* device parameters. */
} ipa;
struct {
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index b8932a2..2e0068c 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -763,10 +763,11 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
}
msgb_free(msg);
return ret;
- } else if (link->port == IPA_TCP_PORT_OML)
- e1i_ts = &link->line->ts[0];
- else if (link->port == IPA_TCP_PORT_RSL)
- e1i_ts = &link->line->ts[1];
+ } else if (hh->proto == IPAC_PROTO_OML ||
+ hh->proto == IPAC_PROTO_OSMO)
+ e1i_ts = &link->line->ts[E1INP_SIGN_OML-1];
+ else if (hh->proto == IPAC_PROTO_RSL)
+ e1i_ts = &link->line->ts[E1INP_SIGN_RSL-1];
OSMO_ASSERT(e1i_ts != NULL);
@@ -827,7 +828,8 @@ static int ipaccess_line_update(struct e1inp_line *line)
LOGP(DLINP, LOGL_NOTICE, "enabling ipaccess BSC mode\n");
oml_link = ipa_server_link_create(tall_ipa_ctx, line,
- "0.0.0.0", IPA_TCP_PORT_OML,
+ line->ops->cfg.ipa.addr,
+ line->ops->cfg.ipa.oml_port,
ipaccess_bsc_oml_cb, NULL);
if (oml_link == NULL) {
LOGP(DLINP, LOGL_ERROR, "cannot create OML "
@@ -841,7 +843,8 @@ static int ipaccess_line_update(struct e1inp_line *line)
return -EIO;
}
rsl_link = ipa_server_link_create(tall_ipa_ctx, line,
- "0.0.0.0", IPA_TCP_PORT_RSL,
+ line->ops->cfg.ipa.addr,
+ line->ops->cfg.ipa.rsl_port,
ipaccess_bsc_rsl_cb, NULL);
if (rsl_link == NULL) {
LOGP(DLINP, LOGL_ERROR, "cannot create RSL "
@@ -866,7 +869,7 @@ static int ipaccess_line_update(struct e1inp_line *line)
&line->ts[E1INP_SIGN_OML-1],
E1INP_SIGN_OML,
line->ops->cfg.ipa.addr,
- IPA_TCP_PORT_OML,
+ line->ops->cfg.ipa.oml_port,
ipaccess_bts_updown_cb,
ipaccess_bts_read_cb,
ipaccess_bts_write_cb,