FD.io VPP  v19.08-27-gf4dcae4
Vector Packet Processing
gbp_policy.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 __GBP_POLICY_H__
17 #define __GBP_POLICY_H__
18 
20 
21 /**
22  * per-packet trace data
23  */
24 typedef struct gbp_policy_trace_t_
25 {
26  /* per-pkt trace data */
33 
34 /* packet trace format function */
35 u8 * format_gbp_policy_trace (u8 * s, va_list * args);
36 
39 {
41 
42  if (PREDICT_TRUE (!(b->flags & VLIB_BUFFER_IS_TRACED)))
43  return;
44 
45  t = vlib_add_trace (vm, node, b, sizeof (*t));
46  t->sclass = key->gck_src;
47  t->dclass = key->gck_dst;
48  t->scope = key->gck_scope;
49  t->allowed = allowed;
50  t->flags = vnet_buffer2 (b)->gbp.flags;
51 }
52 
53 #endif /* __GBP_POLICY_H__ */
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:124
u16 sclass_t
Definition: gbp_types.h:25
#define vnet_buffer2(b)
Definition: buffer.h:420
#define PREDICT_TRUE(x)
Definition: clib.h:112
The key for an Contract.
Definition: gbp_contract.h:47
unsigned char u8
Definition: types.h:56
gbp_scope_t scope
Definition: gbp_policy.h:27
#define static_always_inline
Definition: clib.h:99
per-packet trace data
Definition: gbp_policy.h:24
u8 * format_gbp_policy_trace(u8 *s, va_list *args)
Definition: gbp_policy.c:24
u16 gbp_scope_t
Definition: gbp_types.h:24
unsigned int u32
Definition: types.h:88
sclass_t gck_src
source and destination EPGs for which the ACL applies
Definition: gbp_contract.h:57
vlib_main_t * vm
Definition: buffer.c:312
struct gbp_policy_trace_t_ gbp_policy_trace_t
per-packet trace data
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:55
gbp_scope_t gck_scope
Definition: gbp_contract.h:53
VLIB buffer representation.
Definition: buffer.h:102
typedef key
Definition: ipsec.api:245
static_always_inline void gbp_policy_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, const gbp_contract_key_t *key, u8 allowed)
Definition: gbp_policy.h:38