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.
18 This file defines packet-generator interface APIs.
21 option version = "2.0.0";
23 import "vnet/interface_types.api";
25 enum pg_interface_mode : u8
27 PG_API_MODE_ETHERNET = 0,
32 /** \brief PacketGenerator create interface request
33 @param client_index - opaque cookie to identify the sender
34 @param context - sender context, to match reply w/ request
35 @param interface_id - interface index
36 @param gso_enabled - enable gso on this interface
37 @param gso_size - gso size on this interface
39 define pg_create_interface
43 vl_api_interface_index_t interface_id;
47 define pg_create_interface_v2
51 vl_api_interface_index_t interface_id;
54 vl_api_pg_interface_mode_t mode;
57 /** \brief PacketGenerator create interface response
58 @param context - sender context, to match reply w/ request
59 @param retval - return value for request
61 define pg_create_interface_reply
65 vl_api_interface_index_t sw_if_index;
67 define pg_create_interface_v2_reply
71 vl_api_interface_index_t sw_if_index;
74 /** \brief PacketGenerator interface enable/disable packet coalesce
75 @param client_index - opaque cookie to identify the sender
76 @param context - sender context, to match reply w/ request
77 @param interface_id - interface index
78 @param coalesce_enabled - enable/disable packet coalesce on this interface
80 autoreply define pg_interface_enable_disable_coalesce
84 vl_api_interface_index_t sw_if_index;
85 bool coalesce_enabled;
86 option status="in_progress";
89 /** \brief PacketGenerator capture packets on given interface request
90 @param client_index - opaque cookie to identify the sender
91 @param context - sender context, to match reply w/ request
92 @param interface_id - pg interface index
93 @param is_enabled - 1 if enabling streams, 0 if disabling
94 @param count - number of packets to be captured
95 @param pcap_file_name - pacp file name to store captured packets
97 autoreply define pg_capture
101 vl_api_interface_index_t interface_id;
102 bool is_enabled [default=true];
104 string pcap_file_name[];
107 /** \brief Enable / disable packet generator request
108 @param client_index - opaque cookie to identify the sender
109 @param context - sender context, to match reply w/ request
110 @param is_enabled - 1 if enabling streams, 0 if disabling
111 @param stream_name - stream name to be enable/disabled, if not specified handle all streams
113 autoreply define pg_enable_disable
117 bool is_enabled [default=true];
118 string stream_name[];
123 * eval: (c-set-style "gnu")