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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __ABF_ITF_ATTACH_H__
17 #define __ABF_ITF_ATTACH_H__
19 #include <plugins/abf/abf_policy.h>
20 #include <vnet/fib/fib_path_list.h>
23 * Attachment data for an ABF policy to an interface
25 typedef struct abf_itf_attach_t_
27 CLIB_CACHE_LINE_ALIGN_MARK (marker);
29 * The ACL and DPO are cached for fast DP access
37 * The DPO actually used for forwarding
42 * Linkage into the FIB graph
47 * The VPP index of the ABF policy
52 * Sibling index on the policy's path list
57 * The protocol for the attachment. i.e. the protocol
58 * of the packets that are being forwarded
60 fib_protocol_t aia_proto;
63 * The interface for the attachment
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.
76 * Pool of ABF interface attachment objects
78 extern abf_itf_attach_t *abf_itf_attach_pool;
80 static inline abf_itf_attach_t *
81 abf_itf_attach_get (u32 index)
83 return (pool_elt_at_index (abf_itf_attach_pool, index));
86 extern int abf_itf_attach (fib_protocol_t fproto,
87 u32 policy_id, u32 priority, u32 sw_if_index);
89 extern int abf_itf_detach (fib_protocol_t fproto,
90 u32 policy_id, u32 sw_if_index);
92 typedef int (*abf_itf_attach_walk_cb_t) (index_t aii, void *ctx0);
94 extern void abf_itf_attach_walk (abf_itf_attach_walk_cb_t cb, void *ctx);
97 * fd.io coding-style-patch-verification: ON
100 * eval: (c-set-style "gnu")