libosmo-sigtran  0.10.0
Osmocom SIGTRAN library
sccp_internal.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <osmocom/core/fsm.h>
4 #include <osmocom/core/prim.h>
7 
8 /* an instance of the SCCP stack */
10  /* entry in global list of ss7 instances */
11  struct llist_head list;
12  /* list of 'struct sccp_connection' in this instance */
13  struct llist_head connections;
14  /* list of SCCP users in this instance */
15  struct llist_head users;
16  /* routing context to be used in all outbound messages */
17  uint32_t route_ctx;
18  /* next local reference to allocate */
19  uint32_t next_id;
21  void *priv;
22 
24 };
25 
28  struct llist_head list;
32  char *name;
33 
35  uint16_t ssn;
36  uint32_t pc;
37 
38  /* set if we are a server */
39  struct llist_head links;
40 
41  /* user call-back function in case of incoming primitives */
42  osmo_prim_cb prim_cb;
43  void *priv;
44 
45  /* Application Server FSM Instance */
46  struct osmo_fsm_inst *as_fi;
47 };
48 
49 extern int DSCCP;
50 
51 struct xua_msg;
52 
53 struct osmo_sccp_user *
54 sccp_user_find(struct osmo_sccp_instance *inst, uint16_t ssn, uint32_t pc);
55 
56 /* Message from SCOC -> SCRC */
58  struct xua_msg *xua);
59 
60 /* Message from SCLC -> SCRC */
61 int sccp_scrc_rx_sclc_msg(struct osmo_sccp_instance *inst, struct xua_msg *xua);
62 
63 /* Message from MTP (SUA) -> SCRC */
65  struct xua_msg *xua);
66 
67 /* Message from SCRC -> SCOC */
69  struct xua_msg *xua);
71  struct xua_msg *xua, uint32_t cause);
72 
74 
75 /* Message from SCRC -> SCLC */
77  struct xua_msg *xua);
79  struct xua_msg *xua, uint32_t cause);
80 
81 int sccp_user_prim_up(struct osmo_sccp_user *scut, struct osmo_scu_prim *prim);
82 
83 /* SCU -> SCLC */
84 int sccp_sclc_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph);
85 
86 struct msgb *sccp_msgb_alloc(const char *name);
87 
88 struct osmo_fsm sccp_scoc_fsm;
89 
90 void sccp_scoc_show_connections(struct vty *vty, struct osmo_sccp_instance *inst);
void * priv
Definition: sccp_internal.h:43
char * name
human-readable name of this user
Definition: sccp_internal.h:32
struct msgb * sccp_msgb_alloc(const char *name)
Definition: sua.c:63
uint32_t route_ctx
Definition: sccp_internal.h:17
uint16_t ssn
SSN and/or point code to which we are bound.
Definition: sccp_internal.h:35
Definition: sccp_internal.h:9
struct osmo_fsm sccp_scoc_fsm
Definition: sccp_internal.h:88
Definition: sccp_sap.h:225
int sccp_user_prim_up(struct osmo_sccp_user *scut, struct osmo_scu_prim *prim)
Send a SCCP User SAP Primitive up to the User.
Definition: sccp_user.c:153
osmo_prim_cb prim_cb
Definition: sccp_internal.h:42
int DSCCP
void sccp_sclc_rx_scrc_rout_fail(struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t cause)
SCRC -> SCLC (Routing Failure.
Definition: sccp_sclc.c:327
Definition: osmo_ss7.h:118
void * priv
Definition: sccp_internal.h:21
struct llist_head users
Definition: sccp_internal.h:15
struct osmo_sccp_instance * inst
pointer back to SCCP instance
Definition: sccp_internal.h:30
struct osmo_ss7_user ss7_user
Definition: sccp_internal.h:23
void sccp_scoc_rx_from_scrc(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Main entrance function for primitives from the SCRC (Routing Control)
Definition: sccp_scoc.c:1505
void sccp_scoc_flush_connections(struct osmo_sccp_instance *inst)
Definition: sccp_scoc.c:1665
Definition: sccp_internal.h:26
struct osmo_ss7_instance * ss7
Definition: sccp_internal.h:20
int sccp_scrc_rx_sclc_msg(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Definition: sccp_scrc.c:415
int scrc_rx_mtp_xfer_ind_xua(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Definition: sccp_scrc.c:442
uint32_t next_id
Definition: sccp_internal.h:19
int sccp_scrc_rx_scoc_conn_msg(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Definition: sccp_scrc.c:393
void sccp_scoc_rx_scrc_rout_fail(struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t cause)
SCOC: Receive SCRC Routing Failure.
Definition: sccp_scoc.c:1239
Definition: xua_msg.h:31
struct llist_head connections
Definition: sccp_internal.h:13
struct osmo_sccp_user * sccp_user_find(struct osmo_sccp_instance *inst, uint16_t ssn, uint32_t pc)
Find a SCCP User registered for given PC+SSN or SSN only.
Definition: sccp_user.c:47
Definition: osmo_ss7.h:70
int sccp_sclc_rx_from_scrc(struct osmo_sccp_instance *inst, struct xua_msg *xua)
SCRC -> SCLC (connectionless message)
Definition: sccp_sclc.c:251
uint32_t pc
Definition: sccp_internal.h:36
struct osmo_fsm_inst * as_fi
Definition: sccp_internal.h:46
struct llist_head list
Definition: sccp_internal.h:11
void sccp_scoc_show_connections(struct vty *vty, struct osmo_sccp_instance *inst)
Definition: sccp_scoc.c:1700
int sccp_sclc_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
Main entrance function for primitives from SCCP User.
Definition: sccp_sclc.c:122