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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
15 /* Include the generated file, see BUILT_SOURCES in Makefile.am */
16 #include <acl/acl.api.h>
21 #define _uword_fmt "%lld"
22 #define _uword_cast (long long)
24 #define _uword_fmt "%ld"
25 #define _uword_cast long
29 vl_api_acl_rule_t_print (vl_api_acl_rule_t * a, void *handle)
31 vl_print (handle, "vl_api_acl_rule_t:\n");
32 vl_print (handle, "is_permit: %u\n", (unsigned) a->is_permit);
33 vl_print (handle, "is_ipv6: %u\n", (unsigned) a->is_ipv6);
36 for (_i = 0; _i < 16; _i++)
38 vl_print (handle, "src_ip_addr[%d]: %u\n", _i, a->src_ip_addr[_i]);
41 vl_print (handle, "src_ip_prefix_len: %u\n",
42 (unsigned) a->src_ip_prefix_len);
45 for (_i = 0; _i < 16; _i++)
47 vl_print (handle, "dst_ip_addr[%d]: %u\n", _i, a->dst_ip_addr[_i]);
50 vl_print (handle, "dst_ip_prefix_len: %u\n",
51 (unsigned) a->dst_ip_prefix_len);
52 vl_print (handle, "proto: %u\n", (unsigned) a->proto);
53 vl_print (handle, "srcport_or_icmptype_first: %u\n",
54 (unsigned) a->srcport_or_icmptype_first);
55 vl_print (handle, "srcport_or_icmptype_last: %u\n",
56 (unsigned) a->srcport_or_icmptype_last);
57 vl_print (handle, "dstport_or_icmpcode_first: %u\n",
58 (unsigned) a->dstport_or_icmpcode_first);
59 vl_print (handle, "dstport_or_icmpcode_last: %u\n",
60 (unsigned) a->dstport_or_icmpcode_last);
61 vl_print (handle, "tcp_flags_mask: %u\n", (unsigned) a->tcp_flags_mask);
62 vl_print (handle, "tcp_flags_value: %u\n", (unsigned) a->tcp_flags_value);
67 vl_api_acl_add_replace_t_print (vl_api_acl_add_replace_t * a, void *handle)
70 vl_print (handle, "vl_api_acl_add_replace_t:\n");
71 vl_print (handle, "_vl_msg_id: %u\n", (unsigned) a->_vl_msg_id);
72 vl_print (handle, "client_index: %u\n", (unsigned) a->client_index);
73 vl_print (handle, "context: %u\n", (unsigned) a->context);
74 vl_print (handle, "acl_index: %u\n", (unsigned) a->acl_index);
75 vl_print (handle, "count: %u\n", (unsigned) a->count);
76 vl_print (handle, "r ----- \n");
77 for (i = 0; i < a->count; i++)
79 vl_print (handle, " r[%d]:\n", i);
80 vl_api_acl_rule_t_print (&a->r[i], handle);
82 vl_print (handle, "r ----- END \n");
87 static inline void *vl_api_acl_details_t_print (vl_api_acl_details_t *a,void *handle)
89 vl_print(handle, "vl_api_acl_details_t:\n");
90 vl_print(handle, "_vl_msg_id: %u\n", (unsigned) a->_vl_msg_id);
91 vl_print(handle, "context: %u\n", (unsigned) a->context);
92 vl_print(handle, "acl_index: %u\n", (unsigned) a->acl_index);
95 for (_i = 0; _i < 64; _i++) {
96 vl_print(handle, "tag[%d]: %u\n", _i, a->tag[_i]);
99 vl_print(handle, "count: %u\n", (unsigned) a->count);
100 vl_print(handle, "r ----- \n");
101 // FIXME vl_api_acl_rule_t_print(&a->r, handle);
102 vl_print(handle, "r ----- END \n");
107 vl_api_macip_acl_rule_t_print (vl_api_macip_acl_rule_t * a, void *handle)
109 vl_print (handle, "vl_api_macip_acl_rule_t:\n");
110 vl_print (handle, "is_permit: %u\n", (unsigned) a->is_permit);
111 vl_print (handle, "is_ipv6: %u\n", (unsigned) a->is_ipv6);
114 for (_i = 0; _i < 6; _i++)
116 vl_print (handle, "src_mac[%d]: %u\n", _i, a->src_mac[_i]);
121 for (_i = 0; _i < 6; _i++)
123 vl_print (handle, "src_mac_mask[%d]: %u\n", _i, a->src_mac_mask[_i]);
128 for (_i = 0; _i < 16; _i++)
130 vl_print (handle, "src_ip_addr[%d]: %u\n", _i, a->src_ip_addr[_i]);
133 vl_print (handle, "src_ip_prefix_len: %u\n",
134 (unsigned) a->src_ip_prefix_len);
139 vl_api_macip_acl_add_t_print (vl_api_macip_acl_add_t * a, void *handle)
142 vl_print (handle, "vl_api_macip_acl_add_t:\n");
143 vl_print (handle, "_vl_msg_id: %u\n", (unsigned) a->_vl_msg_id);
144 vl_print (handle, "client_index: %u\n", (unsigned) a->client_index);
145 vl_print (handle, "context: %u\n", (unsigned) a->context);
146 vl_print (handle, "count: %u\n", (unsigned) a->count);
147 vl_print (handle, "r ----- \n");
148 for (i = 0; i < a->count; i++)
150 vl_print (handle, " r[%d]:\n", i);
151 vl_api_macip_acl_rule_t_print (&a->r[i], handle);
153 vl_print (handle, "r ----- END \n");
157 static inline void *vl_api_macip_acl_details_t_print (vl_api_macip_acl_details_t *a,void *handle)
160 vl_print(handle, "vl_api_macip_acl_details_t:\n");
161 vl_print(handle, "_vl_msg_id: %u\n", (unsigned) a->_vl_msg_id);
162 vl_print(handle, "context: %u\n", (unsigned) a->context);
163 vl_print(handle, "acl_index: %u\n", (unsigned) a->acl_index);
166 for (_i = 0; _i < 64; _i++) {
167 vl_print(handle, "tag[%d]: %u\n", _i, a->tag[_i]);
170 vl_print(handle, "count: %u\n", (unsigned) a->count);
171 vl_print(handle, "r ----- \n");
172 for (i = 0; i < a->count; i++)
174 vl_print (handle, " r[%d]:\n", i);
175 vl_api_macip_acl_rule_t_print (&a->r[i], handle);
177 vl_print(handle, "r ----- END \n");
181 #endif /* vl_printfun */
186 #undef clib_net_to_host_uword
188 #define clib_net_to_host_uword clib_net_to_host_u64
190 #define clib_net_to_host_uword clib_net_to_host_u32
194 * Manual endian/print functions created by copypasting the automatically
195 * generated ones with small required adjustments. Appears the codegen
196 * can't make code to print the contents of custom-type array.
200 vl_api_acl_rule_t_endian (vl_api_acl_rule_t * a)
202 /* a->is_permit = a->is_permit (no-op) */
203 /* a->is_ipv6 = a->is_ipv6 (no-op) */
204 /* a->src_ip_addr[0..15] = a->src_ip_addr[0..15] (no-op) */
205 /* a->src_ip_prefix_len = a->src_ip_prefix_len (no-op) */
206 /* a->dst_ip_addr[0..15] = a->dst_ip_addr[0..15] (no-op) */
207 /* a->dst_ip_prefix_len = a->dst_ip_prefix_len (no-op) */
208 /* a->proto = a->proto (no-op) */
209 a->srcport_or_icmptype_first =
210 clib_net_to_host_u16 (a->srcport_or_icmptype_first);
211 a->srcport_or_icmptype_last =
212 clib_net_to_host_u16 (a->srcport_or_icmptype_last);
213 a->dstport_or_icmpcode_first =
214 clib_net_to_host_u16 (a->dstport_or_icmpcode_first);
215 a->dstport_or_icmpcode_last =
216 clib_net_to_host_u16 (a->dstport_or_icmpcode_last);
217 /* a->tcp_flags_mask = a->tcp_flags_mask (no-op) */
218 /* a->tcp_flags_value = a->tcp_flags_value (no-op) */
222 vl_api_acl_add_replace_t_endian (vl_api_acl_add_replace_t * a)
225 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
226 a->client_index = clib_net_to_host_u32 (a->client_index);
227 a->context = clib_net_to_host_u32 (a->context);
228 a->acl_index = clib_net_to_host_u32 (a->acl_index);
229 a->count = clib_net_to_host_u32 (a->count);
230 for (i = 0; i < a->count; i++)
232 vl_api_acl_rule_t_endian (&a->r[i]);
236 static inline void vl_api_acl_details_t_endian (vl_api_acl_details_t *a)
239 a->_vl_msg_id = clib_net_to_host_u16(a->_vl_msg_id);
240 a->context = clib_net_to_host_u32(a->context);
241 a->acl_index = clib_net_to_host_u32(a->acl_index);
242 /* a->tag[0..63] = a->tag[0..63] (no-op) */
243 a->count = clib_net_to_host_u32(a->count);
244 for (i = 0; i < a->count; i++)
246 vl_api_acl_rule_t_endian (&a->r[i]);
250 static inline void vl_api_acl_interface_list_details_t_endian (vl_api_acl_interface_list_details_t *a)
253 a->_vl_msg_id = clib_net_to_host_u16(a->_vl_msg_id);
254 a->context = clib_net_to_host_u32(a->context);
255 a->sw_if_index = clib_net_to_host_u32(a->sw_if_index);
256 /* a->count = a->count (no-op) */
257 /* a->n_input = a->n_input (no-op) */
258 for(i=0; i<a->count; i++) {
259 a->acls[i] = clib_net_to_host_u32(a->acls[i]);
263 static inline void vl_api_acl_interface_set_acl_list_t_endian (vl_api_acl_interface_set_acl_list_t *a)
266 a->_vl_msg_id = clib_net_to_host_u16(a->_vl_msg_id);
267 a->client_index = clib_net_to_host_u32(a->client_index);
268 a->context = clib_net_to_host_u32(a->context);
269 a->sw_if_index = clib_net_to_host_u32(a->sw_if_index);
270 /* a->count = a->count (no-op) */
271 /* a->n_input = a->n_input (no-op) */
272 for(i=0; i<a->count; i++) {
273 a->acls[i] = clib_net_to_host_u32(a->acls[i]);
278 vl_api_macip_acl_rule_t_endian (vl_api_macip_acl_rule_t * a)
280 /* a->is_permit = a->is_permit (no-op) */
281 /* a->is_ipv6 = a->is_ipv6 (no-op) */
282 /* a->src_mac[0..5] = a->src_mac[0..5] (no-op) */
283 /* a->src_mac_mask[0..5] = a->src_mac_mask[0..5] (no-op) */
284 /* a->src_ip_addr[0..15] = a->src_ip_addr[0..15] (no-op) */
285 /* a->src_ip_prefix_len = a->src_ip_prefix_len (no-op) */
289 vl_api_macip_acl_add_t_endian (vl_api_macip_acl_add_t * a)
292 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
293 a->client_index = clib_net_to_host_u32 (a->client_index);
294 a->context = clib_net_to_host_u32 (a->context);
295 a->count = clib_net_to_host_u32 (a->count);
296 for (i = 0; i < a->count; i++)
298 vl_api_macip_acl_rule_t_endian (&a->r[i]);
302 static inline void vl_api_macip_acl_details_t_endian (vl_api_macip_acl_details_t *a)
305 a->_vl_msg_id = clib_net_to_host_u16(a->_vl_msg_id);
306 a->context = clib_net_to_host_u32(a->context);
307 a->acl_index = clib_net_to_host_u32(a->acl_index);
308 /* a->tag[0..63] = a->tag[0..63] (no-op) */
309 a->count = clib_net_to_host_u32(a->count);
310 for (i = 0; i < a->count; i++)
312 vl_api_macip_acl_rule_t_endian (&a->r[i]);
319 #endif /* vl_printfun */