|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
23 #include <nat/det44/det44.api_enum.h>
24 #include <nat/det44/det44.api_types.h>
30 #define REPLY_MSG_ID_BASE dm->msg_id_base
37 vl_api_det44_add_del_map_reply_t *rmp;
53 u16 lo_port = 0, hi_port = 0;
62 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
94 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
153 vl_api_det44_close_session_out_reply_t *rmp;
166 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
170 key.ext_host_addr = ext_addr;
176 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
182 REPLY_MACRO (VL_API_DET44_CLOSE_SESSION_OUT_REPLY);
189 vl_api_det44_close_session_in_reply_t *rmp;
202 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
205 key.ext_host_addr = ext_addr;
210 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
216 REPLY_MACRO (VL_API_DET44_CLOSE_SESSION_OUT_REPLY);
273 vl_api_det44_plugin_enable_disable_reply_t *rmp;
286 REPLY_MACRO (VL_API_DET44_PLUGIN_ENABLE_DISABLE_REPLY);
294 vl_api_det44_interface_add_del_feature_reply_t *rmp;
300 REPLY_MACRO (VL_API_DET44_INTERFACE_ADD_DEL_FEATURE_REPLY);
343 vl_api_det44_set_timeouts_reply_t *rmp;
346 timeouts.
udp = ntohl (mp->
udp);
365 rmp->
udp = htonl (timeouts.
udp);
381 vl_api_nat_det_add_del_map_reply_t *rmp;
398 u16 lo_port = 0, hi_port = 0;
407 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
439 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
498 vl_api_nat_det_close_session_out_reply_t *rmp;
511 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
515 key.ext_host_addr = ext_addr;
521 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
527 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
535 vl_api_nat_det_close_session_in_reply_t *rmp;
548 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
551 key.ext_host_addr = ext_addr;
556 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
562 REPLY_MACRO (VL_API_NAT_DET_CLOSE_SESSION_OUT_REPLY);
616 #include <nat/det44/det44.api.c>
#define det44_interface_is_inside(i)
Check if Deterministic NAT interface is inside.
static void vl_api_det44_forward_t_handler(vl_api_det44_forward_t *mp)
Deterministic NAT (CGN) definitions.
struct nat_timeouts_t::@742 tcp
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_det44_add_del_map_t_handler(vl_api_det44_add_del_map_t *mp)
vl_api_ip4_address_t in_addr
static void vl_api_det44_close_session_in_t_handler(vl_api_det44_close_session_in_t *mp)
#define REPLY_MACRO2(t, body)
Deterministic NAT sessions reply.
#define clib_memcpy(d, s, n)
int snat_det_add_map(ip4_address_t *in_addr, u8 in_plen, ip4_address_t *out_addr, u8 out_plen, int is_add)
Add/delete deterministic NAT mapping.
vl_api_ip4_address_t in_addr
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
nat_timeouts_t det44_get_timeouts()
vl_api_ip4_address_t in_addr
vl_api_interface_index_t sw_if_index
Close deterministic NAT session by inside address and port.
static void sent_nat_det_map_details(snat_det_map_t *m, vl_api_registration_t *reg, u32 context)
static void vl_api_det44_plugin_enable_disable_t_handler(vl_api_det44_plugin_enable_disable_t *mp)
ip4_address_t ext_host_addr
static void sent_det44_map_details(snat_det_map_t *m, vl_api_registration_t *reg, u32 context)
vl_api_ip4_address_t out_addr
static void vl_api_nat_det_forward_t_handler(vl_api_nat_det_forward_t *mp)
static void vl_api_det44_get_timeouts_t_handler(vl_api_det44_get_timeouts_t *mp)
vl_api_ip4_address_t ext_addr
vl_api_ip4_address_t ext_addr
static void vl_api_det44_map_dump_t_handler(vl_api_det44_map_dump_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
clib_error_t * det44_api_hookup(vlib_main_t *vm)
vl_api_ip4_address_t in_addr
det44_interface_t * interfaces
static void vl_api_det44_interface_add_del_feature_t_handler(vl_api_det44_interface_add_del_feature_t *mp)
Enable/disable DET44 plugin.
vl_api_ip4_address_t out_addr
static_always_inline snat_det_map_t * snat_det_map_by_user(ip4_address_t *user_addr)
static void vl_api_nat_det_add_del_map_t_handler(vl_api_nat_det_add_del_map_t *mp)
int det44_plugin_disable()
static void send_det44_session_details(snat_det_session_t *s, vl_api_registration_t *reg, u32 context)
Get inside address from outside address and port.
vl_api_ip4_address_t out_addr
Get values of timeouts for DET44 sessions (seconds)
#define pool_foreach(VAR, POOL)
Iterate through pool.
Get inside address from outside address and port reply.
static_always_inline void snat_det_reverse(snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
snat_det_map_t * det_maps
int det44_plugin_enable(det44_config_t c)
static void vl_api_det44_interface_dump_t_handler(vl_api_det44_interface_dump_t *mp)
Enable/disable DET44 feature on the interface.
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
Close DET44 session by outside address and port.
DET44 interface details response.
static void det44_send_interface_details(det44_interface_t *i, vl_api_registration_t *reg, u32 context)
vl_api_ip4_address_t in_addr
Add/delete DET44 mapping.
static void vl_api_det44_session_dump_t_handler(vl_api_det44_session_dump_t *mp)
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t in_addr
Get inside address from outside address and port reply.
#define BAD_SW_IF_INDEX_LABEL
static void vl_api_nat_det_map_dump_t_handler(vl_api_nat_det_map_dump_t *mp)
vl_api_ip4_address_t ext_addr
static void vl_api_nat_det_reverse_t_handler(vl_api_nat_det_reverse_t *mp)
Close deterministic NAT session by outside address and port.
Get outside address and port range from inside address.
static_always_inline void snat_det_ses_close(snat_det_map_t *dm, snat_det_session_t *ses)
Dump NAT deterministic mappings.
Get values of timeouts for DET44 sessions reply.
vl_api_ip4_address_t in_addr
Get outside address and port range from inside address.
int det44_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del)
static_always_inline snat_det_session_t * snat_det_get_ses_by_out(snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
Get inside address from outside address and port.
static void vl_api_nat_det_close_session_out_t_handler(vl_api_nat_det_close_session_out_t *mp)
vl_api_ip4_address_t user_addr
static_always_inline snat_det_session_t * snat_det_find_ses_by_in(snat_det_map_t *dm, ip4_address_t *in_addr, u16 in_port, snat_det_out_key_t out_key)
static void vl_api_det44_set_timeouts_t_handler(vl_api_det44_set_timeouts_t *mp)
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t ext_addr
static void vl_api_nat_det_session_dump_t_handler(vl_api_nat_det_session_dump_t *mp)
vl_api_ip4_address_t user_addr
vl_api_ip4_address_t in_addr
static void vl_api_det44_close_session_out_t_handler(vl_api_det44_close_session_out_t *mp)
int det44_set_timeouts(nat_timeouts_t *timeouts)
Dump interfaces with DET44 feature.
#define vec_foreach(var, vec)
Vector iterator.
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t out_addr
snat_det_session_t * sessions
static_always_inline void snat_det_forward(snat_det_map_t *dm, ip4_address_t *in_addr, ip4_address_t *out_addr, u16 *lo_port)
Dump determinstic NAT sessions.
static void send_nat_det_session_details(snat_det_session_t *s, vl_api_registration_t *reg, u32 context)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
Get outside address and port range from inside address.
Set values of timeouts for DET44 sessions (seconds)
static void vl_api_nat_det_close_session_in_t_handler(vl_api_nat_det_close_session_in_t *mp)
vl_api_ip4_address_t ext_addr
#define DET44_SES_PER_USER
#define det44_interface_is_outside(i)
Check if Deterministic NAT interface is outside.
vl_api_interface_index_t sw_if_index
static void vl_api_det44_reverse_t_handler(vl_api_det44_reverse_t *mp)
vl_api_ip4_address_t out_addr
vl_api_interface_index_t sw_if_index
Close DET44 session by inside address and port.
vl_api_ip4_address_t out_addr
static_always_inline u32 snat_det_user_ses_offset(ip4_address_t *addr, u8 plen)
vl_api_ip4_address_t in_addr
Add/delete NAT deterministic mapping.
static_always_inline snat_det_map_t * snat_det_map_by_out(ip4_address_t *out_addr)
vl_api_ip4_address_t ext_addr
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t in_addr
void * vl_msg_api_alloc(int nbytes)
Get outside address and port range from inside address.