libosmo-sigtran: src/ss7_as.h File Reference

libosmo-sigtran 2.2.1.99-1c6a Osmocom SIGTRAN library

Data Structures | Macros | Typedefs | Enumerations | Functions
ss7_as.h File Reference
`#include "config.h"`
`#include <stdint.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/fsm.h>`
`#include <osmocom/core/hashtable.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/core/tdef.h>`
`#include <osmocom/netif/stream.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include "ss7_internal.h"`
`#include "xua_msg.h"`

Go to the source code of this file.

## Data Structures
struct | osmo_ss7_as_esls_entry
struct | ss7_as_asp_assoc
struct | osmo_ss7_as

## Macros
#define | NUM_AS_EXT_SLS 128
#define | ss7_as_asp_assoc_llist_round_robin(as, state) ss7_llist_round_robin(&(as)->assoc_asp_list, (void **)state, struct ss7_as_asp_assoc, as_entry)
#define | LOGPAS(as, subsys, level, fmt, args ...) _LOGSS7((as)->inst, subsys, level, "AS(%s) " fmt, (as)->cfg.name, ## args)

## Typedefs
typedef uint8_t | as_ext_sls_t

## Enumerations
enum | osmo_ss7_as_patch_sccp_mode { OSMO_SS7_PATCH_NONE , OSMO_SS7_PATCH_BOTH }
enum | ss7_as_ctr { SS7_AS_CTR_RX_MSU_DISCARD , SS7_AS_CTR_RX_MSU_TOTAL , SS7_AS_CTR_RX_MSU_SLS_0 , SS7_AS_CTR_RX_MSU_SLS_1 , SS7_AS_CTR_RX_MSU_SLS_2 , SS7_AS_CTR_RX_MSU_SLS_3 , SS7_AS_CTR_RX_MSU_SLS_4 , SS7_AS_CTR_RX_MSU_SLS_5 , SS7_AS_CTR_RX_MSU_SLS_6 , SS7_AS_CTR_RX_MSU_SLS_7 , SS7_AS_CTR_RX_MSU_SLS_8 , SS7_AS_CTR_RX_MSU_SLS_9 , SS7_AS_CTR_RX_MSU_SLS_10 , SS7_AS_CTR_RX_MSU_SLS_11 , SS7_AS_CTR_RX_MSU_SLS_12 , SS7_AS_CTR_RX_MSU_SLS_13 , SS7_AS_CTR_RX_MSU_SLS_14 , SS7_AS_CTR_RX_MSU_SLS_15 , SS7_AS_CTR_TX_MSU_TOTAL , SS7_AS_CTR_TX_MSU_SLS_0 , SS7_AS_CTR_TX_MSU_SLS_1 , SS7_AS_CTR_TX_MSU_SLS_2 , SS7_AS_CTR_TX_MSU_SLS_3 , SS7_AS_CTR_TX_MSU_SLS_4 , SS7_AS_CTR_TX_MSU_SLS_5 , SS7_AS_CTR_TX_MSU_SLS_6 , SS7_AS_CTR_TX_MSU_SLS_7 , SS7_AS_CTR_TX_MSU_SLS_8 , SS7_AS_CTR_TX_MSU_SLS_9 , SS7_AS_CTR_TX_MSU_SLS_10 , SS7_AS_CTR_TX_MSU_SLS_11 , SS7_AS_CTR_TX_MSU_SLS_12 , SS7_AS_CTR_TX_MSU_SLS_13 , SS7_AS_CTR_TX_MSU_SLS_14 , SS7_AS_CTR_TX_MSU_SLS_15 }

## Functions
struct osmo_ss7_as * | ss7_as_alloc (struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
| Allocate an Application Server. More...
struct osmo_ss7_asp * | ss7_as_select_asp (struct osmo_ss7_as *as, const struct xua_msg *xua)
| Select an AS to transmit a message, according to AS configuration and ASP availability. More...
int | ss7_as_add_asp (struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
| Add given ASP to given AS. More...
int | ss7_as_del_asp (struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
| Delete given ASP from given AS. More...
int | ss7_as_get_local_role (const struct osmo_ss7_as *as)
struct osmo_ss7_asp * | ss7_as_find_asp_by_remote_asp_id (const struct osmo_ss7_as *as, uint32_t asp_id, const struct osmo_ss7_asp *excl_asp)
| Find ASP with a given announced remote ASP Id. More...
void | ss7_as_loadshare_binding_table_reset (struct osmo_ss7_as *as)
void | ss7_as_del_asp_update_llist_round_robin (struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, struct ss7_as_asp_assoc **state)

## Macro Definition Documentation

## ◆ LOGPAS

#define LOGPAS | ( |  | as,
|  |  | subsys,
|  |  | level,
|  |  | fmt,
|  |  | args ...
| ) |  | _LOGSS7((as)->inst, subsys, level, "AS(%s) " fmt, (as)->cfg.name, ## args)

## ◆ NUM_AS_EXT_SLS

#define NUM_AS_EXT_SLS 128

## ◆ ss7_as_asp_assoc_llist_round_robin

#define ss7_as_asp_assoc_llist_round_robin | ( |  | as,
|  |  | state
| ) |  | ss7_llist_round_robin(&(as)->assoc_asp_list, (void **)state, struct ss7_as_asp_assoc, as_entry)

## Typedef Documentation

## ◆ as_ext_sls_t

typedef uint8_t as_ext_sls_t

## Enumeration Type Documentation

## ◆ osmo_ss7_as_patch_sccp_mode

enum osmo_ss7_as_patch_sccp_mode

Enumerator
OSMO_SS7_PATCH_NONE |
OSMO_SS7_PATCH_BOTH |

## ◆ ss7_as_ctr

enum ss7_as_ctr

Enumerator
SS7_AS_CTR_RX_MSU_DISCARD |
SS7_AS_CTR_RX_MSU_TOTAL |
SS7_AS_CTR_RX_MSU_SLS_0 |
SS7_AS_CTR_RX_MSU_SLS_1 |
SS7_AS_CTR_RX_MSU_SLS_2 |
SS7_AS_CTR_RX_MSU_SLS_3 |
SS7_AS_CTR_RX_MSU_SLS_4 |
SS7_AS_CTR_RX_MSU_SLS_5 |
SS7_AS_CTR_RX_MSU_SLS_6 |
SS7_AS_CTR_RX_MSU_SLS_7 |
SS7_AS_CTR_RX_MSU_SLS_8 |
SS7_AS_CTR_RX_MSU_SLS_9 |
SS7_AS_CTR_RX_MSU_SLS_10 |
SS7_AS_CTR_RX_MSU_SLS_11 |
SS7_AS_CTR_RX_MSU_SLS_12 |
SS7_AS_CTR_RX_MSU_SLS_13 |
SS7_AS_CTR_RX_MSU_SLS_14 |
SS7_AS_CTR_RX_MSU_SLS_15 |
SS7_AS_CTR_TX_MSU_TOTAL |
SS7_AS_CTR_TX_MSU_SLS_0 |
SS7_AS_CTR_TX_MSU_SLS_1 |
SS7_AS_CTR_TX_MSU_SLS_2 |
SS7_AS_CTR_TX_MSU_SLS_3 |
SS7_AS_CTR_TX_MSU_SLS_4 |
SS7_AS_CTR_TX_MSU_SLS_5 |
SS7_AS_CTR_TX_MSU_SLS_6 |
SS7_AS_CTR_TX_MSU_SLS_7 |
SS7_AS_CTR_TX_MSU_SLS_8 |
SS7_AS_CTR_TX_MSU_SLS_9 |
SS7_AS_CTR_TX_MSU_SLS_10 |
SS7_AS_CTR_TX_MSU_SLS_11 |
SS7_AS_CTR_TX_MSU_SLS_12 |
SS7_AS_CTR_TX_MSU_SLS_13 |
SS7_AS_CTR_TX_MSU_SLS_14 |
SS7_AS_CTR_TX_MSU_SLS_15 |

## Function Documentation

## ◆ ss7_as_add_asp()

int ss7_as_add_asp | ( | struct osmo_ss7_as * | as,
|  | struct osmo_ss7_asp * | asp
| ) |  |

Add given ASP to given AS.

Parameters

  [in] | as | Application Server to which asp is added
  [in] | asp | Application Server Process to be added to as

Returns
  0 on success; negative in case of error

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, osmo_ss7_asp::cfg, osmo_ss7_asp::fi, LOGPAS, osmo_ss7_asp::name, osmo_ss7_as_has_asp(), ss7_as_asp_assoc_alloc(), and XUA_ASP_E_AS_ASSIGNED.

Referenced by handle_rkey_reg(), ipa_asp_fsm_wait_id_resp(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), and osmo_ss7_as_add_asp().

## ◆ ss7_as_alloc()

struct osmo_ss7_as * ss7_as_alloc | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | enum osmo_ss7_asp_protocol | proto
| ) |  |

Allocate an Application Server.

Parameters

  [in] | inst | SS7 Instance on which we operate
  [in] | name | Name of Application Server
  [in] | proto | Protocol of Application Server

Returns
  pointer to Application Server on success; NULL otherwise

References osmo_ss7_instance::as_list, osmo_ss7_as::assoc_asp_list, osmo_ss7_as::cfg, osmo_ss7_as::ctrg, osmo_ss7_as::fi, g_ss7_as_rcg_idx, osmo_ss7_as::inst, osmo_ss7_routing_key::l_rk_id, osmo_ss7_as::list, osmo_ss7_as::loadshare, osmo_ss7_as::mode, osmo_ss7_as::name, NULL, OSMO_SS7_AS_TMOD_OVERRIDE, osmo_ss7_as::proto, osmo_ss7_as::recovery_timeout_msec, osmo_ss7_as::routing_key, ss7_as_rcgd, ss7_find_free_l_rk_id(), and xua_as_fsm_start().

Referenced by osmo_ss7_as_find_or_create().

## ◆ ss7_as_del_asp()

int ss7_as_del_asp | ( | struct osmo_ss7_as * | as,
|  | struct osmo_ss7_asp * | asp
| ) |  |

Delete given ASP from given AS.

Parameters

  [in] | as | Application Server from which asp is deleted
  [in] | asp | Application Server Process to delete from as

Returns
  0 on success; negative in case of error

as may be freed during the function call.

References osmo_ss7_as::aesls_table, osmo_ss7_as_esls_entry::alt_asp, ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, osmo_ss7_as::assoc_asp_list, osmo_ss7_asp::cfg, osmo_ss7_as::last_asp_idx_assigned, osmo_ss7_as::last_asp_idx_sent, LOGPAS, osmo_ss7_asp::name, osmo_ss7_as_esls_entry::normal_asp, NULL, osmo_ss7_as_destroy(), osmo_ss7_as::rkm_dyn_allocated, ss7_as_asp_assoc_find(), ss7_as_asp_assoc_free(), ss7_as_del_asp_update_llist_round_robin(), and tcap_as_del_asp().

Referenced by common_asp_fsm_down_onenter(), handle_rkey_dereg(), osmo_ss7_as_del_asp(), and osmo_ss7_asp_destroy().

## ◆ ss7_as_del_asp_update_llist_round_robin()

void ss7_as_del_asp_update_llist_round_robin | ( | struct osmo_ss7_as * | as,
|  | struct osmo_ss7_asp * | asp,
|  | struct ss7_as_asp_assoc ** | state
| ) |  |

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, NULL, and ss7_as_asp_assoc_llist_round_robin.

Referenced by ss7_as_del_asp(), and tcap_as_del_asp().

## ◆ ss7_as_find_asp_by_remote_asp_id()

struct osmo_ss7_asp * ss7_as_find_asp_by_remote_asp_id | ( | const struct osmo_ss7_as * | as,
|  | uint32_t | asp_id,
|  | const struct osmo_ss7_asp * | excl_asp
| ) |  |

Find ASP with a given announced remote ASP Id.

Parameters

  [in] | as | Application Server in which to look for asp
  [in] | asp_id | M3UA/SUA ASP Identifier
  [in] | excl_asp | If not NULL, skip this asp from the candidates.

Returns
  the asp object if found, NULL otherwise

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::as_entry, ss7_as_asp_assoc::asp, osmo_ss7_as::assoc_asp_list, NULL, osmo_ss7_asp::remote_asp_id, and osmo_ss7_asp::remote_asp_id_present.

Referenced by ss7_asp_check_remote_asp_id_unique().

## ◆ ss7_as_get_local_role()

int ss7_as_get_local_role | ( | const struct osmo_ss7_as * | as | ) |

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::as_entry, ss7_as_asp_assoc::asp, osmo_ss7_as::assoc_asp_list, osmo_ss7_asp::cfg, and osmo_ss7_asp::role.

Referenced by ss7_route_update_route_status(), ss7_vty_node_as_go_parent(), and xua_as_fsm_onenter().

## ◆ ss7_as_loadshare_binding_table_reset()

void ss7_as_loadshare_binding_table_reset | ( | struct osmo_ss7_as * | as | ) |

References osmo_ss7_as::aesls_table, ss7_as_asp_assoc::as, osmo_ss7_as::last_asp_idx_assigned, and NULL.

Referenced by DEFUN_ATTR().

## ◆ ss7_as_select_asp()

struct osmo_ss7_asp * ss7_as_select_asp | ( | struct osmo_ss7_as * | as,
|  | const struct xua_msg * | xua
| ) |  |

Select an AS to transmit a message, according to AS configuration and ASP availability.

Parameters

  [in] | as | Application Server.

Returns
  asp to send the message to, NULL if no possible asp found

This function returns NULL too if multiple ASPs would be selected, ie. AS is configured in broadcast mode and more than one ASP is configured.

References _NUM_OSMO_SS7_ASP_TMOD, osmo_ss7_as::cfg, osmo_ss7_as::fi, osmo_ss7_as::loadshare, osmo_ss7_as::mode, xua_msg::mtp, NULL, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, OSMO_SS7_AS_TMOD_OVERRIDE, OSMO_SS7_AS_TMOD_ROUNDROBIN, ss7_as_select_asp_broadcast(), ss7_as_select_asp_loadshare(), ss7_as_select_asp_override(), ss7_as_select_asp_roundrobin(), and tcap_as_select_asp_loadshare().

Referenced by xua_as_transmit_msg().