libosmo-sigtran  2.3.0
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 
11 
12 struct osmo_ss7_as;
13 struct osmo_ss7_asp;
14 
16  struct hlist_node list;
17  bool tid_valid;
18  uint32_t tid;
19 };
20 
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 
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  */
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 
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 
52 
55 
56 /* Transaction centric API
57  * It will update timestamp and used out of a TCAP transaction context
58  */
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 
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 
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 */
83 
86 
Definition: sccp_sap.h:183
Definition: ss7_as.h:105
Definition: ss7_asp.h:55
Definition: tcap_trans_tracking.h:21
time_t tstamp
Definition: tcap_trans_tracking.h:28
struct osmo_ss7_asp * asp
Definition: tcap_trans_tracking.h:30
struct tcap_trans_track_tid_entry own_tid
Definition: tcap_trans_tracking.h:23
struct osmo_sccp_addr * own_addr
Definition: tcap_trans_tracking.h:25
struct tcap_trans_track_tid_entry peer_tid
Definition: tcap_trans_tracking.h:22
struct osmo_sccp_addr * peer_addr
Definition: tcap_trans_tracking.h:26
Definition: tcap_trans_tracking.h:15
struct hlist_node list
Definition: tcap_trans_tracking.h:16
bool tid_valid
Definition: tcap_trans_tracking.h:17
uint32_t tid
Definition: tcap_trans_tracking.h:18
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
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
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
int tcap_trans_track_entries_free_by_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Definition: tcap_trans_tracking.c:360
void tcap_trans_track_garbage_collect_stop(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:355
int tcap_trans_track_garbage_collect(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:304
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
void tcap_trans_track_garbage_collect_start(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:349
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
void tcap_trans_track_entry_free(struct tcap_trans_track_entry *entry)
Definition: tcap_trans_tracking.c:140
int tcap_trans_track_entries_free_all(struct osmo_ss7_as *as)
Definition: tcap_trans_tracking.c:387