27 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 34 vl_api_address_family_t af, ip46_address_t * out)
38 switch (clib_net_to_host_u32 (af))
41 memset (out, 0,
sizeof (*out));
42 clib_memcpy (&out->ip4, &in->ip4, sizeof (out->ip4));
46 clib_memcpy (&out->ip6, &in->ip6, sizeof (out->ip6));
50 ASSERT (!
"Unkown address family in API address type");
66 vl_api_address_family_t af,
67 vl_api_address_union_t * out)
70 memcpy (out->ip6.address, &in->ip6, sizeof (out->ip6));
72 memcpy (out->ip4.address, &in->ip4, sizeof (out->ip4));
100 switch (clib_net_to_host_u32 (in->address.af))
109 out->
fp_len = in->address_length;
116 out->address_length = in->
fp_len;
125 out->af = clib_host_to_net_u32 (out->af);
126 out->grp_address_length = clib_host_to_net_u16 (in->
fp_len);
137 out->
fp_len = clib_net_to_host_u16 (in->grp_address_length);
146 const vl_api_address_t *
addr = va_arg (*args, vl_api_address_t *);
148 if (
ADDRESS_IP6 == clib_net_to_host_u32 (addr->af))
159 const vl_api_address_union_t *
addr =
160 va_arg (*args, vl_api_address_union_t *);
161 vl_api_address_family_t af = va_arg (*args, vl_api_address_family_t);
174 const vl_api_prefix_t *pfx = va_arg (*args, vl_api_prefix_t *);
177 &pfx->address, pfx->address_length);
fib_protocol_t fp_proto
protocol type
ip46_address_t fp_src_addr
static ip46_type_t ip_address_union_decode(const vl_api_address_union_t *in, vl_api_address_family_t af, ip46_address_t *out)
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
ip46_type_t fib_proto_to_ip46(fib_protocol_t fproto)
Convert from fib_protocol to ip46_type.
memset(h->entries, 0, sizeof(h->entries[0])*entries)
Aggregrate type for a prefix.
u8 * format_vl_api_address(u8 *s, va_list *args)
u16 fp_len
The mask length.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
#define ip46_address_is_ip4(ip46)
void ip_mprefix_encode(const mfib_prefix_t *in, vl_api_mprefix_t *out)
#define clib_memcpy(a, b, c)
Aggregrate type for a prefix.
static void ip_address_union_encode(const ip46_address_t *in, vl_api_address_family_t af, vl_api_address_union_t *out)
u8 * format_vl_api_address_union(u8 *s, va_list *args)
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
fib_protocol_t fp_proto
protocol type
u8 * format_vl_api_prefix(u8 *s, va_list *args)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
u16 fp_len
The mask length.
void ip_mprefix_decode(const vl_api_mprefix_t *in, mfib_prefix_t *out)
ip46_address_t fp_grp_addr
The address type is not deriveable from the fp_addr member.