libosmo-sigtran 2.1.0.119-5f21
Osmocom SIGTRAN library
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ss7_as_vty.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <osmocom/vty/vty.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/misc.h>
#include <osmocom/sigtran/protocol/mtp.h>
#include "ss7_as.h"
#include "ss7_asp.h"
#include "ss7_route.h"
#include "ss7_route_table.h"
#include "ss7_internal.h"
#include "ss7_vty.h"

Macros

#define ROUTING_KEY_CMD   "routing-key RCONTEXT DPC"
 
#define ROUTING_KEY_CMD_STRS
 
#define ROUTING_KEY_SI_ARG   " si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)"
 
#define ROUTING_KEY_SI_ARG_STRS
 
#define ROUTING_KEY_SSN_ARG   " ssn SSN"
 
#define ROUTING_KEY_SSN_ARG_STRS
 

Functions

 DEFUN_ATTR (cs7_as, cs7_as_cmd, "as NAME " XUA_VAR_STR, "Configure an Application Server\n" "Name of the Application Server\n" XUA_VAR_HELP_STR, CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (no_cs7_as, no_cs7_as_cmd, "no as NAME", NO_STR "Disable Application Server\n" "Name of AS\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_asp, as_asp_cmd, "asp NAME", "Specify that a given ASP is part of this AS\n" "Name of ASP to be added to AS\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_no_asp, as_no_asp_cmd, "no asp NAME", NO_STR "Specify ASP to be removed from this AS\n" "Name of ASP to be removed\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_USRATTR (as_traf_mode, as_traf_mode_cmd, OSMO_SCCP_LIB_ATTR_RSTRT_ASP, "traffic-mode (broadcast | roundrobin | override)", "Specifies traffic mode of operation of the ASP within the AS\n" "Broadcast to all ASP within AS\n" "Round-Robin between all ASP within AS\n" "Override\n")
 
 DEFUN_USRATTR (as_traf_mode_loadshare, as_traf_mode_loadshare_cmd, OSMO_SCCP_LIB_ATTR_RSTRT_ASP, "traffic-mode loadshare [bindings] [sls] [opc-sls] [opc-shift] [<0-2>]", "Specifies traffic mode of operation of the ASP within the AS\n" "Share Load among all ASP within AS\n" "Configure Loadshare parameters\n" "Configure Loadshare SLS generation parameters\n" "Generate extended SLS with OPC information\n" "Shift OPC bits used during routing decision\n" "How many bits from ITU OPC field (starting from least-significant-bit) to skip (default=0). 6 bits are always used\n")
 
 DEFUN_USRATTR (as_no_traf_mode, as_no_traf_mode_cmd, OSMO_SCCP_LIB_ATTR_RSTRT_ASP, "no traffic-mode", NO_STR "Remove explicit traffic mode of operation of this AS\n")
 
 DEFUN_ATTR (as_sls_shift, as_sls_shift_cmd, "sls-shift <0-3>", "Shift SLS bits used during routing decision\n" "How many bits from SLS field (starting from least-significant-bit) to skip\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_bindingtable_reset, as_bindingtable_reset_cmd, "binding-table reset", "AS Loadshare binding table operations\n" "Reset loadshare binding table\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_recov_tout, as_recov_tout_cmd, "recovery-timeout <1-2000>", "Specifies RFC4666 recovery timer T(r) timeout\n" "Recovery Timeout in Milliseconds\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_qos_clas, as_qos_class_cmd, "qos-class " QOS_CLASS_RANGE_STR, "Specity QoS Class of AS\n" QOS_CLASS_RANGE_HELP_STR, CMD_ATTR_IMMEDIATE)
 
static int _rout_key (struct vty *vty, const char *rcontext, const char *dpc, const char *si, const char *ssn)
 
 DEFUN_ATTR (as_rout_key, as_rout_key_cmd, ROUTING_KEY_CMD, ROUTING_KEY_CMD_STRS, CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_rout_key_si, as_rout_key_si_cmd, ROUTING_KEY_CMD ROUTING_KEY_SI_ARG, ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS, CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_rout_key_ssn, as_rout_key_ssn_cmd, ROUTING_KEY_CMD ROUTING_KEY_SSN_ARG, ROUTING_KEY_CMD_STRS ROUTING_KEY_SSN_ARG_STRS, CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_rout_key_si_ssn, as_rout_key_si_ssn_cmd, ROUTING_KEY_CMD ROUTING_KEY_SI_ARG ROUTING_KEY_SSN_ARG, ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS ROUTING_KEY_SSN_ARG_STRS, CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_pc_override, as_pc_override_cmd, "point-code override dpc PC", "Point Code Specific Features\n" "Override (force) a point-code to hard-coded value\n" "Override Source Point Code\n" "Override Destination Point Code\n" "New Point Code\n", CMD_ATTR_IMMEDIATE)
 
 DEFUN_ATTR (as_pc_patch_sccp, as_pc_patch_sccp_cmd, "point-code override patch-sccp (disabled|both)", "Point Code Specific Features\n" "Override (force) a point-code to hard-coded value\n" "Patch point code values into SCCP called/calling address\n" "Don't patch any point codes into SCCP called/calling address\n" "Patch both origin and destination point codes into SCCP called/calling address\n", CMD_ATTR_IMMEDIATE)
 
void ss7_vty_write_one_as (struct vty *vty, struct osmo_ss7_as *as, bool show_dyn_config)
 
static void show_one_as (struct vty *vty, struct osmo_ss7_as *as)
 
static int show_as (struct vty *vty, int id, const char *as_name, const char *filter)
 
 DEFUN (show_cs7_as, show_cs7_as_cmd, "show cs7 instance <0-15> as (active|all|m3ua|sua)", SHOW_STR CS7_STR INST_STR INST_STR "Application Server (AS)\n" "Display all active ASs\n" "Display all ASs (default)\n" "Display all m3ua ASs\n" "Display all SUA ASs\n")
 
 DEFUN (show_cs7_as_name, show_cs7_as_name_cmd, "show cs7 instance <0-15> as name AS_NAME", SHOW_STR CS7_STR INST_STR INST_STR "Application Server (AS)\n" "Look up AS with a given name\n" "Name of the Application Server (AS)\n")
 
 DEFUN (show_cs7_as_bindingtable_name, show_cs7_as_bindingtable_name_cmd, "show cs7 instance <0-15> as binding-table name AS_NAME", SHOW_STR CS7_STR INST_STR INST_STR "Application Server (AS)\n" "Display binding table\n" "Look up AS with a given name\n" "Name of the Application Server (AS)\n")
 
int ss7_vty_node_as_go_parent (struct vty *vty)
 
void ss7_vty_init_node_as (void)
 

Variables

static struct cmd_node as_node
 
const struct value_string mtp_si_vals []
 

Macro Definition Documentation

◆ ROUTING_KEY_CMD

#define ROUTING_KEY_CMD   "routing-key RCONTEXT DPC"

◆ ROUTING_KEY_CMD_STRS

#define ROUTING_KEY_CMD_STRS
Value:
"Define a routing key\n" \
"Routing context number\n" \
"Destination Point Code\n"

◆ ROUTING_KEY_SI_ARG

#define ROUTING_KEY_SI_ARG   " si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)"

◆ ROUTING_KEY_SI_ARG_STRS

#define ROUTING_KEY_SI_ARG_STRS
Value:
"Match on Service Indicator\n" \
"ATM Adaption Layer 2\n" \
"Bearer Independent Call Control\n" \
"Broadband ISDN User Part\n" \
"H.248\n" \
"ISDN User Part\n" \
"Sattelite ISDN User Part\n" \
"Signalling Connection Control Part\n" \
"Telephony User Part\n"

◆ ROUTING_KEY_SSN_ARG

#define ROUTING_KEY_SSN_ARG   " ssn SSN"

◆ ROUTING_KEY_SSN_ARG_STRS

#define ROUTING_KEY_SSN_ARG_STRS
Value:
"Match on Sub-System Number\n" \
"Sub-System Number to match on\n"

Function Documentation

◆ _rout_key()

◆ DEFUN() [1/3]

DEFUN ( show_cs7_as  ,
show_cs7_as_cmd  ,
"show cs7 instance <0-15> as (active|all|m3ua|sua)"  ,
SHOW_STR CS7_STR INST_STR INST_STR "Application Server (AS)\n" "Display all active ASs\n" "Display all ASs (default)\n" "Display all m3ua ASs\n" "Display all SUA ASs\n"   
)

References NULL, and show_as().

◆ DEFUN() [2/3]

DEFUN ( show_cs7_as_bindingtable_name  ,
show_cs7_as_bindingtable_name_cmd  ,
"show cs7 instance <0-15> as binding-table name AS_NAME"  ,
SHOW_STR CS7_STR INST_STR INST_STR "Application Server (AS)\n" "Display binding table\n" "Look up AS with a given name\n" "Name of the Application Server (AS)\n"   
)

◆ DEFUN() [3/3]

DEFUN ( show_cs7_as_name  ,
show_cs7_as_name_cmd  ,
"show cs7 instance <0-15> as name AS_NAME"  ,
SHOW_STR CS7_STR INST_STR INST_STR "Application Server (AS)\n" "Look up AS with a given name\n" "Name of the Application Server (AS)\n"   
)

References NULL, and show_as().

◆ DEFUN_ATTR() [1/14]

DEFUN_ATTR ( as_asp  ,
as_asp_cmd  ,
"asp NAME"  ,
"Specify that a given ASP is part of this AS\n" "Name of ASP to be added to AS\n"  ,
CMD_ATTR_IMMEDIATE   
)

References osmo_ss7_as_add_asp().

◆ DEFUN_ATTR() [2/14]

DEFUN_ATTR ( as_bindingtable_reset  ,
as_bindingtable_reset_cmd  ,
"binding-table reset"  ,
"AS Loadshare binding table operations\n" "Reset loadshare binding table\n"  ,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [3/14]

DEFUN_ATTR ( as_no_asp  ,
as_no_asp_cmd  ,
"no asp NAME"  ,
NO_STR "Specify ASP to be removed from this AS\n" "Name of ASP to be removed\n"  ,
CMD_ATTR_IMMEDIATE   
)

References osmo_ss7_as_del_asp().

◆ DEFUN_ATTR() [4/14]

DEFUN_ATTR ( as_pc_override  ,
as_pc_override_cmd  ,
"point-code override dpc PC"  ,
"Point Code Specific Features\n" "Override (force) a point-code to hard-coded value\n" "Override Source Point Code\n" "Override Destination Point Code\n" "New Point Code\n"  ,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [5/14]

DEFUN_ATTR ( as_pc_patch_sccp  ,
as_pc_patch_sccp_cmd  ,
"point-code override patch-sccp (disabled|both)"  ,
"Point Code Specific Features\n" "Override (force) a point-code to hard-coded value\n" "Patch point code values into SCCP called/calling address\n" "Don't patch any point codes into SCCP called/calling address\n" "Patch both origin and destination point codes into SCCP called/calling address\n"  ,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [6/14]

DEFUN_ATTR ( as_qos_clas  ,
as_qos_class_cmd  ,
"qos-class "  QOS_CLASS_RANGE_STR,
"Specity QoS Class of AS\n"  QOS_CLASS_RANGE_HELP_STR,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [7/14]

DEFUN_ATTR ( as_recov_tout  ,
as_recov_tout_cmd  ,
"recovery-timeout <1-2000>"  ,
"Specifies RFC4666 recovery timer T(r) timeout\n" "Recovery Timeout in Milliseconds\n"  ,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [8/14]

DEFUN_ATTR ( as_rout_key  ,
as_rout_key_cmd  ,
ROUTING_KEY_CMD  ,
ROUTING_KEY_CMD_STRS  ,
CMD_ATTR_IMMEDIATE   
)

References _rout_key(), and NULL.

◆ DEFUN_ATTR() [9/14]

DEFUN_ATTR ( as_rout_key_si  ,
as_rout_key_si_cmd  ,
ROUTING_KEY_CMD  ROUTING_KEY_SI_ARG,
ROUTING_KEY_CMD_STRS  ROUTING_KEY_SI_ARG_STRS,
CMD_ATTR_IMMEDIATE   
)

References _rout_key(), and NULL.

◆ DEFUN_ATTR() [10/14]

DEFUN_ATTR ( as_rout_key_si_ssn  ,
as_rout_key_si_ssn_cmd  ,
ROUTING_KEY_CMD ROUTING_KEY_SI_ARG  ROUTING_KEY_SSN_ARG,
ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS  ROUTING_KEY_SSN_ARG_STRS,
CMD_ATTR_IMMEDIATE   
)

References _rout_key().

◆ DEFUN_ATTR() [11/14]

DEFUN_ATTR ( as_rout_key_ssn  ,
as_rout_key_ssn_cmd  ,
ROUTING_KEY_CMD  ROUTING_KEY_SSN_ARG,
ROUTING_KEY_CMD_STRS  ROUTING_KEY_SSN_ARG_STRS,
CMD_ATTR_IMMEDIATE   
)

References _rout_key(), and NULL.

◆ DEFUN_ATTR() [12/14]

DEFUN_ATTR ( as_sls_shift  ,
as_sls_shift_cmd  ,
"sls-shift <0-3>"  ,
"Shift SLS bits used during routing decision\n" "How many bits from SLS field (starting from least-significant-bit) to skip\n"  ,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [13/14]

DEFUN_ATTR ( cs7_as  ,
cs7_as_cmd  ,
"as NAME "  XUA_VAR_STR,
"Configure an Application Server\n" "Name of the Application Server\n"  XUA_VAR_HELP_STR,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_ATTR() [14/14]

DEFUN_ATTR ( no_cs7_as  ,
no_cs7_as_cmd  ,
"no as NAME"  ,
NO_STR "Disable Application Server\n" "Name of AS\n"  ,
CMD_ATTR_IMMEDIATE   
)

◆ DEFUN_USRATTR() [1/3]

DEFUN_USRATTR ( as_no_traf_mode  ,
as_no_traf_mode_cmd  ,
OSMO_SCCP_LIB_ATTR_RSTRT_ASP  ,
"no traffic-mode"  ,
NO_STR "Remove explicit traffic mode of operation of this AS\n"   
)

◆ DEFUN_USRATTR() [2/3]

DEFUN_USRATTR ( as_traf_mode  ,
as_traf_mode_cmd  ,
OSMO_SCCP_LIB_ATTR_RSTRT_ASP  ,
"traffic-mode (broadcast | roundrobin | override)"  ,
"Specifies traffic mode of operation of the ASP within the AS\n" "Broadcast to all ASP within AS\n" "Round-Robin between all ASP within AS\n" "Override\n"   
)

◆ DEFUN_USRATTR() [3/3]

DEFUN_USRATTR ( as_traf_mode_loadshare  ,
as_traf_mode_loadshare_cmd  ,
OSMO_SCCP_LIB_ATTR_RSTRT_ASP  ,
"traffic-mode loadshare "  [bindings][sls][opc-sls][opc-shift][< 0-2 >],
"Specifies traffic mode of operation of the ASP within the AS\n" "Share Load among all ASP within AS\n" "Configure Loadshare parameters\n" "Configure Loadshare SLS generation parameters\n" "Generate extended SLS with OPC information\n" "Shift OPC bits used during routing decision\n" "How many bits from ITU OPC field (starting from least-significant-bit) to skip (default=0). 6 bits are always used\n"   
)

◆ show_as()

static int show_as ( struct vty *  vty,
int  id,
const char *  as_name,
const char *  filter 
)
static

◆ show_one_as()

◆ ss7_vty_init_node_as()

void ss7_vty_init_node_as ( void  )

References as_node, and NULL.

Referenced by vty_init_shared().

◆ ss7_vty_node_as_go_parent()

int ss7_vty_node_as_go_parent ( struct vty *  vty)

References osmo_ss7_as::inst.

Referenced by osmo_ss7_vty_go_parent().

◆ ss7_vty_write_one_as()

Variable Documentation

◆ as_node

struct cmd_node as_node
static
Initial value:
= {
L_CS7_AS_NODE,
"%s(config-cs7-as)# ",
1,
}

Referenced by ss7_vty_init_node_as().

◆ mtp_si_vals

const struct value_string mtp_si_vals[]
Initial value:
= {
{ MTP_SI_SCCP, "sccp" },
{ MTP_SI_TUP, "tup" },
{ MTP_SI_ISUP, "isup" },
{ MTP_SI_DUP, "dup" },
{ MTP_SI_TESTING, "testing" },
{ MTP_SI_B_ISUP, "b-isup" },
{ MTP_SI_SAT_ISUP, "sat-isup" },
{ MTP_SI_AAL2_SIG, "aal2" },
{ MTP_SI_BICC, "bicc" },
{ MTP_SI_GCP, "h248" },
{ 0, NULL }
}
@ MTP_SI_GCP
Definition: mtp.h:21
@ MTP_SI_BICC
Definition: mtp.h:20
@ MTP_SI_ISUP
Definition: mtp.h:12
@ MTP_SI_B_ISUP
Definition: mtp.h:16
@ MTP_SI_SAT_ISUP
Definition: mtp.h:17
@ MTP_SI_TESTING
Definition: mtp.h:15
@ MTP_SI_DUP
Definition: mtp.h:13
@ MTP_SI_TUP
Definition: mtp.h:11
@ MTP_SI_AAL2_SIG
Definition: mtp.h:19
@ MTP_SI_SCCP
Definition: mtp.h:10
int and can be left NULL
Definition: osmo_ss7.h:364

Referenced by _rout_key(), ss7_vty_write_one_as(), and xua_snm_rx_dupu().