blob: 7b69a10dbcc4c55485811bf571d46b13425bdb03 [file] [log] [blame]
Harald Welteba43de42015-08-29 20:33:16 +02001#pragma once
2
3#include <osmocom/core/select.h>
4#include <osmocom/core/linuxlist.h>
5
Harald Weltea2e6a7a2015-08-29 21:47:39 +02006/* 25.467 Section 7.1 */
7#define IUH_DEFAULT_SCTP_PORT 29169
8#define RNA_DEFAULT_SCTP_PORT 25471
9
10#define IUH_PPI_RUA 19
11#define IUH_PPI_HNBAP 20
12#define IUH_PPI_SABP 31
13#define IUH_PPI_RNA 42
14#define IUH_PPI_PUA 55
15
16#define IHU_MSGB_SIZE 2048
17
18struct umts_cell_id {
19 uint16_t mcc; /*!< Mobile Country Code */
20 uint16_t mnc; /*!< Mobile Network Code */
21 uint16_t lac; /*!< Locaton Area Code */
22 uint16_t rac; /*!< Routing Area Code */
23 uint16_t sac; /*!< Service Area Code */
24 uint32_t cid; /*!< Cell ID */
25};
26
27struct hnb_gw;
28
Harald Welteba43de42015-08-29 20:33:16 +020029struct hnb_context {
30 /*! Entry in HNB-global list of HNB */
31 struct llist_head list;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020032 /*! HNB-GW we are part of */
33 struct hnb_gw *gw;
Harald Welteba43de42015-08-29 20:33:16 +020034 /*! SCTP socket for Iuh to this specific HNB */
35 struct osmo_fd socket;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020036 /*! copied from HNB-Identity-Info IE */
37 char identity_info[256];
38 /*! copied from Cell Identity IE */
39 struct umts_cell_id id;
Harald Welteba43de42015-08-29 20:33:16 +020040};
41
42struct ue_context {
Harald Weltea2e6a7a2015-08-29 21:47:39 +020043 /*! Entry in the HNB-global list of UE */
Harald Welteba43de42015-08-29 20:33:16 +020044 struct llist_head list;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020045 /*! Unique Context ID for this UE */
Harald Welteba43de42015-08-29 20:33:16 +020046 uint32_t context_id;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020047 /*! UE is serviced via this HNB */
48 struct hnb_context *hnb;
Harald Welteba43de42015-08-29 20:33:16 +020049};
50
51struct hnb_gw {
52 struct {
53 /*! SCTP port for Iuh listening */
54 uint16_t iuh_listen_port;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020055 /*! The UDP port where we receive multiplexed CS user
56 * plane traffic from HNBs */
57 uint16_t iuh_cs_mux_port;
58 uint16_t rnc_id;
Harald Welteba43de42015-08-29 20:33:16 +020059 } config;
60 /*! SCTP listen socket for incoming connections */
61 struct osmo_fd listen_fd;
62 struct llist_head hnb_list;
63};
Harald Weltea2e6a7a2015-08-29 21:47:39 +020064
65extern struct hnb_gw g_hnb_gw;