diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-05-26 12:45:33 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-06-06 19:23:18 +0000 |
commit | 8a8d73a691c709403be4adbe8f2a7150b4d5998a (patch) | |
tree | 2413af79c7ba5aa51b7163fe22277e7ad3a9e62e /src/osmo-bts-trx/trx_vty.c | |
parent | d36b3a84638d6db940387f0e18c98855202f554d (diff) |
trx: Allow BTS and TRX to be on different IPs
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9
Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
Diffstat (limited to 'src/osmo-bts-trx/trx_vty.c')
-rw-r--r-- | src/osmo-bts-trx/trx_vty.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3822b0f7..123ca803 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -24,6 +24,7 @@ #include <errno.h> #include <stdint.h> #include <ctype.h> +#include <inttypes.h> #include <arpa/inet.h> @@ -459,14 +460,31 @@ DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd, DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR - "Set remote IP address\n" - "IP address of OsmoTRX\n") + "Set local and remote IP address\n" + "IP address (for both OsmoBtsTrx and OsmoTRX)\n") { struct phy_link *plink = vty->index; - if (plink->u.osmotrx.transceiver_ip) - talloc_free(plink->u.osmotrx.transceiver_ip); - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_osmotrx_ip, cfg_phy_osmotrx_ip_cmd, + "osmotrx ip (local|remote) A.B.C.D", + OSMOTRX_STR + "Set IP address\n" "Local IP address (BTS)\n" + "Remote IP address (OsmoTRX)\n" "IP address\n") +{ + struct phy_link *plink = vty->index; + + if (!strcmp(argv[0], "local")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[1]); + else if (!strcmp(argv[0], "remote")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[1]); + else + return CMD_WARNING; return CMD_SUCCESS; } @@ -488,9 +506,12 @@ DEFUN(cfg_phy_base_port, cfg_phy_base_port_cmd, void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { - if (plink->u.osmotrx.transceiver_ip) - vty_out(vty, " osmotrx ip %s%s", - plink->u.osmotrx.transceiver_ip, VTY_NEWLINE); + if (plink->u.osmotrx.local_ip) + vty_out(vty, " osmotrx ip local %s%s", + plink->u.osmotrx.local_ip, VTY_NEWLINE); + if (plink->u.osmotrx.remote_ip) + vty_out(vty, " osmotrx ip remote %s%s", + plink->u.osmotrx.remote_ip, VTY_NEWLINE); vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); @@ -568,6 +589,7 @@ int bts_model_vty_init(struct gsm_bts *bts) install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); + install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); |