Ole Troan | 793be46 | 2020-12-04 13:15:30 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020 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 | |
Ole Troan | 793be46 | 2020-12-04 13:15:30 +0100 | [diff] [blame] | 16 | import "vnet/ip/ip_types.api"; |
| 17 | |
| 18 | autoreply define test_prefix { |
| 19 | vl_api_prefix_t pref; |
| 20 | }; |
| 21 | |
| 22 | enumflag test_enumflags { |
| 23 | RED = 0x1, |
| 24 | BLUE = 0x2, |
| 25 | GREEN = 0x4, |
| 26 | }; |
| 27 | |
| 28 | autoreply define test_enum { |
| 29 | vl_api_test_enumflags_t flags; |
| 30 | }; |
Ole Troan | fb0afab | 2021-02-11 11:13:46 +0100 | [diff] [blame] | 31 | |
| 32 | typedef test_stringtype { |
| 33 | string str[]; |
| 34 | }; |
| 35 | |
| 36 | autoreply define test_string { |
| 37 | vl_api_test_stringtype_t str; |
| 38 | }; |
Ole Troan | cf0102b | 2021-02-12 11:48:12 +0100 | [diff] [blame] | 39 | |
Ole Troan | fb0afab | 2021-02-11 11:13:46 +0100 | [diff] [blame] | 40 | autoreply define test_string2 { |
| 41 | string str[]; |
| 42 | }; |
Ole Troan | cf0102b | 2021-02-12 11:48:12 +0100 | [diff] [blame] | 43 | |
| 44 | /* Test of toplevel VLA with basetype */ |
| 45 | autoreply define test_vla { |
| 46 | u32 count; |
| 47 | u32 vla[count]; |
| 48 | }; |
| 49 | |
| 50 | /* Test of toplevel VLA with u8 */ |
| 51 | autoreply define test_vla2 { |
| 52 | u32 count; |
| 53 | u8 vla[count]; |
| 54 | }; |
| 55 | /* Test of toplevel VLA with user type */ |
| 56 | typedef test_vlatype { |
| 57 | u32 data; |
| 58 | }; |
| 59 | autoreply define test_vla3 { |
| 60 | u32 count; |
| 61 | vl_api_test_vlatype_t vla[count]; |
| 62 | }; |
| 63 | /* Test of typedefed VLA */ |
| 64 | typedef test_vlatype2 { |
| 65 | u32 count; |
| 66 | u32 vla[count]; |
| 67 | }; |
| 68 | autoreply define test_vla4 { |
| 69 | vl_api_test_vlatype2_t data; |
| 70 | }; |
| 71 | /* u8 string in typedef */ |
| 72 | typedef test_vlatype3 { |
| 73 | u32 count; |
| 74 | u8 vla[count]; |
| 75 | }; |
| 76 | autoreply define test_vla5 { |
| 77 | vl_api_test_vlatype3_t data; |
| 78 | }; |
| 79 | |
Ole Troan | 316967c | 2021-02-16 00:31:52 +0100 | [diff] [blame] | 80 | /* Addresses */ |
| 81 | autoreply define test_addresses { |
| 82 | vl_api_address_t a; |
| 83 | }; |