Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* Hey Emacs use -*- mode: C -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2015 Cisco and/or its affiliates. |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at: |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame^] | 17 | vl_api_version 1.0.0 |
| 18 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 19 | /* |
| 20 | * Create a client registration |
| 21 | */ |
| 22 | manual_print |
| 23 | define memclnt_create { |
| 24 | i32 ctx_quota; /* requested punt context quota */ |
| 25 | u32 context; /* opaque value to be returned in the reply */ |
| 26 | u64 input_queue; /* client's queue */ |
| 27 | u8 name[64]; /* for show, find by name, whatever */ |
| 28 | u32 api_versions[8]; /* client-server pairs use as desired */ |
| 29 | }; |
| 30 | |
| 31 | define memclnt_create_reply { |
| 32 | i32 response; /* Non-negative = success */ |
Dave Barach | 557d128 | 2016-11-10 14:22:49 -0500 | [diff] [blame] | 33 | u64 handle; /* handle by which vlib knows this client */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 34 | u32 index; /* index, used e.g. by API trace replay */ |
| 35 | u32 context; /* opaque value from the create request */ |
Dave Barach | 557d128 | 2016-11-10 14:22:49 -0500 | [diff] [blame] | 36 | u64 message_table; /* serialized message table in shmem */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | /* |
| 40 | * Delete a client registration |
| 41 | */ |
| 42 | manual_print |
| 43 | define memclnt_delete { |
| 44 | u32 index; /* index, used e.g. by API trace replay */ |
| 45 | u64 handle; /* handle by which vlib knows this client */ |
| 46 | }; |
| 47 | |
| 48 | define memclnt_delete_reply { |
| 49 | i32 response; /* Non-negative = success */ |
| 50 | u64 handle; /* in case the client wonders */ |
| 51 | }; |
| 52 | |
Ole Troan | dfc9b7c | 2017-03-06 23:51:57 +0100 | [diff] [blame] | 53 | /* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 54 | * Client RX thread exit |
| 55 | */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 56 | define rx_thread_exit { |
| 57 | u8 dummy; |
| 58 | }; |
| 59 | |
| 60 | /* |
Ole Troan | dfc9b7c | 2017-03-06 23:51:57 +0100 | [diff] [blame] | 61 | * Client RX thread suspend |
| 62 | */ |
| 63 | define memclnt_rx_thread_suspend { |
| 64 | u8 dummy; |
| 65 | }; |
| 66 | |
| 67 | /* |
| 68 | * Client read timeout |
| 69 | */ |
| 70 | define memclnt_read_timeout { |
| 71 | u8 dummy; |
| 72 | }; |
| 73 | |
| 74 | /* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 75 | * RPC |
| 76 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 77 | autoreply define rpc_call { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 78 | u32 client_index; |
| 79 | u32 context; |
| 80 | u64 function; |
| 81 | u8 multicast; |
| 82 | u8 need_barrier_sync; |
| 83 | u8 send_reply; |
| 84 | u8 data[0]; |
| 85 | }; |
| 86 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 87 | /* |
| 88 | * Lookup message-ID base by name |
| 89 | */ |
| 90 | define get_first_msg_id { |
| 91 | u32 client_index; |
| 92 | u32 context; |
| 93 | u8 name[64]; |
| 94 | }; |
| 95 | |
| 96 | define get_first_msg_id_reply { |
| 97 | u32 client_index; |
| 98 | u32 context; |
| 99 | i32 retval; |
| 100 | u16 first_msg_id; |
| 101 | }; |
Dave Barach | 987e11d | 2017-02-27 13:10:27 -0500 | [diff] [blame] | 102 | |
| 103 | /* |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame^] | 104 | * Get API version table (includes built-in and plugins) |
| 105 | */ |
| 106 | typeonly define module_version { |
| 107 | u32 major; |
| 108 | u32 minor; |
| 109 | u32 patch; |
| 110 | u8 name[64]; |
| 111 | }; |
| 112 | define api_versions { |
| 113 | u32 client_index; |
| 114 | u32 context; |
| 115 | }; |
| 116 | define api_versions_reply { |
| 117 | u32 client_index; |
| 118 | u32 context; |
| 119 | i32 retval; |
| 120 | u32 count; |
| 121 | vl_api_module_version_t api_versions[count]; |
| 122 | }; |
| 123 | |
| 124 | /* |
Dave Barach | 987e11d | 2017-02-27 13:10:27 -0500 | [diff] [blame] | 125 | * Trace the plugin message-id allocator |
| 126 | * so we stand a chance of dealing with different sets of plugins |
| 127 | * at api trace replay time |
| 128 | */ |
| 129 | |
| 130 | manual_print define trace_plugin_msg_ids |
| 131 | { |
| 132 | u32 client_index; |
| 133 | u32 context; |
| 134 | u8 plugin_name[128]; |
| 135 | u16 first_msg_id; |
| 136 | u16 last_msg_id; |
| 137 | }; |
Dave Barach | 59b2565 | 2017-09-10 15:04:27 -0400 | [diff] [blame] | 138 | |
| 139 | /* |
| 140 | * Create a socket client registration. |
| 141 | */ |
| 142 | define sockclnt_create { |
| 143 | u8 name[64]; /* for show, find by name, whatever */ |
| 144 | u32 context; /* opaque value to be returned in the reply */ |
| 145 | }; |
| 146 | |
| 147 | define sockclnt_create_reply { |
| 148 | i32 response; /* Non-negative = success */ |
| 149 | u64 handle; /* handle by which vlib knows this client */ |
| 150 | u32 index; /* index, used e.g. by API trace replay */ |
| 151 | u32 context; /* opaque value from the create request */ |
| 152 | }; |
| 153 | |
| 154 | /* |
| 155 | * Delete a client registration |
| 156 | */ |
| 157 | define sockclnt_delete { |
| 158 | u32 index; /* index, used e.g. by API trace replay */ |
| 159 | u64 handle; /* handle by which vlib knows this client */ |
| 160 | }; |
| 161 | |
| 162 | define sockclnt_delete_reply { |
| 163 | i32 response; /* Non-negative = success */ |
| 164 | u64 handle; /* in case the client wonders */ |
| 165 | }; |
| 166 | |
| 167 | /* |
| 168 | * Ask vpp for a memfd shared segment |
| 169 | */ |
| 170 | define memfd_segment_create { |
| 171 | u32 client_index; |
| 172 | u32 context; |
| 173 | u64 requested_size; |
| 174 | }; |
| 175 | |
| 176 | /* |
| 177 | * Reply |
| 178 | */ |
| 179 | define memfd_segment_create_reply |
| 180 | { |
| 181 | u32 context; |
| 182 | i32 retval; |
| 183 | u32 master_fd; |
| 184 | }; |
| 185 | |
| 186 | /* |
| 187 | * Memory client ping / response |
| 188 | * Only sent on inactive connections |
| 189 | */ |
| 190 | autoreply define memclnt_keepalive |
| 191 | { |
| 192 | u32 client_index; |
| 193 | u32 context; |
| 194 | }; |