102 lines
2.5 KiB
C
102 lines
2.5 KiB
C
#ifndef _TCAP_USER_H
|
|
#define _TCAP_USER_H
|
|
|
|
#include <stdint.h>
|
|
#include <sys/socket.h>
|
|
|
|
#include <osmocore/select.h>
|
|
#include <osmocore/write_queue.h>
|
|
|
|
#include <asn1c/OBJECT_IDENTIFIER.h>
|
|
#include <osmocom/tcap/Parameter.h>
|
|
#include <osmocom/tcap/OPERATION.h>
|
|
|
|
enum tcap_transport_entity_type {
|
|
SCXP_T_UDP, /* TCAP over UDP */
|
|
SCXP_T_SUA_SCTP, /* TCAP over SUA over SCTP */
|
|
SCXP_T_SCCP_IPA, /* TCAP over SCCP over IPA */
|
|
SCXP_T_SCCP_M3UA_SCTP, /* TCAP over SCCP over M3UA over SCTP */
|
|
};
|
|
/* One entity of the underlying network protocol */
|
|
struct tcap_transport_entity {
|
|
struct llist_head list;
|
|
|
|
/* common parts */
|
|
struct sockaddr_storage local_addr;
|
|
struct sockaddr_storage remote_addr;
|
|
|
|
/* type of underlying transport */
|
|
enum tcap_transport_entity_type type;
|
|
union {
|
|
struct {
|
|
struct write_queue write_queue;
|
|
} udp;
|
|
struct {
|
|
} sccp_ipa;
|
|
struct {
|
|
} sua_sctp;
|
|
};
|
|
};
|
|
|
|
/* Call-back to user from other points in the stack */
|
|
|
|
/* metadata associated with a dialogue indication primitive */
|
|
struct tcap_dialg_ind {
|
|
uint32_t dialg_id;
|
|
struct tcap_transport_entity *transp_ent;
|
|
OBJECT_IDENTIFIER_t *app_ctx_name;
|
|
struct user_information *user_info;
|
|
int components_present:1;
|
|
int prearranged_end:1;
|
|
uint32_t reason;
|
|
void *qos;
|
|
};
|
|
|
|
/* metadata associated with a component indication primitive */
|
|
struct tcap_component_ind {
|
|
/* public */
|
|
uint32_t dialg_id; /* Dialogue ID */
|
|
int8_t invoke_id; /* Invoke ID */
|
|
int8_t *linked_id; /* Linked ID */
|
|
struct OPERATION operation; /* Operation Code */
|
|
Parameter_t parameter; /* ANY_t */
|
|
int last_component; /* is this the last component in the msg? */
|
|
uint32_t timeout_secs; /* Timeout in seconds */
|
|
uint32_t error;
|
|
uint8_t op_class;
|
|
/* private */
|
|
int8_t _linked_id; /* actual storage for linked ID */
|
|
};
|
|
|
|
struct scxp_entity;
|
|
|
|
enum tcap_primitive {
|
|
/* dialogue handling primitives */
|
|
TCAP_PR_TC_UNI,
|
|
TCAP_PR_TC_BEGIN,
|
|
TCAP_PR_TC_CONTINUE,
|
|
TCAP_PR_TC_END,
|
|
TCAP_PR_TC_U_ABORT,
|
|
TCAP_PR_TC_NOTICE,
|
|
/* component handling primitives */
|
|
TCAP_PR_TC_INVOKE,
|
|
TCAP_PR_TC_RESULT_L,
|
|
TCAP_PR_TC_RESULT_NL,
|
|
TCAP_PR_TC_U_ERROR,
|
|
TCAP_PR_TC_U_REJECT,
|
|
TCAP_PR_TC_CANCEL,
|
|
TCAP_PR_TC_TIMER_RESET,
|
|
TCAP_PR_TC_L_REJECT,
|
|
TCAP_PR_TC_R_REJECT,
|
|
TCAP_PR_TC_P_ABORT,
|
|
};
|
|
|
|
const char *tcap_prim_name(enum tcap_primitive prim);
|
|
|
|
|
|
/* callbacks to application code regarding various INDICATIONs */
|
|
extern int tcap_user_ind_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci);
|
|
extern int tcap_user_ind_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi);
|
|
|
|
#endif /* TCAP_USER_H */
|