|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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;
57 nm->udp_timeout = ntohl (mp->
udp);
60 nm->icmp_timeout = ntohl (mp->
icmp);
75 rmp->
udp = htonl (
nm->udp_timeout);
78 rmp->
icmp = htonl (
nm->icmp_timeout);
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;
116 REPLY_MACRO (VL_API_NAT64_ADD_DEL_POOL_ADDR_RANGE_REPLY);
137 if (
a->fib_index != ~0)
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;
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>
int nat64_add_del_prefix(ip6_address_t *prefix, u8 plen, u32 vrf_id, u8 is_add)
Add/delete NAT64 prefix.
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.
vl_api_ip6_address_t i_addr
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_nat64_plugin_enable_disable_t_handler(vl_api_nat64_plugin_enable_disable_t *mp)
#define REPLY_MACRO2(t, body)
static int nat64_api_bib_walk(nat64_db_bib_entry_t *bibe, void *arg)
#define clib_memcpy(d, s, n)
static int nat64_api_interface_walk(nat64_interface_t *i, void *arg)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Dump NAT64 prefix details response.
void nat64_prefix_walk(nat64_prefix_walk_fn_t fn, void *ctx)
Walk NAT64 prefixes.
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t o_addr
static void vl_api_nat64_add_del_pool_addr_range_t_handler(vl_api_nat64_add_del_pool_addr_range_t *mp)
static void vl_api_nat64_st_dump_t_handler(vl_api_nat64_st_dump_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void nat64_db_st_walk(nat64_db_t *db, u8 proto, nat64_db_st_walk_fn_t fn, void *ctx)
Walk NAT64 session table.
Add/delete address range to NAT64 pool.
static int nat64_api_st_walk(nat64_db_st_entry_t *ste, void *arg)
Get values of timeouts for NAT64 sessions (seconds)
vl_api_ip6_prefix_t prefix
vl_api_ip6_address_t i_addr
struct nat64_api_walk_ctx_t_ nat64_api_walk_ctx_t
Add/delete NAT64 static BIB entry.
void nat64_db_bib_walk(nat64_db_t *db, u8 proto, nat64_db_bib_walk_fn_t fn, void *ctx)
Walk NAT64 BIB.
static void vl_api_nat64_set_timeouts_t_handler(vl_api_nat64_set_timeouts_t *mp)
static void setup_message_id_table(api_main_t *am)
A protocol Independent FIB table.
Enable/disable NAT64 feature on the interface.
static void vl_api_nat64_pool_addr_dump_t_handler(vl_api_nat64_pool_addr_dump_t *mp)
int nat64_plugin_enable(nat64_config_t c)
vl_api_ip4_address_t o_addr
Add/delete NAT64 pool address from specific interfce.
u32 ft_table_id
Table ID (hash key) for this FIB.
vl_api_registration_t * reg
An API client registration, only in vpp/vlib.
vl_api_ip4_address_t or_addr
void nat64_pool_addr_walk(nat64_pool_addr_walk_fn_t fn, void *ctx)
Walk NAT64 pool.
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
sll srl srl sll sra u16x4 i
vl_api_nat_config_flags_t flags
clib_error_t * nat64_api_hookup(vlib_main_t *vm)
vl_api_interface_index_t sw_if_index
#define nat64_interface_is_inside(i)
Check if NAT64 interface is inside.
static void vl_api_nat64_add_del_interface_addr_t_handler(vl_api_nat64_add_del_interface_addr_t *mp)
#define nat64_interface_is_outside(i)
Check if NAT64 interface is outside.
vl_api_ip6_prefix_t prefix
static void vl_api_nat64_interface_dump_t_handler(vl_api_nat64_interface_dump_t *mp)
static void increment_v4_address(ip4_address_t *a)
#define BAD_SW_IF_INDEX_LABEL
Enable/disable NAT64 plugin.
vl_api_nat_config_flags_t flags
static void vl_api_nat64_add_del_static_bib_t_handler(vl_api_nat64_add_del_static_bib_t *mp)
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.
vl_api_nat_config_flags_t flags
vl_api_ip6_address_t il_addr
Dump interfaces with NAT64 feature.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
static void vl_api_nat64_bib_dump_t_handler(vl_api_nat64_bib_dump_t *mp)
vl_api_interface_index_t sw_if_index
#define vec_foreach(var, vec)
Vector iterator.
vl_api_ip4_address_t start_addr
vl_api_ip4_address_t address
NAT64 pool address details response.
static void vl_api_nat64_get_timeouts_t_handler(vl_api_nat64_get_timeouts_t *mp)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_nat64_add_del_interface_t_handler(vl_api_nat64_add_del_interface_t *mp)
Dump NAT64 pool addresses.
vl_api_ip4_address_t ol_addr
NAT64 session table details response.
Dump NAT64 session table.
static int nat64_api_pool_walk(nat64_address_t *a, void *arg)
vl_api_ip4_address_t end_addr
vl_api_ip6_address_t ir_addr
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.
static int nat64_api_prefix_walk(nat64_prefix_t *p, void *arg)
int nat64_add_interface_address(u32 sw_if_index, int is_add)
NAT64 pool address from specific (DHCP addressed) interface.
int nat64_plugin_disable()
static void vl_api_nat64_prefix_dump_t_handler(vl_api_nat64_prefix_dump_t *mp)
vl_api_interface_index_t sw_if_index
int nat64_interface_add_del(u32 sw_if_index, u8 is_inside, u8 is_add)
Enable/disable NAT64 feature on the interface.
NAT64 BIB details response.
static void vl_api_nat64_add_del_prefix_t_handler(vl_api_nat64_add_del_prefix_t *mp)
Set values of timeouts for NAT64 sessions (seconds)
Get values of timeouts for NAT64 sessions reply.
void * vl_msg_api_alloc(int nbytes)
NAT64 interface details response.