FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
nsh.api
Go to the documentation of this file.
1 option version = "1.0.0";
2 
3 import "vnet/interface_types.api";
4 
5 /** \brief /** \brief Set or delete an NSH header entry keyed by NSP/NSI
6  @param client_index - opaque cookie to identify the sender
7  @param context - sender context, to match reply w/ request
8  @param is_add - add address if non-zero, else delete
9  @param nsp_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI
10  @param md_type - metadata type [1|2] - only MDType1 supported today
11  @param ver_o_c - version, O-bit and C-bit (see nsh_packet.h)
12  @param ttl - indicates the maximum SFF hops for an SFP
13  @param length - header length in n x 32bits, should be 6 for MDtype1
14  @param next_protocol - next protocol encapsulated behind NSH header: 1=Ethernet, 2=IP4, 3=IP6
15  @param c1 - 32bit Metadata type1 field (context1)
16  @param c2 - 32bit Metadata type1 field (context2)
17  @param c3 - 32bit Metadata type1 field (context3)
18  @param c4 - 32bit Metadata type1 field (context4)
19  @param tlvs - Metadata Type 2 only, Type Length Value metadata.
20 */
24  bool is_add;
36  u8 tlv[248];
37 };
38 
39 /** \brief Reply from adding NSH entry (nsh_add_del_entry)
40  @param context - sender context, to match reply w/ request
41  @param retval - 0 means all ok
42 */
43 define nsh_add_del_entry_reply {
47 };
48 
49 
50 define nsh_entry_dump {
54 };
55 
56 define nsh_entry_details {
70  u8 tlv[248];
71 };
72 
73 /** \brief Set or delete a mapping from one NSH header to another and its egress (decap to inner packet, encap NSH with outer header)
74  @param client_index - opaque cookie to identify the sender
75  @param context - sender context, to match reply w/ request
76  @param is_add - add address if non-zero, else delete
77  @param nsh_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI
78  @param mapped_nsp_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI this may be ~0
79  if next action is to decap to NSH next protocol
80  Note the following heuristic:
81  - if nsp_nsi == mapped_nsp_nsi then use-case is like SFC SFF
82  - if nsp_nsi != mapped_nsp_nsi then use-case is like SFC SF
83  Note: these are heuristics. Rules about NSI decrement are out of scope
84  @param sw_if_index - index number of outer encap for NSH egress
85  @param next_node - explicitly which node to send to
86  Note the above parameters are instantiated by "encap-gre-intf <x>" means sw_if_index x, next_node gre-input
87 */
91  bool is_add;
95  vl_api_interface_index_t sw_if_index;
96  vl_api_interface_index_t rx_sw_if_index;
98 };
99 
100 /** \brief Reply from adding NSH map (nsh_add_del_map)
101  @param context - sender context, to match reply w/ request
102  @param retval - 0 means all ok
103 */
104 define nsh_add_del_map_reply {
108 };
109 
110 define nsh_map_dump {
114 };
115 
116 define nsh_map_details {
122  vl_api_interface_index_t sw_if_index;
123  vl_api_interface_index_t rx_sw_if_index;
125 };
vl_api_nsh_add_del_entry_t::is_add
bool is_add
Definition: nsh.api:24
vl_api_nsh_add_del_entry_t::md_type
u8 md_type
Definition: nsh.api:26
vl_api_nsh_add_del_entry_reply_t::retval
i32 retval
Definition: nsh.api:45
vl_api_nsh_map_dump_t
Definition: nsh.api:110
vl_api_nsh_entry_details_t::tlv
u8 tlv[248]
Definition: nsh.api:70
vl_api_nsh_add_del_map_t::next_node
u32 next_node
Definition: nsh.api:97
vl_api_nsh_add_del_entry_reply_t::entry_index
u32 entry_index
Definition: nsh.api:46
vl_api_nsh_entry_details_t::context
u32 context
Definition: nsh.api:57
nsh_add_del_entry
int nsh_add_del_entry(nsh_add_del_entry_args_t *a, u32 *entry_indexp)
Action function for adding an NSH entry nsh_add_del_entry_args_t *a: host order.
Definition: nsh_api.c:509
vl_api_nsh_entry_details_t::c1
u32 c1
Definition: nsh.api:65
vl_api_nsh_map_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: nsh.api:122
vl_api_nsh_map_details_t::mapped_nsp_nsi
u32 mapped_nsp_nsi
Definition: nsh.api:120
vl_api_nsh_add_del_entry_t::client_index
u32 client_index
Definition: nsh.api:22
vl_api_nsh_map_details_t::rx_sw_if_index
vl_api_interface_index_t rx_sw_if_index
Definition: nsh.api:123
vl_api_nsh_map_details_t::context
u32 context
Definition: nsh.api:117
vl_api_nsh_entry_dump_t::context
u32 context
Definition: nsh.api:52
vl_api_nsh_entry_details_t::entry_index
u32 entry_index
Definition: nsh.api:58
vl_api_nsh_entry_details_t::c2
u32 c2
Definition: nsh.api:66
vl_api_nsh_add_del_map_t::rx_sw_if_index
vl_api_interface_index_t rx_sw_if_index
Definition: nsh.api:96
vl_api_nsh_entry_dump_t::client_index
u32 client_index
Definition: nsh.api:51
i32
signed int i32
Definition: types.h:77
vl_api_nsh_add_del_map_t::nsh_action
u32 nsh_action
Definition: nsh.api:94
vl_api_nsh_add_del_entry_t::tlv_length
u8 tlv_length
Definition: nsh.api:35
vl_api_nsh_map_details_t::nsh_action
u32 nsh_action
Definition: nsh.api:121
vl_api_nsh_entry_details_t::tlv_length
u8 tlv_length
Definition: nsh.api:69
vl_api_nsh_add_del_entry_t::nsp_nsi
u32 nsp_nsi
Definition: nsh.api:25
vl_api_nsh_map_details_t::map_index
u32 map_index
Definition: nsh.api:118
vl_api_nsh_add_del_entry_t
/**
Definition: nsh.api:21
vl_api_nsh_entry_details_t::next_protocol
u8 next_protocol
Definition: nsh.api:64
vl_api_nsh_entry_details_t::length
u8 length
Definition: nsh.api:63
vl_api_nsh_entry_details_t
Definition: nsh.api:56
version
option version
Definition: nsh.api:1
vl_api_nsh_add_del_entry_t::c3
u32 c3
Definition: nsh.api:33
vl_api_nsh_add_del_entry_t::ver_o_c
u8 ver_o_c
Definition: nsh.api:27
vl_api_nsh_add_del_map_reply_t::map_index
u32 map_index
Definition: nsh.api:107
vl_api_nsh_add_del_map_reply_t
Reply from adding NSH map (nsh_add_del_map)
Definition: nsh.api:104
nsh_add_del_map
int nsh_add_del_map(nsh_add_del_map_args_t *a, u32 *map_indexp)
Action function to add or del an nsh map.
Definition: nsh_api.c:345
vl_api_nsh_entry_details_t::c4
u32 c4
Definition: nsh.api:68
vl_api_nsh_entry_details_t::nsp_nsi
u32 nsp_nsi
Definition: nsh.api:59
vl_api_nsh_map_dump_t::context
u32 context
Definition: nsh.api:112
vl_api_nsh_add_del_entry_t::c4
u32 c4
Definition: nsh.api:34
vl_api_nsh_add_del_entry_t::ttl
u8 ttl
Definition: nsh.api:28
vl_api_nsh_add_del_map_reply_t::retval
i32 retval
Definition: nsh.api:106
vl_api_nsh_map_dump_t::client_index
u32 client_index
Definition: nsh.api:111
vl_api_nsh_entry_dump_t
Definition: nsh.api:50
vl_api_nsh_entry_details_t::ver_o_c
u8 ver_o_c
Definition: nsh.api:61
vl_api_nsh_map_details_t::nsp_nsi
u32 nsp_nsi
Definition: nsh.api:119
vl_api_nsh_add_del_map_t::context
u32 context
Definition: nsh.api:90
u32
unsigned int u32
Definition: types.h:88
vl_api_nsh_add_del_entry_t::c2
u32 c2
Definition: nsh.api:32
vl_api_nsh_add_del_entry_t::tlv
u8 tlv[248]
Definition: nsh.api:36
vl_api_nsh_map_details_t
Definition: nsh.api:116
u8
unsigned char u8
Definition: types.h:56
vl_api_nsh_add_del_entry_t::length
u8 length
Definition: nsh.api:29
vl_api_nsh_map_details_t::next_node
u32 next_node
Definition: nsh.api:124
vl_api_nsh_add_del_map_t::mapped_nsp_nsi
u32 mapped_nsp_nsi
Definition: nsh.api:93
vl_api_nsh_add_del_map_t::client_index
u32 client_index
Definition: nsh.api:89
vl_api_nsh_add_del_entry_t::next_protocol
u8 next_protocol
Definition: nsh.api:30
vl_api_nsh_entry_details_t::c3
u32 c3
Definition: nsh.api:67
vl_api_nsh_add_del_map_t
Set or delete a mapping from one NSH header to another and its egress (decap to inner packet,...
Definition: nsh.api:88
vl_api_nsh_entry_details_t::ttl
u8 ttl
Definition: nsh.api:62
vl_api_nsh_add_del_entry_reply_t
Reply from adding NSH entry (nsh_add_del_entry)
Definition: nsh.api:43
vl_api_nsh_entry_dump_t::entry_index
u32 entry_index
Definition: nsh.api:53
vl_api_nsh_add_del_entry_t::context
u32 context
Definition: nsh.api:23
vl_api_nsh_map_dump_t::map_index
u32 map_index
Definition: nsh.api:113
vl_api_nsh_add_del_map_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: nsh.api:95
vl_api_nsh_add_del_map_t::nsp_nsi
u32 nsp_nsi
Definition: nsh.api:92
vl_api_nsh_add_del_map_t::is_add
bool is_add
Definition: nsh.api:91
vl_api_nsh_add_del_map_reply_t::context
u32 context
Definition: nsh.api:105
vl_api_nsh_add_del_entry_t::c1
u32 c1
Definition: nsh.api:31
vl_api_nsh_entry_details_t::md_type
u8 md_type
Definition: nsh.api:60
vl_api_nsh_add_del_entry_reply_t::context
u32 context
Definition: nsh.api:44