api: autogenerate api trace print/endian
[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 option version = "3.0.0";
18 manual_print typedef u8 ip4_address[4];
19 manual_print typedef u8 ip6_address[16];
20
21 enum address_family {
22   ADDRESS_IP4 = 0,
23   ADDRESS_IP6,
24 };
25
26 /* ECN code points - RFC 3168
27    https://tools.ietf.org/html/rfc3168
28 */
29 enum ip_ecn : u8 {
30   IP_API_ECN_NONE = 0,
31   IP_API_ECN_ECT0 = 1,
32   IP_API_ECN_ECT1 = 2,
33   IP_API_ECN_CE = 3,
34 };
35
36 /* DSCP code points - RFC 2474
37    https://tools.ietf.org/html/rfc2474
38    Values other than these RFC defined values are accepted.
39 */
40 enum ip_dscp : u8 {
41   IP_API_DSCP_CS0 =  0,
42   IP_API_DSCP_CS1 = 8,
43   IP_API_DSCP_AF11 = 10,
44   IP_API_DSCP_AF12 = 12,
45   IP_API_DSCP_AF13 = 14,
46   IP_API_DSCP_CS2 =  16,
47   IP_API_DSCP_AF21 = 18,
48   IP_API_DSCP_AF22 = 20,
49   IP_API_DSCP_AF23 = 22,
50   IP_API_DSCP_CS3 =  24,
51   IP_API_DSCP_AF31 = 26,
52   IP_API_DSCP_AF32 = 28,
53   IP_API_DSCP_AF33 = 30,
54   IP_API_DSCP_CS4 =  32,
55   IP_API_DSCP_AF41 = 34,
56   IP_API_DSCP_AF42 = 36,
57   IP_API_DSCP_AF43 = 38,
58   IP_API_DSCP_CS5 =  40,
59   IP_API_DSCP_EF =   46,
60   IP_API_DSCP_CS6 =  48,
61   IP_API_DSCP_CS7 =  50,
62 };
63
64 enum ip_proto {
65   IP_API_PROTO_HOPOPT = 0,
66   IP_API_PROTO_ICMP = 1,
67   IP_API_PROTO_IGMP = 2,
68   IP_API_PROTO_TCP = 6,
69   IP_API_PROTO_UDP = 17,
70   IP_API_PROTO_GRE = 47,
71   IP_API_PROTO_AH = 50,
72   IP_API_PROTO_ESP = 51,
73   IP_API_PROTO_EIGRP = 88,
74   IP_API_PROTO_OSPF = 89,
75   IP_API_PROTO_SCTP = 132,
76   IP_API_PROTO_RESERVED = 255,
77 };
78
79 union address_union {
80   vl_api_ip4_address_t ip4;
81   vl_api_ip6_address_t ip6;
82 };
83
84 manual_print typedef address {
85   vl_api_address_family_t af;
86   vl_api_address_union_t un;
87 };
88
89 manual_print typedef prefix {
90   vl_api_address_t address;
91   u8 len;
92 };
93
94 typedef mprefix {
95   vl_api_address_family_t af;
96   u16 grp_address_length;
97   vl_api_address_union_t grp_address;
98   vl_api_address_union_t src_address;
99 };
100
101 manual_print typedef ip6_prefix {
102   vl_api_ip6_address_t address;
103   u8 len;
104 };
105
106 manual_print typedef ip4_prefix {
107   vl_api_ip4_address_t address;
108   u8 len;
109 };
110
111 /** \brief A context for matching prefixes against.  (Think ip prefix list.)
112     The meaning (exact match / want subnets) of an unset matcher is left to the implementer.
113     @param le - le mut be <= to prefix.len. Default: 255 (not set).
114     @param ge - ge must be greater than le and <= max_size of prefix. Default: 255 (not set).
115
116 */
117 typedef prefix_matcher {
118   u8 le; /* [default=255] */
119   u8 ge; /* [default=255] */
120 };