libosmo-sigtran 2.2.1.4-74d0 Osmocom SIGTRAN library

tcap_trans_tracking.h
Go to the documentation of this file.
1#pragma once
2
3/* TCAP transaction tracking */
4
5#include <stdint.h>
6
7#include <osmocom/core/hashtable.h>
8#include <osmocom/core/msgb.h>
9
10#include <osmocom/sigtran/sccp_sap.h>
11
12 struct osmo_ss7_as;
13 struct osmo_ss7_asp;
14
15 struct tcap_trans_track_tid_entry {
16 struct hlist_node list;
17 bool tid_valid;
18 uint32_t tid;
19};
20
21 struct tcap_trans_track_entry {
22 struct tcap_trans_track_tid_entry peer_tid; /* of the peer. If peer initiate transaction, this is otid */
23 struct tcap_trans_track_tid_entry own_tid; /* assigned by this asp */
24
25 struct osmo_sccp_addr *own_addr;
26 struct osmo_sccp_addr *peer_addr;
27
28 time_t tstamp; /* last time this cache was used */
29
30 struct osmo_ss7_asp *asp;
31};
32
33/* Entry centric API
34 * Managing entries without management (e.g. update entries when used)
35 */
36 struct tcap_trans_track_entry *tcap_trans_track_entry_create(
37 struct osmo_ss7_as *as,
38 struct osmo_ss7_asp *asp,
39 const struct osmo_sccp_addr *own_addr,
40 const uint32_t *own_tid,
41 const struct osmo_sccp_addr *peer_addr,
42 const uint32_t *peer_tid);
43
44 struct tcap_trans_track_entry *tcap_trans_track_entry_find(
45 struct osmo_ss7_as *as,
46 const struct osmo_sccp_addr *own_addr,
47 const uint32_t *own_tid,
48 const struct osmo_sccp_addr *peer_addr,
49 const uint32_t *peer_tid);
50
51 void tcap_trans_track_entry_free(struct tcap_trans_track_entry *entry);
52
53 int tcap_trans_track_entries_free_all(struct osmo_ss7_as *as);
54 int tcap_trans_track_entries_free_by_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp);
55
56/* Transaction centric API
57 * It will update timestamp and used out of a TCAP transaction context
58 */
59 struct tcap_trans_track_entry *tcap_trans_track_begin(
60 struct osmo_ss7_as *as,
61 struct osmo_ss7_asp *asp,
62 const struct osmo_sccp_addr *own_addr,
63 const uint32_t *own_tid,
64 const struct osmo_sccp_addr *peer_addr,
65 const uint32_t *peer_tid);
66
67 struct osmo_ss7_asp *tcap_trans_track_continue(
68 struct osmo_ss7_as *as,
69 const struct osmo_sccp_addr *own_addr,
70 const uint32_t *own_tid,
71 const struct osmo_sccp_addr *peer_addr,
72 const uint32_t *peer_tid);
73
74 struct osmo_ss7_asp *tcap_trans_track_end(
75 struct osmo_ss7_as *as,
76 const struct osmo_sccp_addr *own_addr,
77 const uint32_t *own_tid,
78 const struct osmo_sccp_addr *peer_addr,
79 const uint32_t *peer_tid);
80
81/* Garbage collection */
82 int tcap_trans_track_garbage_collect(struct osmo_ss7_as *as);
83
84 void tcap_trans_track_garbage_collect_start(struct osmo_ss7_as *as);
85 void tcap_trans_track_garbage_collect_stop(struct osmo_ss7_as *as);
86
sccp_sap.h
osmo_sccp_addr
Definition: sccp_sap.h:183
osmo_ss7_as
Definition: ss7_as.h:86
osmo_ss7_asp
Definition: ss7_asp.h:45
tcap_trans_track_entry
Definition: tcap_trans_tracking.h:21
tcap_trans_track_entry::tstamp
time_t tstamp
Definition: tcap_trans_tracking.h:28
tcap_trans_track_entry::asp
struct osmo_ss7_asp * asp
Definition: tcap_trans_tracking.h:30
tcap_trans_track_entry::own_tid
struct tcap_trans_track_tid_entry own_tid
Definition: tcap_trans_tracking.h:23
tcap_trans_track_entry::own_addr
struct osmo_sccp_addr * own_addr
Definition: tcap_trans_tracking.h:25
tcap_trans_track_entry::peer_tid
struct tcap_trans_track_tid_entry peer_tid
Definition: tcap_trans_tracking.h:22
tcap_trans_track_entry::peer_addr
struct osmo_sccp_addr * peer_addr
Definition: tcap_trans_tracking.h:26
tcap_trans_track_tid_entry
Definition: tcap_trans_tracking.h:15
tcap_trans_track_tid_entry::list
struct hlist_node list
Definition: tcap_trans_tracking.h:16
tcap_trans_track_tid_entry::tid_valid
bool tid_valid
Definition: tcap_trans_tracking.h:17
tcap_trans_track_tid_entry::tid
uint32_t tid
Definition: tcap_trans_tracking.h:18
tcap_trans_track_continue
struct osmo_ss7_asp * tcap_trans_track_continue(struct osmo_ss7_as *as, const struct osmo_sccp_addr *own_addr, const uint32_t *own_tid, const struct osmo_sccp_addr *peer_addr, const uint32_t *peer_tid)
Definition: tcap_trans_tracking.c:252
tcap_trans_track_entry_create
struct tcap_trans_track_entry * tcap_trans_track_entry_create(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, const struct osmo_sccp_addr *own_addr, const uint32_t *own_tid, const struct osmo_sccp_addr *peer_addr, const uint32_t *peer_tid)
Definition: tcap_trans_tracking.c:78
tcap_trans_track_entries_free_by_asp
int tcap_trans_track_entries_free_by_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Definition: tcap_trans_tracking.c:360
tcap_trans_track_garbage_collect_stop
void tcap_trans_track_garbage_collect_stop(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:355
tcap_trans_track_entry_find
struct tcap_trans_track_entry * tcap_trans_track_entry_find(struct osmo_ss7_as *as, const struct osmo_sccp_addr *own_addr, const uint32_t *own_tid, const struct osmo_sccp_addr *peer_addr, const uint32_t *peer_tid)
Definition: tcap_trans_tracking.c:154
tcap_trans_track_end
struct osmo_ss7_asp * tcap_trans_track_end(struct osmo_ss7_as *as, const struct osmo_sccp_addr *own_addr, const uint32_t *own_tid, const struct osmo_sccp_addr *peer_addr, const uint32_t *peer_tid)
Definition: tcap_trans_tracking.c:285
tcap_trans_track_garbage_collect
int tcap_trans_track_garbage_collect(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:304
tcap_trans_track_garbage_collect_start
void tcap_trans_track_garbage_collect_start(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:349
tcap_trans_track_begin
struct tcap_trans_track_entry * tcap_trans_track_begin(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, const struct osmo_sccp_addr *own_addr, const uint32_t *own_tid, const struct osmo_sccp_addr *peer_addr, const uint32_t *peer_tid)
Definition: tcap_trans_tracking.c:233
tcap_trans_track_entry_free
void tcap_trans_track_entry_free(struct tcap_trans_track_entry *entry)
Definition: tcap_trans_tracking.c:140
tcap_trans_track_entries_free_all
int tcap_trans_track_entries_free_all(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:385