libosmo-sigtran: src/ss7_vty.c File Reference

libosmo-sigtran 2.2.1.95-893c Osmocom SIGTRAN library

Macros | Functions | Variables
ss7_vty.c File Reference
`#include "config.h"`
`#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/osmo_ss7.h>`
`#include <osmocom/sigtran/protocol/mtp.h>`
`#include "xua_internal.h"`
`#include <osmocom/sigtran/sccp_sap.h>`
`#include "sccp_internal.h"`
`#include "ss7_as.h"`
`#include "ss7_asp.h"`
`#include "ss7_combined_linkset.h"`
`#include <ss7_linkset.h>`
`#include "ss7_route.h"`
`#include "ss7_route_table.h"`
`#include "ss7_internal.h"`
`#include "ss7_user.h"`
`#include "ss7_vty.h"`
`#include "ss7_xua_srv.h"`

## Macros
#define | ROUTE_PRIO_RANGE_STR "<1-9>"
#define | ROUTE_PRIO_RANGE_HELP_STR "Priority\n"
#define | ROUTE_PRIO_VAR_STR "(" ROUTE_PRIO_RANGE_STR "|default)"
#define | ROUTE_PRIO_VAR_HELP_STR
#define | RT_DEST_SPRINTF(buf, rt)

## Functions
int | parse_trans_proto (const char *protocol)
enum osmo_ss7_asp_protocol | parse_asp_proto (const char *protocol)
| DEFUN_ATTR (cs7_instance, cs7_instance_cmd, "cs7 instance <0-15>", CS7_STR "Configure a SS7 Instance\n" INST_STR "Number of the instance\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_net_ind, cs7_net_ind_cmd, "network-indicator (international | national | reserved | spare)", "Configure the Network Indicator\n" "International Network\n" "National Network\n" "Reserved Network\n" "Spare Network\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_pc_format, cs7_pc_format_cmd, "point-code format <1-24> [<1-23>] [<1-22>]", PC_STR "Configure Point Code Format\n" "Length of first PC component\n" "Length of second PC component\n" "Length of third PC component\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_pc_format_def, cs7_pc_format_def_cmd, "point-code format default", PC_STR "Configure Point Code Format\n" "Default Point Code Format (3.8.3)\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_pc_delimiter, cs7_pc_delimiter_cmd, "point-code delimiter (default|dash)", PC_STR "Configure Point Code Delimiter\n" "Use dot as delimiter\n" "User dash as delimiter\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_point_code, cs7_point_code_cmd, "point-code POINT_CODE", "Configure the local Point Code\n" "Point Code\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_secondary_pc, cs7_secondary_pc_cmd, "secondary-pc POINT_CODE", "Configure the local Secondary Point Code\n" "Point Code\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_permit_dyn_rkm, cs7_permit_dyn_rkm_cmd, "xua rkm routing-key-allocation (static-only|dynamic-permitted)", "SIGTRAN xxxUA related\n" "Routing Key Management\n" "Routing Key Management Allocation Policy\n" "Only static (pre-configured) Routing Keys permitted\n" "Dynamically allocate Routing Keys for what ASPs request\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_opc_dpc_shift, cs7_opc_dpc_shift_cmd, "sls-opc-dpc [opc-shift] [<0-8>] [dpc-shift] [<0-8>]", "Shift OPC and DPC bits used during routing decision\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" "Shift DPC bits used during routing decision\n" "How many bits from ITU DPC field (starting from least-significant-bit) to skip (default=0). 6 bits are always used\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sls_shift, cs7_sls_shift_cmd, "sls-shift <0-6>", "Shift SLS bits used during routing decision\n" "How many bits from derivated 7-bit extended-SLS (OPC, DPC, SLS) field (starting from least-significant-bit) to skip\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_timer_xua, cs7_timer_xua_cmd, NULL, NULL, CMD_ATTR_IMMEDIATE)
static void | gen_cs7_timer_xua_cmd_strs (struct cmd_element *cmd)
static void | write_one_cs7 (struct vty *vty, struct osmo_ss7_instance *inst, bool show_dyn_config)
static int | write_all_cs7 (struct vty *vty, bool show_dyn_config)
static int | config_write_cs7 (struct vty *vty)
| DEFUN (show_cs7_user, show_cs7_user_cmd, "show cs7 instance <0-15> users", SHOW_STR CS7_STR INST_STR INST_STR "User Table\n")
| DEFUN_ATTR (cs7_route_table, cs7_route_table_cmd, "route-table system", "Specify the name of the route table\n" "Name of the route table\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_rt_upd, cs7_rt_upd_cmd, "update route POINT_CODE MASK linkset LS_NAME [priority] [" ROUTE_PRIO_VAR_STR "] [qos-class] [" QOS_CLASS_VAR_STR "]", "Update the Route\n" "Update the Route\n" "Destination Point Code\n" "Point Code Mask\n" "Specify Destination Linkset\n" "Linkset Name\n" "Specify Priority (lower value means higher priority)\n" ROUTE_PRIO_VAR_HELP_STR "Specify QoS Class\n" QOS_CLASS_VAR_HELP_STR, CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_rt_rem, cs7_rt_rem_cmd, "remove route POINT_CODE MASK", "Remove a Route\n" "Remove a Route\n" "Destination Point Code\n" "Point Code Mask\n" "Point Code Length\n", CMD_ATTR_IMMEDIATE)
static void | write_one_rtable (struct vty *vty, struct osmo_ss7_route_table *rtable)
static void | vty_dump_rtable (struct vty *vty, struct osmo_ss7_route_table *rtbl, uint32_t filter_pc)
| DEFUN (show_cs7_route, show_cs7_route_cmd, "show cs7 instance <0-15> route [POINT_CODE]", SHOW_STR CS7_STR INST_STR INST_STR "Routing Table\n" "Destination Point Code\n")
| DEFUN (show_cs7_route_bindingtable, show_cs7_route_bindingtable_cmd, "show cs7 instance <0-15> route binding-table [POINT_CODE] [all-matches]", SHOW_STR CS7_STR INST_STR INST_STR "Routing Table\n" "Display binding table\n" "Destination Point Code\n" "Display all matching Combination Links\n")
| DEFUN (show_cs7_route_lookup, show_cs7_route_lookup_cmd, "show cs7 instance <0-15> route-lookup POINT_CODE from POINT_CODE sls <0-15> [list-asps]", SHOW_STR CS7_STR INST_STR INST_STR "Look up route\n" "Destination PC\n" "From\n" "Origin PC\n" "SLS\n" "SLS value\n" "List ASPs of the AS if route points to an AS")
| DEFUN (show_cs7_config, show_cs7_config_cmd, "show cs7 config", SHOW_STR CS7_STR "Currently running cs7 configuration")
| DEFUN (cs7_asp_disconnect, cs7_asp_disconnect_cmd, "cs7 instance <0-15> asp NAME disconnect", CS7_STR "Instance related commands\n" "SS7 Instance Number\n" "ASP related commands\n" "Name of ASP\n" "Disconnect the ASP (client will reconnect)\n")
static void | write_sccp_addressbook (struct vty *vty, const struct osmo_ss7_instance *inst)
| DEFUN (cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, "show cs7 instance <0-15> sccp addressbook", SHOW_STR CS7_STR INST_STR INST_STR SCCP_STR "List all SCCP addressbook entries\n")
| DEFUN_ATTR (cs7_sccpaddr, cs7_sccpaddr_cmd, "sccp-address NAME", "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, "no sccp-address NAME", NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, "routing-indicator (GT|PC|IP)", "Add Routing Indicator\n" "by global-title\n" "by point-code\n" "by ip-address\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, "point-code POINT_CODE", "Add point-code Number\n" "PC\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, "no point-code", NO_STR "Remove point-code Number\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, "no subsystem-number", NO_STR "Remove Subsystem Number\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, "global-title", "Add/Modify Global Title\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, "no global-title", NO_STR "Remove Global Title\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, "numbering-plan-indicator <0-15>", "Set Global Title Numbering Plan Indicator\n" "NPI\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, "nature-of-address-indicator <0-127>", "Set Global Title Nature of Address Indicator\n" "NAI\n", CMD_ATTR_IMMEDIATE)
| DEFUN_ATTR (cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, "digits DIGITS", "Set Global Title Digits\n" "Number digits\n", CMD_ATTR_IMMEDIATE)
static void | write_cs7_timers_xua (struct vty *vty, const char *indent, struct osmo_ss7_instance *inst)
int | osmo_ss7_vty_go_parent (struct vty *vty)
int | osmo_ss7_is_config_node (struct vty *vty, int node)
static void | vty_init_addr (void)
static void | vty_init_shared (void *ctx)
void | osmo_ss7_vty_init_asp (void *ctx)
void | osmo_ss7_vty_init_sg (void *ctx)

## Variables
const struct value_string | ipproto_vals []
enum cs7_role_t | cs7_role
void * | g_ctx
static struct cmd_node | cs7_node
const struct value_string | mtp_network_indicator_vals []
static struct cmd_node | rtable_node
static struct cmd_node | sccpaddr_node
static struct cmd_node | sccpaddr_gt_node

## Macro Definition Documentation

## ◆ ROUTE_PRIO_RANGE_HELP_STR

#define ROUTE_PRIO_RANGE_HELP_STR "Priority\n"

## ◆ ROUTE_PRIO_RANGE_STR

#define ROUTE_PRIO_RANGE_STR "<1-9>"

## ◆ ROUTE_PRIO_VAR_HELP_STR

#define ROUTE_PRIO_VAR_HELP_STR

Value:
ROUTE_PRIO_RANGE_HELP_STR \
"Default Priority (5)\n"
ROUTE_PRIO_RANGE_HELP_STR
#define ROUTE_PRIO_RANGE_HELP_STR
Definition: ss7_vty.c:58

## ◆ ROUTE_PRIO_VAR_STR

#define ROUTE_PRIO_VAR_STR "(" ROUTE_PRIO_RANGE_STR "|default)"

## ◆ RT_DEST_SPRINTF

#define RT_DEST_SPRINTF | ( |  | buf,
|  |  | rt
| ) |  |

Value:
do { \
if (rt) { \
if ((rt)->dest.as) { \
snprintf(buf, sizeof(buf), "%s", (rt)->dest.as->cfg.name); \
} else if ((rt)->dest.linkset) { \
snprintf(buf, sizeof(buf), "%s", (rt)->dest.linkset->cfg.name); \
} else { \
snprintf(buf, sizeof(buf), "<error>"); \
} \
} else { \
snprintf(buf, sizeof(buf), "-"); \
} \
} while (0)

## Function Documentation

## ◆ config_write_cs7()

static int config_write_cs7 | ( | struct vty * | vty | ) |
| static

References write_all_cs7().

Referenced by vty_init_shared().

## ◆ DEFUN() [1/7]

DEFUN | ( | cs7_asp_disconnect | ,
|  | cs7_asp_disconnect_cmd | ,
|  | "cs7 instance <0-15> asp NAME disconnect" | ,
|  | CS7_STR "Instance related commands\n" "SS7 Instance Number\n" "ASP related commands\n" "Name of ASP\n" "Disconnect the ASP (client will reconnect)\n" |
| ) |  |

References osmo_ss7_asp::inst, osmo_ss7_asp_disconnect(), osmo_ss7_asp_find_by_name(), and osmo_ss7_instance_find().

## ◆ DEFUN() [2/7]

DEFUN | ( | cs7_show_sccpaddr | ,
|  | cs7_show_sccpaddr_cmd | ,
|  | "show cs7 instance <0-15> sccp addressbook" | ,
|  | SHOW_STR CS7_STR INST_STR INST_STR SCCP_STR "List all SCCP addressbook entries\n" |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_ss7_instance::cfg, osmo_ss7_instance::description, osmo_sccp_gt::digits, osmo_sccp_addr::gt, osmo_sccp_gt::gti, osmo_sccp_addr_entry::inst, osmo_sccp_addr::ip, osmo_sccp_addr_entry::list, osmo_sccp_gt::nai, osmo_sccp_addr_entry::name, osmo_sccp_gt::npi, OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_IPv4, OSMO_SCCP_ADDR_T_IPv6, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_SSN_IP, OSMO_SCCP_RI_SSN_PC, osmo_ss7_instance_find(), osmo_ss7_pointcode_print(), osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ri, osmo_ss7_instance::sccp_address_book, osmo_sccp_addr::ssn, osmo_sccp_gt::tt, osmo_sccp_addr::v4, and osmo_sccp_addr::v6.

## ◆ DEFUN() [3/7]

DEFUN | ( | show_cs7_config | ,
|  | show_cs7_config_cmd | ,
|  | "show cs7 config" | ,
|  | SHOW_STR CS7_STR "Currently running cs7 configuration" |
| ) |  |

References write_all_cs7().

## ◆ DEFUN() [4/7]

DEFUN | ( | show_cs7_route | ,
|  | show_cs7_route_cmd | ,
|  | "show cs7 instance <0-15> route " | [POINT_CODE],
|  | SHOW_STR CS7_STR INST_STR INST_STR "Routing Table\n" "Destination Point Code\n" |
| ) |  |

References osmo_ss7_instance_find(), OSMO_SS7_PC_INVALID, osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_parse(), pc, osmo_ss7_instance::rtable_system, and vty_dump_rtable().

## ◆ DEFUN() [5/7]

DEFUN | ( | show_cs7_route_bindingtable | ,
|  | show_cs7_route_bindingtable_cmd | ,
|  | "show cs7 instance <0-15> route binding-table " | [POINT_CODE][all-matches],
|  | SHOW_STR CS7_STR INST_STR INST_STR "Routing Table\n" "Display binding table\n" "Destination Point Code\n" "Display all matching Combination Links\n" |
| ) |  |

References osmo_ss7_esls_entry::alt_rt, osmo_ss7_combined_linkset::cfg, osmo_ss7_route_table::combined_linksets, osmo_ss7_combined_linkset::esls_table, osmo_ss7_route_table::inst, osmo_ss7_combined_linkset::list, osmo_ss7_combined_linkset::mask, osmo_ss7_esls_entry::normal_rt, osmo_ss7_instance_find(), OSMO_SS7_PC_INVALID, osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_parse(), osmo_ss7_pointcode_print(), osmo_ss7_pointcode_print2(), osmo_ss7_combined_linkset::pc, pc, RT_DEST_SPRINTF, osmo_ss7_combined_linkset::rtable, osmo_ss7_instance::rtable_system, and ss7_route_is_available().

## ◆ DEFUN() [6/7]

DEFUN | ( | show_cs7_route_lookup | ,
|  | show_cs7_route_lookup_cmd | ,
|  | "show cs7 instance <0-15> route-lookup POINT_CODE from POINT_CODE sls <0-15> " | [list-asps],
|  | SHOW_STR CS7_STR INST_STR INST_STR "Look up route\n" "Destination PC\n" "From\n" "Origin PC\n" "SLS\n" "SLS value\n" "List ASPs of the AS if route points to an AS" |
| ) |  |

References osmo_ss7_route_label::dpc, osmo_ss7_route_label::opc, osmo_ss7_instance_find(), osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_parse(), osmo_ss7_route_name(), pc, osmo_ss7_route_label::sls, ss7_instance_lookup_route(), and ss7_route_label_to_str().

## ◆ DEFUN() [7/7]

DEFUN | ( | show_cs7_user | ,
|  | show_cs7_user_cmd | ,
|  | "show cs7 instance <0-15> users" | ,
|  | SHOW_STR CS7_STR INST_STR INST_STR "User Table\n" |
| ) |  |

References osmo_ss7_user::inst, osmo_ss7_user::name, osmo_ss7_instance_find(), and osmo_ss7_instance::user.

## ◆ DEFUN_ATTR() [1/28]

DEFUN_ATTR | ( | cs7_instance | ,
|  | cs7_instance_cmd | ,
|  | "cs7 instance <0-15>" | ,
|  | CS7_STR "Configure a SS7 Instance\n" INST_STR "Number of the instance\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_instance::description, g_ctx, and osmo_ss7_instance_find_or_create().

## ◆ DEFUN_ATTR() [2/28]

DEFUN_ATTR | ( | cs7_net_ind | ,
|  | cs7_net_ind_cmd | ,
|  | "network-indicator (international | national | reserved | spare)" | ,
|  | "Configure the Network Indicator\n" "International Network\n" "National Network\n" "Reserved Network\n" "Spare Network\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, mtp_network_indicator_vals, osmo_ss7_instance::network_indicator, and ni.

## ◆ DEFUN_ATTR() [3/28]

DEFUN_ATTR | ( | cs7_opc_dpc_shift | ,
|  | cs7_opc_dpc_shift_cmd | ,
|  | "sls-opc-dpc " | [opc-shift][< 0-8 >][dpc-shift][< 0-8 >],
|  | "Shift OPC and DPC bits used during routing decision\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" "Shift DPC bits used during routing decision\n" "How many bits from ITU DPC field (starting from least-significant-bit) to skip (default=0). 6 bits are always used\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_instance::dpc_shift, and osmo_ss7_instance::opc_shift.

## ◆ DEFUN_ATTR() [4/28]

DEFUN_ATTR | ( | cs7_pc_delimiter | ,
|  | cs7_pc_delimiter_cmd | ,
|  | "point-code delimiter (default|dash)" | ,
|  | PC_STR "Configure Point Code Delimiter\n" "Use dot as delimiter\n" "User dash as delimiter\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::delimiter, and osmo_ss7_instance::pc_fmt.

## ◆ DEFUN_ATTR() [5/28]

DEFUN_ATTR | ( | cs7_pc_format | ,
|  | cs7_pc_format_cmd | ,
|  | "point-code format <1-24> " | [< 1-23 >][< 1-22 >],
|  | PC_STR "Configure Point Code Format\n" "Length of first PC component\n" "Length of second PC component\n" "Length of third PC component\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::component_len, and osmo_ss7_instance::pc_fmt.

## ◆ DEFUN_ATTR() [6/28]

DEFUN_ATTR | ( | cs7_pc_format_def | ,
|  | cs7_pc_format_def_cmd | ,
|  | "point-code format default" | ,
|  | PC_STR "Configure Point Code Format\n" "Default Point Code Format (3.8.3)\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::component_len, and osmo_ss7_instance::pc_fmt.

## ◆ DEFUN_ATTR() [7/28]

DEFUN_ATTR | ( | cs7_permit_dyn_rkm | ,
|  | cs7_permit_dyn_rkm_cmd | ,
|  | "xua rkm routing-key-allocation (static-only|dynamic-permitted)" | ,
|  | "SIGTRAN xxxUA related\n" "Routing Key Management\n" "Routing Key Management Allocation Policy\n" "Only static (pre-configured) Routing Keys permitted\n" "Dynamically allocate Routing Keys for what ASPs request\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, and osmo_ss7_instance::permit_dyn_rkm_alloc.

## ◆ DEFUN_ATTR() [8/28]

DEFUN_ATTR | ( | cs7_point_code | ,
|  | cs7_point_code_cmd | ,
|  | "point-code POINT_CODE" | ,
|  | "Configure the local Point Code\n" "Point Code\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_parse(), pc, and osmo_ss7_instance::primary_pc.

## ◆ DEFUN_ATTR() [9/28]

DEFUN_ATTR | ( | cs7_route_table | ,
|  | cs7_route_table_cmd | ,
|  | "route-table system" | ,
|  | "Specify the name of the route table\n" "Name of the route table\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_route_table::cfg, osmo_ss7_route_table::description, osmo_ss7_route_table::inst, and osmo_ss7_instance::rtable_system.

## ◆ DEFUN_ATTR() [10/28]

DEFUN_ATTR | ( | cs7_rt_rem | ,
|  | cs7_rt_rem_cmd | ,
|  | "remove route POINT_CODE MASK" | ,
|  | "Remove a Route\n" "Remove a Route\n" "Destination Point Code\n" "Point Code Mask\n" "Point Code Length\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References dpc, osmo_ss7_route_table::inst, osmo_ss7_route::mask, osmo_ss7_pointcode_parse(), osmo_ss7_pointcode_parse_mask_or_len(), osmo_ss7_route::rtable, ss7_route_destroy(), and ss7_route_table_find_route_by_dpc_mask().

## ◆ DEFUN_ATTR() [11/28]

DEFUN_ATTR | ( | cs7_rt_upd | ,
|  | cs7_rt_upd_cmd | ,
|  | "update route POINT_CODE MASK linkset LS_NAME " | [priority][" ROUTE_PRIO_VAR_STR "][qos-class][" QOS_CLASS_VAR_STR "],
|  | "Update the Route\n" "Update the Route\n" "Destination Point Code\n" "Point Code Mask\n" "Specify Destination Linkset\n" "Linkset Name\n" "Specify Priority (lower value means higher priority)\n" ROUTE_PRIO_VAR_HELP_STR "Specify QoS Class\n" | QOS_CLASS_VAR_HELP_STR,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_route::cfg, dpc, osmo_ss7_route_table::inst, osmo_ss7_route::mask, osmo_ss7_pointcode_parse(), osmo_ss7_pointcode_parse_mask_or_len(), osmo_ss7_route::priority, osmo_ss7_route::qos_class, osmo_ss7_route::rtable, ss7_route_alloc(), ss7_route_destroy(), ss7_route_insert(), and ss7_route_set_linkset().

## ◆ DEFUN_ATTR() [12/28]

DEFUN_ATTR | ( | cs7_sccpaddr | ,
|  | cs7_sccpaddr_cmd | ,
|  | "sccp-address NAME" | ,
|  | "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References addr_entry_by_name_local(), osmo_ss7_instance::cfg, osmo_ss7_instance::id, osmo_ss7_instance::name, osmo_sccp_addr_create(), OSMO_SCCP_RI_SSN_PC, and osmo_sccp_addr::ri.

## ◆ DEFUN_ATTR() [13/28]

DEFUN_ATTR | ( | cs7_sccpaddr_del | ,
|  | cs7_sccpaddr_del_cmd | ,
|  | "no sccp-address NAME" | ,
|  | NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References addr_entry_by_name_local(), and osmo_ss7_instance::name.

## ◆ DEFUN_ATTR() [14/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt | ,
|  | cs7_sccpaddr_gt_cmd | ,
|  | "global-title" | ,
|  | "Add/Modify Global Title\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, OSMO_SCCP_ADDR_T_GT, and osmo_sccp_addr::presence.

## ◆ DEFUN_ATTR() [15/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt_del | ,
|  | cs7_sccpaddr_gt_del_cmd | ,
|  | "no global-title" | ,
|  | NO_STR "Remove Global Title\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::gt, and osmo_sccp_addr::presence.

## ◆ DEFUN_ATTR() [16/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt_digits | ,
|  | cs7_sccpaddr_gt_digits_cmd | ,
|  | "digits DIGITS" | ,
|  | "Set Global Title Digits\n" "Number digits\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_gt::digits, and osmo_sccp_addr::gt.

## ◆ DEFUN_ATTR() [17/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt_gti | ,
|  | cs7_sccpaddr_gt_gti_cmd | ,
|  | "global-title-indicator <0-15>" | ,
|  | "Set Global Title Indicator\n" "GTI\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::gt, and osmo_sccp_gt::gti.

## ◆ DEFUN_ATTR() [18/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt_nai | ,
|  | cs7_sccpaddr_gt_nai_cmd | ,
|  | "nature-of-address-indicator <0-127>" | ,
|  | "Set Global Title Nature of Address Indicator\n" "NAI\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::gt, and osmo_sccp_gt::nai.

## ◆ DEFUN_ATTR() [19/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt_npi | ,
|  | cs7_sccpaddr_gt_npi_cmd | ,
|  | "numbering-plan-indicator <0-15>" | ,
|  | "Set Global Title Numbering Plan Indicator\n" "NPI\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::gt, and osmo_sccp_gt::npi.

## ◆ DEFUN_ATTR() [20/28]

DEFUN_ATTR | ( | cs7_sccpaddr_gt_tt | ,
|  | cs7_sccpaddr_gt_tt_cmd | ,
|  | "translation-type <0-255>" | ,
|  | "Set Global Title Translation Type\n" "TT\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::gt, and osmo_sccp_gt::tt.

## ◆ DEFUN_ATTR() [21/28]

DEFUN_ATTR | ( | cs7_sccpaddr_pc | ,
|  | cs7_sccpaddr_pc_cmd | ,
|  | "point-code POINT_CODE" | ,
|  | "Add point-code Number\n" "PC\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr_entry::inst, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_RI_NONE, OSMO_SCCP_RI_SSN_PC, osmo_ss7_pointcode_parse(), osmo_sccp_addr::pc, pc, osmo_sccp_addr::presence, and osmo_sccp_addr::ri.

## ◆ DEFUN_ATTR() [22/28]

DEFUN_ATTR | ( | cs7_sccpaddr_pc_del | ,
|  | cs7_sccpaddr_pc_del_cmd | ,
|  | "no point-code" | ,
|  | NO_STR "Remove point-code Number\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::pc, and osmo_sccp_addr::presence.

## ◆ DEFUN_ATTR() [23/28]

DEFUN_ATTR | ( | cs7_sccpaddr_ri | ,
|  | cs7_sccpaddr_ri_cmd | ,
|  | "routing-indicator (GT|PC|IP)" | ,
|  | "Add Routing Indicator\n" "by global-title\n" "by point-code\n" "by ip-address\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_SSN_IP, OSMO_SCCP_RI_SSN_PC, and osmo_sccp_addr::ri.

## ◆ DEFUN_ATTR() [24/28]

DEFUN_ATTR | ( | cs7_sccpaddr_ssn | ,
|  | cs7_sccpaddr_ssn_cmd | ,
|  | "subsystem-number <0-4294967295>" | ,
|  | "Add Subsystem Number\n" "SSN\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, OSMO_SCCP_ADDR_T_SSN, osmo_sccp_addr::presence, and osmo_sccp_addr::ssn.

## ◆ DEFUN_ATTR() [25/28]

DEFUN_ATTR | ( | cs7_sccpaddr_ssn_del | ,
|  | cs7_sccpaddr_ssn_del_cmd | ,
|  | "no subsystem-number" | ,
|  | NO_STR "Remove Subsystem Number\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_sccp_addr_entry::addr, osmo_sccp_addr::presence, and osmo_sccp_addr::ssn.

## ◆ DEFUN_ATTR() [26/28]

DEFUN_ATTR | ( | cs7_secondary_pc | ,
|  | cs7_secondary_pc_cmd | ,
|  | "secondary-pc POINT_CODE" | ,
|  | "Configure the local Secondary Point Code\n" "Point Code\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_parse(), pc, and osmo_ss7_instance::secondary_pc.

## ◆ DEFUN_ATTR() [27/28]

DEFUN_ATTR | ( | cs7_sls_shift | ,
|  | cs7_sls_shift_cmd | ,
|  | "sls-shift <0-6>" | ,
|  | "Shift SLS bits used during routing decision\n" "How many bits from derivated 7-bit extended-SLS (OPC, DPC, SLS) field (starting from least-significant-bit) to skip\n" | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, and osmo_ss7_instance::sls_shift.

## ◆ DEFUN_ATTR() [28/28]

DEFUN_ATTR | ( | cs7_timer_xua | ,
|  | cs7_timer_xua_cmd | ,
|  | NULL | ,
|  | NULL | ,
|  | CMD_ATTR_IMMEDIATE |
| ) |  |

References osmo_ss7_instance::cfg, SS7_INST_XUA_TIMERS_LEN, ss7_instance_xua_timer_names, osmo_ss7_instance::T_defs_xua, and osmo_ss7_instance::timer.

## ◆ gen_cs7_timer_xua_cmd_strs()

static void gen_cs7_timer_xua_cmd_strs | ( | struct cmd_element * | cmd | ) |
| static

References NULL, ss7_instance_xua_timer_defaults, and ss7_instance_xua_timer_names.

Referenced by vty_init_shared().

## ◆ osmo_ss7_is_config_node()

int osmo_ss7_is_config_node | ( | struct vty * | vty,
|  | int | node
| ) |  |

## ◆ osmo_ss7_vty_go_parent()

int osmo_ss7_vty_go_parent | ( | struct vty * | vty | ) |

References osmo_sccp_addr_entry::inst, osmo_ss7_route_table::inst, NULL, ss7_vty_node_as_go_parent(), ss7_vty_node_asp_go_parent(), and ss7_vty_node_oxs_go_parent().

## ◆ osmo_ss7_vty_init_asp()

void osmo_ss7_vty_init_asp | ( | void * | ctx | ) |

References cs7_role, CS7_ROLE_ASP, and vty_init_shared().

## ◆ osmo_ss7_vty_init_sg()

void osmo_ss7_vty_init_sg | ( | void * | ctx | ) |

References cs7_role, CS7_ROLE_SG, NULL, rtable_node, tcap_as_vty_init(), and vty_init_shared().

## ◆ parse_asp_proto()

enum osmo_ss7_asp_protocol parse_asp_proto | ( | const char * | protocol | ) |

References osmo_ss7_asp_protocol_vals.

Referenced by DEFUN(), and DEFUN_ATTR().

## ◆ parse_trans_proto()

int parse_trans_proto | ( | const char * | protocol | ) |

References ipproto_vals.

Referenced by DEFUN(), and DEFUN_ATTR().

## ◆ vty_dump_rtable()

static void vty_dump_rtable | ( | struct vty * | vty,
|  | struct osmo_ss7_route_table * | rtbl,
|  | uint32_t | filter_pc
| ) |  |
| static

References osmo_ss7_combined_linkset::cfg, osmo_ss7_route::cfg, osmo_ss7_route_table::cfg, osmo_ss7_route::clset, osmo_ss7_route_table::combined_linksets, osmo_ss7_route::dyn_allocated, osmo_ss7_route::linkset_name, osmo_ss7_route::list, osmo_ss7_combined_linkset::mask, osmo_ss7_route_table::name, OSMO_SS7_PC_INVALID, osmo_ss7_route_print(), OSMO_SS7_ROUTE_STATUS_AVAILABLE, OSMO_SS7_ROUTE_STATUS_RESTRICTED, OSMO_SS7_ROUTE_STATUS_UNAVAILABLE, osmo_ss7_combined_linkset::pc, osmo_ss7_route::priority, osmo_ss7_route::qos_class, osmo_ss7_combined_linkset::routes, ss7_combined_linkset_is_available(), ss7_route_dest_is_available(), and osmo_ss7_route::status.

Referenced by DEFUN().

## ◆ vty_init_addr()

static void vty_init_addr | ( | void |  | ) |
| static

References NULL, sccpaddr_gt_node, and sccpaddr_node.

Referenced by vty_init_shared().

## ◆ vty_init_shared()

static void vty_init_shared | ( | void * | ctx | ) |
| static

References config_write_cs7(), cs7_node, g_ctx, gen_cs7_timer_xua_cmd_strs(), ss7_vty_init_node_as(), ss7_vty_init_node_asp(), ss7_vty_init_node_oxs(), ss7_vty_init_show_oxs(), and vty_init_addr().

Referenced by osmo_ss7_vty_init_asp(), and osmo_ss7_vty_init_sg().

## ◆ write_all_cs7()

static int write_all_cs7 | ( | struct vty * | vty,
|  | bool | show_dyn_config
| ) |  |
| static

References osmo_ss7_instance::list, osmo_ss7_instances, and write_one_cs7().

Referenced by config_write_cs7(), and DEFUN().

## ◆ write_cs7_timers_xua()

static void write_cs7_timers_xua | ( | struct vty * | vty,
|  | const char * | indent,
|  | struct osmo_ss7_instance * | inst
| ) |  |
| static

References osmo_ss7_instance::cfg, ss7_instance_xua_timer_names, and osmo_ss7_instance::T_defs_xua.

Referenced by write_one_cs7().

## ◆ write_one_cs7()

static void write_one_cs7 | ( | struct vty * | vty,
|  | struct osmo_ss7_instance * | inst,
|  | bool | show_dyn_config
| ) |  |
| static

References osmo_ss7_instance::as_list, osmo_ss7_instance::asp_list, osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::component_len, cs7_role, CS7_ROLE_SG, osmo_ss7_pc_fmt::delimiter, osmo_ss7_instance::description, osmo_ss7_instance::dpc_shift, osmo_ss7_instance::id, osmo_xua_server::inst, osmo_xua_server::list, mtp_network_indicator_vals, osmo_ss7_instance::network_indicator, osmo_ss7_instance::opc_shift, osmo_sccp_vty_write_cs7_node(), osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_print(), osmo_ss7_instance::pc_fmt, osmo_ss7_instance::permit_dyn_rkm_alloc, osmo_ss7_instance::primary_pc, osmo_ss7_instance::rtable_list, osmo_ss7_instance::sccp, osmo_ss7_instance::secondary_pc, osmo_ss7_instance::sls_shift, ss7_vty_write_one_as(), ss7_vty_write_one_asp(), ss7_vty_write_one_oxs(), write_cs7_timers_xua(), write_one_rtable(), write_sccp_addressbook(), and osmo_ss7_instance::xua_servers.

Referenced by write_all_cs7().

## ◆ write_one_rtable()

static void write_one_rtable | ( | struct vty * | vty,
|  | struct osmo_ss7_route_table * | rtable
| ) |  |
| static

References osmo_ss7_route::cfg, osmo_ss7_route_table::cfg, osmo_ss7_route::clset, osmo_ss7_route_table::combined_linksets, osmo_ss7_route_table::description, osmo_ss7_route::dyn_allocated, osmo_ss7_route_table::inst, osmo_ss7_route::linkset_name, osmo_ss7_route::list, osmo_ss7_route::mask, osmo_ss7_route_table::name, osmo_ss7_pointcode_print(), osmo_ss7_pointcode_print2(), OSMO_SS7_ROUTE_PRIO_DEFAULT, osmo_ss7_route::pc, osmo_ss7_route::priority, osmo_ss7_route::qos_class, osmo_ss7_combined_linkset::routes, and osmo_ss7_route::rtable.

Referenced by write_one_cs7().

## ◆ write_sccp_addressbook()

static void write_sccp_addressbook | ( | struct vty * | vty,
|  | const struct osmo_ss7_instance * | inst
| ) |  |
| static

References osmo_sccp_addr_entry::addr, osmo_ss7_instance::cfg, osmo_sccp_gt::digits, osmo_sccp_addr::gt, osmo_sccp_gt::gti, osmo_sccp_addr_entry::inst, osmo_sccp_addr_entry::list, osmo_sccp_gt::nai, osmo_sccp_addr_entry::name, osmo_sccp_gt::npi, OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_NONE, OSMO_SCCP_RI_SSN_IP, OSMO_SCCP_RI_SSN_PC, osmo_ss7_pointcode_print(), osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ri, osmo_ss7_instance::sccp_address_book, osmo_sccp_addr::ssn, and osmo_sccp_gt::tt.

Referenced by write_one_cs7().

## Variable Documentation

## ◆ cs7_node

struct cmd_node cs7_node
| static

Initial value:
= {
L_CS7_NODE,
"%s(config-cs7)# ",
1,
}

Referenced by vty_init_shared().

## ◆ cs7_role

enum cs7_role_t cs7_role

Referenced by DEFUN_ATTR(), ipa_rx_msg_osmo_ext_tcap_routing(), osmo_ss7_vty_init_asp(), osmo_ss7_vty_init_sg(), ss7_vty_init_node_as(), ss7_vty_node_as_go_parent(), and write_one_cs7().

## ◆ g_ctx

void* g_ctx

Referenced by DEFUN_ATTR(), ss7_vty_init_node_asp(), and vty_init_shared().

## ◆ ipproto_vals

const struct value_string ipproto_vals[]

Initial value:
= {
{ IPPROTO_SCTP, "sctp" },
{ IPPROTO_TCP, "tcp" },
{ 0, NULL },
}
NULL
int and can be left NULL
Definition: osmo_ss7.h:353

Referenced by parse_trans_proto(), ss7_vty_write_one_asp(), ss7_vty_write_one_oxs(), and vty_dump_xua_server().

## ◆ mtp_network_indicator_vals

const struct value_string mtp_network_indicator_vals[]

Initial value:
= {
{ MTP_NI_INTERNATIONAL, "international" },
{ MTP_NI_SPARE_INTERNATIONAL, "spare" },
{ MTP_NI_NATIONAL, "national" },
{ MTP_NI_RESERVED_NATIONAL, "reserved" },
{ 0, NULL }
}
MTP_NI_NATIONAL
@ MTP_NI_NATIONAL
Definition: mtp.h:42
MTP_NI_RESERVED_NATIONAL
@ MTP_NI_RESERVED_NATIONAL
Definition: mtp.h:43
MTP_NI_SPARE_INTERNATIONAL
@ MTP_NI_SPARE_INTERNATIONAL
Definition: mtp.h:41
MTP_NI_INTERNATIONAL
@ MTP_NI_INTERNATIONAL
Definition: mtp.h:40

Referenced by DEFUN_ATTR(), and write_one_cs7().

## ◆ rtable_node

struct cmd_node rtable_node
| static

Initial value:
= {
L_CS7_RTABLE_NODE,
"%s(config-cs7-rt)# ",
1,
}

Referenced by osmo_ss7_vty_init_sg().

## ◆ sccpaddr_gt_node

struct cmd_node sccpaddr_gt_node
| static

Initial value:
= {
L_CS7_SCCPADDR_GT_NODE,
"%s(config-cs7-sccpaddr-gt)# ",
1,
}

Referenced by vty_init_addr().

## ◆ sccpaddr_node

struct cmd_node sccpaddr_node
| static

Initial value:
= {
L_CS7_SCCPADDR_NODE,
"%s(config-cs7-sccpaddr)# ",
1,
}

Referenced by vty_init_addr().