blob: c1a4495bc9b7bee86df78f6a1578ae1d04fbf3db [file] [log] [blame]
Harald Welte90256ba2015-12-23 20:16:36 +01001#pragma once
2
3#include <stdint.h>
4#include <osmocom/core/linuxlist.h>
5
6enum hnbgw_context_map_state {
7 MAP_S_NULL,
8 MAP_S_ACTIVE, /* currently active map */
9 MAP_S_RESERVED1, /* just disconnected, still resrved */
10 MAP_S_RESERVED2, /* still reserved */
11};
12
13struct hnb_context;
14struct hnbgw_cnlink;
15
16struct hnbgw_context_map {
17 /* entry in the per-CN list of mappings */
18 struct llist_head cn_list;
19 /* entry in the per-HNB list of mappings */
20 struct llist_head hnb_list;
21 /* pointer to HNB */
22 struct hnb_context *hnb_ctx;
23 /* pointer to CN */
24 struct hnbgw_cnlink *cn_link;
25 /* RUA contxt ID */
26 uint32_t rua_ctx_id;
27 /* SCCP User SAP connection ID */
28 uint32_t scu_conn_id;
29
30 enum hnbgw_context_map_state state;
31};
32
33
34struct hnbgw_context_map *
35context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id,
36 struct hnbgw_cnlink *cn_if_new);
37
38struct hnbgw_context_map *
39context_map_by_cn(struct hnbgw_cnlink *cn, uint32_t scu_conn_id);
40
41void context_map_deactivate(struct hnbgw_context_map *map);
42
43int context_map_init(struct hnb_gw *gw);