libosmo-sigtran 2.2.1.56-7580 Osmocom SIGTRAN library

Functions | Variables
mtp_sap.c File Reference
`#include <errno.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/core/talloc.h>`
`#include <osmocom/core/prim.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include <osmocom/sigtran/mtp_sap.h>`
`#include "mtp3_hmrt.h"`
`#include "ss7_user.h"`
`#include "ss7_internal.h"`
`#include "xua_internal.h"`

## Functions
static int | mtp_prim_hdr_name_buf (char *buf, size_t buflen, const struct osmo_prim_hdr *oph)
char * | osmo_mtp_prim_name (const struct osmo_prim_hdr *oph)
static struct msgb * | mtp_prim_msgb_alloc (void)
static struct osmo_mtp_prim * | mtp_prim_resume_ind_alloc (uint32_t pc)
static struct osmo_mtp_prim * | mtp_prim_pause_ind_alloc (uint32_t pc)
struct osmo_mtp_prim * | mtp_prim_status_ind_alloc (uint32_t dpc, enum mtp_unavail_cause cause, bool cong_level_present, uint8_t cong_level)
struct osmo_mtp_prim * | mtp_prim_xfer_ind_alloc (const struct osmo_mtp_transfer_param *param, const uint8_t *user_data, size_t user_data_len)
struct osmo_mtp_prim * | osmo_mtp_prim_xfer_req_prepend (const struct osmo_mtp_transfer_param *param, struct msgb *msg)
| Wrap MTP payload into an MTP-TRANSFER.req primitive. More...
void | mtp_resume_ind_up_to_all_users (struct osmo_ss7_instance *s7i, uint32_t pc)
void | mtp_pause_ind_up_to_all_users (struct osmo_ss7_instance *s7i, uint32_t pc)
void | mtp_status_ind_up_to_all_users (struct osmo_ss7_instance *s7i, uint32_t dpc, enum mtp_unavail_cause cause, bool cong_level_present, uint8_t cong_level)
int | ss7_user_mtp_sap_prim_up (const struct osmo_ss7_user *osu, struct osmo_mtp_prim *omp)
| Send a MTP SAP Primitive up to the MTP User. More...
int | osmo_ss7_user_mtp_sap_prim_down (struct osmo_ss7_user *osu, struct osmo_mtp_prim *omp)

## Variables
const struct value_string | osmo_mtp_prim_type_names []
static char | prim_name_buf [128]

## Function Documentation

## ◆ mtp_pause_ind_up_to_all_users()

void mtp_pause_ind_up_to_all_users | ( | struct osmo_ss7_instance * | s7i,
|  | uint32_t | pc
| ) |  |

References mtp_prim_pause_ind_alloc(), pc, ss7_user_mtp_sap_prim_up(), and osmo_ss7_instance::user.

Referenced by xua_snm_pc_available_to_mtp_users().

## ◆ mtp_prim_hdr_name_buf()

static int mtp_prim_hdr_name_buf | ( | char * | buf,
|  | size_t | buflen,
|  | const struct osmo_prim_hdr * | oph
| ) |  |
| static

References osmo_mtp_prim_type_name().

Referenced by osmo_mtp_prim_name().

## ◆ mtp_prim_msgb_alloc()

static struct msgb * mtp_prim_msgb_alloc | ( | void |  | ) |
| static

References m3ua_msgb_alloc().

Referenced by mtp_prim_pause_ind_alloc(), mtp_prim_resume_ind_alloc(), and mtp_prim_status_ind_alloc().

## ◆ mtp_prim_pause_ind_alloc()

static struct osmo_mtp_prim * mtp_prim_pause_ind_alloc | ( | uint32_t | pc | ) |
| static

References osmo_mtp_pause_param::affected_dpc, mtp_prim_msgb_alloc(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_PAUSE, osmo_mtp_prim::pause, pc, and osmo_mtp_prim::u.

Referenced by mtp_pause_ind_up_to_all_users().

## ◆ mtp_prim_resume_ind_alloc()

static struct osmo_mtp_prim * mtp_prim_resume_ind_alloc | ( | uint32_t | pc | ) |
| static

References osmo_mtp_resume_param::affected_dpc, mtp_prim_msgb_alloc(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_RESUME, pc, osmo_mtp_prim::resume, and osmo_mtp_prim::u.

Referenced by mtp_resume_ind_up_to_all_users().

## ◆ mtp_prim_status_ind_alloc()

struct osmo_mtp_prim * mtp_prim_status_ind_alloc | ( | uint32_t | dpc,
|  | enum mtp_unavail_cause | cause,
|  | bool | cong_level_present,
|  | uint8_t | cong_level
| ) |  |

References osmo_mtp_status_param::affected_dpc, osmo_mtp_status_param::cause, osmo_mtp_status_param::congestion_level, osmo_mtp_status_param::congestion_level_present, dpc, mtp_prim_msgb_alloc(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_STATUS, osmo_mtp_prim::status, and osmo_mtp_prim::u.

Referenced by mtp_status_ind_up_to_all_users(), and xua_snm_upu().

## ◆ mtp_prim_xfer_ind_alloc()

struct osmo_mtp_prim * mtp_prim_xfer_ind_alloc | ( | const struct osmo_mtp_transfer_param * | param,
|  | const uint8_t * | user_data,
|  | size_t | user_data_len
| ) |  |

References m3ua_msgb_alloc(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_mtp_prim::transfer, and osmo_mtp_prim::u.

Referenced by m3ua_to_xfer_ind().

## ◆ mtp_resume_ind_up_to_all_users()

void mtp_resume_ind_up_to_all_users | ( | struct osmo_ss7_instance * | s7i,
|  | uint32_t | pc
| ) |  |

References mtp_prim_resume_ind_alloc(), pc, ss7_user_mtp_sap_prim_up(), and osmo_ss7_instance::user.

Referenced by xua_snm_pc_available_to_mtp_users().

## ◆ mtp_status_ind_up_to_all_users()

void mtp_status_ind_up_to_all_users | ( | struct osmo_ss7_instance * | s7i,
|  | uint32_t | dpc,
|  | enum mtp_unavail_cause | cause,
|  | bool | cong_level_present,
|  | uint8_t | cong_level
| ) |  |

References dpc, mtp_prim_status_ind_alloc(), ss7_user_mtp_sap_prim_up(), and osmo_ss7_instance::user.

Referenced by xua_snm_scon_to_mtp_users().

## ◆ osmo_mtp_prim_name()

char * osmo_mtp_prim_name | ( | const struct osmo_prim_hdr * | oph | ) |

References mtp_prim_hdr_name_buf(), and prim_name_buf.

Referenced by ss7_user_mtp_sap_prim_up().

## ◆ osmo_mtp_prim_xfer_req_prepend()

struct osmo_mtp_prim * osmo_mtp_prim_xfer_req_prepend | ( | const struct osmo_mtp_transfer_param * | param,
|  | struct msgb * | msg
| ) |  |

Wrap MTP payload into an MTP-TRANSFER.req primitive.

Parameters

  [in] | param | MTP-TRANSFER.req params to copy to the primitive (Optional, can be NULL)
  [in] | msg | msgb containing MTP payload and where primitive will be prepended

Returns
  return MTP-TRANSFER.req prepended to msgb

References MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_mtp_prim::transfer, and osmo_mtp_prim::u.

Referenced by sua2sccp_tx_m3ua().

## ◆ osmo_ss7_user_mtp_sap_prim_down()

int osmo_ss7_user_mtp_sap_prim_down | ( | struct osmo_ss7_user * | osu,
|  | struct osmo_mtp_prim * | omp
| ) |  |

References osmo_ss7_user::inst, LOGPSS7U, mtp3_hmrt_mtp_xfer_request_l4_to_l3(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_mtp_prim::transfer, and osmo_mtp_prim::u.

Referenced by sua2sccp_tx_m3ua().

## ◆ ss7_user_mtp_sap_prim_up()

int ss7_user_mtp_sap_prim_up | ( | const struct osmo_ss7_user * | osu,
|  | struct osmo_mtp_prim * | omp
| ) |  |

Send a MTP SAP Primitive up to the MTP User.

Parameters

  [in] | osu | MTP User to whom to send the primitive
  [in] | prim | Primitive to send to the user

Returns
  return value of the MTP User's prim_cb() function

Ownership of prim->oph->msg is passed to the user of the registered callback

References LOGPSS7U, osmo_mtp_prim::oph, osmo_mtp_prim_name(), osmo_ss7_user::prim_cb, and osmo_ss7_user::priv.

Referenced by deliver_to_mtp_user(), mtp_pause_ind_up_to_all_users(), mtp_resume_ind_up_to_all_users(), mtp_status_ind_up_to_all_users(), and xua_snm_upu().

## Variable Documentation

## ◆ osmo_mtp_prim_type_names

const struct value_string osmo_mtp_prim_type_names[]

Initial value:
= {
{ OSMO_MTP_PRIM_TRANSFER, "MTP-TRANSFER" },
{ OSMO_MTP_PRIM_PAUSE, "MTP-PAUSE" },
{ OSMO_MTP_PRIM_RESUME, "MTP-RESUME" },
{ OSMO_MTP_PRIM_STATUS, "MTP-STATUS" },
{ 0, NULL }
}
OSMO_MTP_PRIM_RESUME
@ OSMO_MTP_PRIM_RESUME
Definition: mtp_sap.h:30
OSMO_MTP_PRIM_TRANSFER
@ OSMO_MTP_PRIM_TRANSFER
Definition: mtp_sap.h:28
OSMO_MTP_PRIM_PAUSE
@ OSMO_MTP_PRIM_PAUSE
Definition: mtp_sap.h:29
OSMO_MTP_PRIM_STATUS
@ OSMO_MTP_PRIM_STATUS
Definition: mtp_sap.h:31
NULL
int and can be left NULL
Definition: osmo_ss7.h:363

Referenced by osmo_mtp_prim_type_name().

## ◆ prim_name_buf

char prim_name_buf[128]
| static

Referenced by osmo_mtp_prim_name().