Harald Welte | 90256ba | 2015-12-23 20:16:36 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | #include <osmocom/core/linuxlist.h> |
| 5 | |
| 6 | enum 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 | |
| 13 | struct hnb_context; |
| 14 | struct hnbgw_cnlink; |
| 15 | |
| 16 | struct 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 | |
| 34 | struct hnbgw_context_map * |
| 35 | context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, |
| 36 | struct hnbgw_cnlink *cn_if_new); |
| 37 | |
| 38 | struct hnbgw_context_map * |
| 39 | context_map_by_cn(struct hnbgw_cnlink *cn, uint32_t scu_conn_id); |
| 40 | |
| 41 | void context_map_deactivate(struct hnbgw_context_map *map); |
| 42 | |
| 43 | int context_map_init(struct hnb_gw *gw); |