osmo_ss7.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/prim.h>
extern struct llist_head osmo_ss7_instances;
struct osmo_ss7_instance;
struct osmo_ss7_user;
struct osmo_sccp_instance;
struct osmo_mtp_prim;
struct osmo_xua_layer_manager;
int osmo_ss7_init(void);
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst);
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc);
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str);
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in);
const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc);
const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc);
/* All known point-code formats have a length of or below 24 bit.
* A point-code value exceeding that is used to indicate an unset PC. */
#define OSMO_SS7_PC_INVALID 0xffffffff
static inline bool osmo_ss7_pc_is_valid(uint32_t pc)
{
return pc <= 0x00ffffff;
}
/***********************************************************************
* SS7 Routing Tables
***********************************************************************/
struct osmo_ss7_route_table {
struct llist_head list;
struct osmo_ss7_instance *inst;
struct llist_head routes;
struct {
char *name;
char *description;
} cfg;
};
struct osmo_ss7_route_table *
osmo_ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name);
struct osmo_ss7_route_table *
osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name);
void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl);
/***********************************************************************
* SS7 Instances
***********************************************************************/
struct osmo_ss7_pc_fmt {
char delimiter;
uint8_t component_len[3];
};
struct osmo_ss7_instance {
struct llist_head list;
struct llist_head linksets;
struct llist_head as_list;
struct llist_head asp_list;
struct llist_head rtable_list;
struct llist_head xua_servers;
/* array for faster lookup of user (indexed by service
* indicator) */
const struct osmo_ss7_user *user[16];
struct osmo_ss7_route_table *rtable_system;
struct osmo_sccp_instance *sccp;
struct {
uint32_t id;
char *name;
char *description;
uint32_t primary_pc;
/* secondary PCs */
/* capability PCs */
uint8_t network_indicator;
struct osmo_ss7_pc_fmt pc_fmt;
bool permit_dyn_rkm_alloc;
struct llist_head sccp_address_book;
} cfg;
};
struct osmo_ss7_instance *osmo_ss7_instance_find(uint32_t id);
struct osmo_ss7_instance *
osmo_ss7_instance_find_or_create(void *ctx, uint32_t id);
void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst);
int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst,
uint8_t c0, uint8_t c1, uint8_t c2);
int osmo_ss7_instance_bind(struct osmo_ss7_instance *inst);
int osmo_ss7_bind_all_instances();
/***********************************************************************
* MTP Users (Users of MTP, such as SCCP or ISUP)
***********************************************************************/
struct osmo_ss7_user {
/* pointer back to SS7 instance */
struct osmo_ss7_instance *inst;
/* name of the user */
const char *name;
/* primitive call-back for incoming MTP primitives */
osmo_prim_cb prim_cb;
/* private data */
void *priv;
};
int osmo_ss7_user_register(struct osmo_ss7_instance *inst, uint8_t service_ind,
struct osmo_ss7_user *user);
int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind,
struct osmo_ss7_user *user);
int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp);
/* SS7 User wants to issue MTP-TRANSFER.req */
int osmo_ss7_user_mtp_xfer_req(struct osmo_ss7_instance *inst,
struct osmo_mtp_prim *omp);
/***********************************************************************
* SS7 Links
***********************************************************************/
enum osmo_ss7_link_adm_state {
OSMO_SS7_LS_SHUTDOWN,
OSMO_SS7_LS_INHIBITED,
OSMO_SS7_LS_ENABLED,
_NUM_OSMO_SS7_LS
};
struct osmo_ss7_linkset;
struct osmo_ss7_link;
struct osmo_ss7_link {
struct osmo_ss7_linkset *linkset;
struct {
char *name;
char *description;
uint32_t id;
enum osmo_ss7_link_adm_state adm_state;
} cfg;
};
void osmo_ss7_link_destroy(struct osmo_ss7_link *link);
struct osmo_ss7_link *
osmo_ss7_link_find_or_create(struct osmo_ss7_linkset *lset, uint32_t id);
/***********************************************************************
* SS7 Linksets
***********************************************************************/
struct osmo_ss7_linkset {
struct llist_head list;
struct osmo_ss7_instance *inst;
struct osmo_ss7_link *links[16];
struct {
char *name;
char *description;
uint32_t adjacent_pc;
uint32_t local_pc;
} cfg;
};
void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset);
struct osmo_ss7_linkset *
osmo_ss7_linkset_find_by_name(struct osmo_ss7_instance *inst, const char *name);
struct osmo_ss7_linkset *
osmo_ss7_linkset_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint32_t pc);
/***********************************************************************
* SS7 Routes
***********************************************************************/
struct osmo_ss7_route {
struct llist_head list;
struct osmo_ss7_route_table *rtable;
struct {
struct osmo_ss7_linkset *linkset;
struct osmo_ss7_as *as;
} dest;
struct {
/* FIXME: presence? */
uint32_t pc;
uint32_t mask;
char *linkset_name;
uint32_t priority;
uint8_t qos_class;
} cfg;
};
struct osmo_ss7_route *
osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc);
struct osmo_ss7_route *
osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
uint32_t mask);
struct osmo_ss7_route *
osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc);
struct osmo_ss7_route *
osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
uint32_t mask, const char *linkset_name);
void osmo_ss7_route_destroy(struct osmo_ss7_route *rt);
const char *osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps);
/***********************************************************************
* SS7 Application Servers
***********************************************************************/
struct osmo_ss7_routing_key {
uint32_t context;
uint32_t l_rk_id;
uint32_t pc;
uint8_t si;
uint32_t ssn;
/* FIXME: more complex routing keys */
};
enum osmo_ss7_as_traffic_mode {
OSMO_SS7_AS_TMOD_OVERRIDE = 0, /* default */
OSMO_SS7_AS_TMOD_BCAST,
OSMO_SS7_AS_TMOD_LOADSHARE,
OSMO_SS7_AS_TMOD_ROUNDROBIN,
_NUM_OSMO_SS7_ASP_TMOD
};
extern struct value_string osmo_ss7_as_traffic_mode_vals[];
static inline const char *
osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
{
return get_value_string(osmo_ss7_as_traffic_mode_vals, mode);
}
enum osmo_ss7_asp_protocol {
OSMO_SS7_ASP_PROT_NONE,
OSMO_SS7_ASP_PROT_SUA,
OSMO_SS7_ASP_PROT_M3UA,
OSMO_SS7_ASP_PROT_IPA,
_NUM_OSMO_SS7_ASP_PROT
};
extern struct value_string osmo_ss7_asp_protocol_vals[];
static inline const char *
osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
{
return get_value_string(osmo_ss7_asp_protocol_vals, mode);
}
int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot);
struct osmo_ss7_as {
struct llist_head list;
struct osmo_ss7_instance *inst;
struct osmo_fsm_inst *fi;
bool rkm_dyn_allocated;
struct {
char *name;
char *description;
enum osmo_ss7_asp_protocol proto;
struct osmo_ss7_routing_key routing_key;
enum osmo_ss7_as_traffic_mode mode;
uint32_t recovery_timeout_msec;
uint8_t qos_class;
struct {
uint32_t dpc;
} pc_override;
struct osmo_ss7_asp *asps[16];
} cfg;
};
struct osmo_ss7_as *
osmo_ss7_as_find_by_name(struct osmo_ss7_instance *inst, const char *name);
struct osmo_ss7_as *
osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx);
struct osmo_ss7_as *
osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id);
struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst,
enum osmo_ss7_asp_protocol proto);
struct osmo_ss7_as *
osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name,
enum osmo_ss7_asp_protocol proto);
int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name);
int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name);
void osmo_ss7_as_destroy(struct osmo_ss7_as *as);
bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as,
struct osmo_ss7_asp *asp);
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp);
/***********************************************************************
* SS7 Application Server Processes
***********************************************************************/
struct osmo_ss7_asp_peer {
char *host;
uint16_t port;
};
enum osmo_ss7_asp_admin_state {
OSMO_SS7_ASP_ADM_S_SHUTDOWN,
OSMO_SS7_ASP_ADM_S_BLOCKED,
OSMO_SS7_ASP_ADM_S_ENABLED,
};
struct osmo_ss7_asp {
struct llist_head list;
struct osmo_ss7_instance *inst;
struct osmo_fsm_inst *fi;
struct osmo_xua_server *xua_server;
struct llist_head siblings;
struct osmo_stream_cli *client;
struct osmo_stream_srv *server;
char *sock_name;
/* ASP Identifier for ASP-UP + NTFY */
uint32_t asp_id;
bool asp_id_present;
/* Layer Manager to which we talk */
const struct osmo_xua_layer_manager *lm;
void *lm_priv;
bool dyn_allocated;
struct msgb *pending_msg;
struct {
char *name;
char *description;
enum osmo_ss7_asp_protocol proto;
enum osmo_ss7_asp_admin_state adm_state;
bool is_server;
struct osmo_ss7_asp_peer local;
struct osmo_ss7_asp_peer remote;
uint8_t qos_class;
} cfg;
};
struct osmo_ss7_asp *
osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name);
struct osmo_ss7_asp
*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as,
enum osmo_ss7_asp_protocol proto);
struct osmo_ss7_asp *
osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
uint16_t remote_port, uint16_t local_port,
enum osmo_ss7_asp_protocol proto);
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp);
int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg);
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);
int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);
typedef int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg);
void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb);
#define LOGPASP(asp, subsys, level, fmt, args ...) \
LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
/***********************************************************************
* xUA Servers
***********************************************************************/
struct osmo_xua_layer_manager {
osmo_prim_cb prim_cb;
};
struct osmo_xua_server {
struct llist_head list;
struct osmo_ss7_instance *inst;
/* list of ASPs established via this server */
struct llist_head asp_list;
struct osmo_stream_srv_link *server;
struct {
bool accept_dyn_reg;
struct osmo_ss7_asp_peer local;
enum osmo_ss7_asp_protocol proto;
} cfg;
};
struct osmo_xua_server *
osmo_ss7_xua_server_find(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto,
uint16_t local_port);
struct osmo_xua_server *
osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto,
uint16_t local_port, const char *local_host);
int
osmo_ss7_xua_server_bind(struct osmo_xua_server *xs);
int
osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host);
void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs);
struct osmo_sccp_instance *
osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
enum osmo_ss7_asp_protocol prot, int default_local_port,
const char *default_local_ip, int default_remote_port,
const char *default_remote_ip);
struct osmo_sccp_instance *
osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
uint32_t default_pc,
enum osmo_ss7_asp_protocol prot,
int default_local_port,
const char *default_local_ip,
int default_remote_port,
const char *default_remote_ip);
struct osmo_sccp_instance *
osmo_sccp_simple_server(void *ctx, uint32_t pc,
enum osmo_ss7_asp_protocol prot, int local_port,
const char *local_ip);
struct osmo_sccp_instance *
osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc,
enum osmo_ss7_asp_protocol prot,
int local_port, const char *local_ip);
struct osmo_sccp_instance *
osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst,
enum osmo_ss7_asp_protocol prot,
const char *name, uint32_t pc,
int local_port, int remote_port,
const char *remote_ip);
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in);
int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod);
/* VTY related */
struct vty;
void osmo_ss7_vty_init_asp(void *ctx);
void osmo_ss7_vty_init_sg(void *ctx);
int osmo_ss7_vty_go_parent(struct vty *vty);
int osmo_ss7_is_config_node(struct vty *vty, int node);
dpc
uint32_t dpc
Definition: m3ua.h:445
osmo_ss7_init
int osmo_ss7_init(void)
Definition: osmo_ss7.c:1876
osmo_ss7_asp::client
struct osmo_stream_cli * client
osmo_stream / libosmo-netif handles
Definition: osmo_ss7.h:365
osmo_ss7_linkset_destroy
void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset)
Destroy a SS7 Linkset.
Definition: osmo_ss7.c:547
osmo_ss7_instance::id
uint32_t id
Definition: osmo_ss7.h:92
osmo_xua_server::server
struct osmo_stream_srv_link * server
Definition: osmo_ss7.h:440
osmo_ss7_xua_server_find
struct osmo_xua_server * osmo_ss7_xua_server_find(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port)
Definition: osmo_ss7.c:1767
osmo_ss7_instance::primary_pc
uint32_t primary_pc
Definition: osmo_ss7.h:95
osmo_ss7_routing_key::si
uint8_t si
Definition: osmo_ss7.h:249
osmo_ss7_instance::network_indicator
uint8_t network_indicator
Definition: osmo_ss7.h:98
osmo_ss7_route::linkset_name
char * linkset_name
human-specified linkset name
Definition: osmo_ss7.h:219
osmo_ss7_instance_set_pc_fmt
int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2)
Set the point code format used in given SS7 instance.
Definition: osmo_ss7.c:410
osmo_ss7_route_table_destroy
void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
Definition: osmo_ss7.c:697
OSMO_SS7_LS_SHUTDOWN
Definition: osmo_ss7.h:146
osmo_ss7_mtp_to_user
int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7.c:516
osmo_ss7_route_find_dpc
struct osmo_ss7_route * osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc)
Find a SS7 route for given destination point code in given table.
Definition: osmo_ss7.c:711
osmo_ss7_linkset_find_by_name
struct osmo_ss7_linkset * osmo_ss7_linkset_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find SS7 Linkset by given name.
Definition: osmo_ss7.c:577
osmo_ss7_route_name
const char * osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps)
Return human readable representation of the route, in a static buffer.
Definition: osmo_ss7_hmrt.c:149
osmo_ss7_linkset::local_pc
uint32_t local_pc
Definition: osmo_ss7.h:186
osmo_ss7_as::description
char * description
Definition: osmo_ss7.h:301
osmo_sccp_simple_server
struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip)
Definition: sccp_user.c:580
osmo_ss7_asp::server
struct osmo_stream_srv * server
Definition: osmo_ss7.h:366
osmo_ss7_routing_key::context
uint32_t context
Definition: osmo_ss7.h:245
osmo_sccp_instance
Definition: sccp_internal.h:9
osmo_ss7_instance_find_or_create
struct osmo_ss7_instance * osmo_ss7_instance_find_or_create(void *ctx, uint32_t id)
Find or create a SS7 Instance.
Definition: osmo_ss7.c:346
osmo_ss7_pointcode_print2
const char * osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:282
osmo_ss7_as::rkm_dyn_allocated
bool rkm_dyn_allocated
Were we dynamically allocated by RKM?
Definition: osmo_ss7.h:297
osmo_ss7_user_unregister
int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
Unregister a MTP user for a given service indicator.
Definition: osmo_ss7.c:496
osmo_ss7_route
Definition: osmo_ss7.h:201
osmo_ss7_instance::permit_dyn_rkm_alloc
bool permit_dyn_rkm_alloc
Definition: osmo_ss7.h:100
osmo_ss7_user::priv
void * priv
Definition: osmo_ss7.h:126
osmo_xua_server
Definition: osmo_ss7.h:433
osmo_ss7_route_table::inst
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:45
osmo_ss7_asp_use_default_lm
int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level)
Definition: xua_default_lm_fsm.c:366
osmo_ss7_routing_key::l_rk_id
uint32_t l_rk_id
Definition: osmo_ss7.h:246
osmo_ss7_asp::fi
struct osmo_fsm_inst * fi
ASP FSM.
Definition: osmo_ss7.h:358
osmo_xua_server::accept_dyn_reg
bool accept_dyn_reg
Definition: osmo_ss7.h:443
osmo_ss7_asp_find_by_proto
struct osmo_ss7_asp * osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, enum osmo_ss7_asp_protocol proto)
Find an ASP that matches the given protocol.
Definition: osmo_ss7.c:1133
osmo_ss7_asp_destroy
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1179
osmo_ss7_as_traffic_mode_vals
struct value_string osmo_ss7_as_traffic_mode_vals[]
Definition: osmo_ss7.c:61
OSMO_SS7_ASP_PROT_IPA
Definition: osmo_ss7.h:274
osmo_ss7_asp::qos_class
uint8_t qos_class
Definition: osmo_ss7.h:393
osmo_ss7_asp_peer
Definition: osmo_ss7.h:338
osmo_ss7_asp::lm
const struct osmo_xua_layer_manager * lm
Definition: osmo_ss7.h:375
osmo_ss7_asp::asp_id
uint32_t asp_id
Definition: osmo_ss7.h:371
osmo_ss7_linkset::inst
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:178
osmo_ss7_route::priority
uint32_t priority
lower priority is higher
Definition: osmo_ss7.h:221
osmo_ss7_user
Definition: osmo_ss7.h:118
osmo_ss7_route_table
Definition: osmo_ss7.h:41
osmo_sccp_simple_server_add_clnt
struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, int local_port, int remote_port, const char *remote_ip)
Definition: sccp_user.c:589
osmo_ss7_routing_key
Definition: osmo_ss7.h:244
osmo_ss7_link_find_or_create
struct osmo_ss7_link * osmo_ss7_link_find_or_create(struct osmo_ss7_linkset *lset, uint32_t id)
Find or create SS7 Link with given ID in given Linkset.
Definition: osmo_ss7.c:638
osmo_ss7_link
Definition: osmo_ss7.h:155
osmo_ss7_routing_key::pc
uint32_t pc
Definition: osmo_ss7.h:248
osmo_ss7_asp_protocol_port
int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot)
Definition: osmo_ss7.c:313
osmo_ss7_tmode_from_xua
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in)
Definition: osmo_ss7.c:1903
osmo_ss7_asp_protocol_name
static const char * osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
Definition: osmo_ss7.h:281
OSMO_SS7_ASP_PROT_M3UA
Definition: osmo_ss7.h:273
osmo_ss7_instance::user
const struct osmo_ss7_user * user[16]
Definition: osmo_ss7.h:85
osmo_ss7_asp_restart
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1215
osmo_ss7_as_del_asp
int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name)
Delete given ASP from given AS.
Definition: osmo_ss7.c:987
osmo_ss7_instance::rtable_system
struct osmo_ss7_route_table * rtable_system
Definition: osmo_ss7.h:87
osmo_ss7_is_config_node
int osmo_ss7_is_config_node(struct vty *vty, int node)
Definition: osmo_ss7_vty.c:1710
osmo_ss7_link_adm_state
osmo_ss7_link_adm_state
Definition: osmo_ss7.h:145
osmo_xua_server::proto
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:445
osmo_ss7_tmode_to_xua
int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod)
Definition: osmo_ss7.c:1889
osmo_ss7_link_destroy
void osmo_ss7_link_destroy(struct osmo_ss7_link *link)
Destryo SS7 Link.
Definition: osmo_ss7.c:621
osmo_ss7_user::inst
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:120
osmo_ss7_asp::dyn_allocated
bool dyn_allocated
Were we dynamically allocated.
Definition: osmo_ss7.h:379
osmo_ss7_as_find_or_create
struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
Find or Create Application Server.
Definition: osmo_ss7.c:924
osmo_ss7_instance_find
struct osmo_ss7_instance * osmo_ss7_instance_find(uint32_t id)
Find a SS7 Instance with given ID.
Definition: osmo_ss7.c:329
osmo_xua_server::inst
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:435
osmo_ss7_instances
struct llist_head osmo_ss7_instances
_NUM_OSMO_SS7_ASP_PROT
Definition: osmo_ss7.h:275
osmo_ss7_as::dpc
uint32_t dpc
Definition: osmo_ss7.h:308
osmo_ss7_route::mask
uint32_t mask
Definition: osmo_ss7.h:217
osmo_ss7_route_table_find_or_create
struct osmo_ss7_route_table * osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:680
osmo_ss7_as_find_by_l_rk_id
struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id)
Find Application Server by given local routing key ID.
Definition: osmo_ss7.c:871
osmo_ss7_as_find_by_name
struct osmo_ss7_as * osmo_ss7_as_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find Application Server by given name.
Definition: osmo_ss7.c:837
osmo_ss7_xua_server_bind
int osmo_ss7_xua_server_bind(struct osmo_xua_server *xs)
Set the xUA server to bind/listen to the currently configured ip/port.
Definition: osmo_ss7.c:1831
osmo_ss7_as::proto
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:302
osmo_ss7_asp_protocol_vals
struct value_string osmo_ss7_asp_protocol_vals[]
Definition: osmo_ss7.c:69
osmo_ss7_register_rx_unknown_cb
void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb)
Register a call-back function for unknown SCTP PPID / IPA Stream ID.
Definition: osmo_ss7.c:1937
OSMO_SS7_ASP_PROT_SUA
Definition: osmo_ss7.h:272
osmo_ss7_asp::asp_id_present
bool asp_id_present
Definition: osmo_ss7.h:372
osmo_ss7_pc_is_valid
static bool osmo_ss7_pc_is_valid(uint32_t pc)
Definition: osmo_ss7.h:32
osmo_xua_layer_manager
Definition: osmo_ss7.h:429
osmo_ss7_xua_server_set_local_host
int osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: osmo_ss7.c:1840
osmo_ss7_link::linkset
struct osmo_ss7_linkset * linkset
osmo_ss7_linkset to which we belong
Definition: osmo_ss7.h:157
osmo_ss7_asp_disconnect
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1753
OSMO_SS7_AS_TMOD_BCAST
Definition: osmo_ss7.h:256
osmo_ss7_route_table::list
struct llist_head list
member in list of routing tables
Definition: osmo_ss7.h:43
OSMO_SS7_ASP_ADM_S_SHUTDOWN
no SCTP association with peer
Definition: osmo_ss7.h:345
osmo_ss7_vty_init_asp
void osmo_ss7_vty_init_asp(void *ctx)
Definition: osmo_ss7_vty.c:1808
osmo_ss7_asp_admin_state
osmo_ss7_asp_admin_state
Definition: osmo_ss7.h:343
_NUM_OSMO_SS7_ASP_TMOD
Definition: osmo_ss7.h:259
osmo_ss7_linkset::name
char * name
Definition: osmo_ss7.h:183
osmo_ss7_asp_rx_unknown_cb
int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.
Definition: osmo_ss7.h:418
osmo_ss7_route_destroy
void osmo_ss7_route_destroy(struct osmo_ss7_route *rt)
Destroy a given SS7 route.
Definition: osmo_ss7.c:821
osmo_xua_layer_manager::prim_cb
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:430
osmo_ss7_instance_destroy
void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst)
Destroy a SS7 Instance.
Definition: osmo_ss7.c:387
osmo_ss7_pointcode_print
const char * osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:274
osmo_ss7_instance::description
char * description
Definition: osmo_ss7.h:94
osmo_ss7_vty_init_sg
void osmo_ss7_vty_init_sg(void *ctx)
Definition: osmo_ss7_vty.c:1814
osmo_ss7_pc_fmt
Definition: osmo_ss7.h:65
osmo_sccp_simple_server_on_ss7_id
struct osmo_sccp_instance * osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip)
Definition: sccp_user.c:539
osmo_ss7_vty_go_parent
int osmo_ss7_vty_go_parent(struct vty *vty)
Definition: osmo_ss7_vty.c:1662
osmo_ss7_as_traffic_mode
osmo_ss7_as_traffic_mode
Definition: osmo_ss7.h:254
osmo_ss7_instance::name
char * name
Definition: osmo_ss7.h:93
osmo_ss7_route_lookup
struct osmo_ss7_route * osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc)
Find a SS7 route for given destination point code in given SS7.
Definition: osmo_ss7.c:746
osmo_ss7_find_free_rctx
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst)
Definition: osmo_ss7.c:92
osmo_ss7_linkset::description
char * description
Definition: osmo_ss7.h:184
osmo_ss7_link::id
uint32_t id
Definition: osmo_ss7.h:161
osmo_ss7_asp::inst
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:355
osmo_ss7_asp_protocol
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:270
osmo_ss7_asp_send
int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
send a fully encoded msgb via a given ASP
Definition: osmo_ss7.c:1715
osmo_ss7_user::name
const char * name
Definition: osmo_ss7.h:122
osmo_ss7_user_mtp_xfer_req
int osmo_ss7_user_mtp_xfer_req(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7_hmrt.c:284
OSMO_SS7_AS_TMOD_OVERRIDE
Definition: osmo_ss7.h:255
osmo_ss7_asp
Definition: osmo_ss7.h:352
osmo_ss7_asp_find_or_create
struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7.c:1147
osmo_ss7_as::inst
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:291
osmo_ss7_as::fi
struct osmo_fsm_inst * fi
AS FSM.
Definition: osmo_ss7.h:294
_NUM_OSMO_SS7_LS
Definition: osmo_ss7.h:149
osmo_ss7_routing_key::ssn
uint32_t ssn
Definition: osmo_ss7.h:250
osmo_ss7_xua_server_create
struct osmo_xua_server * osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port, const char *local_host)
create a new xUA server configured with given ip/port
Definition: osmo_ss7.c:1789
osmo_ss7_route_table::routes
struct llist_head routes
list of osmo_ss7_route
Definition: osmo_ss7.h:47
osmo_ss7_as_add_asp
int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name)
Add given ASP to given AS.
Definition: osmo_ss7.c:957
osmo_ss7_linkset::adjacent_pc
uint32_t adjacent_pc
Definition: osmo_ss7.h:185
OSMO_SS7_ASP_ADM_S_BLOCKED
SCP association, but reject ASP-ACTIVE.
Definition: osmo_ss7.h:347
osmo_ss7_asp_find_by_name
struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:1055
osmo_ss7_as_traffic_mode_name
static const char * osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
Definition: osmo_ss7.h:265
osmo_ss7_instance::sccp
struct osmo_sccp_instance * sccp
Definition: osmo_ss7.h:89
osmo_ss7_asp::sock_name
char * sock_name
pre-formatted human readable local/remote socket name
Definition: osmo_ss7.h:368
OSMO_SS7_ASP_ADM_S_ENABLED
in normal operation
Definition: osmo_ss7.h:349
OSMO_SS7_AS_TMOD_LOADSHARE
Definition: osmo_ss7.h:257
osmo_ss7_as_find_by_rctx
struct osmo_ss7_as * osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx)
Find Application Server by given routing context.
Definition: osmo_ss7.c:854
OSMO_SS7_AS_TMOD_ROUNDROBIN
Definition: osmo_ss7.h:258
osmo_sccp_simple_client_on_ss7_id
struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip)
request an sccp client instance
Definition: sccp_user.c:334
osmo_ss7_as_destroy
void osmo_ss7_as_destroy(struct osmo_ss7_as *as)
Destroy given Application Server.
Definition: osmo_ss7.c:1012
osmo_ss7_route_find_dpc_mask
struct osmo_ss7_route * osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask)
Find a SS7 route for given destination point code + mask in given table.
Definition: osmo_ss7.c:728
osmo_ss7_route::qos_class
uint8_t qos_class
Definition: osmo_ss7.h:222
osmo_ss7_linkset_find_or_create
struct osmo_ss7_linkset * osmo_ss7_linkset_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint32_t pc)
Find or allocate SS7 Linkset.
Definition: osmo_ss7.c:594
osmo_ss7_asp::pending_msg
struct msgb * pending_msg
Pending message for non-blocking IPA read.
Definition: osmo_ss7.h:382
osmo_ss7_asp::description
char * description
Definition: osmo_ss7.h:386
osmo_ss7_asp::xua_server
struct osmo_xua_server * xua_server
osmo_xua_server over which we were established
Definition: osmo_ss7.h:361
OSMO_SS7_LS_ENABLED
Definition: osmo_ss7.h:148
osmo_ss7_instance
Definition: osmo_ss7.h:70
OSMO_SS7_ASP_PROT_NONE
Definition: osmo_ss7.h:271
osmo_ss7_asp::is_server
bool is_server
Definition: osmo_ss7.h:389
osmo_ss7_as_find_by_proto
struct osmo_ss7_as * osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto)
Find Application Server (AS) by given protocol.
Definition: osmo_ss7.c:889
osmo_ss7_linkset
Definition: osmo_ss7.h:175
OSMO_SS7_LS_INHIBITED
Definition: osmo_ss7.h:147
osmo_ss7_pc_is_local
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:1867
osmo_ss7_asp::proto
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:387
osmo_ss7_instance_bind
int osmo_ss7_instance_bind(struct osmo_ss7_instance *inst)
bind all xUA servers belonging to an SS7 Instance
Definition: osmo_ss7.c:430
osmo_ss7_link::name
char * name
Definition: osmo_ss7.h:159
osmo_ss7_as::name
char * name
Definition: osmo_ss7.h:300
osmo_ss7_user::prim_cb
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:124
osmo_ss7_route::linkset
struct osmo_ss7_linkset * linkset
pointer to linkset (destination) of route
Definition: osmo_ss7.h:209
osmo_ss7_asp::lm_priv
void * lm_priv
Definition: osmo_ss7.h:376
osmo_ss7_asp_peer::host
char * host
Definition: osmo_ss7.h:339
osmo_ss7_bind_all_instances
int osmo_ss7_bind_all_instances()
bind all xUA servers on each of the stored SS7 instances
Definition: osmo_ss7.c:447
osmo_ss7_route::rtable
struct osmo_ss7_route_table * rtable
osmo_ss7_route_table to which we belong
Definition: osmo_ss7.h:205
osmo_ss7_pc_fmt::delimiter
char delimiter
Definition: osmo_ss7.h:66
osmo_ss7_route_table::cfg
struct osmo_ss7_route_table::@19 cfg
osmo_ss7_route::as
struct osmo_ss7_as * as
pointer to Application Server
Definition: osmo_ss7.h:211
osmo_ss7_link::description
char * description
Definition: osmo_ss7.h:160
osmo_ss7_pointcode_parse
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str)
Definition: osmo_ss7.c:216
osmo_ss7_as
Definition: osmo_ss7.h:288
osmo_ss7_pointcode_parse_mask_or_len
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in)
Definition: osmo_ss7.c:288
osmo_ss7_route::pc
uint32_t pc
Definition: osmo_ss7.h:216
osmo_ss7_asp_peer::port
uint16_t port
Definition: osmo_ss7.h:340
osmo_ss7_user_register
int osmo_ss7_user_register(struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
Register a MTP user for a given service indicator.
Definition: osmo_ss7.c:472
osmo_ss7_as_has_asp
bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Determine if given AS contains ASP.
Definition: osmo_ss7.c:1037
osmo_ss7_asp::name
char * name
Definition: osmo_ss7.h:385
osmo_ss7_route_create
struct osmo_ss7_route * osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, const char *linkset_name)
Create a new route in the given routing table.
Definition: osmo_ss7.c:782
osmo_mtp_prim
Definition: mtp_sap.h:56
osmo_ss7_route_table::description
char * description
Definition: osmo_ss7.h:51
osmo_ss7_xua_server_destroy
void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs)
Definition: osmo_ss7.c:1850
osmo_ss7_as::recovery_timeout_msec
uint32_t recovery_timeout_msec
Definition: osmo_ss7.h:305
osmo_ss7_as::qos_class
uint8_t qos_class
Definition: osmo_ss7.h:306
osmo_sccp_simple_client
struct osmo_sccp_instance * osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip)
request an sccp client instance
Definition: sccp_user.c:518
osmo_ss7_route_table::name
char * name
Definition: osmo_ss7.h:50
osmo_ss7_route_table_find
struct osmo_ss7_route_table * osmo_ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:668