Support for additional NR metrics
[ric-app/mc.git] / mc-core / mc / local / SgNB_ack_for_ue_measurements.h
1 #ifndef _SGNB_ACK_FOR_UE_MEASUREMENTS_H__INCLUDED_
2 #define _SGNB_ACK_FOR_UE_MEASUREMENTS_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 _SgNB_ack_for_ue_measurements {
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_uint32_t id_MeNB_UE_X2AP_ID_Extension;
35         gs_uint32_t ssbFrequency;
36         gs_int8_t ssbFrequency_exists;
37         gs_uint32_t refFreqCSI_RS;
38         gs_int8_t refFreqCSI_RS_exists;
39         gs_uint32_t physCellId;
40         gs_int8_t physCellId_exists;
41         gs_uint32_t rsrq;
42         gs_int8_t rsrq_exists;
43         gs_uint32_t rsrp;
44         gs_int8_t rsrp_exists;
45         gs_uint32_t sinr;
46         gs_int8_t sinr_exists;
47 };
48
49 static inline void init__SgNB_ack_for_ue_measurements(struct _SgNB_ack_for_ue_measurements *m){
50         m->ssbFrequency_exists=0;
51         m->refFreqCSI_RS_exists=0;
52         m->physCellId_exists=0;
53         m->rsrq_exists=0;
54         m->rsrp_exists=0;
55         m->sinr_exists=0;
56 }
57
58 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__timestamp_ms(struct packet *p, gs_uint64_t *t){
59         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->timestamp_ms;
60         return 0;
61 }
62
63 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__gnb_id(struct packet *p, struct gs_string *t){
64         t->owner=0;
65         t->data = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->gnb_id;
66         if( t->data == NULL){
67                 t->length=0;
68                 return 0;
69         }
70         t->length = strlen(t->data);
71 }
72
73 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__id_MeNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
74         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->id_MeNB_UE_X2AP_ID;
75         return 0;
76 }
77
78 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__id_SgNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
79         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->id_SgNB_UE_X2AP_ID;
80         return 0;
81 }
82
83 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__id_MeNB_UE_X2AP_ID_Extension(struct packet *p, gs_uint32_t *t){
84         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->id_MeNB_UE_X2AP_ID_Extension;
85         return 0;
86 }
87
88 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__ssbFrequency(struct packet *p, gs_uint32_t *t){
89         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->ssbFrequency;
90         return (((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->ssbFrequency==0);
91 }
92
93 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__refFreqCSI_RS(struct packet *p, gs_uint32_t *t){
94         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->refFreqCSI_RS;
95         return (((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->refFreqCSI_RS==0);
96 }
97
98 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__physCellId(struct packet *p, gs_uint32_t *t){
99         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->physCellId;
100         return (((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->physCellId==0);
101 }
102
103 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__rsrq(struct packet *p, gs_uint32_t *t){
104         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->rsrq;
105         return (((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->rsrq==0);
106 }
107
108 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__rsrp(struct packet *p, gs_uint32_t *t){
109         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->rsrp;
110         return (((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->rsrp==0);
111 }
112
113 static inline gs_retval_t get_SgNB_ack_for_ue_measurements__sinr(struct packet *p, gs_uint32_t *t){
114         *t = ((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->sinr;
115         return (((struct _SgNB_ack_for_ue_measurements *)(p->record.packed.values))->sinr==0);
116 }
117
118 #endif