blob: ab8c10371ac93009091960aa1ebb75939f18d585 [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 Welteb3dae302015-08-30 12:20:09 +02006#define DEBUG
7#include <osmocom/core/logging.h>
8
9enum {
10 DMAIN,
11};
12
13
Harald Weltea2e6a7a2015-08-29 21:47:39 +020014/* 25.467 Section 7.1 */
15#define IUH_DEFAULT_SCTP_PORT 29169
16#define RNA_DEFAULT_SCTP_PORT 25471
17
18#define IUH_PPI_RUA 19
19#define IUH_PPI_HNBAP 20
20#define IUH_PPI_SABP 31
21#define IUH_PPI_RNA 42
22#define IUH_PPI_PUA 55
23
Harald Welteb3dae302015-08-30 12:20:09 +020024#define IUH_MSGB_SIZE 2048
Harald Weltea2e6a7a2015-08-29 21:47:39 +020025
26struct umts_cell_id {
27 uint16_t mcc; /*!< Mobile Country Code */
28 uint16_t mnc; /*!< Mobile Network Code */
29 uint16_t lac; /*!< Locaton Area Code */
30 uint16_t rac; /*!< Routing Area Code */
31 uint16_t sac; /*!< Service Area Code */
32 uint32_t cid; /*!< Cell ID */
33};
34
35struct hnb_gw;
36
Harald Welteba43de42015-08-29 20:33:16 +020037struct hnb_context {
38 /*! Entry in HNB-global list of HNB */
39 struct llist_head list;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020040 /*! HNB-GW we are part of */
41 struct hnb_gw *gw;
Harald Welteba43de42015-08-29 20:33:16 +020042 /*! SCTP socket for Iuh to this specific HNB */
43 struct osmo_fd socket;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020044 /*! copied from HNB-Identity-Info IE */
45 char identity_info[256];
46 /*! copied from Cell Identity IE */
47 struct umts_cell_id id;
Harald Welteba43de42015-08-29 20:33:16 +020048};
49
50struct ue_context {
Harald Weltea2e6a7a2015-08-29 21:47:39 +020051 /*! Entry in the HNB-global list of UE */
Harald Welteba43de42015-08-29 20:33:16 +020052 struct llist_head list;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020053 /*! Unique Context ID for this UE */
Harald Welteba43de42015-08-29 20:33:16 +020054 uint32_t context_id;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020055 /*! UE is serviced via this HNB */
56 struct hnb_context *hnb;
Harald Welteba43de42015-08-29 20:33:16 +020057};
58
59struct hnb_gw {
60 struct {
61 /*! SCTP port for Iuh listening */
62 uint16_t iuh_listen_port;
Harald Weltea2e6a7a2015-08-29 21:47:39 +020063 /*! The UDP port where we receive multiplexed CS user
64 * plane traffic from HNBs */
65 uint16_t iuh_cs_mux_port;
66 uint16_t rnc_id;
Harald Welteba43de42015-08-29 20:33:16 +020067 } config;
68 /*! SCTP listen socket for incoming connections */
69 struct osmo_fd listen_fd;
70 struct llist_head hnb_list;
71};
Harald Weltea2e6a7a2015-08-29 21:47:39 +020072
73extern struct hnb_gw g_hnb_gw;