libosmo-sigtran 2.1.0.194-89e3 Osmocom SIGTRAN library

Data Structures | Macros | Typedefs | Enumerations | Functions
ss7_as.h File Reference
`#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_internal.h"`
`#include "xua_msg.h"`

Go to the source code of this file.

## Data Structures
struct | osmo_ss7_as_esls_entry
struct | osmo_ss7_as

## Macros
#define | NUM_AS_EXT_SLS 128
#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...
unsigned int | osmo_ss7_as_count_asp (const struct osmo_ss7_as *as)
| Determine amount of ASPs associated to an AS. 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)
void | ss7_as_loadshare_binding_table_reset (struct osmo_ss7_as *as)

## 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

## 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

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7_as_count_asp | ( | const struct osmo_ss7_as * | as | ) |

Determine amount of ASPs associated to an AS.

Parameters

  [in] | as | Application Server.

Returns
  number of ASPs associated to as

References osmo_ss7_as::asps, and osmo_ss7_as::cfg.

Referenced by xua_rkm_cleanup_dyn_as_for_asp().

## ◆ 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 osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, osmo_ss7_asp::fi, LOGPAS, osmo_ss7_asp::name, osmo_ss7_as_has_asp(), 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::asps, 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::last_asp_idx_assigned, osmo_ss7_as::list, 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

References osmo_ss7_as::aesls_table, osmo_ss7_as_esls_entry::alt_asp, osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, LOGPAS, osmo_ss7_asp::name, osmo_ss7_as_esls_entry::normal_asp, and NULL.

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

## ◆ ss7_as_get_local_role()

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

References osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, and osmo_ss7_asp::role.

Referenced by 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, osmo_ss7_as::asps, osmo_ss7_as::cfg, and osmo_ss7_as::last_asp_idx_assigned.

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::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(), and ss7_as_select_asp_roundrobin().

Referenced by xua_as_transmit_msg().