diff options
author | Pablo Neira Ayuso <pablo@soleta.eu> | 2014-08-29 12:30:38 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@soleta.eu> | 2014-08-29 12:30:38 +0200 |
commit | 03ab79abace6ce19ae13f0ad5a817938c496b791 (patch) | |
tree | 95a5185069d4847eae95017eeb4493ebde8c6a03 | |
parent | 308d5f8912acdfbfe512aed1a2f50b4e7bf5d370 (diff) |
osmux: add 'osmux batch-size NUM' option to mgcp vty
This allows you to specify the osmux batch frame size. If zero, the
library uses the default value.
-rw-r--r-- | openbsc/include/openbsc/mgcp.h | 2 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcp_osmux.c | 2 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcp_vty.c | 12 |
3 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index bf240a342..9015f6989 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -217,6 +217,8 @@ struct mgcp_config { int osmux_init; /* osmux batch factor: from 1 to 4 maximum */ int osmux_batch; + /* osmux batch size (in bytes) */ + int osmux_batch_size; /* osmux port */ uint16_t osmux_port; }; diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index 7c0b41c83..c285de49a 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -121,6 +121,8 @@ osmux_handle_alloc(struct mgcp_config *cfg, struct in_addr *addr, int rem_port) h->in->osmux_seq = 0; /* sequence number to start OSmux message from */ h->in->batch_factor = cfg->osmux_batch; + /* If batch size is zero, the library defaults to 1470 bytes. */ + h->in->batch_size = cfg->osmux_batch_size; h->in->deliver = osmux_deliver; osmux_xfrm_input_init(h->in); h->in->data = h; diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c index d40a3ce27..4dd89b7ae 100644 --- a/openbsc/src/libmgcp/mgcp_vty.c +++ b/openbsc/src/libmgcp/mgcp_vty.c @@ -135,6 +135,8 @@ static int config_write_mgcp(struct vty *vty) g_cfg->osmux == 1 ? "on" : "off", VTY_NEWLINE); vty_out(vty, " osmux batch-factor %d%s", g_cfg->osmux_batch, VTY_NEWLINE); + vty_out(vty, " osmux batch-size %u%s", + g_cfg->osmux_batch_size, VTY_NEWLINE); vty_out(vty, " osmux port %u%s", g_cfg->osmux_port, VTY_NEWLINE); @@ -1134,6 +1136,15 @@ DEFUN(cfg_mgcp_osmux_batch_factor, return CMD_SUCCESS; } +DEFUN(cfg_mgcp_osmux_batch_size, + cfg_mgcp_osmux_batch_size_cmd, + "osmux batch-size <1-65535>", + OSMUX_STR "batch size\n" "Batch size in bytes\n") +{ + g_cfg->osmux_batch_size = atoi(argv[0]); + return CMD_SUCCESS; +} + DEFUN(cfg_mgcp_osmux_port, cfg_mgcp_osmux_port_cmd, "osmux port <1-65535>", @@ -1198,6 +1209,7 @@ int mgcp_vty_init(void) install_element(MGCP_NODE, &cfg_mgcp_no_sdp_payload_send_ptime_cmd); install_element(MGCP_NODE, &cfg_mgcp_osmux_cmd); install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_factor_cmd); + install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_size_cmd); install_element(MGCP_NODE, &cfg_mgcp_osmux_port_cmd); install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd); |