df22ca6acd411eaea54395530f0378b11b8ffe86
[ric-app/mc.git] / mc-core / mc / local / serv_nr_cell.h
1 #ifndef _SERV_NR_CELL_H__INCLUDED_
2 #define _SERV_NR_CELL_H__INCLUDED_
3
4 /*
5 ==============================================================================
6
7         Copyright (c) 2018-2019 AT&T Intellectual Property.
8
9    Licensed under the Apache License, Version 2.0 (the "License");
10    you may not use this file except in compliance with the License.
11    You may obtain a copy of the License at
12
13        http://www.apache.org/licenses/LICENSE-2.0
14
15    Unless required by applicable law or agreed to in writing, software
16    distributed under the License is distributed on an "AS IS" BASIS,
17    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18    See the License for the specific language governing permissions and
19    limitations under the License.
20 =============================================================================
21 */
22
23
24 #include "packet.h"
25
26
27 #include "/usr/local/include/protobuf-c/protobuf-c.h"
28
29 struct _serv_nr_cell {
30         gs_uint64_t timestamp_ms;
31         gs_sp_t gnb_id;
32         gs_int64_t id_MeNB_UE_X2AP_ID;
33         gs_int64_t id_SgNB_UE_X2AP_ID;
34         gs_int64_t servCellID;
35         gs_uint32_t physCellId;
36         gs_int8_t physCellId_exists;
37         gs_uint32_t rsrq;
38         gs_int8_t rsrq_exists;
39         gs_uint32_t rsrp;
40         gs_int8_t rsrp_exists;
41         gs_uint32_t sinr;
42         gs_int8_t sinr_exists;
43 };
44
45 static inline void init__serv_nr_cell(struct _serv_nr_cell *m){
46         m->physCellId_exists=0;
47         m->rsrq_exists=0;
48         m->rsrp_exists=0;
49         m->sinr_exists=0;
50 }
51
52 static inline gs_retval_t get_serv_nr_cell__timestamp_ms(struct packet *p, gs_uint64_t *t){
53         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->timestamp_ms;
54         return 0;
55 }
56
57 static inline gs_retval_t get_serv_nr_cell__gnb_id(struct packet *p, struct gs_string *t){
58         t->owner=0;
59         t->data = ((struct _serv_nr_cell *)(p->record.packed.values))->gnb_id;
60         if( t->data == NULL){
61                 t->length=0;
62                 return 0;
63         }
64         t->length = strlen(t->data);
65 }
66
67 static inline gs_retval_t get_serv_nr_cell__id_MeNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
68         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->id_MeNB_UE_X2AP_ID;
69         return 0;
70 }
71
72 static inline gs_retval_t get_serv_nr_cell__id_SgNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
73         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->id_SgNB_UE_X2AP_ID;
74         return 0;
75 }
76
77 static inline gs_retval_t get_serv_nr_cell__servCellID(struct packet *p, gs_int64_t *t){
78         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->servCellID;
79         return 0;
80 }
81
82 static inline gs_retval_t get_serv_nr_cell__physCellId(struct packet *p, gs_uint32_t *t){
83         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->physCellId;
84         return (((struct _serv_nr_cell *)(p->record.packed.values))->physCellId==0);
85 }
86
87 static inline gs_retval_t get_serv_nr_cell__rsrq(struct packet *p, gs_uint32_t *t){
88         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->rsrq;
89         return (((struct _serv_nr_cell *)(p->record.packed.values))->rsrq==0);
90 }
91
92 static inline gs_retval_t get_serv_nr_cell__rsrp(struct packet *p, gs_uint32_t *t){
93         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->rsrp;
94         return (((struct _serv_nr_cell *)(p->record.packed.values))->rsrp==0);
95 }
96
97 static inline gs_retval_t get_serv_nr_cell__sinr(struct packet *p, gs_uint32_t *t){
98         *t = ((struct _serv_nr_cell *)(p->record.packed.values))->sinr;
99         return (((struct _serv_nr_cell *)(p->record.packed.values))->sinr==0);
100 }
101
102 #endif