FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
abf_itf_attach.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 __ABF_ITF_ATTACH_H__
17 #define __ABF_ITF_ATTACH_H__
18 
19 #include <plugins/abf/abf_policy.h>
20 #include <vnet/fib/fib_path_list.h>
21 
22 /**
23  * Attachment data for an ABF policy to an interface
24  */
25 typedef struct abf_itf_attach_t_
26 {
28  /**
29  * The ACL and DPO are cached for fast DP access
30  */
31  /**
32  * ACL index to match
33  */
35 
36  /**
37  * The DPO actually used for forwarding
38  */
40 
41  /**
42  * Linkage into the FIB graph
43  */
45 
46  /**
47  * The VPP index of the ABF policy
48  */
50 
51  /**
52  * Sibling index on the policy's path list
53  */
55 
56  /**
57  * The protocol for the attachment. i.e. the protocol
58  * of the packets that are being forwarded
59  */
61 
62  /**
63  * The interface for the attachment
64  */
66 
67  /**
68  * The priority of this policy for attachment.
69  * The lower the value the higher the priority.
70  * The higher priority policies are matched first.
71  */
74 
75 /**
76  * Pool of ABF interface attachment objects
77  */
79 
80 static inline abf_itf_attach_t *
82 {
83  return (pool_elt_at_index (abf_itf_attach_pool, index));
84 }
85 
86 extern int abf_itf_attach (fib_protocol_t fproto,
87  u32 policy_id, u32 priority, u32 sw_if_index);
88 
89 extern int abf_itf_detach (fib_protocol_t fproto,
90  u32 policy_id, u32 sw_if_index);
91 
92 typedef int (*abf_itf_attach_walk_cb_t) (index_t aii, void *ctx0);
93 
94 extern void abf_itf_attach_walk (abf_itf_attach_walk_cb_t cb, void *ctx);
95 
96 /*
97  * fd.io coding-style-patch-verification: ON
98  *
99  * Local Variables:
100  * eval: (c-set-style "gnu")
101  * End:
102  */
103 
104 #endif
fib_protocol_t aia_proto
The protocol for the attachment.
CLIB_CACHE_LINE_ALIGN_MARK(marker)
abf_itf_attach_t * abf_itf_attach_pool
Pool of ABF interface attachment objects.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:41
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u32 aia_acl
The ACL and DPO are cached for fast DP access.
u32 aia_abf
The VPP index of the ABF policy.
int abf_itf_detach(fib_protocol_t fproto, u32 policy_id, u32 sw_if_index)
vl_api_interface_index_t sw_if_index
Definition: gre.api:59
static abf_itf_attach_t * abf_itf_attach_get(u32 index)
unsigned int u32
Definition: types.h:88
i32 priority
Definition: ipsec.api:92
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:170
void abf_itf_attach_walk(abf_itf_attach_walk_cb_t cb, void *ctx)
u32 aia_sibling
Sibling index on the policy&#39;s path list.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:519
int abf_itf_attach(fib_protocol_t fproto, u32 policy_id, u32 priority, u32 sw_if_index)
long ctx[MAX_CONNS]
Definition: main.c:144
struct abf_itf_attach_t_ abf_itf_attach_t
Attachment data for an ABF policy to an interface.
u32 aia_sw_if_index
The interface for the attachment.
An node in the FIB graph.
Definition: fib_node.h:295
int(* abf_itf_attach_walk_cb_t)(index_t aii, void *ctx0)
Attachment data for an ABF policy to an interface.
u32 aia_prio
The priority of this policy for attachment.
dpo_id_t aia_dpo
The DPO actually used for forwarding.
fib_node_t aia_node
Linkage into the FIB graph.