19 #include <nat/nat64/nat64.api_enum.h> 20 #include <nat/nat64/nat64.api_types.h> 24 #define REPLY_MSG_ID_BASE nm->msg_id_base 32 vl_api_nat64_plugin_enable_disable_reply_t *rmp;
47 REPLY_MACRO (VL_API_NAT64_PLUGIN_ENABLE_DISABLE_REPLY);
54 vl_api_nat64_set_timeouts_reply_t *rmp;
88 vl_api_nat64_add_del_pool_addr_range_reply_t *rmp;
91 u32 start_host_order, end_host_order;
97 start_host_order = clib_host_to_net_u32 (tmp[0]);
99 end_host_order = clib_host_to_net_u32 (tmp[0]);
101 count = (end_host_order - start_host_order) + 1;
103 vrf_id = clib_host_to_net_u32 (mp->
vrf_id);
107 for (i = 0; i <
count; i++)
116 REPLY_MACRO (VL_API_NAT64_ADD_DEL_POOL_ADDR_RANGE_REPLY);
175 vl_api_nat64_add_del_interface_reply_t *rmp;
186 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_REPLY);
202 rmp->
flags |= NAT_API_IS_INSIDE;
204 rmp->
flags |= NAT_API_IS_OUTSIDE;
235 vl_api_nat64_add_del_static_bib_reply_t *rmp;
236 ip6_address_t in_addr;
240 memcpy (&in_addr.as_u8, mp->
i_addr, 16);
245 clib_net_to_host_u16 (mp->
i_port),
246 clib_net_to_host_u16 (mp->
o_port),
248 clib_net_to_host_u32 (mp->
vrf_id),
251 REPLY_MACRO (VL_API_NAT64_ADD_DEL_STATIC_BIB_REPLY);
272 rmp->
i_port = bibe->in_port;
273 rmp->
o_port = bibe->out_port;
275 rmp->
proto = bibe->proto;
277 rmp->
flags |= NAT_API_IS_STATIC;
278 rmp->
ses_num = ntohl (bibe->ses_num);
313 nat64_db_bib_entry_t *bibe;
336 rmp->
proto = ste->proto;
372 vl_api_nat64_add_del_prefix_reply_t *rmp;
376 memcpy (&prefix.as_u8, mp->
prefix.address, 16);
426 vl_api_nat64_add_del_interface_addr_reply_t *rmp;
436 REPLY_MACRO (VL_API_NAT64_ADD_DEL_INTERFACE_ADDR_REPLY);
441 #include <nat/nat64/nat64.api.c>
NAT64 interface details response.
nat64_db_t * db
BIB and session DB per thread.
NAT64 BIB details response.
static void vl_api_nat64_st_dump_t_handler(vl_api_nat64_st_dump_t *mp)
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vl_api_nat_config_flags_t flags
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_nat64_prefix_dump_t_handler(vl_api_nat64_prefix_dump_t *mp)
static void vl_api_nat64_plugin_enable_disable_t_handler(vl_api_nat64_plugin_enable_disable_t *mp)
vl_api_ip6_prefix_t prefix
#define nat64_interface_is_inside(i)
Check if NAT64 interface is inside.
static void vl_api_nat64_add_del_static_bib_t_handler(vl_api_nat64_add_del_static_bib_t *mp)
vl_api_ip4_address_t or_addr
static void vl_api_nat64_add_del_prefix_t_handler(vl_api_nat64_add_del_prefix_t *mp)
int nat64_add_interface_address(u32 sw_if_index, int is_add)
NAT64 pool address from specific (DHCP addressed) interface.
static void vl_api_nat64_interface_dump_t_handler(vl_api_nat64_interface_dump_t *mp)
Add/delete NAT64 pool address from specific interfce.
void * vl_msg_api_alloc(int nbytes)
Enable/disable NAT64 feature on the interface.
#define clib_memcpy(d, s, n)
static int nat64_api_interface_walk(nat64_interface_t *i, void *arg)
vl_api_interface_index_t sw_if_index
vl_api_nat_config_flags_t flags
vl_api_ip6_address_t ir_addr
vl_api_ip4_address_t o_addr
Dump NAT64 session table.
vl_api_ip6_address_t i_addr
static int nat64_api_bib_walk(nat64_db_bib_entry_t *bibe, void *arg)
Get values of timeouts for NAT64 sessions (seconds)
u32 udp_timeout
values of various timeouts
static int nat64_api_pool_walk(nat64_address_t *a, void *arg)
Add/delete address range to NAT64 pool.
Dump NAT64 pool addresses.
static void vl_api_nat64_get_timeouts_t_handler(vl_api_nat64_get_timeouts_t *mp)
vl_api_ip6_address_t i_addr
static int nat64_api_prefix_walk(nat64_prefix_t *p, void *arg)
vl_api_ip6_address_t il_addr
static void vl_api_nat64_pool_addr_dump_t_handler(vl_api_nat64_pool_addr_dump_t *mp)
Add/delete NAT64 static BIB entry.
clib_error_t * nat64_api_hookup(vlib_main_t *vm)
An API client registration, only in vpp/vlib.
vl_api_interface_index_t sw_if_index
static void setup_message_id_table(api_main_t *am)
#define BAD_SW_IF_INDEX_LABEL
void nat64_pool_addr_walk(nat64_pool_addr_walk_fn_t fn, void *ctx)
Walk NAT64 pool.
u32 ft_table_id
Table ID (hash key) for this FIB.
struct nat64_api_walk_ctx_t_ nat64_api_walk_ctx_t
sll srl srl sll sra u16x4 i
int nat64_add_del_prefix(ip6_address_t *prefix, u8 plen, u32 vrf_id, u8 is_add)
Add/delete NAT64 prefix.
vl_api_ip4_address_t ol_addr
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void increment_v4_address(ip4_address_t *a)
static void vl_api_nat64_add_del_pool_addr_range_t_handler(vl_api_nat64_add_del_pool_addr_range_t *mp)
#define nat64_interface_is_outside(i)
Check if NAT64 interface is outside.
Get values of timeouts for NAT64 sessions reply.
void nat64_db_st_walk(nat64_db_t *db, u8 proto, nat64_db_st_walk_fn_t fn, void *ctx)
Walk NAT64 session table.
vl_api_registration_t * reg
static void vl_api_nat64_add_del_interface_t_handler(vl_api_nat64_add_del_interface_t *mp)
NAT64 pool address details response.
Dump NAT64 prefix details response.
nat64_db_bib_entry_t * nat64_db_bib_entry_by_index(nat64_db_t *db, u8 proto, u32 bibe_index)
Get BIB entry by index and protocol.
int nat64_add_del_pool_addr(u32 thread_index, ip4_address_t *addr, u32 vrf_id, u8 is_add)
Add/delete address to NAT64 pool.
void nat64_prefix_walk(nat64_prefix_walk_fn_t fn, void *ctx)
Walk NAT64 prefixes.
vl_api_ip4_address_t o_addr
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
vl_api_ip4_address_t start_addr
static int nat64_api_st_walk(nat64_db_st_entry_t *ste, void *arg)
Dump interfaces with NAT64 feature.
vl_api_interface_index_t sw_if_index
int nat64_plugin_disable()
int nat64_interface_add_del(u32 sw_if_index, u8 is_inside, u8 is_add)
Enable/disable NAT64 feature on the interface.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
vl_api_ip4_address_t end_addr
int nat64_plugin_enable(nat64_config_t c)
vl_api_ip6_prefix_t prefix
#define vec_foreach(var, vec)
Vector iterator.
vl_api_ip4_address_t address
Set values of timeouts for NAT64 sessions (seconds)
static void vl_api_nat64_set_timeouts_t_handler(vl_api_nat64_set_timeouts_t *mp)
void nat64_db_bib_walk(nat64_db_t *db, u8 proto, nat64_db_bib_walk_fn_t fn, void *ctx)
Walk NAT64 BIB.
int nat64_add_del_static_bib_entry(ip6_address_t *in_addr, ip4_address_t *out_addr, u16 in_port, u16 out_port, u8 proto, u32 vrf_id, u8 is_add)
Add/delete static NAT64 BIB entry.
static void vl_api_nat64_add_del_interface_addr_t_handler(vl_api_nat64_add_del_interface_addr_t *mp)
Enable/disable NAT64 plugin.
static void vl_api_nat64_bib_dump_t_handler(vl_api_nat64_bib_dump_t *mp)
vl_api_interface_index_t sw_if_index
vl_api_nat_config_flags_t flags
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
NAT64 session table details response.