libosmo-sigtran 2.2.1.28-88af Osmocom SIGTRAN library

ss7_user.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <unistd.h>
5#include <osmocom/core/prim.h>
6#include <osmocom/sigtran/protocol/mtp.h>
7#include <osmocom/sigtran/mtp_sap.h>
8
9/***********************************************************************
10 * SS7 User (MTP SAP)
11 ***********************************************************************/
12
13 struct osmo_ss7_instance;
14
15 struct osmo_ss7_user {
16 /* pointer back to SS7 instance */
17 struct osmo_ss7_instance *inst;
18 /* name of the user */
19 const char *name;
20 /* primitive call-back for incoming MTP primitives */
21 osmo_prim_cb prim_cb;
22 /* private data */
23 void *priv;
24};
25
26 void ss7_user_unregister_all(struct osmo_ss7_user *user);
27 int ss7_user_mtp_sap_prim_up(const struct osmo_ss7_user *osu, struct osmo_mtp_prim *omp);
28
29 struct osmo_mtp_prim *mtp_prim_xfer_ind_alloc(const struct osmo_mtp_transfer_param *param,
30 const uint8_t *user_data, size_t user_data_len);
31
32 struct osmo_mtp_prim *mtp_prim_status_ind_alloc(uint32_t dpc,
33 enum mtp_unavail_cause cause,
34 bool cong_level_present,
35 uint8_t cong_level);
36 void mtp_resume_ind_up_to_all_users(struct osmo_ss7_instance *s7i, uint32_t pc);
37 void mtp_pause_ind_up_to_all_users(struct osmo_ss7_instance *s7i, uint32_t pc);
38 void mtp_status_ind_up_to_all_users(struct osmo_ss7_instance *s7i,
39 uint32_t dpc, enum mtp_unavail_cause cause,
40 bool cong_level_present, uint8_t cong_level);
41
42
43#define _LOGPSS7U(osu, subsys, level, fmt, args ...) \
44 _LOGSS7((osu)->inst, subsys, level, "ss7_user(%s) " fmt, osu->name, ## args)
45#define LOGPSS7U(osu, level, fmt, args ...) \
46 _LOGPSS7U(osu, DLSS7, level, fmt, ## args)
dpc
uint32_t dpc
Definition: m3ua.h:1
mtp.h
mtp_unavail_cause
mtp_unavail_cause
Definition: mtp.h:49
mtp_sap.h
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)
Definition: mtp_sap.c:182
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)
Definition: mtp_sap.c:119
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.
Definition: mtp_sap.c:202
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)
Definition: mtp_sap.c:99
ss7_user_unregister_all
void ss7_user_unregister_all(struct osmo_ss7_user *user)
Definition: ss7_user.c:131
mtp_pause_ind_up_to_all_users
void mtp_pause_ind_up_to_all_users(struct osmo_ss7_instance *s7i, uint32_t pc)
Definition: mtp_sap.c:171
mtp_resume_ind_up_to_all_users
void mtp_resume_ind_up_to_all_users(struct osmo_ss7_instance *s7i, uint32_t pc)
Definition: mtp_sap.c:160
osmo_mtp_prim
Definition: mtp_sap.h:64
osmo_mtp_transfer_param
Definition: mtp_sap.h:42
osmo_ss7_instance
Definition: ss7_instance.h:45
osmo_ss7_instance::user
struct osmo_ss7_user * user[16]
Definition: ss7_instance.h:60
osmo_ss7_user
Definition: ss7_user.h:15
osmo_ss7_user::name
const char * name
Definition: ss7_user.h:19
osmo_ss7_user::prim_cb
osmo_prim_cb prim_cb
Definition: ss7_user.h:21
osmo_ss7_user::priv
void * priv
Definition: ss7_user.h:23
osmo_ss7_user::inst
struct osmo_ss7_instance * inst
Definition: ss7_user.h:17
pc
uint32_t pc
Definition: tcap_as_loadshare.c:2