Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/select.h> |
| 4 | #include <osmocom/core/linuxlist.h> |
| 5 | |
Harald Welte | b3dae30 | 2015-08-30 12:20:09 +0200 | [diff] [blame] | 6 | #define DEBUG |
| 7 | #include <osmocom/core/logging.h> |
| 8 | |
| 9 | enum { |
| 10 | DMAIN, |
| 11 | }; |
| 12 | |
| 13 | |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 14 | /* 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 Welte | b3dae30 | 2015-08-30 12:20:09 +0200 | [diff] [blame] | 24 | #define IUH_MSGB_SIZE 2048 |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 25 | |
| 26 | struct 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 | |
| 35 | struct hnb_gw; |
| 36 | |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 37 | struct hnb_context { |
| 38 | /*! Entry in HNB-global list of HNB */ |
| 39 | struct llist_head list; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 40 | /*! HNB-GW we are part of */ |
| 41 | struct hnb_gw *gw; |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 42 | /*! SCTP socket for Iuh to this specific HNB */ |
| 43 | struct osmo_fd socket; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 44 | /*! copied from HNB-Identity-Info IE */ |
| 45 | char identity_info[256]; |
| 46 | /*! copied from Cell Identity IE */ |
| 47 | struct umts_cell_id id; |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | struct ue_context { |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 51 | /*! Entry in the HNB-global list of UE */ |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 52 | struct llist_head list; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 53 | /*! Unique Context ID for this UE */ |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 54 | uint32_t context_id; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 55 | /*! UE is serviced via this HNB */ |
| 56 | struct hnb_context *hnb; |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | struct hnb_gw { |
| 60 | struct { |
| 61 | /*! SCTP port for Iuh listening */ |
| 62 | uint16_t iuh_listen_port; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 63 | /*! 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 Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 67 | } config; |
| 68 | /*! SCTP listen socket for incoming connections */ |
| 69 | struct osmo_fd listen_fd; |
| 70 | struct llist_head hnb_list; |
| 71 | }; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame] | 72 | |
| 73 | extern struct hnb_gw g_hnb_gw; |