Daniel Willmann | 97374c0 | 2015-12-03 09:37:58 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/select.h> |
| 4 | #include <osmocom/core/linuxlist.h> |
| 5 | #include <osmocom/core/write_queue.h> |
| 6 | |
| 7 | #define DEBUG |
| 8 | #include <osmocom/core/logging.h> |
| 9 | |
| 10 | #define msgb_ppid(msg) (msg)->cb[0] |
| 11 | |
| 12 | enum { |
| 13 | DMAIN, |
| 14 | }; |
| 15 | |
| 16 | |
| 17 | /* 25.467 Section 7.1 */ |
| 18 | #define IUH_DEFAULT_SCTP_PORT 29169 |
| 19 | #define RNA_DEFAULT_SCTP_PORT 25471 |
| 20 | |
| 21 | #define IUH_PPI_RUA 19 |
| 22 | #define IUH_PPI_HNBAP 20 |
| 23 | #define IUH_PPI_SABP 31 |
| 24 | #define IUH_PPI_RNA 42 |
| 25 | #define IUH_PPI_PUA 55 |
| 26 | |
| 27 | #define IUH_MSGB_SIZE 2048 |
| 28 | |
| 29 | struct umts_cell_id { |
| 30 | uint16_t mcc; /*!< Mobile Country Code */ |
| 31 | uint16_t mnc; /*!< Mobile Network Code */ |
| 32 | uint16_t lac; /*!< Locaton Area Code */ |
| 33 | uint16_t rac; /*!< Routing Area Code */ |
| 34 | uint16_t sac; /*!< Service Area Code */ |
| 35 | uint32_t cid; /*!< Cell ID */ |
| 36 | }; |
| 37 | |
| 38 | struct ue_context { |
| 39 | /*! Entry in the HNB-global list of UE */ |
| 40 | struct llist_head list; |
| 41 | /*! Unique Context ID for this UE */ |
| 42 | uint32_t context_id; |
| 43 | char imsi[16+1]; |
| 44 | }; |
| 45 | |
| 46 | struct hnb_test { |
| 47 | uint16_t gw_port; |
| 48 | /*! SCTP listen socket for incoming connections */ |
| 49 | struct osmo_fd conn_fd; |
| 50 | |
| 51 | /*! SCTP socket + write queue for Iuh to this specific HNB */ |
| 52 | struct osmo_wqueue wqueue; |
| 53 | /*! copied from HNB-Identity-Info IE */ |
| 54 | char identity_info[256]; |
| 55 | /*! copied from Cell Identity IE */ |
| 56 | struct umts_cell_id id; |
| 57 | |
| 58 | /*! SCTP stream ID for HNBAP */ |
| 59 | uint16_t hnbap_stream; |
| 60 | /*! SCTP stream ID for RUA */ |
| 61 | uint16_t rua_stream; |
| 62 | }; |
| 63 | |
| 64 | extern struct hnb_test g_hnb_test; |