FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
stat_segment_shared.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef included_stat_segment_shared_h
17 #define included_stat_segment_shared_h
18 
19 typedef enum
20 {
28 
29 typedef struct
30 {
32  union {
33  uint64_t offset;
34  uint64_t index;
35  uint64_t value;
36  };
37  uint64_t offset_vector;
38  char name[128]; // TODO change this to pointer to "somewhere"
40 
41 /*
42  * Shared header first in the shared memory segment.
43  */
44 typedef struct
45 {
46  uint64_t version;
47  volatile uint64_t epoch;
48  volatile uint64_t in_progress;
49  volatile uint64_t directory_offset;
50  volatile uint64_t error_offset;
51  volatile uint64_t stats_offset;
53 
54 static inline void *
55 stat_segment_pointer (void *start, uint64_t offset)
56 {
57  return ((char *) start + offset);
58 }
59 
60 #endif /* included_stat_segment_shared_h */
uint64_t index
uint64_t value
static void * stat_segment_pointer(void *start, uint64_t offset)
stat_directory_type_t
uint64_t offset
string name[64]
Definition: ip.api:44
uint64_t offset_vector
template key/value backing page structure
Definition: bihash_doc.h:44
stat_directory_type_t type