#pragma once #include #include #include #include #include #include #include #include #include #include #include #define DEBUG #include #include #include #include #include #include #include #include #define HNB_STORE_RAB_DURATIONS_INTERVAL 1 /* seconds */ #define LOGHNB(HNB_CTX, ss, lvl, fmt, args ...) \ LOGP(ss, lvl, "(%s) " fmt, hnb_context_name(HNB_CTX), ## args) enum hnb_ctrl_node { CTRL_NODE_HNB = _LAST_CTRL_NODE, _LAST_CTRL_NODE_HNB }; /* The lifecycle of the hnb_context object is the same as its conn */ struct hnb_context { /*! Entry in HNB-global list of HNB */ struct llist_head list; /*! SCTP socket + write queue for Iuh to this specific HNB */ struct osmo_stream_srv *conn; /*! copied from HNB-Identity-Info IE */ char identity_info[256]; /*! copied from Cell Identity IE */ struct umts_cell_id id; /*! SCTP stream ID for HNBAP */ uint16_t hnbap_stream; /*! SCTP stream ID for RUA */ uint16_t rua_stream; /*! True if a HNB-REGISTER-REQ from this HNB has been accepted. */ bool hnb_registered; /* linked list of hnbgw_context_map */ struct llist_head map_list; /*! pointer to the associated hnb persistent state. Always present after HNB-Register */ struct hnb_persistent *persistent; }; int hnbgw_rua_accept_cb(struct osmo_stream_srv_link *srv, int fd); int hnb_ctrl_cmds_install(void); int hnb_ctrl_node_lookup(void *data, vector vline, int *node_type, void **node_data, int *i); struct hnb_context *hnb_context_by_identity_info(const char *identity_info); const char *hnb_context_name(struct hnb_context *ctx); void hnb_context_release(struct hnb_context *ctx); void hnb_context_release_ue_state(struct hnb_context *ctx); unsigned long long hnb_get_updowntime(const struct hnb_context *ctx); void hnb_store_rab_durations(struct hnb_context *hnb);