X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_types.api;h=4a5cea79064d7ba68388192ec16f21fe3fda6bf0;hb=f126e746fc01c75bc99329d10ce9127b26b23814;hp=61a0898819d077360f8b1221960b30bd7a4c1beb;hpb=9d42087149a6870965896be74dc6260f72d2cac9;p=vpp.git diff --git a/src/vnet/fib/fib_types.api b/src/vnet/fib/fib_types.api index 61a0898819d..4a5cea79064 100644 --- a/src/vnet/fib/fib_types.api +++ b/src/vnet/fib/fib_types.api @@ -1,5 +1,6 @@ +/* Hey Emacs use -*- mode: C -*- */ /* - * Copyright (c) 2016 Cisco and/or its affiliates. + * Copyright (c) 2018 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -13,33 +14,116 @@ * limitations under the License. */ +option version = "2.0.0"; +import "vnet/ip/ip_types.api"; + +/** \brief MPLS label +*/ +typedef fib_mpls_label +{ + u8 is_uniform; + u32 label; + u8 ttl; + u8 exp; +}; + +/** brief A path's nexthop protocol + */ +enum fib_path_nh_proto +{ + FIB_API_PATH_NH_PROTO_IP4 = 0, + FIB_API_PATH_NH_PROTO_IP6, + FIB_API_PATH_NH_PROTO_MPLS, + FIB_API_PATH_NH_PROTO_ETHERNET, + FIB_API_PATH_NH_PROTO_BIER, +}; + +/** \brief Flags for the path + */ +enum fib_path_flags +{ + FIB_API_PATH_FLAG_NONE = 0, + /* the path must resolve via an attached route */ + FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED = 1, + /* the path must resolve via a host route */ + FIB_API_PATH_FLAG_RESOLVE_VIA_HOST = 2, + /* pop a Pseudo Wire Control Word as well */ + FIB_API_PATH_FLAG_POP_PW_CW = 4, +}; + +/* \brief A description of the 'next-hop' for a path + * this can be something that needs resolving like an IP address + * (into an adjacency or another FIB entry) or the index of another + * VPP object that was previously created (i.e. a UDP encap object) + */ +typedef fib_path_nh +{ + /* proto = IP[46] */ + vl_api_address_union_t address; + /* proto = MPLS */ + u32 via_label; + /* proto = ANY, determined by path type */ + u32 obj_id; + /* path-type = CLASSIFY */ + u32 classify_table_index; +}; + +enum fib_path_type +{ + /* Normal Paths */ + FIB_API_PATH_TYPE_NORMAL = 0, + /* local/for-us/receive = packet sent to VPP's L4 stack */ + FIB_API_PATH_TYPE_LOCAL, + /* packet is dropped */ + FIB_API_PATH_TYPE_DROP, + /* Packet is UDP encapped - set obj_id in fib_path_nh_id */ + FIB_API_PATH_TYPE_UDP_ENCAP, + /* Packet is BIER encapped - set obj_id in fib_path_nh_id */ + FIB_API_PATH_TYPE_BIER_IMP, + /* packet will generated ICMP unreach to sender */ + FIB_API_PATH_TYPE_ICMP_UNREACH, + /* packet will generated ICMP prohibt to sender */ + FIB_API_PATH_TYPE_ICMP_PROHIBIT, + /* perform a lookup based on the packet's source address */ + FIB_API_PATH_TYPE_SOURCE_LOOKUP, + /* Distributed Virtual router, packet is forwarded with the original + L2 header unchanged */ + FIB_API_PATH_TYPE_DVR, + /* packet's RX interface is changed */ + FIB_API_PATH_TYPE_INTERFACE_RX, + /* packet will be sent to a classify table */ + FIB_API_PATH_TYPE_CLASSIFY, +}; + /** \brief FIB path @param sw_if_index - index of the interface + @param table_id - The table ID in which to find the next-hop address + (for recursive routes, i.e. when the interface is + not given) @param weight - The weight, for UCMP @param preference - The preference of the path. lowest preference - is prefered - @param is_local - local if non-zero, else remote - @param is_drop - Drop the packet - @param is_udp_encap - The path describes a UDP-o-IP encapsulation. - @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2 - @param next_hop[16] - the next hop address - @param next_hop_id - Used when the path resolves via an object - that has a unique identifier. e.g. the UDP - encap object + is prefered + @param rpf-id - For paths that pop to multicast, this the the + RPF ID the packet will be given (0 and ~0 => unset) + @param type - the path type + @param flags - path flags + @param proto - protocol that describes the next-hop address + @param nh - the next-hop/net resolving object + @param n_labels - the number of labels present in the stack + @param label_stack - a stack of MPLS labels */ -typeonly define fib_path3 +typedef fib_path { u32 sw_if_index; u32 table_id; + u32 rpf_id; u8 weight; u8 preference; - u8 is_local; - u8 is_drop; - u8 is_udp_encap; - u8 afi; - u8 next_hop[16]; - u32 next_hop_id; - u32 rpf_id; + + vl_api_fib_path_type_t type; + vl_api_fib_path_flags_t flags; + vl_api_fib_path_nh_proto_t proto; + vl_api_fib_path_nh_t nh; u8 n_labels; - u32 label_stack[16]; + vl_api_fib_mpls_label_t label_stack[16]; };