14f10e733429635ea9430cbef8a2ac29488ea658
[vpp.git] / src / vnet / map / map.api
1 /*
2  * Copyright (c) 2016 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
16 vl_api_version 1.0.0
17
18 /** \brief Add MAP domains
19     @param client_index - opaque cookie to identify the sender
20     @param context - sender context, to match reply w/ request
21     @param ip6_prefix - Rule IPv6 prefix
22     @param ip4_prefix - Rule IPv4 prefix
23     @param ip6_src - MAP domain IPv6 BR address / Tunnel source
24     @param ip6_prefix_len - Rule IPv6 prefix length
25     @param ip4_prefix_len - Rule IPv4 prefix length
26     @param ea_bits_len - Embedded Address bits length
27     @param psid_offset - Port Set Identifider (PSID) offset
28     @param psid_length - PSID length
29     @param is_translation - MAP-E / MAP-T
30     @param mtu - MTU
31 */
32 define map_add_domain
33 {
34   u32 client_index;
35   u32 context;
36   u8 ip6_prefix[16];
37   u8 ip4_prefix[4];
38   u8 ip6_src[16];
39   u8 ip6_prefix_len;
40   u8 ip4_prefix_len;
41   u8 ip6_src_prefix_len;
42   u8 ea_bits_len;
43   u8 psid_offset;
44   u8 psid_length;
45   u8 is_translation;
46   u16 mtu;
47 };
48
49 /** \brief Reply for MAP domain add
50     @param context - returned sender context, to match reply w/ request
51     @param index - MAP domain index
52     @param retval - return code
53 */
54 define map_add_domain_reply
55 {
56   u32 context;
57   u32 index;
58   i32 retval;
59 };
60
61 /** \brief Delete MAP domain
62     @param client_index - opaque cookie to identify the sender
63     @param context - sender context, to match reply w/ request
64     @param index - MAP Domain index
65 */
66 autoreply define map_del_domain
67 {
68   u32 client_index;
69   u32 context;
70   u32 index;
71 };
72
73
74 /** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
75     @param client_index - opaque cookie to identify the sender
76     @param context - sender context, to match reply w/ request
77     @param index - MAP Domain index
78     @param is_add - If 1 add rule, if 0 delete rule
79     @param ip6_dst - MAP CE IPv6 address
80     @param psid - Rule PSID
81 */
82 autoreply define map_add_del_rule
83 {
84   u32 client_index;
85   u32 context;
86   u32 index;
87   u8 is_add;
88   u8 ip6_dst[16];
89   u16 psid;
90 };
91
92
93 /** \brief Get list of map domains
94     @param client_index - opaque cookie to identify the sender
95 */
96 define map_domain_dump
97 {
98   u32 client_index;
99   u32 context;
100 };
101
102 define map_domain_details
103 {
104   u32 context;
105   u32 domain_index;
106   u8 ip6_prefix[16];
107   u8 ip4_prefix[4];
108   u8 ip6_src[16];
109   u8 ip6_prefix_len;
110   u8 ip4_prefix_len;
111   u8 ip6_src_len;
112   u8 ea_bits_len;
113   u8 psid_offset;
114   u8 psid_length;
115   u8 flags;
116   u16 mtu;
117   u8 is_translation;
118 };
119
120 define map_rule_dump
121 {
122   u32 client_index;
123   u32 context;
124   u32 domain_index;
125 };
126
127 define map_rule_details
128 {
129   u32 context;
130   u8 ip6_dst[16];
131   u16 psid;
132 };
133
134 /** \brief Request for a single block of summary stats
135     @param client_index - opaque cookie to identify the sender
136     @param context - sender context, to match reply w/ request
137 */
138 define map_summary_stats
139 {
140   u32 client_index;
141   u32 context;
142 };
143
144 /** \brief Reply for map_summary_stats request
145     @param context - sender context, to match reply w/ request
146     @param retval - return code for request
147     @param total_bindings -
148     @param total_pkts -
149     @param total_ip4_fragments -
150     @param total_security_check -
151 */
152 define map_summary_stats_reply
153 {
154   u32 context;
155   i32 retval;
156   u64 total_bindings;
157   u64 total_pkts[2];
158   u64 total_bytes[2];
159   u64 total_ip4_fragments;
160   u64 total_security_check[2];
161 };