Loading...
Searching...
No Matches
osmo_ss7_hmrt.c File Reference
`#include <stdbool.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <arpa/inet.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/sigtran/mtp_sap.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include <osmocom/sigtran/protocol/m3ua.h>`
`#include "xua_internal.h"`
`#include "ss7_internal.h"`

## Macros

#define | APPEND(fmt, args ...)

## Functions

struct osmo_mtp_prim * | m3ua_to_xfer_ind (struct xua_msg *xua)
static struct xua_msg * | mtp_prim_to_m3ua (struct osmo_mtp_prim *prim)
static int | deliver_to_mtp_user (const struct osmo_ss7_user *osu, struct xua_msg *xua)
static int | hmdt_message_for_distribution (struct osmo_ss7_instance *inst, struct xua_msg *xua)
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.
static int | hmrt_message_for_routing (struct osmo_ss7_instance *inst, struct xua_msg *xua)
int | m3ua_hmdc_rx_from_l2 (struct osmo_ss7_instance *inst, struct xua_msg *xua)
int | osmo_ss7_user_mtp_xfer_req (struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)

## Macro Definition Documentation

## APPEND

#define APPEND | ( |  | fmt,
|  |  | args ...
| ) |  |

Value:
do { \
l = snprintf(pos, sizeof(buf) - (pos - buf), fmt, ## args); \
pos += l; \
if (pos - buf >= sizeof(buf) ) \
goto out; \
} while (0)

## Function Documentation

## deliver_to_mtp_user()

static int deliver_to_mtp_user | ( | const struct osmo_ss7_user * | osu,
|  | struct xua_msg * | xua
| ) |  |

static

References m3ua_to_xfer_ind(), xua_msg::mtp, osmo_mtp_prim::oph, osmo_ss7_user::prim_cb, osmo_ss7_user::priv, osmo_mtp_prim::transfer, and osmo_mtp_prim::u.

Referenced by hmdt_message_for_distribution().

## hmdt_message_for_distribution()

static int hmdt_message_for_distribution | ( | struct osmo_ss7_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |

static

References data_hdr_from_m3ua(), deliver_to_mtp_user(), xua_msg::hdr, osmo_ss7_user::inst, M3UA_MSGC_SNM, M3UA_MSGC_XFER, M3UA_XFER_DATA, xua_common_hdr::msg_class, xua_common_hdr::msg_type, m3ua_data_hdr::si, and osmo_ss7_instance::user.

Referenced by m3ua_hmdc_rx_from_l2().

## hmrt_message_for_routing()

static int hmrt_message_for_routing | ( | struct osmo_ss7_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |

static

References osmo_ss7_route::as, osmo_ss7_as::cfg, osmo_ss7_as::ctrg, osmo_ss7_route::dest, osmo_mtp_transfer_param::dpc, dpc, osmo_ss7_as::inst, ipa_tx_xua_as(), osmo_ss7_route::linkset, m3ua_tx_xua_as(), xua_msg::mtp, OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, osmo_ss7_pointcode_print(), osmo_ss7_route_lookup(), osmo_ss7_route_name(), osmo_ss7_as::proto, and SS7_AS_CTR_TX_MSU_TOTAL.

Referenced by m3ua_hmdc_rx_from_l2().

## m3ua_hmdc_rx_from_l2()

int m3ua_hmdc_rx_from_l2 | ( | struct osmo_ss7_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |

References osmo_mtp_transfer_param::dpc, dpc, hmdt_message_for_distribution(), hmrt_message_for_routing(), osmo_ss7_as::inst, xua_msg::mtp, osmo_ss7_pc_is_local(), and osmo_ss7_pointcode_print().

Referenced by ipa_rx_msg_sccp(), m3ua_rx_xfer(), and osmo_ss7_user_mtp_xfer_req().

## m3ua_to_xfer_ind()

struct osmo_mtp_prim * m3ua_to_xfer_ind | ( | struct xua_msg * | xua | ) |

References xua_msg_part::dat, xua_msg_part::len, m3ua_dh_to_xfer_param(), M3UA_IEI_PROT_DATA, m3ua_msgb_alloc(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_mtp_prim::transfer, osmo_mtp_prim::u, and xua_msg_find_tag().

Referenced by deliver_to_mtp_user().

## mtp_prim_to_m3ua()

static struct xua_msg * mtp_prim_to_m3ua | ( | struct osmo_mtp_prim * | prim | ) |

static

References m3ua_xfer_from_data(), mtp_xfer_param_to_m3ua_dh(), osmo_mtp_prim::oph, osmo_mtp_prim::transfer, and osmo_mtp_prim::u.

Referenced by osmo_ss7_user_mtp_xfer_req().

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

This uses both osmo_ss7_pointcode_print() and osmo_ss7_pointcode_print2(), so pairing osmo_ss7_route_name() with osmo_ss7_pointcode_print() in the same printf statement is likely to conflict.

Parameters

  [in] | rt | The route information to print, or NULL.
  [in] | list_asps | If true, append info for all ASPs for the route's AS.

Returns
  A string constant or static buffer.

References APPEND, osmo_ss7_route::as, osmo_ss7_as::asps, osmo_ss7_linkset::cfg, osmo_ss7_route::cfg, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, osmo_ss7_route::dest, osmo_ss7_route_table::inst, osmo_ss7_route::linkset, osmo_ss7_route::mask, osmo_ss7_linkset::name, osmo_ss7_as::name, osmo_ss7_asp::name, osmo_ss7_asp_protocol_name(), osmo_ss7_pointcode_print(), osmo_ss7_pointcode_print2(), osmo_ss7_route::pc, osmo_ss7_as::proto, osmo_ss7_route::rtable, and osmo_ss7_asp::sock_name.

Referenced by hmrt_message_for_routing().

## osmo_ss7_user_mtp_xfer_req()

int osmo_ss7_user_mtp_xfer_req | ( | struct osmo_ss7_instance * | inst,
|  | struct osmo_mtp_prim * | omp
| ) |  |

References m3ua_hmdc_rx_from_l2(), xua_msg::mtp, mtp_prim_to_m3ua(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_mtp_prim::transfer, osmo_mtp_prim::u, and xua_msg_free().

Referenced by sua2sccp_tx_m3ua().