blob: 3630e0c2f0d7836b1885940abd9cd58f95b21956 [file] [log] [blame]
Neale Rannsb8d44812017-11-10 06:53:54 -08001/*
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:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 */
15
16/** \file
17
18 This file defines packet-generator interface APIs.
19*/
20
Jakub Grajciardb863292020-01-30 14:14:15 +010021option version = "2.0.0";
22
23import "vnet/interface_types.api";
Neale Rannsb8d44812017-11-10 06:53:54 -080024
Neale Ranns6197cb72021-06-03 14:43:21 +000025enum pg_interface_mode : u8
26{
27 PG_API_MODE_ETHERNET = 0,
28 PG_API_MODE_IP4,
29 PG_API_MODE_IP6,
30};
31
Neale Rannsb8d44812017-11-10 06:53:54 -080032/** \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
Mohsin Kazmi0cf52822020-06-10 12:35:05 +020036 @param gso_enabled - enable gso on this interface
Mohsin Kazmi22e9cfd2019-07-23 11:54:48 +020037 @param gso_size - gso size on this interface
Neale Rannsb8d44812017-11-10 06:53:54 -080038*/
39define pg_create_interface
40{
41 u32 client_index;
42 u32 context;
Jakub Grajciardb863292020-01-30 14:14:15 +010043 vl_api_interface_index_t interface_id;
44 bool gso_enabled;
Mohsin Kazmi22e9cfd2019-07-23 11:54:48 +020045 u32 gso_size;
Neale Rannsb8d44812017-11-10 06:53:54 -080046};
Neale Ranns6197cb72021-06-03 14:43:21 +000047define pg_create_interface_v2
48{
49 u32 client_index;
50 u32 context;
51 vl_api_interface_index_t interface_id;
52 bool gso_enabled;
53 u32 gso_size;
54 vl_api_pg_interface_mode_t mode;
55};
Neale Rannsb8d44812017-11-10 06:53:54 -080056
57/** \brief PacketGenerator create interface response
58 @param context - sender context, to match reply w/ request
59 @param retval - return value for request
60*/
61define pg_create_interface_reply
62{
63 u32 context;
64 i32 retval;
Jakub Grajciardb863292020-01-30 14:14:15 +010065 vl_api_interface_index_t sw_if_index;
Neale Rannsb8d44812017-11-10 06:53:54 -080066};
Neale Ranns6197cb72021-06-03 14:43:21 +000067define pg_create_interface_v2_reply
68{
69 u32 context;
70 i32 retval;
71 vl_api_interface_index_t sw_if_index;
72};
Neale Rannsb8d44812017-11-10 06:53:54 -080073
Mohsin Kazmif382b062020-08-11 15:00:44 +020074/** \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
79*/
80autoreply define pg_interface_enable_disable_coalesce
81{
82 u32 client_index;
83 u32 context;
84 vl_api_interface_index_t sw_if_index;
85 bool coalesce_enabled;
86 option status="in_progress";
87};
88
Neale Rannsb8d44812017-11-10 06:53:54 -080089/** \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
Jakub Grajciardb863292020-01-30 14:14:15 +010095 @param pcap_file_name - pacp file name to store captured packets
Neale Rannsb8d44812017-11-10 06:53:54 -080096*/
97autoreply define pg_capture
98{
99 u32 client_index;
100 u32 context;
Jakub Grajciardb863292020-01-30 14:14:15 +0100101 vl_api_interface_index_t interface_id;
102 bool is_enabled [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800103 u32 count;
Jakub Grajciardb863292020-01-30 14:14:15 +0100104 string pcap_file_name[];
Neale Rannsb8d44812017-11-10 06:53:54 -0800105};
106
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
Jakub Grajciardb863292020-01-30 14:14:15 +0100111 @param stream_name - stream name to be enable/disabled, if not specified handle all streams
Neale Rannsb8d44812017-11-10 06:53:54 -0800112*/
113autoreply define pg_enable_disable
114{
115 u32 client_index;
116 u32 context;
Jakub Grajciardb863292020-01-30 14:14:15 +0100117 bool is_enabled [default=true];
118 string stream_name[];
Neale Rannsb8d44812017-11-10 06:53:54 -0800119};
120
121/*
122 * Local Variables:
123 * eval: (c-set-style "gnu")
124 * End:
125 */