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.
19 #include <vnet/fib/fib_node.h>
21 #define ABF_PLUGIN_VERSION_MAJOR 1
22 #define ABF_PLUGIN_VERSION_MINOR 0
25 * An ACL based Forwading 'policy'.
26 * This comprises the ACL index to match against and the forwarding
27 * path to take if the match is successfull.
29 * ABF policies are then 'attached' to interfaces. An input feature
30 * will run through the list of policies a match will divert the packet,
31 * if all miss then we continues down the interface's feature arc
33 typedef struct abf_policy_t_
36 * Linkage into the FIB graph
46 * The path-list describing how to forward in case of a match
48 fib_node_index_t ap_pl;
51 * Sibling index on the path-list
56 * The policy ID - as configured by the client
62 * Get an ABF object from its VPP index
64 extern abf_policy_t *abf_policy_get (index_t index);
67 * Find a ABF object from the client's policy ID
69 * @param policy_id Client's defined policy ID
70 * @return VPP's object index
72 extern index_t abf_policy_find (u32 policy_id);
75 * The FIB node type for ABF policies
77 extern fib_node_type_t abf_policy_fib_node_type;
80 * Create or update an ABF Policy
82 * @param policy_id User defined Policy ID
83 * @param acl_index The ACL the policy with match on
84 * @param rpaths The set of paths to add to the forwarding set
86 extern void abf_policy_update (u32 policy_id,
88 const fib_route_path_t * rpaths);
91 * Delete paths from an ABF Policy. If no more paths exist, the policy
94 * @param policy_id User defined Policy ID
95 * @param rpaths The set of paths to forward remove
97 extern int abf_policy_delete (u32 policy_id, const fib_route_path_t * rpaths);
100 * Callback function invoked during a walk of all policies
102 typedef int (*abf_policy_walk_cb_t) (index_t index, void *ctx);
105 * Walk/visit each of the ABF policies
107 extern void abf_policy_walk (abf_policy_walk_cb_t cb, void *ctx);
111 * fd.io coding-style-patch-verification: ON
114 * eval: (c-set-style "gnu")