Punt: specify packets by IP protocol Type
[vpp.git] / src / vnet / ip / ip_types.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2018 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
17 typedef u8 ip4_address[4];
18 typedef u8 ip6_address[16];
19
20 enum address_family {
21   ADDRESS_IP4 = 0,
22   ADDRESS_IP6,
23 };
24
25 enum ip_proto {
26   IP_API_PROTO_TCP = 6,
27   IP_API_PROTO_UDP = 17,
28   IP_API_PROTO_EIGRP = 88,
29   IP_API_PROTO_OSPF = 89,
30 };
31
32 union address_union {
33   vl_api_ip4_address_t ip4;
34   vl_api_ip6_address_t ip6;
35 };
36
37 typedef address {
38   vl_api_address_family_t af;
39   vl_api_address_union_t un;
40 };
41
42 typedef prefix {
43   vl_api_address_t address;
44   u8 address_length;
45 };
46
47 typedef mprefix {
48   vl_api_address_family_t af;
49   u16 grp_address_length;
50   vl_api_address_union_t grp_address;
51   vl_api_address_union_t src_address;
52 };
53
54 typedef ip6_prefix {
55   vl_api_ip6_address_t prefix;
56   u8 len;
57 };
58
59 typedef ip4_prefix {
60   vl_api_ip4_address_t prefix;
61   u8 len;
62 };