FD.io VPP
v21.06-3-gbb25fbf28
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
19
#include <
plugins/gbp/gbp_contract.h
>
20
21
/**
22
* per-packet trace data
23
*/
24
typedef
struct
gbp_policy_trace_t_
25
{
26
/* per-pkt trace data */
27
gbp_scope_t
scope
;
28
sclass_t
sclass
;
29
sclass_t
dclass
;
30
gbp_rule_action_t
action
;
31
u32
flags
;
32
u32
acl_match
;
33
u32
rule_match
;
34
}
gbp_policy_trace_t
;
35
36
/* packet trace format function */
37
u8
*
format_gbp_policy_trace
(
u8
* s, va_list * args);
38
39
static_always_inline
void
40
gbp_policy_trace
(
vlib_main_t
*
vm
,
vlib_node_runtime_t
*
node
,
vlib_buffer_t
*
b
,
const
gbp_contract_key_t
*
key
,
gbp_rule_action_t
action
,
u32
acl_match,
u32
rule_match
)
41
{
42
gbp_policy_trace_t
*t;
43
44
if
(
PREDICT_TRUE
(!(
b
->
flags
& VLIB_BUFFER_IS_TRACED)))
45
return
;
46
47
t =
vlib_add_trace
(
vm
,
node
,
b
,
sizeof
(*t));
48
t->
sclass
=
key
->gck_src;
49
t->
dclass
=
key
->gck_dst;
50
t->
scope
=
key
->gck_scope;
51
t->
action
=
action
;
52
t->
flags
=
vnet_buffer2
(
b
)->gbp.flags;
53
t->
acl_match
= acl_match;
54
t->
rule_match
=
rule_match
;
55
}
56
57
#endif
/* __GBP_POLICY_H__ */
gbp_policy_trace_t_::acl_match
u32 acl_match
Definition:
gbp_policy.h:32
node
vlib_main_t vlib_node_runtime_t * node
Definition:
nat44_ei.c:3047
gbp_policy_trace_t
struct gbp_policy_trace_t_ gbp_policy_trace_t
per-packet trace data
gbp_policy_trace_t_::rule_match
u32 rule_match
Definition:
gbp_policy.h:33
gbp_policy_trace
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, gbp_rule_action_t action, u32 acl_match, u32 rule_match)
Definition:
gbp_policy.h:40
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition:
nat44_ei.c:3047
vnet_buffer2
#define vnet_buffer2(b)
Definition:
buffer.h:499
gbp_policy_trace_t_::action
gbp_rule_action_t action
Definition:
gbp_policy.h:30
rule_match
vlib_parse_match_function_t rule_match
Definition:
parse.h:189
key
typedef key
Definition:
ipsec_types.api:88
gbp_contract.h
static_always_inline
#define static_always_inline
Definition:
clib.h:112
format_gbp_policy_trace
u8 * format_gbp_policy_trace(u8 *s, va_list *args)
Definition:
gbp_policy.c:24
gbp_rule_action_t
enum gbp_rule_action_t_ gbp_rule_action_t
gbp_policy_trace_t_
per-packet trace data
Definition:
gbp_policy.h:24
sclass_t
u16 sclass_t
Definition:
gbp_types.h:25
u32
unsigned int u32
Definition:
types.h:88
gbp_policy_trace_t_::flags
u32 flags
Definition:
gbp_policy.h:31
gbp_contract_key_t_
The key for an Contract.
Definition:
gbp_contract.h:48
gbp_policy_trace_t_::scope
gbp_scope_t scope
Definition:
gbp_policy.h:27
vlib_main_t
Definition:
main.h:102
vlib_add_trace
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition:
trace.c:628
gbp_policy_trace_t_::sclass
sclass_t sclass
Definition:
gbp_policy.h:28
b
vlib_buffer_t ** b
Definition:
nat44_ei_out2in.c:717
u8
unsigned char u8
Definition:
types.h:56
vlib_node_runtime_t
Definition:
node.h:454
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition:
clib.h:125
action
vl_api_mac_event_action_t action
Definition:
l2.api:211
gbp_policy_trace_t_::dclass
sclass_t dclass
Definition:
gbp_policy.h:29
gbp_scope_t
u16 gbp_scope_t
Definition:
gbp_types.h:24
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition:
buffer.h:133
vlib_buffer_t
VLIB buffer representation.
Definition:
buffer.h:111
src
plugins
gbp
gbp_policy.h
Generated on Sat Jan 8 2022 10:03:49 for FD.io VPP by
1.8.17