blob: 9fba69638cd554e8909123d5424730f9ca872f89 [file] [log] [blame]
Daniel Willmann97374c02015-12-03 09:37:58 +01001#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
Daniel Willmann97374c02015-12-03 09:37:58 +010010enum {
11 DMAIN,
Daniel Willmann32797802015-12-17 12:53:05 +010012 DHNBAP,
Daniel Willmann97374c02015-12-03 09:37:58 +010013};
14
15
16/* 25.467 Section 7.1 */
17#define IUH_DEFAULT_SCTP_PORT 29169
18#define RNA_DEFAULT_SCTP_PORT 25471
19
20#define IUH_PPI_RUA 19
21#define IUH_PPI_HNBAP 20
22#define IUH_PPI_SABP 31
23#define IUH_PPI_RNA 42
24#define IUH_PPI_PUA 55
25
26#define IUH_MSGB_SIZE 2048
27
28struct umts_cell_id {
29 uint16_t mcc; /*!< Mobile Country Code */
30 uint16_t mnc; /*!< Mobile Network Code */
31 uint16_t lac; /*!< Locaton Area Code */
32 uint16_t rac; /*!< Routing Area Code */
33 uint16_t sac; /*!< Service Area Code */
34 uint32_t cid; /*!< Cell ID */
35};
36
37struct ue_context {
38 /*! Entry in the HNB-global list of UE */
39 struct llist_head list;
40 /*! Unique Context ID for this UE */
41 uint32_t context_id;
42 char imsi[16+1];
43};
44
45struct hnb_test {
46 uint16_t gw_port;
47 /*! SCTP listen socket for incoming connections */
48 struct osmo_fd conn_fd;
49
50 /*! SCTP socket + write queue for Iuh to this specific HNB */
51 struct osmo_wqueue wqueue;
52 /*! copied from HNB-Identity-Info IE */
53 char identity_info[256];
54 /*! copied from Cell Identity IE */
55 struct umts_cell_id id;
56
57 /*! SCTP stream ID for HNBAP */
58 uint16_t hnbap_stream;
59 /*! SCTP stream ID for RUA */
60 uint16_t rua_stream;
Daniel Willmann479cb302015-12-09 17:54:59 +010061
62 uint16_t rnc_id;
Daniel Willmann19dedbb2015-12-17 11:57:41 +010063
64 uint32_t ctx_id;
Daniel Willmann141a0ba2015-12-17 18:03:52 +010065
66 int ues;
Daniel Willmann97374c02015-12-03 09:37:58 +010067};
68
69extern struct hnb_test g_hnb_test;