lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2022

  • 3 participants
  • 1374 discussions
Change in osmo-ttcn3-hacks[master]: hnodeb: Test passing unordered list of RFCIs
by osmith 10 Jun '22

10 Jun '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28254 ) Change subject: hnodeb: Test passing unordered list of RFCIs ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28254 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ib8961630a1ebe6f6bfee5af0889aa129e491cb2b Gerrit-Change-Number: 28254 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:41:54 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: hnodeb: Update primitives to audio SAPI version 1
by osmith 10 Jun '22

10 Jun '22
Attention is currently required from: laforge, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28253 ) Change subject: hnodeb: Update primitives to audio SAPI version 1 ...................................................................... Patch Set 3: Code-Review+1 (1 comment) File library/HNBLLIF_Templates.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28253/comment/d3a922bf_96d3… PS2, Line 283: rfcis[i] := i; > That's me failing to change the editor indentation config every time I switch between osmocom and op […] consider adding an .editorconfig file to both repos: https://editorconfig.org/ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28253 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I9af56f5e6a70b350f2fffa2e04be384d101b52ed Gerrit-Change-Number: 28253 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:36:03 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-hnbgw[master]: fix segfault in error handling for mgw_fi == NULL
by fixeria 10 Jun '22

10 Jun '22
Attention is currently required from: neels, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/28263 ) Change subject: fix segfault in error handling for mgw_fi == NULL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/28263 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I3e98dc3a00145ec1f71c678bbf45debfd4276237 Gerrit-Change-Number: 28263 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:35:48 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: hnodeb: Allow setting hnbllif sapi versions
by osmith 10 Jun '22

10 Jun '22
Attention is currently required from: osmith, fixeria. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28252 ) Change subject: hnodeb: Allow setting hnbllif sapi versions ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28252 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I24d757d3dfa4148537db49d70c525e1a81836426 Gerrit-Change-Number: 28252 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:33:29 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-hnodeb[master]: llsk: Validate received SAPI versions at startup
by pespin 10 Jun '22

10 Jun '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/28250 ) Change subject: llsk: Validate received SAPI versions at startup ...................................................................... llsk: Validate received SAPI versions at startup Change-Id: I172abfee3bfadb383aa6bce6fe76306291c7cd7f --- M include/osmocom/hnodeb/hnodeb.h M include/osmocom/hnodeb/llsk.h M src/osmo-hnodeb/llsk.c 3 files changed, 36 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h index 5503020..986c638 100644 --- a/include/osmocom/hnodeb/hnodeb.h +++ b/include/osmocom/hnodeb/hnodeb.h @@ -92,6 +92,9 @@ struct osmo_prim_srv_link *link; struct osmo_prim_srv *srv; uint8_t valid_sapi_mask; + uint16_t sapi_version_iuh; + uint16_t sapi_version_gtp; + uint16_t sapi_version_audio; struct osmo_timer_list defer_configure_ind_timer; } llsk; diff --git a/include/osmocom/hnodeb/llsk.h b/include/osmocom/hnodeb/llsk.h index 78eb065..d9e1a69 100644 --- a/include/osmocom/hnodeb/llsk.h +++ b/include/osmocom/hnodeb/llsk.h @@ -37,8 +37,8 @@ int ll_addr2osa(enum u_addr_type t, const union u_addr *uaddr, uint16_t port, struct osmo_sockaddr *osa); enum u_addr_type osa2_ll_addr(const struct osmo_sockaddr *osa, union u_addr *uaddr, uint16_t *port); - - +#define LLSK_SAPI_IUH_VERSION_MIN 0 +#define LLSK_SAPI_IUH_VERSION_MAX 0 extern const struct value_string hnb_iuh_prim_type_names[]; int llsk_rx_iuh(struct hnb *hnb, struct osmo_prim_hdr *oph); int llsk_iuh_tx_configure_ind(struct hnb *hnb); @@ -50,12 +50,15 @@ uint32_t data_len); struct hnb_iuh_prim *hnb_iuh_makeprim_unitdata_ind(const uint8_t *data, uint32_t data_len); - +#define LLSK_SAPI_AUDIO_VERSION_MIN 0 +#define LLSK_SAPI_AUDIO_VERSION_MAX 0 extern const struct value_string hnb_audio_prim_type_names[]; int llsk_rx_audio(struct hnb *hnb, struct osmo_prim_hdr *oph); int llsk_audio_tx_conn_data_ind(struct rtp_conn *conn, uint8_t frame_nr, uint8_t fqc, uint8_t rfci, const uint8_t *payload, uint32_t len); +#define LLSK_SAPI_GTP_VERSION_MIN 0 +#define LLSK_SAPI_GTP_VERSION_MAX 0 extern const struct value_string hnb_gtp_prim_type_names[]; int llsk_rx_gtp(struct hnb *hnb, struct osmo_prim_hdr *oph); struct hnb_gtp_prim *hnb_gtp_makeprim_conn_data_ind(uint32_t gtp_conn_id, const uint8_t *data, uint32_t data_len); diff --git a/src/osmo-hnodeb/llsk.c b/src/osmo-hnodeb/llsk.c index 89e8364..b56cae7 100644 --- a/src/osmo-hnodeb/llsk.c +++ b/src/osmo-hnodeb/llsk.c @@ -146,6 +146,33 @@ struct hnb *hnb = (struct hnb *)osmo_prim_srv_get_priv(prim_srv); if (sapi > sizeof(hnb->llsk.valid_sapi_mask)*8 - 1) return -1; + + switch (sapi) { + case HNB_PRIM_SAPI_IUH: + if (rem_version < LLSK_SAPI_IUH_VERSION_MIN) + return -1; + if (rem_version > LLSK_SAPI_IUH_VERSION_MAX) + return LLSK_SAPI_IUH_VERSION_MAX; + hnb->llsk.sapi_version_iuh = rem_version; + break; + case HNB_PRIM_SAPI_GTP: + if (rem_version < LLSK_SAPI_GTP_VERSION_MIN) + return -1; + if (rem_version > LLSK_SAPI_GTP_VERSION_MAX) + return LLSK_SAPI_GTP_VERSION_MAX; + hnb->llsk.sapi_version_gtp = rem_version; + break; + case HNB_PRIM_SAPI_AUDIO: + if (rem_version < LLSK_SAPI_AUDIO_VERSION_MIN) + return -1; + if (rem_version > LLSK_SAPI_AUDIO_VERSION_MAX) + return LLSK_SAPI_AUDIO_VERSION_MAX; + hnb->llsk.sapi_version_audio = rem_version; + break; + default: + return -1; + } + hnb->llsk.valid_sapi_mask |= (1 << sapi); /* Defer CONFIGURE.req after we have confirmed the versions */ -- To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/28250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnodeb Gerrit-Branch: master Gerrit-Change-Id: I172abfee3bfadb383aa6bce6fe76306291c7cd7f Gerrit-Change-Number: 28250 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-hnodeb[master]: audio: Introduce SAPI v1 with unordered RFCI support
by pespin 10 Jun '22

10 Jun '22
Attention is currently required from: osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/28251 ) Change subject: audio: Introduce SAPI v1 with unordered RFCI support ...................................................................... Patch Set 1: (1 comment) File src/osmo-hnodeb/llsk_audio.c: https://gerrit.osmocom.org/c/osmo-hnodeb/+/28251/comment/6808c34a_7592e869 PS1, Line 76: llsk_audio_prim_size_tbl[PRIM_OP_REQUEST][HNB_AUDIO_PRIM_CONN_ESTABLISH] = > I'm a bit surprised that this modifies a global variable. […] Yes, one osmo-hnodeb has 1 llsk socket. -- To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/28251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnodeb Gerrit-Branch: master Gerrit-Change-Id: I860d18b80c1041bf63a1570d435e0568c0f6b01b Gerrit-Change-Number: 28251 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:31:46 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-hnodeb[master]: llsk: Validate received SAPI versions at startup
by pespin 10 Jun '22

10 Jun '22
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/28250 ) Change subject: llsk: Validate received SAPI versions at startup ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/28250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnodeb Gerrit-Branch: master Gerrit-Change-Id: I172abfee3bfadb383aa6bce6fe76306291c7cd7f Gerrit-Change-Number: 28250 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:30:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: Move all SMSCB/CBC vty code to its own file
by pespin 10 Jun '22

10 Jun '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28256 ) Change subject: Move all SMSCB/CBC vty code to its own file ...................................................................... Move all SMSCB/CBC vty code to its own file This way we separate all the VTY boilerplate from the actual logic, as we usually do in all other subsystems. Change-Id: Ifc7d1693d745dd2a3c31e3ee9610d8c634b50812 --- M include/osmocom/bsc/smscb.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/cbsp_link.c M src/osmo-bsc/smscb.c A src/osmo-bsc/smscb_vty.c 5 files changed, 426 insertions(+), 395 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/smscb.h b/include/osmocom/bsc/smscb.h index 0e157c6..03c3bb0 100644 --- a/include/osmocom/bsc/smscb.h +++ b/include/osmocom/bsc/smscb.h @@ -18,7 +18,6 @@ const char *bts_smscb_chan_state_name(const struct bts_smscb_chan_state *cstate); unsigned int bts_smscb_chan_load_percent(const struct bts_smscb_chan_state *cstate); unsigned int bts_smscb_chan_page_count(const struct bts_smscb_chan_state *cstate); -void smscb_vty_init(void); /* cbch_scheduler.c */ int bts_smscb_gen_sched_arr(struct bts_smscb_chan_state *cstate, struct bts_smscb_page ***arr_out); @@ -61,9 +60,12 @@ struct msgb *msg; } client; }; -void cbc_vty_init(void); int bsc_cbc_link_restart(void); int cbsp_tx_decoded(struct bsc_cbc_link *cbc, struct osmo_cbsp_decoded *decoded); void bts_etws_init(struct gsm_bts *bts); void bts_etws_bootstrap(struct gsm_bts *bts); + +/* smscb_vty.c: */ +void smscb_vty_init(void); +void cbc_vty_init(void); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 583fb79..557178e 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -106,6 +106,7 @@ system_information.c \ timeslot_fsm.c \ smscb.c \ + smscb_vty.c \ cbch_scheduler.c \ cbsp_link.c \ power_control.c \ diff --git a/src/osmo-bsc/cbsp_link.c b/src/osmo-bsc/cbsp_link.c index 4926799..39798df 100644 --- a/src/osmo-bsc/cbsp_link.c +++ b/src/osmo-bsc/cbsp_link.c @@ -21,7 +21,6 @@ #include <osmocom/bsc/gsm_data.h> -#include <osmocom/bsc/vty.h> #include <osmocom/bsc/debug.h> #include <osmocom/bsc/smscb.h> #include <osmocom/bsc/bsc_msc_data.h> @@ -320,341 +319,3 @@ talloc_free(cbsp); return 0; } - -static struct bsc_cbc_link *vty_cbc_data(struct vty *vty) -{ - return bsc_gsmnet->cbc; -} - -/********************************************************************************* - * VTY Interface (Configuration + Introspection) - *********************************************************************************/ - -DEFUN(cfg_cbc, cfg_cbc_cmd, - "cbc", "Configure CBSP Link to Cell Broadcast Centre\n") -{ - vty->node = CBC_NODE; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_mode, cfg_cbc_mode_cmd, - "mode (server|client|disabled)", - "Set OsmoBSC as CBSP server or client\n" - "CBSP Server: listen for inbound TCP connections from a remote Cell Broadcast Centre\n" - "CBSP Client: establish outbound TCP connection to a remote Cell Broadcast Centre\n" - "Disable CBSP link\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->mode = get_string_value(bsc_cbc_link_mode_names, argv[0]); - OSMO_ASSERT(cbc->mode >= 0); - - /* Immediately restart/stop CBSP only when coming from a telnet session. The settings from the config file take - * effect in osmo_bsc_main.c's invocation of bsc_cbc_link_restart(). */ - if (vty->type != VTY_FILE) - bsc_cbc_link_restart(); - - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_server, cfg_cbc_server_cmd, - "server", "Configure OsmoBSC's CBSP server role\n") -{ - vty->node = CBC_SERVER_NODE; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_server_local_ip, cfg_cbc_server_local_ip_cmd, - "local-ip " VTY_IPV46_CMD, - "Set IP Address to listen on for inbound CBSP from a Cell Broadcast Centre\n" - "IPv4 address\n" "IPv6 address\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - osmo_sockaddr_str_from_str(&cbc->server.local_addr, argv[0], cbc->server.local_addr.port); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_server_local_port, cfg_cbc_server_local_port_cmd, - "local-port <1-65535>", - "Set TCP port to listen on for inbound CBSP from a Cell Broadcast Centre\n" - "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->server.local_addr.port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client, cfg_cbc_client_cmd, - "client", "Configure OsmoBSC's CBSP client role\n") -{ - vty->node = CBC_CLIENT_NODE; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_remote_ip, cfg_cbc_client_remote_ip_cmd, - "remote-ip " VTY_IPV46_CMD, - "Set IP Address of the Cell Broadcast Centre, to establish CBSP link to\n" - "IPv4 address\n" "IPv6 address\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - osmo_sockaddr_str_from_str(&cbc->client.remote_addr, argv[0], cbc->client.remote_addr.port); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_remote_port, cfg_cbc_client_remote_port_cmd, - "remote-port <1-65535>", - "Set TCP port of the Cell Broadcast Centre, to establish CBSP link to\n" - "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.remote_addr.port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_local_ip, cfg_cbc_client_local_ip_cmd, - "local-ip " VTY_IPV46_CMD, - "Set local bind address for the outbound CBSP link to the Cell Broadcast Centre\n" - "IPv4 address\n" "IPv6 address\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - osmo_sockaddr_str_from_str(&cbc->client.local_addr, argv[0], cbc->client.local_addr.port); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_local_port, cfg_cbc_client_local_port_cmd, - "local-port <1-65535>", - "Set local bind port for the outbound CBSP link to the Cell Broadcast Centre\n" - "port number\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.local_addr.port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_no_local_ip, cfg_cbc_client_no_local_ip_cmd, - "no local-ip", - NO_STR "Remove local IP address bind config for the CBSP client mode\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.local_addr = (struct osmo_sockaddr_str){ .port = cbc->client.local_addr.port }; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_no_local_port, cfg_cbc_client_no_local_port_cmd, - "no local-port", - NO_STR "Remove local TCP port bind config for the CBSP client mode\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.local_addr.port = 0; - return CMD_SUCCESS; -} - -static struct cmd_node cbc_node = { - CBC_NODE, - "%s(config-cbc)# ", - 1, -}; - -static struct cmd_node cbc_server_node = { - CBC_SERVER_NODE, - "%s(config-cbc-server)# ", - 1, -}; - -static struct cmd_node cbc_client_node = { - CBC_CLIENT_NODE, - "%s(config-cbc-client)# ", - 1, -}; - -static int config_write_cbc(struct vty *vty) -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - - bool default_server_local; - bool default_client_remote; - bool default_client_local; - - default_server_local = !osmo_sockaddr_str_cmp(&cbc->server.local_addr, - &bsc_cbc_default_server_local_addr); - default_client_remote = !osmo_sockaddr_str_is_set(&cbc->client.remote_addr); - default_client_local = !osmo_sockaddr_str_is_set(&cbc->client.local_addr); - - /* If all reflects default values, skip the 'cbc' section */ - if (cbc->mode == BSC_CBC_LINK_MODE_DISABLED - && default_server_local - && default_client_remote && default_client_local) - return 0; - - vty_out(vty, "cbc%s", VTY_NEWLINE); - vty_out(vty, " mode %s%s", bsc_cbc_link_mode_name(cbc->mode), VTY_NEWLINE); - - if (!default_server_local) { - vty_out(vty, " server%s", VTY_NEWLINE); - - if (strcmp(cbc->server.local_addr.ip, bsc_cbc_default_server_local_addr.ip)) - vty_out(vty, " local-ip %s%s", cbc->server.local_addr.ip, VTY_NEWLINE); - if (cbc->server.local_addr.port != bsc_cbc_default_server_local_addr.port) - vty_out(vty, " local-port %u%s", cbc->server.local_addr.port, VTY_NEWLINE); - } - - if (!(default_client_remote && default_client_local)) { - vty_out(vty, " client%s", VTY_NEWLINE); - - if (osmo_sockaddr_str_is_set(&cbc->client.remote_addr)) { - vty_out(vty, " remote-ip %s%s", cbc->client.remote_addr.ip, VTY_NEWLINE); - if (cbc->client.remote_addr.port != CBSP_TCP_PORT) - vty_out(vty, " remote-port %u%s", cbc->client.remote_addr.port, VTY_NEWLINE); - } - - if (cbc->client.local_addr.ip[0]) - vty_out(vty, " local-ip %s%s", cbc->client.local_addr.ip, VTY_NEWLINE); - if (cbc->client.local_addr.port) - vty_out(vty, " local-port %u%s", cbc->client.local_addr.port, VTY_NEWLINE); - } - - return 0; -} - -DEFUN(show_cbc, show_cbc_cmd, - "show cbc", - SHOW_STR "Display state of CBC / CBSP\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - - switch (cbc->mode) { - case BSC_CBC_LINK_MODE_DISABLED: - vty_out(vty, "CBSP link is disabled%s", VTY_NEWLINE); - break; - - case BSC_CBC_LINK_MODE_SERVER: - vty_out(vty, "OsmoBSC is configured as CBSP Server on " OSMO_SOCKADDR_STR_FMT "%s", - OSMO_SOCKADDR_STR_FMT_ARGS(&cbc->server.local_addr), VTY_NEWLINE); - vty_out(vty, "CBSP Server Connection: %s%s", - cbc->server.sock_name ? cbc->server.sock_name : "Disconnected", VTY_NEWLINE); - break; - - case BSC_CBC_LINK_MODE_CLIENT: - vty_out(vty, "OsmoBSC is configured as CBSP Client to remote CBC at " OSMO_SOCKADDR_STR_FMT "%s", - OSMO_SOCKADDR_STR_FMT_ARGS(&cbc->client.remote_addr), VTY_NEWLINE); - vty_out(vty, "CBSP Client Connection: %s%s", - cbc->client.sock_name ? cbc->client.sock_name : "Disconnected", VTY_NEWLINE); - break; - } - return CMD_SUCCESS; -} - -/* --- Deprecated 'cbc' commands for backwards compat --- */ - -DEFUN_DEPRECATED(cfg_cbc_remote_ip, cfg_cbc_remote_ip_cmd, - "remote-ip A.B.C.D", - "IP Address of the Cell Broadcast Centre\n" - "IP Address of the Cell Broadcast Centre\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - vty_out(vty, "%% cbc/remote-ip config is deprecated, instead use cbc/client/remote-ip and cbc/ mode%s", - VTY_NEWLINE); - osmo_sockaddr_str_from_str(&cbc->client.remote_addr, argv[0], cbc->client.remote_addr.port); - cbc->mode = BSC_CBC_LINK_MODE_CLIENT; - if (vty->type != VTY_FILE) - bsc_cbc_link_restart(); - return CMD_SUCCESS; -} -DEFUN_DEPRECATED(cfg_cbc_no_remote_ip, cfg_cbc_no_remote_ip_cmd, - "no remote-ip", - NO_STR "Remove IP address of CBC; disables outbound CBSP connections\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - vty_out(vty, "%% cbc/remote-ip config is deprecated, instead use cbc/client/remote-ip and cbc/mode%s", - VTY_NEWLINE); - if (cbc->mode == BSC_CBC_LINK_MODE_CLIENT) { - cbc->mode = BSC_CBC_LINK_MODE_DISABLED; - if (vty->type != VTY_FILE) - bsc_cbc_link_restart(); - } - return CMD_SUCCESS; -} - -DEFUN_DEPRECATED(cfg_cbc_remote_port, cfg_cbc_remote_port_cmd, - "remote-port <1-65535>", - "TCP Port number of the Cell Broadcast Centre (Default: 48049)\n" - "TCP Port number of the Cell Broadcast Centre (Default: 48049)\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - vty_out(vty, "%% cbc/remote-port config is deprecated, instead use cbc/client/remote-port%s", - VTY_NEWLINE); - cbc->client.remote_addr.port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN_DEPRECATED(cfg_cbc_listen_port, cfg_cbc_listen_port_cmd, - "listen-port <1-65535>", - "Local TCP port at which BSC listens for incoming CBSP connections from CBC\n" - "Local TCP port at which BSC listens for incoming CBSP connections from CBC\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - vty_out(vty, "%% cbc/listen-port config is deprecated, instead use cbc/server/local-port and cbc/mode%s", - VTY_NEWLINE); - cbc->mode = BSC_CBC_LINK_MODE_SERVER; - cbc->server.local_addr.port = atoi(argv[0]); - if (vty->type != VTY_FILE) - bsc_cbc_link_restart(); - return CMD_SUCCESS; -} - -DEFUN_DEPRECATED(cfg_cbc_no_listen_port, cfg_cbc_no_listen_port_cmd, - "no listen-port", - NO_STR "Remove CBSP Listen Port; disables inbound CBSP connections\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - vty_out(vty, "%% cbc/listen-port config is deprecated, instead use cbc/server/local-port and cbc/mode%s", - VTY_NEWLINE); - if (cbc->mode == BSC_CBC_LINK_MODE_SERVER) { - cbc->mode = BSC_CBC_LINK_MODE_DISABLED; - if (vty->type != VTY_FILE) - bsc_cbc_link_restart(); - } - return CMD_SUCCESS; -} - -DEFUN_DEPRECATED(cfg_cbc_listen_ip, cfg_cbc_listen_ip_cmd, - "listen-ip A.B.C.D", - "Local IP Address where BSC listens for incoming CBC connections (Default: 127.0.0.1)\n" - "Local IP Address where BSC listens for incoming CBC connections\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - vty_out(vty, "%% cbc/listen-ip config is deprecated, instead use cbc/server/local-ip%s", - VTY_NEWLINE); - osmo_sockaddr_str_from_str(&cbc->server.local_addr, argv[0], cbc->server.local_addr.port); - return CMD_SUCCESS; -} - -void cbc_vty_init(void) -{ - install_element_ve(&show_cbc_cmd); - - install_element(CONFIG_NODE, &cfg_cbc_cmd); - install_node(&cbc_node, config_write_cbc); - install_element(CBC_NODE, &cfg_cbc_mode_cmd); - - install_element(CBC_NODE, &cfg_cbc_server_cmd); - install_node(&cbc_server_node, NULL); - install_element(CBC_SERVER_NODE, &cfg_cbc_server_local_ip_cmd); - install_element(CBC_SERVER_NODE, &cfg_cbc_server_local_port_cmd); - - install_element(CBC_NODE, &cfg_cbc_client_cmd); - install_node(&cbc_client_node, NULL); - install_element(CBC_CLIENT_NODE, &cfg_cbc_client_remote_ip_cmd); - install_element(CBC_CLIENT_NODE, &cfg_cbc_client_remote_port_cmd); - install_element(CBC_CLIENT_NODE, &cfg_cbc_client_local_ip_cmd); - install_element(CBC_CLIENT_NODE, &cfg_cbc_client_local_port_cmd); - install_element(CBC_CLIENT_NODE, &cfg_cbc_client_no_local_ip_cmd); - install_element(CBC_CLIENT_NODE, &cfg_cbc_client_no_local_port_cmd); - - /* Deprecated, for backwards compat */ - install_element(CBC_NODE, &cfg_cbc_remote_ip_cmd); - install_element(CBC_NODE, &cfg_cbc_no_remote_ip_cmd); - install_element(CBC_NODE, &cfg_cbc_remote_port_cmd); - install_element(CBC_NODE, &cfg_cbc_listen_port_cmd); - install_element(CBC_NODE, &cfg_cbc_no_listen_port_cmd); - install_element(CBC_NODE, &cfg_cbc_listen_ip_cmd); -} diff --git a/src/osmo-bsc/smscb.c b/src/osmo-bsc/smscb.c index 8e2eb0c..193dc4e 100644 --- a/src/osmo-bsc/smscb.c +++ b/src/osmo-bsc/smscb.c @@ -38,7 +38,6 @@ #include <osmocom/bsc/debug.h> #include <osmocom/bsc/gsm_data.h> #include <osmocom/bsc/smscb.h> -#include <osmocom/bsc/vty.h> #include <osmocom/bsc/gsm_04_08_rr.h> #include <osmocom/bsc/lchan_fsm.h> #include <osmocom/bsc/abis_rsl.h> @@ -1026,59 +1025,6 @@ return rc; } -/********************************************************************************* - * VTY Interface (Introspection) - *********************************************************************************/ - -static void vty_dump_smscb_chan_state(struct vty *vty, const struct bts_smscb_chan_state *cs) -{ - const struct bts_smscb_message *sm; - - vty_out(vty, "%s CBCH:%s", cs == &cs->bts->cbch_basic ? "BASIC" : "EXTENDED", VTY_NEWLINE); - - vty_out(vty, " MsgId | SerNo | Pg | Category | Perd | #Tx | #Req | DCS%s", VTY_NEWLINE); - vty_out(vty, "-------|-------|----|---------------|------|------|------|----%s", VTY_NEWLINE); - llist_for_each_entry(sm, &cs->messages, list) { - vty_out(vty, " %04x | %04x | %2u | %13s | %4u | %4u | %4u | %02x%s", - sm->input.msg_id, sm->input.serial_nr, sm->num_pages, - get_value_string(cbsp_category_names, sm->input.category), - sm->input.rep_period, sm->bcast_count, sm->input.num_bcast_req, - sm->input.dcs, VTY_NEWLINE); - } - vty_out(vty, "%s", VTY_NEWLINE); -} - -DEFUN(bts_show_cbs, bts_show_cbs_cmd, - "show bts <0-255> smscb [(basic|extended)]", - SHOW_STR "Display information about a BTS\n" "BTS number\n" - "SMS Cell Broadcast State\n" - "Show only information related to CBCH BASIC\n" - "Show only information related to CBCH EXTENDED\n") -{ - struct gsm_network *net = gsmnet_from_vty(vty); - int bts_nr = atoi(argv[0]); - struct gsm_bts *bts; - - if (bts_nr >= net->num_bts) { - vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); - return CMD_WARNING; - } - bts = gsm_bts_num(net, bts_nr); - - if (argc < 2 || !strcmp(argv[1], "basic")) - vty_dump_smscb_chan_state(vty, &bts->cbch_basic); - if (argc < 2 || !strcmp(argv[1], "extended")) - vty_dump_smscb_chan_state(vty, &bts->cbch_extended); - - return CMD_SUCCESS; -} - -void smscb_vty_init(void) -{ - install_element_ve(&bts_show_cbs_cmd); -} - - /* initialize the ETWS state of a BTS */ void bts_etws_init(struct gsm_bts *bts) { diff --git a/src/osmo-bsc/smscb_vty.c b/src/osmo-bsc/smscb_vty.c new file mode 100644 index 0000000..b13d2db --- /dev/null +++ b/src/osmo-bsc/smscb_vty.c @@ -0,0 +1,421 @@ +/* CBSP (Cell Broadcast Service Protocol) Handling for OsmoBSC */ +/* + * (C) 2019 by Harald Welte <laforge(a)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/bsc/gsm_data.h> +#include <osmocom/bsc/vty.h> +#include <osmocom/bsc/debug.h> +#include <osmocom/bsc/smscb.h> +#include <osmocom/bsc/bsc_msc_data.h> +#include <osmocom/bsc/bts.h> + +#include <osmocom/core/talloc.h> +#include <osmocom/core/socket.h> +#include <osmocom/gsm/cbsp.h> + +/********************************************************************************* + * cbc + *********************************************************************************/ +static struct bsc_cbc_link *vty_cbc_data(struct vty *vty) +{ + return bsc_gsmnet->cbc; +} + +DEFUN(cfg_cbc, cfg_cbc_cmd, + "cbc", "Configure CBSP Link to Cell Broadcast Centre\n") +{ + vty->node = CBC_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_mode, cfg_cbc_mode_cmd, + "mode (server|client|disabled)", + "Set OsmoBSC as CBSP server or client\n" + "CBSP Server: listen for inbound TCP connections from a remote Cell Broadcast Centre\n" + "CBSP Client: establish outbound TCP connection to a remote Cell Broadcast Centre\n" + "Disable CBSP link\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->mode = get_string_value(bsc_cbc_link_mode_names, argv[0]); + OSMO_ASSERT(cbc->mode >= 0); + + /* Immediately restart/stop CBSP only when coming from a telnet session. The settings from the config file take + * effect in osmo_bsc_main.c's invocation of bsc_cbc_link_restart(). */ + if (vty->type != VTY_FILE) + bsc_cbc_link_restart(); + + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_server, cfg_cbc_server_cmd, + "server", "Configure OsmoBSC's CBSP server role\n") +{ + vty->node = CBC_SERVER_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_server_local_ip, cfg_cbc_server_local_ip_cmd, + "local-ip " VTY_IPV46_CMD, + "Set IP Address to listen on for inbound CBSP from a Cell Broadcast Centre\n" + "IPv4 address\n" "IPv6 address\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + osmo_sockaddr_str_from_str(&cbc->server.local_addr, argv[0], cbc->server.local_addr.port); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_server_local_port, cfg_cbc_server_local_port_cmd, + "local-port <1-65535>", + "Set TCP port to listen on for inbound CBSP from a Cell Broadcast Centre\n" + "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->server.local_addr.port = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client, cfg_cbc_client_cmd, + "client", "Configure OsmoBSC's CBSP client role\n") +{ + vty->node = CBC_CLIENT_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_remote_ip, cfg_cbc_client_remote_ip_cmd, + "remote-ip " VTY_IPV46_CMD, + "Set IP Address of the Cell Broadcast Centre, to establish CBSP link to\n" + "IPv4 address\n" "IPv6 address\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + osmo_sockaddr_str_from_str(&cbc->client.remote_addr, argv[0], cbc->client.remote_addr.port); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_remote_port, cfg_cbc_client_remote_port_cmd, + "remote-port <1-65535>", + "Set TCP port of the Cell Broadcast Centre, to establish CBSP link to\n" + "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.remote_addr.port = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_local_ip, cfg_cbc_client_local_ip_cmd, + "local-ip " VTY_IPV46_CMD, + "Set local bind address for the outbound CBSP link to the Cell Broadcast Centre\n" + "IPv4 address\n" "IPv6 address\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + osmo_sockaddr_str_from_str(&cbc->client.local_addr, argv[0], cbc->client.local_addr.port); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_local_port, cfg_cbc_client_local_port_cmd, + "local-port <1-65535>", + "Set local bind port for the outbound CBSP link to the Cell Broadcast Centre\n" + "port number\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.local_addr.port = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_no_local_ip, cfg_cbc_client_no_local_ip_cmd, + "no local-ip", + NO_STR "Remove local IP address bind config for the CBSP client mode\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.local_addr = (struct osmo_sockaddr_str){ .port = cbc->client.local_addr.port }; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_no_local_port, cfg_cbc_client_no_local_port_cmd, + "no local-port", + NO_STR "Remove local TCP port bind config for the CBSP client mode\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.local_addr.port = 0; + return CMD_SUCCESS; +} + +static struct cmd_node cbc_node = { + CBC_NODE, + "%s(config-cbc)# ", + 1, +}; + +static struct cmd_node cbc_server_node = { + CBC_SERVER_NODE, + "%s(config-cbc-server)# ", + 1, +}; + +static struct cmd_node cbc_client_node = { + CBC_CLIENT_NODE, + "%s(config-cbc-client)# ", + 1, +}; + +static int config_write_cbc(struct vty *vty) +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + + bool default_server_local; + bool default_client_remote; + bool default_client_local; + + default_server_local = !osmo_sockaddr_str_cmp(&cbc->server.local_addr, + &bsc_cbc_default_server_local_addr); + default_client_remote = !osmo_sockaddr_str_is_set(&cbc->client.remote_addr); + default_client_local = !osmo_sockaddr_str_is_set(&cbc->client.local_addr); + + /* If all reflects default values, skip the 'cbc' section */ + if (cbc->mode == BSC_CBC_LINK_MODE_DISABLED + && default_server_local + && default_client_remote && default_client_local) + return 0; + + vty_out(vty, "cbc%s", VTY_NEWLINE); + vty_out(vty, " mode %s%s", bsc_cbc_link_mode_name(cbc->mode), VTY_NEWLINE); + + if (!default_server_local) { + vty_out(vty, " server%s", VTY_NEWLINE); + + if (strcmp(cbc->server.local_addr.ip, bsc_cbc_default_server_local_addr.ip)) + vty_out(vty, " local-ip %s%s", cbc->server.local_addr.ip, VTY_NEWLINE); + if (cbc->server.local_addr.port != bsc_cbc_default_server_local_addr.port) + vty_out(vty, " local-port %u%s", cbc->server.local_addr.port, VTY_NEWLINE); + } + + if (!(default_client_remote && default_client_local)) { + vty_out(vty, " client%s", VTY_NEWLINE); + + if (osmo_sockaddr_str_is_set(&cbc->client.remote_addr)) { + vty_out(vty, " remote-ip %s%s", cbc->client.remote_addr.ip, VTY_NEWLINE); + if (cbc->client.remote_addr.port != CBSP_TCP_PORT) + vty_out(vty, " remote-port %u%s", cbc->client.remote_addr.port, VTY_NEWLINE); + } + + if (cbc->client.local_addr.ip[0]) + vty_out(vty, " local-ip %s%s", cbc->client.local_addr.ip, VTY_NEWLINE); + if (cbc->client.local_addr.port) + vty_out(vty, " local-port %u%s", cbc->client.local_addr.port, VTY_NEWLINE); + } + + return 0; +} + +DEFUN(show_cbc, show_cbc_cmd, + "show cbc", + SHOW_STR "Display state of CBC / CBSP\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + + switch (cbc->mode) { + case BSC_CBC_LINK_MODE_DISABLED: + vty_out(vty, "CBSP link is disabled%s", VTY_NEWLINE); + break; + + case BSC_CBC_LINK_MODE_SERVER: + vty_out(vty, "OsmoBSC is configured as CBSP Server on " OSMO_SOCKADDR_STR_FMT "%s", + OSMO_SOCKADDR_STR_FMT_ARGS(&cbc->server.local_addr), VTY_NEWLINE); + vty_out(vty, "CBSP Server Connection: %s%s", + cbc->server.sock_name ? cbc->server.sock_name : "Disconnected", VTY_NEWLINE); + break; + + case BSC_CBC_LINK_MODE_CLIENT: + vty_out(vty, "OsmoBSC is configured as CBSP Client to remote CBC at " OSMO_SOCKADDR_STR_FMT "%s", + OSMO_SOCKADDR_STR_FMT_ARGS(&cbc->client.remote_addr), VTY_NEWLINE); + vty_out(vty, "CBSP Client Connection: %s%s", + cbc->client.sock_name ? cbc->client.sock_name : "Disconnected", VTY_NEWLINE); + break; + } + return CMD_SUCCESS; +} + +/* --- Deprecated 'cbc' commands for backwards compat --- */ + +DEFUN_DEPRECATED(cfg_cbc_remote_ip, cfg_cbc_remote_ip_cmd, + "remote-ip A.B.C.D", + "IP Address of the Cell Broadcast Centre\n" + "IP Address of the Cell Broadcast Centre\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + vty_out(vty, "%% cbc/remote-ip config is deprecated, instead use cbc/client/remote-ip and cbc/ mode%s", + VTY_NEWLINE); + osmo_sockaddr_str_from_str(&cbc->client.remote_addr, argv[0], cbc->client.remote_addr.port); + cbc->mode = BSC_CBC_LINK_MODE_CLIENT; + if (vty->type != VTY_FILE) + bsc_cbc_link_restart(); + return CMD_SUCCESS; +} +DEFUN_DEPRECATED(cfg_cbc_no_remote_ip, cfg_cbc_no_remote_ip_cmd, + "no remote-ip", + NO_STR "Remove IP address of CBC; disables outbound CBSP connections\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + vty_out(vty, "%% cbc/remote-ip config is deprecated, instead use cbc/client/remote-ip and cbc/mode%s", + VTY_NEWLINE); + if (cbc->mode == BSC_CBC_LINK_MODE_CLIENT) { + cbc->mode = BSC_CBC_LINK_MODE_DISABLED; + if (vty->type != VTY_FILE) + bsc_cbc_link_restart(); + } + return CMD_SUCCESS; +} + +DEFUN_DEPRECATED(cfg_cbc_remote_port, cfg_cbc_remote_port_cmd, + "remote-port <1-65535>", + "TCP Port number of the Cell Broadcast Centre (Default: 48049)\n" + "TCP Port number of the Cell Broadcast Centre (Default: 48049)\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + vty_out(vty, "%% cbc/remote-port config is deprecated, instead use cbc/client/remote-port%s", + VTY_NEWLINE); + cbc->client.remote_addr.port = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN_DEPRECATED(cfg_cbc_listen_port, cfg_cbc_listen_port_cmd, + "listen-port <1-65535>", + "Local TCP port at which BSC listens for incoming CBSP connections from CBC\n" + "Local TCP port at which BSC listens for incoming CBSP connections from CBC\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + vty_out(vty, "%% cbc/listen-port config is deprecated, instead use cbc/server/local-port and cbc/mode%s", + VTY_NEWLINE); + cbc->mode = BSC_CBC_LINK_MODE_SERVER; + cbc->server.local_addr.port = atoi(argv[0]); + if (vty->type != VTY_FILE) + bsc_cbc_link_restart(); + return CMD_SUCCESS; +} + +DEFUN_DEPRECATED(cfg_cbc_no_listen_port, cfg_cbc_no_listen_port_cmd, + "no listen-port", + NO_STR "Remove CBSP Listen Port; disables inbound CBSP connections\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + vty_out(vty, "%% cbc/listen-port config is deprecated, instead use cbc/server/local-port and cbc/mode%s", + VTY_NEWLINE); + if (cbc->mode == BSC_CBC_LINK_MODE_SERVER) { + cbc->mode = BSC_CBC_LINK_MODE_DISABLED; + if (vty->type != VTY_FILE) + bsc_cbc_link_restart(); + } + return CMD_SUCCESS; +} + +DEFUN_DEPRECATED(cfg_cbc_listen_ip, cfg_cbc_listen_ip_cmd, + "listen-ip A.B.C.D", + "Local IP Address where BSC listens for incoming CBC connections (Default: 127.0.0.1)\n" + "Local IP Address where BSC listens for incoming CBC connections\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + vty_out(vty, "%% cbc/listen-ip config is deprecated, instead use cbc/server/local-ip%s", + VTY_NEWLINE); + osmo_sockaddr_str_from_str(&cbc->server.local_addr, argv[0], cbc->server.local_addr.port); + return CMD_SUCCESS; +} + +void cbc_vty_init(void) +{ + install_element_ve(&show_cbc_cmd); + + install_element(CONFIG_NODE, &cfg_cbc_cmd); + install_node(&cbc_node, config_write_cbc); + install_element(CBC_NODE, &cfg_cbc_mode_cmd); + + install_element(CBC_NODE, &cfg_cbc_server_cmd); + install_node(&cbc_server_node, NULL); + install_element(CBC_SERVER_NODE, &cfg_cbc_server_local_ip_cmd); + install_element(CBC_SERVER_NODE, &cfg_cbc_server_local_port_cmd); + + install_element(CBC_NODE, &cfg_cbc_client_cmd); + install_node(&cbc_client_node, NULL); + install_element(CBC_CLIENT_NODE, &cfg_cbc_client_remote_ip_cmd); + install_element(CBC_CLIENT_NODE, &cfg_cbc_client_remote_port_cmd); + install_element(CBC_CLIENT_NODE, &cfg_cbc_client_local_ip_cmd); + install_element(CBC_CLIENT_NODE, &cfg_cbc_client_local_port_cmd); + install_element(CBC_CLIENT_NODE, &cfg_cbc_client_no_local_ip_cmd); + install_element(CBC_CLIENT_NODE, &cfg_cbc_client_no_local_port_cmd); + + /* Deprecated, for backwards compat */ + install_element(CBC_NODE, &cfg_cbc_remote_ip_cmd); + install_element(CBC_NODE, &cfg_cbc_no_remote_ip_cmd); + install_element(CBC_NODE, &cfg_cbc_remote_port_cmd); + install_element(CBC_NODE, &cfg_cbc_listen_port_cmd); + install_element(CBC_NODE, &cfg_cbc_no_listen_port_cmd); + install_element(CBC_NODE, &cfg_cbc_listen_ip_cmd); +} + + +/********************************************************************************* + * smscb + *********************************************************************************/ +static void vty_dump_smscb_chan_state(struct vty *vty, const struct bts_smscb_chan_state *cs) +{ + const struct bts_smscb_message *sm; + + vty_out(vty, "%s CBCH:%s", cs == &cs->bts->cbch_basic ? "BASIC" : "EXTENDED", VTY_NEWLINE); + + vty_out(vty, " MsgId | SerNo | Pg | Category | Perd | #Tx | #Req | DCS%s", VTY_NEWLINE); + vty_out(vty, "-------|-------|----|---------------|------|------|------|----%s", VTY_NEWLINE); + llist_for_each_entry(sm, &cs->messages, list) { + vty_out(vty, " %04x | %04x | %2u | %13s | %4u | %4u | %4u | %02x%s", + sm->input.msg_id, sm->input.serial_nr, sm->num_pages, + get_value_string(cbsp_category_names, sm->input.category), + sm->input.rep_period, sm->bcast_count, sm->input.num_bcast_req, + sm->input.dcs, VTY_NEWLINE); + } + vty_out(vty, "%s", VTY_NEWLINE); +} + +DEFUN(bts_show_cbs, bts_show_cbs_cmd, + "show bts <0-255> smscb [(basic|extended)]", + SHOW_STR "Display information about a BTS\n" "BTS number\n" + "SMS Cell Broadcast State\n" + "Show only information related to CBCH BASIC\n" + "Show only information related to CBCH EXTENDED\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + int bts_nr = atoi(argv[0]); + struct gsm_bts *bts; + + if (bts_nr >= net->num_bts) { + vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + bts = gsm_bts_num(net, bts_nr); + + if (argc < 2 || !strcmp(argv[1], "basic")) + vty_dump_smscb_chan_state(vty, &bts->cbch_basic); + if (argc < 2 || !strcmp(argv[1], "extended")) + vty_dump_smscb_chan_state(vty, &bts->cbch_extended); + + return CMD_SUCCESS; +} + +void smscb_vty_init(void) +{ + install_element_ve(&bts_show_cbs_cmd); +} -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28256 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ifc7d1693d745dd2a3c31e3ee9610d8c634b50812 Gerrit-Change-Number: 28256 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-bsc[master]: Move all SMSCB/CBC vty code to its own file
by osmith 10 Jun '22

10 Jun '22
Attention is currently required from: laforge, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28256 ) Change subject: Move all SMSCB/CBC vty code to its own file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28256 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ifc7d1693d745dd2a3c31e3ee9610d8c634b50812 Gerrit-Change-Number: 28256 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:29:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-hnodeb[master]: audio: Introduce SAPI v1 with unordered RFCI support
by osmith 10 Jun '22

10 Jun '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/28251 ) Change subject: audio: Introduce SAPI v1 with unordered RFCI support ...................................................................... Patch Set 1: Code-Review+1 (1 comment) File src/osmo-hnodeb/llsk_audio.c: https://gerrit.osmocom.org/c/osmo-hnodeb/+/28251/comment/416ebe1a_18238767 PS1, Line 76: llsk_audio_prim_size_tbl[PRIM_OP_REQUEST][HNB_AUDIO_PRIM_CONN_ESTABLISH] = I'm a bit surprised that this modifies a global variable. So there's only one connection with one version possible at the same time? (I'm sure you thought of that, giving +1 anyway.) -- To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/28251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnodeb Gerrit-Branch: master Gerrit-Change-Id: I860d18b80c1041bf63a1570d435e0568c0f6b01b Gerrit-Change-Number: 28251 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Jun 2022 11:24:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.