libosmogb 1.9.0.196-9975
Osmocom Gb library
gprs_ns2_vty.c File Reference

VTY interface for our GPRS Networks Service (NS) implementation. More...

#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdint.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <osmocom/core/byteswap.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/osmo_io.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/select.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/sockaddr_str.h>
#include <osmocom/core/socket.h>
#include <osmocom/gprs/frame_relay.h>
#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/misc.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/vty.h>
#include "gprs_ns2_internal.h"

Data Structures

struct  vty_bind
 
struct  vty_nse
 
struct  vty_nse_bind
 

Macros

#define SHOW_NS_STR   "Display information about the NS protocol\n"
 
#define NSVCI_STR   "NS Virtual Connection ID (NS-VCI)\n"
 
#define DLCI_STR   "Data Link connection identifier\n"
 

Functions

static struct vty_bindvty_bind_by_name (const char *name)
 
static struct vty_bindvty_bind_alloc (const char *name)
 
static void vty_bind_free (struct vty_bind *vbind)
 
static struct vty_nsevty_nse_by_nsei (uint16_t nsei)
 
static struct vty_nsevty_nse_alloc (uint16_t nsei)
 
static void vty_nse_free (struct vty_nse *vnse)
 
static int vty_nse_add_vbind (struct vty_nse *vnse, struct vty_bind *vbind)
 
static int vty_nse_remove_vbind (struct vty_nse *vnse, struct vty_bind *vbind)
 
static bool vty_nse_check_sns (struct gprs_ns2_nse *nse)
 
 DEFUN (cfg_ns, cfg_ns_cmd, "ns", "Configure the GPRS Network Service")
 
 DEFUN (cfg_ns_timer, cfg_ns_timer_cmd, "timer " NS_TIMERS " <0-65535>", "Network Service Timer\n" NS_TIMERS_HELP "Timer Value\n")
 
 DEFUN (cfg_ns_nsei, cfg_ns_nsei_cmd, "nse <0-65535> [ip-sns-role-sgsn]", "Persistent NS Entity\n" "NS Entity ID (NSEI)\n" "Create NSE in SGSN role (default: BSS)\n")
 
 DEFUN (cfg_no_ns_nsei, cfg_no_ns_nsei_cmd, "no nse <0-65535>", NO_STR "Delete a Persistent NS Entity\n" "NS Entity ID (NSEI)\n")
 
 DEFUN (cfg_ns_bind, cfg_ns_bind_cmd, "bind (fr|udp) ID", "Configure local Bind\n" "Frame Relay\n" "UDP/IP\n" "Unique identifier for this bind (to reference from NS-VCs, NSEs, ...)\n")
 
 DEFUN (cfg_no_ns_bind, cfg_no_ns_bind_cmd, "no bind ID", NO_STR "Delete a bind\n" "Unique identifier for this bind\n")
 
static void config_write_vbind (struct vty *vty, struct vty_bind *vbind)
 
static void config_write_nsvc (struct vty *vty, const struct gprs_ns2_vc *nsvc)
 
static void _config_write_ns_nse (struct vty *vty, struct gprs_ns2_nse *nse)
 
static int config_write_ns_nse (struct vty *vty)
 
static int config_write_ns_bind (struct vty *vty)
 
static int config_write_ns (struct vty *vty)
 
 DEFUN (cfg_ns_bind_listen, cfg_ns_bind_listen_cmd, "listen " VTY_IPV46_CMD " <1-65535>", "Configure local IP + Port of this bind\n" "Local IPv4 Address\n" "Local IPv6 Address\n" "Local UDP Port\n")
 
 DEFUN (cfg_no_ns_bind_listen, cfg_no_ns_bind_listen_cmd, "no listen", NO_STR "Delete a IP/Port assignment\n")
 
 DEFUN (cfg_ns_bind_dscp, cfg_ns_bind_dscp_cmd, "dscp <0-63>", "Set DSCP/TOS on the UDP socket\n" "DSCP Value\n")
 
 DEFUN (cfg_no_ns_bind_dscp, cfg_no_ns_bind_dscp_cmd, "no dscp", "Set DSCP/TOS on the UDP socket\n" "DSCP Value\n")
 
 DEFUN (cfg_ns_bind_priority, cfg_ns_bind_priority_cmd, "socket-priority <0-255>", "Set socket priority on the UDP socket\n" "Priority Value (>6 requires CAP_NET_ADMIN)\n")
 
 DEFUN (cfg_ns_bind_ipaccess, cfg_ns_bind_ipaccess_cmd, "accept-ipaccess", "Allow to create dynamic NS Entity by NS Reset PDU on UDP (ip.access style)\n")
 
 DEFUN (cfg_no_ns_bind_ipaccess, cfg_no_ns_bind_ipaccess_cmd, "no accept-ipaccess", NO_STR "Reject NS Reset PDU on UDP (ip.access style)\n")
 
 DEFUN (cfg_ns_bind_accept_sns, cfg_ns_bind_accept_sns_cmd, "accept-dynamic-ip-sns", "Allow to create dynamic NS Entities by IP-SNS PDUs\n")
 
 DEFUN (cfg_no_ns_bind_accept_sns, cfg_no_ns_bind_accept_sns_cmd, "no accept-dynamic-ip-sns", NO_STR "Disable dynamic creation of NS Entities by IP-SNS PDUs\n")
 
 DEFUN (cfg_ns_bind_ip_sns_weight, cfg_ns_bind_ip_sns_weight_cmd, "ip-sns signalling-weight <0-254> data-weight <0-254>", "IP SNS\n" "signalling weight used by IP-SNS dynamic configuration\n" "signalling weight used by IP-SNS dynamic configuration\n" "data weight used by IP-SNS dynamic configuration\n" "data weight used by IP-SNS dynamic configuration\n")
 
 DEFUN (cfg_ns_bind_fr, cfg_ns_bind_fr_cmd, "fr NETIF (fr|frnet)", "frame relay\n" IFNAME_STR "fr (user) is used by BSS or SGSN attached to UNI of a FR network\n" "frnet (network) is used by SGSN if BSS is directly attached\n")
 
 DEFUN (cfg_no_ns_bind_fr, cfg_no_ns_bind_fr_cmd, "no fr NETIF", NO_STR "Delete a frame relay link\n" "Delete a frame relay link\n" IFNAME_STR)
 
 DEFUN (cfg_ns_nse_nsvc_fr, cfg_ns_nse_nsvc_fr_cmd, "nsvc fr NETIF dlci <16-1007> nsvci <0-65535>", "NS Virtual Connection\n" "frame relay\n" "frame relay interface. Must be registered via fr vty\n" NSVCI_STR NSVCI_STR DLCI_STR DLCI_STR)
 
 DEFUN (cfg_no_ns_nse_nsvc_fr_dlci, cfg_no_ns_nse_nsvc_fr_dlci_cmd, "no nsvc fr NETIF dlci <16-1007>", NO_STR "Delete frame relay NS-VC\n" "frame relay\n" "frame relay interface. Must be registered via fr vty\n" DLCI_STR DLCI_STR)
 
 DEFUN (cfg_no_ns_nse_nsvci, cfg_no_ns_nse_nsvci_cmd, "no nsvc nsvci <0-65535>", NO_STR "Delete NSVC\n" NSVCI_STR NSVCI_STR)
 
static int ns_nse_nsvc_udp_cmds (struct vty *vty, const char *bind_name, const char *remote_char, uint16_t port, uint16_t sig_weight, uint16_t data_weight)
 
 DEFUN (cfg_ns_nse_nsvc_udp, cfg_ns_nse_nsvc_udp_cmd, "nsvc udp BIND " VTY_IPV46_CMD " <1-65535>", "NS Virtual Connection\n" "NS over UDP\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n")
 
 DEFUN (cfg_ns_nse_nsvc_udp_weights, cfg_ns_nse_nsvc_udp_weights_cmd, "nsvc udp BIND " VTY_IPV46_CMD " <1-65535> signalling-weight <0-254> data-weight <0-254>", "NS Virtual Connection\n" "NS over UDP\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n" "Signalling weight of the NSVC (default = 1)\n" "Signalling weight of the NSVC (default = 1)\n" "Data weight of the NSVC (default = 1)\n" "Data weight of the NSVC (default = 1)\n")
 
 DEFUN (cfg_no_ns_nse_nsvc_udp, cfg_no_ns_nse_nsvc_udp_cmd, "no nsvc udp BIND " VTY_IPV46_CMD " <1-65535>", NO_STR "Delete a NS Virtual Connection\n" "NS over UDP\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n")
 
 DEFUN (cfg_ns_nse_nsvc_ipa, cfg_ns_nse_nsvc_ipa_cmd, "nsvc ipa BIND " VTY_IPV46_CMD " <1-65535> nsvci <0-65535>", "NS Virtual Connection\n" "NS over UDP ip.access style (uses RESET/BLOCK)\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n" NSVCI_STR NSVCI_STR)
 
 DEFUN (cfg_no_ns_nse_nsvc_ipa, cfg_no_ns_nse_nsvc_ipa_cmd, "no nsvc ipa BIND " VTY_IPV46_CMD " <1-65535> nsvci <0-65535>", NO_STR "Delete a NS Virtual Connection\n" "NS over UDP\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n" NSVCI_STR NSVCI_STR)
 
 DEFUN (cfg_ns_nse_ip_sns_remote, cfg_ns_nse_ip_sns_remote_cmd, "ip-sns-remote " VTY_IPV46_CMD " <1-65535>", "SNS Initial Endpoint\n" "SGSN IPv4 Address\n" "SGSN IPv6 Address\n" "SGSN UDP Port\n")
 
 DEFUN (cfg_no_ns_nse_ip_sns_remote, cfg_no_ns_nse_ip_sns_remote_cmd, "no ip-sns-remote " VTY_IPV46_CMD " <1-65535>", NO_STR "Delete a SNS Initial Endpoint\n" "SGSN IPv4 Address\n" "SGSN IPv6 Address\n" "SGSN UDP Port\n")
 
int ns2_sns_add_sns_default_binds (struct gprs_ns2_nse *nse)
 
 DEFUN (cfg_ns_ip_sns_default_bind, cfg_ns_ip_sns_default_bind_cmd, "ip-sns-default bind ID", "Defaults for dynamically created NSEs created by IP-SNS in SGSN role\n" "IP SNS binds\n" "Name of NS udp bind whose IP endpoint will be used as IP-SNS local endpoint. Can be given multiple times.\n")
 
 DEFUN (cfg_no_ns_ip_sns_default_bind, cfg_no_ns_ip_sns_default_bind_cmd, "no ip-sns-default bind ID", NO_STR "Defaults for dynamically created NSEs created by IP-SNS in SGSN role\n" "IP SNS binds\n" "Name of NS udp bind whose IP endpoint will be removed as IP-SNS local endpoint.\n")
 
 DEFUN (cfg_ns_txqueue_max_length, cfg_ns_txqueue_max_length_cmd, "txqueue-max-length <1-4096>", "Set the maximum length of the txqueue (for UDP)\n" "Maximum length of the txqueue\n")
 
 DEFUN (cfg_ns_nse_ip_sns_bind, cfg_ns_nse_ip_sns_bind_cmd, "ip-sns-bind BINDID", "IP SNS binds\n" "Name of NS udp bind whose IP endpoint will be used as IP-SNS local endpoint. Can be given multiple times.\n")
 
 DEFUN (cfg_no_ns_nse_ip_sns_bind, cfg_no_ns_nse_ip_sns_bind_cmd, "no ip-sns-bind BINDID", NO_STR "IP SNS binds\n" "Name of NS udp bind whose IP endpoint will not be used as IP-SNS local endpoint\n")
 
void ns2_vty_dump_nsvc (struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
 
static void dump_nse (struct vty *vty, const struct gprs_ns2_nse *nse, bool stats, bool persistent_only)
 
static void dump_bind (struct vty *vty, const struct gprs_ns2_vc_bind *bind, bool stats)
 
static void dump_ns_bind (struct vty *vty, const struct gprs_ns2_inst *nsi, bool stats)
 
static void dump_ns_entities (struct vty *vty, const struct gprs_ns2_inst *nsi, bool stats, bool persistent_only)
 
 DEFUN_HIDDEN (show_ns, show_ns_cmd, "show ns", SHOW_STR SHOW_NS_STR)
 
 DEFUN (show_ns_binds, show_ns_binds_cmd, "show ns binds [stats]", SHOW_STR SHOW_NS_STR "Display information about the NS protocol binds\n" "Include statistic\n")
 
 DEFUN (show_ns_entities, show_ns_entities_cmd, "show ns entities [stats]", SHOW_STR SHOW_NS_STR "Display information about the NS protocol entities (NSEs)\n" "Include statistics\n")
 
 DEFUN (show_ns_pers, show_ns_pers_cmd, "show ns persistent", SHOW_STR SHOW_NS_STR "Show only persistent NS\n")
 
 DEFUN (show_nse, show_nse_cmd, "show ns (nsei|nsvc) <0-65535> [stats]", SHOW_STR SHOW_NS_STR "Select one NSE by its NSE Identifier\n" "Select one NSE by its NS-VC Identifier\n" "The Identifier of selected type\n" "Include Statistics\n")
 
static int nsvc_force_unconf_cb (struct gprs_ns2_vc *nsvc, void *ctx)
 
 DEFUN_HIDDEN (nsvc_force_unconf, nsvc_force_unconf_cmd, "nsvc nsei <0-65535> force-unconfigured", "NS Virtual Connection\n" "The NSEI\n" "Reset the NSVCs back to initial state\n")
 
 DEFUN (nse_restart_sns, nse_restart_sns_cmd, "nse <0-65535> restart-sns", "NSE specific commands\n" "NS Entity ID (NSEI)\n" "Restart SNS procedure\n")
 
 DEFUN (nsvc_block, nsvc_block_cmd, "nsvc <0-65535> (block|unblock|reset)", "NS Virtual Connection\n" NSVCI_STR "Block a NSVC. As cause code O&M intervention will be used.\n" "Unblock a NSVC. As cause code O&M intervention will be used.\n" "Reset a NSVC. As cause code O&M intervention will be used.\n")
 
static void log_set_nse_filter (struct log_target *target, struct gprs_ns2_nse *nse)
 
static void log_set_nsvc_filter (struct log_target *target, struct gprs_ns2_vc *nsvc)
 
 DEFUN (logging_fltr_nse, logging_fltr_nse_cmd, "logging filter nse nsei <0-65535>", LOGGING_STR FILTER_STR "Filter based on NS Entity\n" "Identify NSE by NSEI\n" "Numeric identifier\n")
 
 DEFUN (logging_fltr_nsvc, logging_fltr_nsvc_cmd, "logging filter nsvc nsvci <0-65535>", LOGGING_STR FILTER_STR "Filter based on NS Virtual Connection\n" "Identify NS-VC by NSVCI\n" "Numeric identifier\n")
 
int gprs_ns2_vty_init_reduced (struct gprs_ns2_inst *nsi)
 initialized a reduced vty interface which excludes the configuration nodes besides timeouts. More...
 
int gprs_ns2_vty_init (struct gprs_ns2_inst *nsi)
 

Variables

static struct gprs_ns2_instvty_nsi = NULL
 
static struct osmo_fr_networkvty_fr_network = NULL
 
static struct llist_head binds
 
static struct llist_head nses
 
static struct llist_head ip_sns_default_binds
 
const struct value_string gprs_ns_timer_strs []
 
const struct value_string vty_fr_role_names []
 
const struct value_string vty_ll_names []
 
static struct cmd_node ns_node
 
static struct cmd_node ns_bind_node
 
static struct cmd_node ns_nse_node
 

Detailed Description

VTY interface for our GPRS Networks Service (NS) implementation.

Macro Definition Documentation

◆ DLCI_STR

#define DLCI_STR   "Data Link connection identifier\n"

◆ NSVCI_STR

#define NSVCI_STR   "NS Virtual Connection ID (NS-VCI)\n"

◆ SHOW_NS_STR

#define SHOW_NS_STR   "Display information about the NS protocol\n"

Function Documentation

◆ _config_write_ns_nse()

◆ config_write_ns()

◆ config_write_ns_bind()

static int config_write_ns_bind ( struct vty vty)
static

◆ config_write_ns_nse()

static int config_write_ns_nse ( struct vty vty)
static

◆ config_write_nsvc()

◆ config_write_vbind()

◆ DEFUN() [1/41]

DEFUN ( cfg_no_ns_bind  ,
cfg_no_ns_bind_cmd  ,
"no bind ID"  ,
NO_STR "Delete a bind\n" "Unique identifier for this bind\n  
)

◆ DEFUN() [2/41]

DEFUN ( cfg_no_ns_bind_accept_sns  ,
cfg_no_ns_bind_accept_sns_cmd  ,
"no accept-dynamic-ip-sns"  ,
NO_STR "Disable dynamic creation of NS Entities by IP-SNS PDUs\n  
)

◆ DEFUN() [3/41]

DEFUN ( cfg_no_ns_bind_dscp  ,
cfg_no_ns_bind_dscp_cmd  ,
"no dscp"  ,
"Set DSCP/TOS on the UDP socket\n" "DSCP Value\n  
)

◆ DEFUN() [4/41]

DEFUN ( cfg_no_ns_bind_fr  ,
cfg_no_ns_bind_fr_cmd  ,
"no fr NETIF"  ,
NO_STR "Delete a frame relay link\n" "Delete a frame relay link\n IFNAME_STR 
)

◆ DEFUN() [5/41]

DEFUN ( cfg_no_ns_bind_ipaccess  ,
cfg_no_ns_bind_ipaccess_cmd  ,
"no accept-ipaccess"  ,
NO_STR "Reject NS Reset PDU on UDP (ip.access style)\n  
)

◆ DEFUN() [6/41]

DEFUN ( cfg_no_ns_bind_listen  ,
cfg_no_ns_bind_listen_cmd  ,
"no listen"  ,
NO_STR "Delete a IP/Port assignment\n  
)

◆ DEFUN() [7/41]

DEFUN ( cfg_no_ns_ip_sns_default_bind  ,
cfg_no_ns_ip_sns_default_bind_cmd  ,
"no ip-sns-default bind ID"  ,
NO_STR "Defaults for dynamically created NSEs created by IP-SNS in SGSN role\n" "IP SNS binds\n" "Name of NS udp bind whose IP endpoint will be removed as IP-SNS local endpoint.\n  
)

◆ DEFUN() [8/41]

◆ DEFUN() [9/41]

DEFUN ( cfg_no_ns_nse_ip_sns_remote  ,
cfg_no_ns_nse_ip_sns_remote_cmd  ,
"no ip-sns-remote " VTY_IPV46_CMD " <1-65535>"  ,
NO_STR "Delete a SNS Initial Endpoint\n" "SGSN IPv4 Address\n" "SGSN IPv6 Address\n" "SGSN UDP Port\n  
)

◆ DEFUN() [10/41]

DEFUN ( cfg_no_ns_nse_nsvc_fr_dlci  ,
cfg_no_ns_nse_nsvc_fr_dlci_cmd  ,
"no nsvc fr NETIF dlci <16-1007>"  ,
NO_STR "Delete frame relay NS-VC\n" "frame relay\n" "frame relay interface. Must be registered via fr vty\n" DLCI_STR  DLCI_STR 
)

◆ DEFUN() [11/41]

◆ DEFUN() [12/41]

◆ DEFUN() [13/41]

◆ DEFUN() [14/41]

DEFUN ( cfg_no_ns_nsei  ,
cfg_no_ns_nsei_cmd  ,
"no nse <0-65535>"  ,
NO_STR "Delete a Persistent NS Entity\n" "NS Entity ID (NSEI)\n  
)

◆ DEFUN() [15/41]

DEFUN ( cfg_ns  ,
cfg_ns_cmd  ,
"ns"  ,
"Configure the GPRS Network Service"   
)

References CMD_SUCCESS, L_NS_NODE, and vty::node.

◆ DEFUN() [16/41]

DEFUN ( cfg_ns_bind  ,
cfg_ns_bind_cmd  ,
"bind (fr|udp) ID"  ,
"Configure local Bind\n" "Frame Relay\n" "UDP/IP\n" "Unique identifier for this bind (to reference from NS-VCs, NSEs, ...)\n  
)

◆ DEFUN() [17/41]

DEFUN ( cfg_ns_bind_accept_sns  ,
cfg_ns_bind_accept_sns_cmd  ,
"accept-dynamic-ip-sns"  ,
"Allow to create dynamic NS Entities by IP-SNS PDUs\n  
)

◆ DEFUN() [18/41]

DEFUN ( cfg_ns_bind_dscp  ,
cfg_ns_bind_dscp_cmd  ,
"dscp <0-63>"  ,
"Set DSCP/TOS on the UDP socket\n" "DSCP Value\n  
)

◆ DEFUN() [19/41]

DEFUN ( cfg_ns_bind_fr  ,
cfg_ns_bind_fr_cmd  ,
"fr NETIF (fr|frnet)"  ,
"frame relay\n" IFNAME_STR "fr (user) is used by BSS or SGSN attached to UNI of a FR network\n" "frnet (network) is used by SGSN if BSS is directly attached\n  
)

◆ DEFUN() [20/41]

DEFUN ( cfg_ns_bind_ip_sns_weight  ,
cfg_ns_bind_ip_sns_weight_cmd  ,
"ip-sns signalling-weight <0-254> data-weight <0-254>"  ,
"IP SNS\n" "signalling weight used by IP-SNS dynamic configuration\n" "signalling weight used by IP-SNS dynamic configuration\n" "data weight used by IP-SNS dynamic configuration\n" "data weight used by IP-SNS dynamic configuration\n  
)

◆ DEFUN() [21/41]

DEFUN ( cfg_ns_bind_ipaccess  ,
cfg_ns_bind_ipaccess_cmd  ,
"accept-ipaccess"  ,
"Allow to create dynamic NS Entity by NS Reset PDU on UDP (ip.access style)\n  
)

◆ DEFUN() [22/41]

◆ DEFUN() [23/41]

DEFUN ( cfg_ns_bind_priority  ,
cfg_ns_bind_priority_cmd  ,
"socket-priority <0-255>"  ,
"Set socket priority on the UDP socket\n" "Priority Value (>6 requires CAP_NET_ADMIN)\n  
)

◆ DEFUN() [24/41]

DEFUN ( cfg_ns_ip_sns_default_bind  ,
cfg_ns_ip_sns_default_bind_cmd  ,
"ip-sns-default bind ID"  ,
"Defaults for dynamically created NSEs created by IP-SNS in SGSN role\n" "IP SNS binds\n" "Name of NS udp bind whose IP endpoint will be used as IP-SNS local endpoint. Can be given multiple times.\n  
)

◆ DEFUN() [25/41]

DEFUN ( cfg_ns_nse_ip_sns_bind  ,
cfg_ns_nse_ip_sns_bind_cmd  ,
"ip-sns-bind BINDID"  ,
"IP SNS binds\n" "Name of NS udp bind whose IP endpoint will be used as IP-SNS local endpoint. Can be given multiple times.\n  
)

◆ DEFUN() [26/41]

DEFUN ( cfg_ns_nse_ip_sns_remote  ,
cfg_ns_nse_ip_sns_remote_cmd  ,
"ip-sns-remote " VTY_IPV46_CMD " <1-65535>"  ,
"SNS Initial Endpoint\n" "SGSN IPv4 Address\n" "SGSN IPv6 Address\n" "SGSN UDP Port\n  
)

◆ DEFUN() [27/41]

DEFUN ( cfg_ns_nse_nsvc_fr  ,
cfg_ns_nse_nsvc_fr_cmd  ,
"nsvc fr NETIF dlci <16-1007> nsvci <0-65535>"  ,
"NS Virtual Connection\n" "frame relay\n" "frame relay interface. Must be registered via fr vty\n" NSVCI_STR NSVCI_STR DLCI_STR  DLCI_STR 
)

◆ DEFUN() [28/41]

DEFUN ( cfg_ns_nse_nsvc_ipa  ,
cfg_ns_nse_nsvc_ipa_cmd  ,
"nsvc ipa BIND " VTY_IPV46_CMD " <1-65535> nsvci <0-65535>"  ,
"NS Virtual Connection\n" "NS over UDP ip.access style (uses RESET/BLOCK)\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n" NSVCI_STR  NSVCI_STR 
)

◆ DEFUN() [29/41]

DEFUN ( cfg_ns_nse_nsvc_udp  ,
cfg_ns_nse_nsvc_udp_cmd  ,
"nsvc udp BIND " VTY_IPV46_CMD " <1-65535>"  ,
"NS Virtual Connection\n" "NS over UDP\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n  
)

◆ DEFUN() [30/41]

DEFUN ( cfg_ns_nse_nsvc_udp_weights  ,
cfg_ns_nse_nsvc_udp_weights_cmd  ,
"nsvc udp BIND " VTY_IPV46_CMD " <1-65535> signalling-weight <0-254> data-weight <0-254>"  ,
"NS Virtual Connection\n" "NS over UDP\n" "A unique bind identifier created by ns bind\n" "Remote IPv4 Address\n" "Remote IPv6 Address\n" "Remote UDP Port\n" "Signalling weight of the NSVC (default = 1)\n" "Signalling weight of the NSVC (default = 1)\n" "Data weight of the NSVC (default = 1)\n" "Data weight of the NSVC (default = 1)\n  
)

◆ DEFUN() [31/41]

DEFUN ( cfg_ns_nsei  ,
cfg_ns_nsei_cmd  ,
"nse <0-65535> "  [ip-sns-role-sgsn],
"Persistent NS Entity\n" "NS Entity ID (NSEI)\n" "Create NSE in SGSN role (default: BSS)\n  
)

◆ DEFUN() [32/41]

DEFUN ( cfg_ns_timer  ,
cfg_ns_timer_cmd  ,
"timer " NS_TIMERS " <0-65535>"  ,
"Network Service Timer\n" NS_TIMERS_HELP "Timer Value\n  
)

◆ DEFUN() [33/41]

DEFUN ( cfg_ns_txqueue_max_length  ,
cfg_ns_txqueue_max_length_cmd  ,
"txqueue-max-length <1-4096>"  ,
"Set the maximum length of the txqueue (for UDP)\n" "Maximum length of the txqueue\n  
)

◆ DEFUN() [34/41]

DEFUN ( logging_fltr_nse  ,
logging_fltr_nse_cmd  ,
"logging filter nse nsei <0-65535>"  ,
LOGGING_STR FILTER_STR "Filter based on NS Entity\n" "Identify NSE by NSEI\n" "Numeric identifier\n  
)

◆ DEFUN() [35/41]

DEFUN ( logging_fltr_nsvc  ,
logging_fltr_nsvc_cmd  ,
"logging filter nsvc nsvci <0-65535>"  ,
LOGGING_STR FILTER_STR "Filter based on NS Virtual Connection\n" "Identify NS-VC by NSVCI\n" "Numeric identifier\n  
)

◆ DEFUN() [36/41]

DEFUN ( nse_restart_sns  ,
nse_restart_sns_cmd  ,
"nse <0-65535> restart-sns"  ,
"NSE specific commands\n" "NS Entity ID (NSEI)\n" "Restart SNS procedure\n  
)

◆ DEFUN() [37/41]

DEFUN ( nsvc_block  ,
nsvc_block_cmd  ,
"nsvc <0-65535> (block|unblock|reset)"  ,
"NS Virtual Connection\n" NSVCI_STR "Block a NSVC. As cause code O&M intervention will be used.\n" "Unblock a NSVC. As cause code O&M intervention will be used.\n" "Reset a NSVC. As cause code O&M intervention will be used.\n  
)

◆ DEFUN() [38/41]

DEFUN ( show_ns_binds  ,
show_ns_binds_cmd  ,
"show ns binds [stats],
SHOW_STR SHOW_NS_STR "Display information about the NS protocol binds\n" "Include statistic\n  
)

References argc, CMD_SUCCESS, dump_ns_bind(), and vty_nsi.

◆ DEFUN() [39/41]

DEFUN ( show_ns_entities  ,
show_ns_entities_cmd  ,
"show ns entities "  [stats],
SHOW_STR SHOW_NS_STR "Display information about the NS protocol entities (NSEs)\n" "Include statistics\n  
)

◆ DEFUN() [40/41]

DEFUN ( show_ns_pers  ,
show_ns_pers_cmd  ,
"show ns persistent"  ,
SHOW_STR SHOW_NS_STR "Show only persistent NS\n  
)

◆ DEFUN() [41/41]

DEFUN ( show_nse  ,
show_nse_cmd  ,
"show ns (nsei|nsvc) <0-65535> "  [stats],
SHOW_STR SHOW_NS_STR "Select one NSE by its NSE Identifier\n" "Select one NSE by its NS-VC Identifier\n" "The Identifier of selected type\n" "Include Statistics\n  
)

◆ DEFUN_HIDDEN() [1/2]

DEFUN_HIDDEN ( nsvc_force_unconf  ,
nsvc_force_unconf_cmd  ,
"nsvc nsei <0-65535> force-unconfigured"  ,
"NS Virtual Connection\n" "The NSEI\n" "Reset the NSVCs back to initial state\n  
)

◆ DEFUN_HIDDEN() [2/2]

DEFUN_HIDDEN ( show_ns  ,
show_ns_cmd  ,
"show ns"  ,
SHOW_STR  SHOW_NS_STR 
)

◆ dump_bind()

static void dump_bind ( struct vty vty,
const struct gprs_ns2_vc_bind bind,
bool  stats 
)
static

◆ dump_ns_bind()

static void dump_ns_bind ( struct vty vty,
const struct gprs_ns2_inst nsi,
bool  stats 
)
static

◆ dump_ns_entities()

static void dump_ns_entities ( struct vty vty,
const struct gprs_ns2_inst nsi,
bool  stats,
bool  persistent_only 
)
static

◆ dump_nse()

◆ gprs_ns2_vty_init()

◆ gprs_ns2_vty_init_reduced()

int gprs_ns2_vty_init_reduced ( struct gprs_ns2_inst nsi)

initialized a reduced vty interface which excludes the configuration nodes besides timeouts.

This can be used by the PCU which can be only configured by the BTS/BSC and not by the vty.

Parameters
[in]nsiNS instance on which we operate
Returns
0 on success.

References binds, CFG_LOG_NODE, CONFIG_NODE, config_write_ns(), ENABLE_NODE, INIT_LLIST_HEAD, install_lib_element(), install_lib_element_ve(), install_node(), ip_sns_default_binds, L_NS_NODE, ns_node, nses, osmo_fr_network_alloc(), vty_fr_network, and vty_nsi.

Referenced by gprs_ns2_vty_init().

◆ log_set_nse_filter()

static void log_set_nse_filter ( struct log_target target,
struct gprs_ns2_nse nse 
)
static

◆ log_set_nsvc_filter()

static void log_set_nsvc_filter ( struct log_target target,
struct gprs_ns2_vc nsvc 
)
static

◆ ns2_sns_add_sns_default_binds()

◆ ns2_vty_dump_nsvc()

◆ ns_nse_nsvc_udp_cmds()

◆ nsvc_force_unconf_cb()

static int nsvc_force_unconf_cb ( struct gprs_ns2_vc nsvc,
void *  ctx 
)
static

◆ vty_bind_alloc()

static struct vty_bind * vty_bind_alloc ( const char *  name)
static

◆ vty_bind_by_name()

static struct vty_bind * vty_bind_by_name ( const char *  name)
static

References binds, list, llist_for_each_entry, name, and vty_bind::name.

Referenced by DEFUN().

◆ vty_bind_free()

static void vty_bind_free ( struct vty_bind vbind)
static

References vty_bind::list, and llist_del().

Referenced by DEFUN().

◆ vty_nse_add_vbind()

static int vty_nse_add_vbind ( struct vty_nse vnse,
struct vty_bind vbind 
)
static

◆ vty_nse_alloc()

static struct vty_nse * vty_nse_alloc ( uint16_t  nsei)
static

◆ vty_nse_by_nsei()

static struct vty_nse * vty_nse_by_nsei ( uint16_t  nsei)
static

◆ vty_nse_check_sns()

static bool vty_nse_check_sns ( struct gprs_ns2_nse nse)
static

◆ vty_nse_free()

static void vty_nse_free ( struct vty_nse vnse)
static

References vty_nse::list, and llist_del().

Referenced by DEFUN().

◆ vty_nse_remove_vbind()

static int vty_nse_remove_vbind ( struct vty_nse vnse,
struct vty_bind vbind 
)
static

Variable Documentation

◆ binds

◆ gprs_ns_timer_strs

const struct value_string gprs_ns_timer_strs[]
Initial value:
= {
{ 0, NULL }
}
#define TNS_ALIVE_STR
Definition: gprs_ns2_internal.h:71
#define TNS_RESET_RETRIES_STR
Definition: gprs_ns2_internal.h:69
#define TNS_TEST_STR
Definition: gprs_ns2_internal.h:70
#define TSNS_CONFIG_RETRIES_STR
Definition: gprs_ns2_internal.h:75
#define TSNS_SIZE_RETRIES_STR
Definition: gprs_ns2_internal.h:74
#define TNS_BLOCK_STR
Definition: gprs_ns2_internal.h:66
@ NS_TOUT_TSNS_CONFIG_RETRIES
Definition: gprs_ns2_internal.h:110
@ NS_TOUT_TSNS_SIZE_RETRIES
Definition: gprs_ns2_internal.h:109
@ NS_TOUT_TSNS_PROCEDURES_RETRIES
Definition: gprs_ns2_internal.h:111
#define TNS_BLOCK_RETRIES_STR
Definition: gprs_ns2_internal.h:67
#define TNS_RESET_STR
Definition: gprs_ns2_internal.h:68
#define TSNS_PROV_STR
Definition: gprs_ns2_internal.h:73
#define TNS_ALIVE_RETRIES_STR
Definition: gprs_ns2_internal.h:72
#define TSNS_PROCEDURES_RETRIES_STR
Definition: gprs_ns2_internal.h:76
@ NS_TOUT_TSNS_PROV
Definition: gprs_ns.h:41
@ NS_TOUT_TNS_BLOCK
Definition: gprs_ns.h:34
@ NS_TOUT_TNS_RESET
Definition: gprs_ns.h:36
@ NS_TOUT_TNS_BLOCK_RETRIES
Definition: gprs_ns.h:35
@ NS_TOUT_TNS_TEST
Definition: gprs_ns.h:38
@ NS_TOUT_TNS_ALIVE_RETRIES
Definition: gprs_ns.h:40
@ NS_TOUT_TNS_RESET_RETRIES
Definition: gprs_ns.h:37
@ NS_TOUT_TNS_ALIVE
Definition: gprs_ns.h:39

Referenced by config_write_ns(), and DEFUN().

◆ ip_sns_default_binds

struct llist_head ip_sns_default_binds
static

◆ ns_bind_node

struct cmd_node ns_bind_node
static
Initial value:
= {
"%s(config-ns-bind)# ",
1,
}
L_NS_BIND_NODE

Referenced by gprs_ns2_vty_init().

◆ ns_node

struct cmd_node ns_node
static
Initial value:
= {
"%s(config-ns)# ",
1,
}
L_NS_NODE

Referenced by gprs_ns2_vty_init_reduced().

◆ ns_nse_node

struct cmd_node ns_nse_node
static
Initial value:
= {
"%s(config-ns-nse)# ",
1,
}
L_NS_NSE_NODE

Referenced by gprs_ns2_vty_init().

◆ nses

◆ vty_fr_network

struct osmo_fr_network* vty_fr_network = NULL
static

◆ vty_fr_role_names

const struct value_string vty_fr_role_names[]
Initial value:
= {
{ 0, NULL }
}
@ FR_ROLE_NETWORK_EQUIPMENT
Definition: frame_relay.h:40
@ FR_ROLE_USER_EQUIPMENT
Definition: frame_relay.h:39

Referenced by config_write_vbind().

◆ vty_ll_names

const struct value_string vty_ll_names[]
Initial value:
= {
{ GPRS_NS2_LL_FR, "fr" },
{ GPRS_NS2_LL_FR_GRE, "frgre" },
{ GPRS_NS2_LL_UDP, "udp" },
{ 0, NULL }
}
@ GPRS_NS2_LL_FR
NS/FR.
Definition: gprs_ns2.h:47
@ GPRS_NS2_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns2.h:48
@ GPRS_NS2_LL_UDP
NS/UDP/IP.
Definition: gprs_ns2.h:46

Referenced by config_write_vbind(), and DEFUN().

◆ vty_nsi