b7e7e14445ae9336d8db0737c1bdd47c79d7cce2
[ric-app/admin.git] / src / X2AP / sgnb_addition_helpers.hpp
1 /*
2 ==================================================================================
3         Copyright (c) 2018-2019 AT&T Intellectual Property.
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16 ==================================================================================
17 */
18 /*
19  * ric_indication.h
20  *
21  *  Created on: Aug 14, 2019
22  *      Author:  Ashwin Sridharan
23  */
24
25 #ifndef SGNB_INDICATION_HELPER_
26 #define SGNB_INDICATION_HELPER_
27
28   
29 #include <iostream>
30 #include <vector>
31
32 struct erab_sgnb_item {
33   erab_sgnb_item(void):  qci(0), priority_level(0), pre_emption_capability(0), pre_emption_vulnerability(0),  dl_forwarding(0), ul_configuration(0), secondary_meNB_UTL_GTP(0), transport_layer_addr(0), transport_layer_addr_size(0), transport_layer_addr_unused(0), gtp_tei(0), gtp_tei_size(0), rlc_mode(0) {};
34
35   /* Erab level qos parameters */
36   long int qci;
37   long int priority_level;
38   long int pre_emption_capability;
39   long int pre_emption_vulnerability;
40
41  
42   
43   /* Optional  forwarding info */
44   void * dl_forwarding;
45   void * ul_configuration;
46   void * secondary_meNB_UTL_GTP;
47   
48   /* Tunnel end point */
49   unsigned char * transport_layer_addr;
50   int transport_layer_addr_size;
51   int transport_layer_addr_unused;
52   
53   unsigned char * gtp_tei;
54   int gtp_tei_size;
55
56   /* Rlc mode */
57   long int rlc_mode;
58 };
59
60
61
62 struct erab_item {
63
64   erab_item(void):erab_id(0), drb_id(0), cause(0), pdcp_at_sgnb(0), mcg_resources(0), scg_resources(0), sgnb_pdcp_present(0) {};
65   
66   long int erab_id;
67   long int drb_id;
68
69   int cause; // used when not admitting 
70   /* enums describing type
71      of resources present */
72
73   long int pdcp_at_sgnb;
74   long int mcg_resources;
75   long int scg_resources;
76
77
78   int sgnb_pdcp_present;
79   struct erab_sgnb_item sgnb_item;
80
81 };
82
83
84   
85
86 class sgnb_addition_helper {
87
88   
89 public:
90
91   sgnb_addition_helper(void): menb_ue_x2ap_id(0), sgnb_ue_x2ap_id(0), encryption_algs(0), encryption_algs_size(0), encryption_algs_unused(0), integrity_protection_algs(0), integrity_protection_algs_size(0), integrity_protection_algs_unused(0), sgnb_security_key(0), sgnb_security_key_size(0), sgnb_security_key_unused(0), bit_rate_max_up(0), bit_rate_max_dn(0), menb_sgnb_container(0), menb_sgnb_container_size(0), selected_plmn(0), selected_plmn_size(0), plmn_identity(0), plmn_identity_size(0), eutran_identifier(0), eutran_identifier_size(0), eutran_identifier_unused(0), subscriber_profile_id(0), cause(0), cause_desc(0) {};
92   
93   long int menb_ue_x2ap_id, sgnb_ue_x2ap_id;
94   
95   unsigned char *encryption_algs;
96   int encryption_algs_size;
97   int encryption_algs_unused;
98   
99   unsigned char *integrity_protection_algs;
100   int integrity_protection_algs_size;
101   int integrity_protection_algs_unused;
102   
103   unsigned char *sgnb_security_key;
104   int sgnb_security_key_size;
105   int sgnb_security_key_unused;
106   
107   long int  bit_rate_max_up, bit_rate_max_dn;
108   
109   unsigned char *menb_sgnb_container;
110   int menb_sgnb_container_size;
111
112   unsigned char *selected_plmn;
113   int selected_plmn_size;
114   
115   unsigned char *plmn_identity;
116   int plmn_identity_size;
117
118   unsigned char *eutran_identifier;
119   int eutran_identifier_size;
120   int eutran_identifier_unused;
121
122
123   int subscriber_profile_id;
124   
125   int cause; //  CHOICE {radioNetwork CauseRadioNetwork,transport CauseTransport,protocol CauseProtocol,misc CauseMisc}
126   int cause_desc; //enum CauseRadioNetwork, enum CauseTransport...etc
127   
128   void clear(void){
129     erab_list.clear();
130     erab_admitted_list.clear();
131     erab_not_admitted_list.clear();
132     
133     subscriber_profile_id = -1;
134     menb_ue_x2ap_id = -1;
135     sgnb_ue_x2ap_id = -1;
136     encryption_algs = 0;
137     encryption_algs_size = 0;
138     integrity_protection_algs = 0;
139     integrity_protection_algs_size = 0;
140     sgnb_security_key = 0;
141     sgnb_security_key_size = 0;
142     bit_rate_max_up = -1;
143     bit_rate_max_dn = -1;
144     menb_sgnb_container = 0;
145     selected_plmn = 0;
146     selected_plmn_size = 0;
147     plmn_identity = 0;
148     plmn_identity_size = 0;
149     eutran_identifier = 0;
150     eutran_identifier_size = 0;
151     
152   };
153   
154   std::vector<struct erab_item> * get_list(void) { return &erab_list;};
155   std::vector<struct erab_item> * get_admitted_list(void) { return &erab_admitted_list;};
156   std::vector<struct erab_item> * get_not_admitted_list(void) { return &erab_not_admitted_list;};
157   
158   std::vector<struct erab_item> erab_list;
159   std::vector<struct erab_item> erab_admitted_list;
160   std::vector<struct erab_item> erab_not_admitted_list;
161
162
163 };
164
165 #endif