FD.io VPP  v16.06
Vector Packet Processing
cj.h
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * cj.h
4  *
5  * Copyright (c) 2013 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #ifndef __included_cj_h__
21 #define __included_cj_h__
22 
23 typedef struct {
27  u64 data[2];
28 } cj_record_t;
29 
30 typedef struct {
31  volatile u64 tail;
34  volatile u32 enable;
35 
37 } cj_main_t;
38 
39 void cj_log (u32 type, void * data0, void * data1);
40 
41 /*
42  * Supply in application main, so we can log from any library...
43  * Declare a weak reference in the library, off you go.
44  */
45 
46 #define DECLARE_CJ_GLOBAL_LOG \
47 void cj_global_log (unsigned type, void * data0, void * data1) \
48  __attribute__ ((weak)); \
49  \
50 unsigned __cj_type; \
51 void * __cj_data0; \
52 void * __cj_data1; \
53  \
54 void \
55 cj_global_log (unsigned type, void * data0, void * data1) \
56 { \
57  __cj_type = type; \
58  __cj_data0 = data0; \
59  __cj_data1 = data1; \
60 }
61 
62 #define CJ_GLOBAL_LOG_PROTOTYPE
63 void cj_global_log (unsigned type, void * data0, void * data1) \
64  __attribute__ ((weak)); \
65 
66 void cj_stop(void);
67 
68 #endif /* __included_cj_h__ */
u32 cpu
Definition: cj.h:25
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
void cj_stop(void)
Definition: cj.c:47
Definition: cj.h:30
volatile u32 enable
Definition: cj.h:34
volatile u64 tail
Definition: cj.h:31
f64 time
Definition: cj.h:24
unsigned long u64
Definition: types.h:89
void cj_log(u32 type, void *data0, void *data1)
Definition: cj.c:28
vlib_main_t * vlib_main
Definition: cj.h:36
unsigned int u32
Definition: types.h:88
void cj_global_log(unsigned type, void *data0, void *data1)
Definition: cj.h:23
u32 type
Definition: cj.h:26
double f64
Definition: types.h:140
u32 num_records
Definition: cj.h:33
cj_record_t * records
Definition: cj.h:32