2 * Copyright (c) 2015-2016 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 option version = "2.0.0";
18 import "vnet/interface_types.api";
19 import "vnet/ethernet/ethernet_types.api";
21 /** \brief Create host-interface
22 @param client_index - opaque cookie to identify the sender
23 @param context - sender context, to match reply w/ request
24 @param hw_addr - interface MAC
25 @param use_random_hw_addr - use random generated MAC
26 @param host_if_name - interface name
28 define af_packet_create
35 vl_api_mac_address_t hw_addr;
36 bool use_random_hw_addr;
37 string host_if_name[64];
40 /** \brief Create host-interface response
41 @param context - sender context, to match reply w/ request
42 @param retval - return value for request
44 define af_packet_create_reply
50 vl_api_interface_index_t sw_if_index;
53 /** \brief Create host-interface
54 @param client_index - opaque cookie to identify the sender
55 @param context - sender context, to match reply w/ request
56 @param hw_addr - interface MAC
57 @param use_random_hw_addr - use random generated MAC
58 @param host_if_name - interface name
59 @param rx_frame_size - frame size for RX
60 @param tx_frame_size - frame size for TX
61 @param rx_frames_per_block - frames per block for RX
62 @param tx_frames_per_block - frames per block for TX
63 @param flags - flags for the af_packet interface creation
64 @param num_rx_queues - number of rx queues
66 define af_packet_create_v2
73 vl_api_mac_address_t hw_addr;
74 bool use_random_hw_addr;
75 string host_if_name[64];
78 u32 rx_frames_per_block;
79 u32 tx_frames_per_block;
81 u16 num_rx_queues [default=1];
84 /** \brief Create host-interface response
85 @param context - sender context, to match reply w/ request
86 @param retval - return value for request
88 define af_packet_create_v2_reply
94 vl_api_interface_index_t sw_if_index;
98 AF_PACKET_API_MODE_ETHERNET = 1, /* mode ethernet */
99 AF_PACKET_API_MODE_IP = 2, /* mode ip */
102 enum af_packet_flags {
103 AF_PACKET_API_FLAG_QDISC_BYPASS = 1, /* enable the qdisc bypass */
104 AF_PACKET_API_FLAG_CKSUM_GSO = 2, /* enable checksum/gso */
105 AF_PACKET_API_FLAG_VERSION_2 = 8 [backwards_compatible], /* af packet v2, default is v3 */
108 /** \brief Create host-interface
109 @param client_index - opaque cookie to identify the sender
110 @param context - sender context, to match reply w/ request
111 @param mode - 1 - Ethernet, 2 - IP
112 @param hw_addr - interface MAC
113 @param use_random_hw_addr - use random generated MAC
114 @param host_if_name - interface name
115 @param rx_frame_size - frame size for RX
116 @param tx_frame_size - frame size for TX
117 @param rx_frames_per_block - frames per block for RX
118 @param tx_frames_per_block - frames per block for TX
119 @param flags - flags for the af_packet interface creation
120 @param num_rx_queues - number of rx queues
121 @param num_tx_queues - number of tx queues
123 define af_packet_create_v3
128 vl_api_af_packet_mode_t mode;
129 vl_api_mac_address_t hw_addr;
130 bool use_random_hw_addr;
131 string host_if_name[64];
134 u32 rx_frames_per_block;
135 u32 tx_frames_per_block;
136 vl_api_af_packet_flags_t flags;
137 u16 num_rx_queues [default=1];
138 u16 num_tx_queues [default=1];
141 /** \brief Create host-interface response
142 @param context - sender context, to match reply w/ request
143 @param retval - return value for request
145 define af_packet_create_v3_reply
149 vl_api_interface_index_t sw_if_index;
152 /** \brief Delete host-interface
153 @param client_index - opaque cookie to identify the sender
154 @param context - sender context, to match reply w/ request
155 @param host_if_name - interface name
157 autoreply define af_packet_delete
162 string host_if_name[64];
165 /** \brief Set l4 offload checksum calculation
166 @param client_index - opaque cookie to identify the sender
167 @param context - sender context, to match reply w/ request
169 autoreply define af_packet_set_l4_cksum_offload
174 vl_api_interface_index_t sw_if_index;
178 /** \brief Dump af_packet interfaces request */
179 define af_packet_dump
185 /** \brief Reply for af_packet dump request
186 @param sw_if_index - software index of af_packet interface
187 @param host_if_name - interface name
189 define af_packet_details
192 vl_api_interface_index_t sw_if_index;
193 string host_if_name[64];
198 * eval: (c-set-style "gnu")