Loading...
Searching...
No Matches
ss7_asp.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/tdef.h>
#include <osmocom/netif/stream.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include "ss7_asp_peer.h"
#include "ss7_internal.h"
/***********************************************************************
* SS7 Application Server Processes
***********************************************************************/
struct osmo_ss7_instance;
struct osmo_xua_layer_manager;
enum ss7_asp_ctr {
SS7_ASP_CTR_PKT_RX_TOTAL,
SS7_ASP_CTR_PKT_RX_UNKNOWN,
SS7_ASP_CTR_PKT_TX_TOTAL,
};
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;
bool simple_client_allocated;
struct rate_ctr_group *ctrg;
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;
enum osmo_ss7_asp_role role;
bool role_set_by_vty;
bool trans_role_set_by_vty;
struct osmo_ss7_asp_peer local;
struct osmo_ss7_asp_peer remote;
uint8_t qos_class;
uint32_t quirks;
/* T_defs used by the default_lm: */
struct osmo_tdef *T_defs_lm;
struct {
bool num_ostreams_present;
bool max_instreams_present;
bool max_attempts_present;
bool max_init_timeo_present;
uint16_t num_ostreams_value;
uint16_t max_instreams_value;
uint16_t max_attempts_value;
uint16_t max_init_timeo_value; /* ms */
} sctp_init;
int trans_proto;
} cfg;
};
struct osmo_ss7_asp *ss7_asp_alloc(struct osmo_ss7_instance *inst, const char *name,
uint16_t remote_port, uint16_t local_port,
int trans_proto, enum osmo_ss7_asp_protocol proto);
bool ss7_asp_set_default_peer_hosts(struct osmo_ss7_asp *asp);
bool ss7_asp_is_started(const struct osmo_ss7_asp *asp);
int ss7_asp_get_fd(const struct osmo_ss7_asp *asp);
int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp);
int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp);
int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx);
int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx);
#define LOGPASP(asp, subsys, level, fmt, args ...) \
_LOGSS7((asp)->inst, subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
osmo_ss7.h
osmo_ss7_asp_protocol
osmo_ss7_asp_protocol
Definition osmo_ss7.h:153
osmo_ss7_asp_role
osmo_ss7_asp_role
Definition osmo_ss7.h:238
osmo_ss7_asp_admin_state
osmo_ss7_asp_admin_state
Definition osmo_ss7.h:229
ss7_asp_is_started
bool ss7_asp_is_started(const struct osmo_ss7_asp *asp)
Definition osmo_ss7_asp.c:730
ss7_asp_apply_primary_address
int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp)
Definition osmo_ss7_asp.c:286
ss7_asp_ctr
ss7_asp_ctr
Definition ss7_asp.h:22
SS7_ASP_CTR_PKT_TX_TOTAL
@ SS7_ASP_CTR_PKT_TX_TOTAL
Definition ss7_asp.h:25
SS7_ASP_CTR_PKT_RX_UNKNOWN
@ SS7_ASP_CTR_PKT_RX_UNKNOWN
Definition ss7_asp.h:24
SS7_ASP_CTR_PKT_RX_TOTAL
@ SS7_ASP_CTR_PKT_RX_TOTAL
Definition ss7_asp.h:23
ss7_asp_apply_peer_primary_address
int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp)
Definition osmo_ss7_asp.c:244
ss7_asp_get_fd
int ss7_asp_get_fd(const struct osmo_ss7_asp *asp)
Get the fd of a given ASP.
Definition osmo_ss7_asp.c:1239
ss7_asp_apply_new_local_address
int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx)
Definition osmo_ss7_asp.c:200
ss7_asp_apply_drop_local_address
int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx)
Definition osmo_ss7_asp.c:222
ss7_asp_alloc
struct osmo_ss7_asp * ss7_asp_alloc(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, int trans_proto, enum osmo_ss7_asp_protocol proto)
Definition osmo_ss7_asp.c:535
ss7_asp_set_default_peer_hosts
bool ss7_asp_set_default_peer_hosts(struct osmo_ss7_asp *asp)
Definition osmo_ss7_asp.c:397
ss7_asp_peer.h
ss7_internal.h
osmo_ss7_asp_peer
Definition ss7_asp_peer.h:11
osmo_ss7_asp
Definition ss7_asp.h:28
osmo_ss7_asp::role
enum osmo_ss7_asp_role role
Definition ss7_asp.h:72
osmo_ss7_asp::sock_name
char * sock_name
pre-formatted human readable local/remote socket name
Definition ss7_asp.h:44
osmo_ss7_asp::role_set_by_vty
bool role_set_by_vty
Definition ss7_asp.h:73
osmo_ss7_asp::remote
struct osmo_ss7_asp_peer remote
Definition ss7_asp.h:77
osmo_ss7_asp::cfg
struct osmo_ss7_asp::@310311263032360247272375325147260070002212162311 cfg
osmo_ss7_asp::max_attempts_present
bool max_attempts_present
Definition ss7_asp.h:87
osmo_ss7_asp::max_instreams_present
bool max_instreams_present
Definition ss7_asp.h:86
osmo_ss7_asp::T_defs_lm
struct osmo_tdef * T_defs_lm
Definition ss7_asp.h:82
osmo_ss7_asp::fi
struct osmo_fsm_inst * fi
ASP FSM.
Definition ss7_asp.h:34
osmo_ss7_asp::max_attempts_value
uint16_t max_attempts_value
Definition ss7_asp.h:91
osmo_ss7_asp::max_instreams_value
uint16_t max_instreams_value
Definition ss7_asp.h:90
osmo_ss7_asp::list
struct llist_head list
entry in osmo_ss7_instance::asp_list
Definition ss7_asp.h:30
osmo_ss7_asp::proto
enum osmo_ss7_asp_protocol proto
Definition ss7_asp.h:69
osmo_ss7_asp::lm_priv
void * lm_priv
Definition ss7_asp.h:52
osmo_ss7_asp::inst
struct osmo_ss7_instance * inst
Definition ss7_asp.h:31
osmo_ss7_asp::lm
const struct osmo_xua_layer_manager * lm
Definition ss7_asp.h:51
osmo_ss7_asp::num_ostreams_present
bool num_ostreams_present
Definition ss7_asp.h:85
osmo_ss7_asp::server
struct osmo_stream_srv * server
Definition ss7_asp.h:42
osmo_ss7_asp::quirks
uint32_t quirks
Definition ss7_asp.h:79
osmo_ss7_asp::simple_client_allocated
bool simple_client_allocated
Were we allocated by "simple client" support?
Definition ss7_asp.h:58
osmo_ss7_asp::client
struct osmo_stream_cli * client
osmo_stream / libosmo-netif handles
Definition ss7_asp.h:41
osmo_ss7_asp::trans_role_set_by_vty
bool trans_role_set_by_vty
Definition ss7_asp.h:74
osmo_ss7_asp::adm_state
enum osmo_ss7_asp_admin_state adm_state
Definition ss7_asp.h:70
osmo_ss7_asp::xua_server
struct osmo_xua_server * xua_server
osmo_xua_server over which we were established
Definition ss7_asp.h:37
osmo_ss7_asp::local
struct osmo_ss7_asp_peer local
Definition ss7_asp.h:76
osmo_ss7_asp::is_server
bool is_server
Definition ss7_asp.h:71
osmo_ss7_asp::dyn_allocated
bool dyn_allocated
Were we dynamically allocated.
Definition ss7_asp.h:55
osmo_ss7_asp::max_init_timeo_present
bool max_init_timeo_present
Definition ss7_asp.h:88
osmo_ss7_asp::name
char * name
Definition ss7_asp.h:67
osmo_ss7_asp::qos_class
uint8_t qos_class
Definition ss7_asp.h:78
osmo_ss7_asp::pending_msg
struct msgb * pending_msg
Pending message for non-blocking IPA read.
Definition ss7_asp.h:64
osmo_ss7_asp::asp_id
uint32_t asp_id
Definition ss7_asp.h:47
osmo_ss7_asp::num_ostreams_value
uint16_t num_ostreams_value
Definition ss7_asp.h:89
osmo_ss7_asp::trans_proto
int trans_proto
The underlaying transport protocol (one of IPPROTO_*).
Definition ss7_asp.h:96
osmo_ss7_asp::description
char * description
Definition ss7_asp.h:68
osmo_ss7_asp::asp_id_present
bool asp_id_present
Definition ss7_asp.h:48
osmo_ss7_asp::ctrg
struct rate_ctr_group * ctrg
Rate Counter Group.
Definition ss7_asp.h:61
osmo_ss7_asp::siblings
struct llist_head siblings
Definition ss7_asp.h:38
osmo_ss7_asp::max_init_timeo_value
uint16_t max_init_timeo_value
Definition ss7_asp.h:92
osmo_ss7_instance
Definition ss7_instance.h:20
osmo_xua_layer_manager
Definition ss7_xua_srv.h:18
osmo_xua_server
Definition ss7_xua_srv.h:22