ctrl: take both address and port from vty config
Change-Id: Id053bc02e0a6359e52a0f5e110128d3bb87ed151
This commit is contained in:
parent
ded02cfc29
commit
9c0d105d09
|
@ -6,7 +6,6 @@ noinst_HEADERS = \
|
||||||
mgcp_endp.h \
|
mgcp_endp.h \
|
||||||
mgcp_sdp.h \
|
mgcp_sdp.h \
|
||||||
mgcp_codec.h \
|
mgcp_codec.h \
|
||||||
mgcp_ctrl.h \
|
|
||||||
mgcp_trunk.h \
|
mgcp_trunk.h \
|
||||||
debug.h \
|
debug.h \
|
||||||
mgcp_ratectr.h \
|
mgcp_ratectr.h \
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
/*
|
|
||||||
* (C) 2020 by Harald Welte <laforge@gnumonks.org>
|
|
||||||
* All Rights Reserved
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
struct ctrl_handle *mgw_ctrl_interface_setup(struct mgcp_config *cfg,
|
|
||||||
const char *bind_addr, uint16_t port);
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ libosmo_mgcp_a_SOURCES = \
|
||||||
mgcp_stat.c \
|
mgcp_stat.c \
|
||||||
mgcp_endp.c \
|
mgcp_endp.c \
|
||||||
mgcp_trunk.c \
|
mgcp_trunk.c \
|
||||||
mgcp_ctrl.c \
|
|
||||||
mgcp_ratectr.c \
|
mgcp_ratectr.c \
|
||||||
mgcp_e1.c \
|
mgcp_e1.c \
|
||||||
mgcp_iuup.c \
|
mgcp_iuup.c \
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
* (C) 2020 by Harald Welte <laforge@gnumonks.org>
|
|
||||||
* All Rights Reserved
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <osmocom/ctrl/control_if.h>
|
|
||||||
#include <osmocom/mgcp/mgcp.h>
|
|
||||||
|
|
||||||
|
|
||||||
static int mgw_ctrl_node_lookup(void *data, vector vline, int *node_type,
|
|
||||||
void **node_data, int *i)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
struct ctrl_handle *mgw_ctrl_interface_setup(struct mgcp_config *cfg,
|
|
||||||
const char *bind_addr, uint16_t port)
|
|
||||||
{
|
|
||||||
return ctrl_interface_setup_dynip2(cfg, bind_addr, port, mgw_ctrl_node_lookup,
|
|
||||||
_LAST_CTRL_NODE);
|
|
||||||
}
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include <osmocom/mgcp/debug.h>
|
#include <osmocom/mgcp/debug.h>
|
||||||
#include <osmocom/mgcp/mgcp_endp.h>
|
#include <osmocom/mgcp/mgcp_endp.h>
|
||||||
#include <osmocom/mgcp/mgcp_trunk.h>
|
#include <osmocom/mgcp/mgcp_trunk.h>
|
||||||
#include <osmocom/mgcp/mgcp_ctrl.h>
|
|
||||||
|
|
||||||
#include <osmocom/core/application.h>
|
#include <osmocom/core/application.h>
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
|
@ -51,7 +50,7 @@
|
||||||
#include <osmocom/core/rate_ctr.h>
|
#include <osmocom/core/rate_ctr.h>
|
||||||
#include <osmocom/core/logging.h>
|
#include <osmocom/core/logging.h>
|
||||||
#include <osmocom/core/socket.h>
|
#include <osmocom/core/socket.h>
|
||||||
|
#include <osmocom/ctrl/control_if.h>
|
||||||
#include <osmocom/ctrl/control_vty.h>
|
#include <osmocom/ctrl/control_vty.h>
|
||||||
|
|
||||||
#include <osmocom/vty/telnet_interface.h>
|
#include <osmocom/vty/telnet_interface.h>
|
||||||
|
@ -366,7 +365,7 @@ int main(int argc, char **argv)
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
cfg->ctrl = mgw_ctrl_interface_setup(cfg, ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_MGW);
|
cfg->ctrl = ctrl_interface_setup(cfg, OSMO_CTRL_PORT_MGW, NULL);
|
||||||
if (!cfg->ctrl) {
|
if (!cfg->ctrl) {
|
||||||
fprintf(stderr, "Failed to init the control interface on %s:%u. Exiting\n",
|
fprintf(stderr, "Failed to init the control interface on %s:%u. Exiting\n",
|
||||||
ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_MGW);
|
ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_MGW);
|
||||||
|
|
Loading…
Reference in New Issue