Support for additional NR metrics
[ric-app/mc.git] / mc-core / mc / local / rat_data_usage.h
1 #ifndef _RAT_DATA_USAGE_H__INCLUDED_
2 #define _RAT_DATA_USAGE_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 _rat_data_usage {
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_int64_t e_RAB_ID;
36         gs_int64_t secondaryRATType;
37         gs_int64_t startTimeStamp;
38         gs_int64_t endTimeStamp;
39         gs_int64_t usageCountDL;
40 };
41
42 static inline void init__rat_data_usage(struct _rat_data_usage *m){
43 }
44
45 static inline gs_retval_t get_rat_data_usage__timestamp_ms(struct packet *p, gs_uint64_t *t){
46         *t = ((struct _rat_data_usage *)(p->record.packed.values))->timestamp_ms;
47         return 0;
48 }
49
50 static inline gs_retval_t get_rat_data_usage__gnb_id(struct packet *p, struct gs_string *t){
51         t->owner=0;
52         t->data = ((struct _rat_data_usage *)(p->record.packed.values))->gnb_id;
53         if( t->data == NULL){
54                 t->length=0;
55                 return 0;
56         }
57         t->length = strlen(t->data);
58 }
59
60 static inline gs_retval_t get_rat_data_usage__id_MeNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
61         *t = ((struct _rat_data_usage *)(p->record.packed.values))->id_MeNB_UE_X2AP_ID;
62         return 0;
63 }
64
65 static inline gs_retval_t get_rat_data_usage__id_SgNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
66         *t = ((struct _rat_data_usage *)(p->record.packed.values))->id_SgNB_UE_X2AP_ID;
67         return 0;
68 }
69
70 static inline gs_retval_t get_rat_data_usage__id_MeNB_UE_X2AP_ID_Extension(struct packet *p, gs_uint32_t *t){
71         *t = ((struct _rat_data_usage *)(p->record.packed.values))->id_MeNB_UE_X2AP_ID_Extension;
72         return 0;
73 }
74
75 static inline gs_retval_t get_rat_data_usage__e_RAB_ID(struct packet *p, gs_int64_t *t){
76         *t = ((struct _rat_data_usage *)(p->record.packed.values))->e_RAB_ID;
77         return 0;
78 }
79
80 static inline gs_retval_t get_rat_data_usage__secondaryRATType(struct packet *p, gs_int64_t *t){
81         *t = ((struct _rat_data_usage *)(p->record.packed.values))->secondaryRATType;
82         return 0;
83 }
84
85 static inline gs_retval_t get_rat_data_usage__startTimeStamp(struct packet *p, gs_int64_t *t){
86         *t = ((struct _rat_data_usage *)(p->record.packed.values))->startTimeStamp;
87         return 0;
88 }
89
90 static inline gs_retval_t get_rat_data_usage__endTimeStamp(struct packet *p, gs_int64_t *t){
91         *t = ((struct _rat_data_usage *)(p->record.packed.values))->endTimeStamp;
92         return 0;
93 }
94
95 static inline gs_retval_t get_rat_data_usage__usageCountDL(struct packet *p, gs_int64_t *t){
96         *t = ((struct _rat_data_usage *)(p->record.packed.values))->usageCountDL;
97         return 0;
98 }
99
100 #endif