1 /* Hey Emacs use -*- mode: C -*- */
3 * Copyright (c) 2018 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 option version = "2.0.1";
18 import "vnet/ip/ip_types.api";
22 typedef fib_mpls_label
30 /** brief A path's nexthop protocol
32 enum fib_path_nh_proto
34 FIB_API_PATH_NH_PROTO_IP4 = 0,
35 FIB_API_PATH_NH_PROTO_IP6,
36 FIB_API_PATH_NH_PROTO_MPLS,
37 FIB_API_PATH_NH_PROTO_ETHERNET,
38 FIB_API_PATH_NH_PROTO_BIER,
41 /** \brief Flags for the path
45 FIB_API_PATH_FLAG_NONE = 0,
46 /* the path must resolve via an attached route */
47 FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED = 1,
48 /* the path must resolve via a host route */
49 FIB_API_PATH_FLAG_RESOLVE_VIA_HOST = 2,
50 /* pop a Pseudo Wire Control Word as well */
51 FIB_API_PATH_FLAG_POP_PW_CW = 4,
54 /* \brief A description of the 'next-hop' for a path
55 * this can be something that needs resolving like an IP address
56 * (into an adjacency or another FIB entry) or the index of another
57 * VPP object that was previously created (i.e. a UDP encap object)
62 vl_api_address_union_t address;
65 /* proto = ANY, determined by path type */
67 /* path-type = CLASSIFY */
68 u32 classify_table_index;
74 FIB_API_PATH_TYPE_NORMAL = 0,
75 /* local/for-us/receive = packet sent to VPP's L4 stack */
76 FIB_API_PATH_TYPE_LOCAL,
77 /* packet is dropped */
78 FIB_API_PATH_TYPE_DROP,
79 /* Packet is UDP encapped - set obj_id in fib_path_nh_id */
80 FIB_API_PATH_TYPE_UDP_ENCAP,
81 /* Packet is BIER encapped - set obj_id in fib_path_nh_id */
82 FIB_API_PATH_TYPE_BIER_IMP,
83 /* packet will generated ICMP unreach to sender */
84 FIB_API_PATH_TYPE_ICMP_UNREACH,
85 /* packet will generated ICMP prohibt to sender */
86 FIB_API_PATH_TYPE_ICMP_PROHIBIT,
87 /* perform a lookup based on the packet's source address */
88 FIB_API_PATH_TYPE_SOURCE_LOOKUP,
89 /* Distributed Virtual router, packet is forwarded with the original
90 L2 header unchanged */
91 FIB_API_PATH_TYPE_DVR,
92 /* packet's RX interface is changed */
93 FIB_API_PATH_TYPE_INTERFACE_RX,
94 /* packet will be sent to a classify table */
95 FIB_API_PATH_TYPE_CLASSIFY,
99 @param sw_if_index - index of the interface
100 @param table_id - The table ID in which to find the next-hop address
101 (for recursive routes, i.e. when the interface is
103 @param weight - The weight, for UCMP
104 @param preference - The preference of the path. lowest preference
106 @param rpf-id - For paths that pop to multicast, this the the
107 RPF ID the packet will be given (0 and ~0 => unset)
108 @param type - the path type
109 @param flags - path flags
110 @param proto - protocol that describes the next-hop address
111 @param nh - the next-hop/net resolving object
112 @param n_labels - the number of labels present in the stack
113 @param label_stack - a stack of MPLS labels
123 vl_api_fib_path_type_t type;
124 vl_api_fib_path_flags_t flags;
125 vl_api_fib_path_nh_proto_t proto;
126 vl_api_fib_path_nh_t nh;
128 vl_api_fib_mpls_label_t label_stack[16];