dhcp ip: DSCP settings for transmitted DHCP packets
[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 /* ECN code points - RFC 3168
26    https://tools.ietf.org/html/rfc3168
27 */
28 enum ip_ecn : u8 {
29   IP_API_ECN_NONE = 0,
30   IP_API_ECN_ECT0 = 1,
31   IP_API_ECN_ECT1 = 2,
32   IP_API_ECN_CE = 3,
33 };
34
35 /* DSCP code points - RFC 2474
36    https://tools.ietf.org/html/rfc2474
37    Values other than these RFC defined values are accepted.
38 */
39 enum ip_dscp : u8 {
40   IP_API_DSCP_CS0 =  0,
41   IP_API_DSCP_CS1 = 8,
42   IP_API_DSCP_AF11 = 10,
43   IP_API_DSCP_AF12 = 12,
44   IP_API_DSCP_AF13 = 14,
45   IP_API_DSCP_CS2 =  16,
46   IP_API_DSCP_AF21 = 18,
47   IP_API_DSCP_AF22 = 20,
48   IP_API_DSCP_AF23 = 22,
49   IP_API_DSCP_CS3 =  24,
50   IP_API_DSCP_AF31 = 26,
51   IP_API_DSCP_AF32 = 28,
52   IP_API_DSCP_AF33 = 30,
53   IP_API_DSCP_CS4 =  32,
54   IP_API_DSCP_AF41 = 34,
55   IP_API_DSCP_AF42 = 36,
56   IP_API_DSCP_AF43 = 38,
57   IP_API_DSCP_CS5 =  40,
58   IP_API_DSCP_EF =   46,
59   IP_API_DSCP_CS6 =  48,
60   IP_API_DSCP_CS7 =  50,
61 };
62
63 enum ip_proto {
64   IP_API_PROTO_HOPOPT = 0,
65   IP_API_PROTO_ICMP = 1,
66   IP_API_PROTO_IGMP = 2,
67   IP_API_PROTO_TCP = 6,
68   IP_API_PROTO_UDP = 17,
69   IP_API_PROTO_GRE = 47,
70   IP_API_PROTO_AH = 50,
71   IP_API_PROTO_ESP = 51,
72   IP_API_PROTO_EIGRP = 88,
73   IP_API_PROTO_OSPF = 89,
74   IP_API_PROTO_SCTP = 132,
75   IP_API_PROTO_RESERVED = 255,
76 };
77
78 union address_union {
79   vl_api_ip4_address_t ip4;
80   vl_api_ip6_address_t ip6;
81 };
82
83 typedef address {
84   vl_api_address_family_t af;
85   vl_api_address_union_t un;
86 };
87
88 typedef prefix {
89   vl_api_address_t address;
90   u8 len;
91 };
92
93 typedef mprefix {
94   vl_api_address_family_t af;
95   u16 grp_address_length;
96   vl_api_address_union_t grp_address;
97   vl_api_address_union_t src_address;
98 };
99
100 typedef ip6_prefix {
101   vl_api_ip6_address_t address;
102   u8 len;
103 };
104
105 typedef ip4_prefix {
106   vl_api_ip4_address_t address;
107   u8 len;
108 };