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 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 17 | /* |
| 18 | * Create a client registration |
| 19 | */ |
| 20 | manual_print |
| 21 | define memclnt_create { |
| 22 | i32 ctx_quota; /* requested punt context quota */ |
| 23 | u32 context; /* opaque value to be returned in the reply */ |
| 24 | u64 input_queue; /* client's queue */ |
| 25 | u8 name[64]; /* for show, find by name, whatever */ |
| 26 | u32 api_versions[8]; /* client-server pairs use as desired */ |
| 27 | }; |
| 28 | |
| 29 | define memclnt_create_reply { |
| 30 | i32 response; /* Non-negative = success */ |
Dave Barach | 557d128 | 2016-11-10 14:22:49 -0500 | [diff] [blame] | 31 | u64 handle; /* handle by which vlib knows this client */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 32 | u32 index; /* index, used e.g. by API trace replay */ |
| 33 | u32 context; /* opaque value from the create request */ |
Dave Barach | 557d128 | 2016-11-10 14:22:49 -0500 | [diff] [blame] | 34 | u64 message_table; /* serialized message table in shmem */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | /* |
| 38 | * Delete a client registration |
| 39 | */ |
| 40 | manual_print |
| 41 | define memclnt_delete { |
| 42 | u32 index; /* index, used e.g. by API trace replay */ |
| 43 | u64 handle; /* handle by which vlib knows this client */ |
| 44 | }; |
| 45 | |
| 46 | define memclnt_delete_reply { |
| 47 | i32 response; /* Non-negative = success */ |
| 48 | u64 handle; /* in case the client wonders */ |
| 49 | }; |
| 50 | |
| 51 | /* |
| 52 | * Client RX thread exit |
| 53 | */ |
| 54 | |
| 55 | define rx_thread_exit { |
| 56 | u8 dummy; |
| 57 | }; |
| 58 | |
| 59 | /* |
| 60 | * RPC |
| 61 | */ |
| 62 | define rpc_call { |
| 63 | u32 client_index; |
| 64 | u32 context; |
| 65 | u64 function; |
| 66 | u8 multicast; |
| 67 | u8 need_barrier_sync; |
| 68 | u8 send_reply; |
| 69 | u8 data[0]; |
| 70 | }; |
| 71 | |
| 72 | define rpc_reply { |
| 73 | i32 retval; |
| 74 | u32 context; |
| 75 | }; |
| 76 | |
| 77 | /* |
| 78 | * Lookup message-ID base by name |
| 79 | */ |
| 80 | define get_first_msg_id { |
| 81 | u32 client_index; |
| 82 | u32 context; |
| 83 | u8 name[64]; |
| 84 | }; |
| 85 | |
| 86 | define get_first_msg_id_reply { |
| 87 | u32 client_index; |
| 88 | u32 context; |
| 89 | i32 retval; |
| 90 | u16 first_msg_id; |
| 91 | }; |
Dave Barach | 987e11d | 2017-02-27 13:10:27 -0500 | [diff] [blame] | 92 | |
| 93 | /* |
| 94 | * Trace the plugin message-id allocator |
| 95 | * so we stand a chance of dealing with different sets of plugins |
| 96 | * at api trace replay time |
| 97 | */ |
| 98 | |
| 99 | manual_print define trace_plugin_msg_ids |
| 100 | { |
| 101 | u32 client_index; |
| 102 | u32 context; |
| 103 | u8 plugin_name[128]; |
| 104 | u16 first_msg_id; |
| 105 | u16 last_msg_id; |
| 106 | }; |