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 | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 6 | /* 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 | |
| 18 | struct 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 | |
| 27 | struct hnb_gw; |
| 28 | |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 29 | struct hnb_context { |
| 30 | /*! Entry in HNB-global list of HNB */ |
| 31 | struct llist_head list; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 32 | /*! HNB-GW we are part of */ |
| 33 | struct hnb_gw *gw; |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 34 | /*! SCTP socket for Iuh to this specific HNB */ |
| 35 | struct osmo_fd socket; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 36 | /*! copied from HNB-Identity-Info IE */ |
| 37 | char identity_info[256]; |
| 38 | /*! copied from Cell Identity IE */ |
| 39 | struct umts_cell_id id; |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | struct ue_context { |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 43 | /*! Entry in the HNB-global list of UE */ |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 44 | struct llist_head list; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 45 | /*! Unique Context ID for this UE */ |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 46 | uint32_t context_id; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 47 | /*! UE is serviced via this HNB */ |
| 48 | struct hnb_context *hnb; |
Harald Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | struct hnb_gw { |
| 52 | struct { |
| 53 | /*! SCTP port for Iuh listening */ |
| 54 | uint16_t iuh_listen_port; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 55 | /*! 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 Welte | ba43de4 | 2015-08-29 20:33:16 +0200 | [diff] [blame] | 59 | } config; |
| 60 | /*! SCTP listen socket for incoming connections */ |
| 61 | struct osmo_fd listen_fd; |
| 62 | struct llist_head hnb_list; |
| 63 | }; |
Harald Welte | a2e6a7a | 2015-08-29 21:47:39 +0200 | [diff] [blame^] | 64 | |
| 65 | extern struct hnb_gw g_hnb_gw; |