Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 1 | /* |
| 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 Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 21 | option version = "2.0.0"; |
| 22 | |
| 23 | import "vnet/interface_types.api"; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 24 | |
Neale Ranns | 6197cb7 | 2021-06-03 14:43:21 +0000 | [diff] [blame] | 25 | enum pg_interface_mode : u8 |
| 26 | { |
| 27 | PG_API_MODE_ETHERNET = 0, |
| 28 | PG_API_MODE_IP4, |
| 29 | PG_API_MODE_IP6, |
| 30 | }; |
| 31 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 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 |
Mohsin Kazmi | 0cf5282 | 2020-06-10 12:35:05 +0200 | [diff] [blame] | 36 | @param gso_enabled - enable gso on this interface |
Mohsin Kazmi | 22e9cfd | 2019-07-23 11:54:48 +0200 | [diff] [blame] | 37 | @param gso_size - gso size on this interface |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 38 | */ |
| 39 | define pg_create_interface |
| 40 | { |
Ondrej Fabry | be56761 | 2023-04-27 00:00:33 +0200 | [diff] [blame] | 41 | option deprecated; |
| 42 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 43 | u32 client_index; |
| 44 | u32 context; |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 45 | vl_api_interface_index_t interface_id; |
| 46 | bool gso_enabled; |
Mohsin Kazmi | 22e9cfd | 2019-07-23 11:54:48 +0200 | [diff] [blame] | 47 | u32 gso_size; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 48 | }; |
Neale Ranns | 6197cb7 | 2021-06-03 14:43:21 +0000 | [diff] [blame] | 49 | define pg_create_interface_v2 |
| 50 | { |
| 51 | u32 client_index; |
| 52 | u32 context; |
| 53 | vl_api_interface_index_t interface_id; |
| 54 | bool gso_enabled; |
| 55 | u32 gso_size; |
| 56 | vl_api_pg_interface_mode_t mode; |
| 57 | }; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 58 | |
| 59 | /** \brief PacketGenerator create interface response |
| 60 | @param context - sender context, to match reply w/ request |
| 61 | @param retval - return value for request |
| 62 | */ |
| 63 | define pg_create_interface_reply |
| 64 | { |
Ondrej Fabry | be56761 | 2023-04-27 00:00:33 +0200 | [diff] [blame] | 65 | option deprecated; |
| 66 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 67 | u32 context; |
| 68 | i32 retval; |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 69 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 70 | }; |
Neale Ranns | 6197cb7 | 2021-06-03 14:43:21 +0000 | [diff] [blame] | 71 | define pg_create_interface_v2_reply |
| 72 | { |
| 73 | u32 context; |
| 74 | i32 retval; |
| 75 | vl_api_interface_index_t sw_if_index; |
| 76 | }; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 77 | |
Mohsin Kazmi | f382b06 | 2020-08-11 15:00:44 +0200 | [diff] [blame] | 78 | /** \brief PacketGenerator interface enable/disable packet coalesce |
| 79 | @param client_index - opaque cookie to identify the sender |
| 80 | @param context - sender context, to match reply w/ request |
| 81 | @param interface_id - interface index |
| 82 | @param coalesce_enabled - enable/disable packet coalesce on this interface |
| 83 | */ |
| 84 | autoreply define pg_interface_enable_disable_coalesce |
| 85 | { |
| 86 | u32 client_index; |
| 87 | u32 context; |
| 88 | vl_api_interface_index_t sw_if_index; |
| 89 | bool coalesce_enabled; |
| 90 | option status="in_progress"; |
| 91 | }; |
| 92 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 93 | /** \brief PacketGenerator capture packets on given interface request |
| 94 | @param client_index - opaque cookie to identify the sender |
| 95 | @param context - sender context, to match reply w/ request |
| 96 | @param interface_id - pg interface index |
| 97 | @param is_enabled - 1 if enabling streams, 0 if disabling |
| 98 | @param count - number of packets to be captured |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 99 | @param pcap_file_name - pacp file name to store captured packets |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 100 | */ |
| 101 | autoreply define pg_capture |
| 102 | { |
| 103 | u32 client_index; |
| 104 | u32 context; |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 105 | vl_api_interface_index_t interface_id; |
| 106 | bool is_enabled [default=true]; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 107 | u32 count; |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 108 | string pcap_file_name[]; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | /** \brief Enable / disable packet generator request |
| 112 | @param client_index - opaque cookie to identify the sender |
| 113 | @param context - sender context, to match reply w/ request |
| 114 | @param is_enabled - 1 if enabling streams, 0 if disabling |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 115 | @param stream_name - stream name to be enable/disabled, if not specified handle all streams |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 116 | */ |
| 117 | autoreply define pg_enable_disable |
| 118 | { |
| 119 | u32 client_index; |
| 120 | u32 context; |
Jakub Grajciar | db86329 | 2020-01-30 14:14:15 +0100 | [diff] [blame] | 121 | bool is_enabled [default=true]; |
| 122 | string stream_name[]; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 123 | }; |
| 124 | |
| 125 | /* |
| 126 | * Local Variables: |
| 127 | * eval: (c-set-style "gnu") |
| 128 | * End: |
| 129 | */ |