diff options
author | Ole Troan <ot@cisco.com> | 2018-04-24 00:02:37 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-05-23 16:29:47 +0000 |
commit | 2c2feab7d89239c92df4622c96e853230393deb9 (patch) | |
tree | 132f56800f7c78f236fc41f025f53ba2f4835df6 /src/vnet | |
parent | 886bb1ae9b7cfef181e279f3f3b48586ea8d9ad0 (diff) |
VPPAPIGEN: Add union and enum support and IP4/IP6 address type.
Note: The Python, Java and C/C++ bindings must be updated before ip/ip_types.api can be used.
ip_types.api:
typedef ip4_address {
u8 address[4];
};
typedef ip6_address {
u8 address[16];
};
enum address_family {
ADDRESS_IP4 = 0,
ADDRESS_IP6,
};
union address_union {
vl_api_ip4_address_t ip4;
vl_api_ip6_address_t ip6;
};
typedef address {
vl_api_address_family_t af;
vl_api_address_union_t un;
};
Change-Id: I22f67092f24db5bd650a03c6f446a84cd9fd1074
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/ip/ip_types.api | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/vnet/ip/ip_types.api b/src/vnet/ip/ip_types.api new file mode 100644 index 00000000000..ec6b9d0024c --- /dev/null +++ b/src/vnet/ip/ip_types.api @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +typedef ip4_address { + u8 address[4]; +}; + +typedef ip6_address { + u8 address[16]; +}; + +enum address_family { + ADDRESS_IP4 = 0, + ADDRESS_IP6, +}; + +union address_union { + vl_api_ip4_address_t ip4; + vl_api_ip6_address_t ip6; +}; + +typedef address { + vl_api_address_family_t af; + vl_api_address_union_t un; +}; |