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;
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;
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);
334 det44_send_interface_details(i, reg, mp->context);
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;
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;
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> static void vl_api_det44_set_timeouts_t_handler(vl_api_det44_set_timeouts_t *mp)
static void sent_nat_det_map_details(snat_det_map_t *m, vl_api_registration_t *reg, u32 context)
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 ext_addr
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)
static void vl_api_det44_get_timeouts_t_handler(vl_api_det44_get_timeouts_t *mp)
int det44_plugin_enable(det44_config_t c)
static void send_nat_det_session_details(snat_det_session_t *s, vl_api_registration_t *reg, u32 context)
vl_api_ip4_address_t out_addr
static void vl_api_det44_plugin_enable_disable_t_handler(vl_api_det44_plugin_enable_disable_t *mp)
int det44_plugin_disable()
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)
vl_api_ip4_address_t out_addr
static void vl_api_det44_reverse_t_handler(vl_api_det44_reverse_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)
#define REPLY_MACRO2(t, body)
vl_api_ip4_address_t in_addr
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Get outside address and port range from inside address.
Deterministic NAT (CGN) definitions.
Get inside address from outside address and port reply.
Get values of timeouts for DET44 sessions reply.
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t in_addr
vl_api_ip4_address_t out_addr
static void vl_api_det44_interface_dump_t_handler(vl_api_det44_interface_dump_t *mp)
struct nat_timeouts_s::@74 tcp
void * vl_msg_api_alloc(int nbytes)
static void vl_api_nat_det_session_dump_t_handler(vl_api_nat_det_session_dump_t *mp)
vl_api_ip4_address_t ext_addr
vl_api_ip4_address_t out_addr
#define clib_memcpy(d, s, n)
static_always_inline u32 snat_det_user_ses_offset(ip4_address_t *addr, u8 plen)
Dump interfaces with DET44 feature.
static void vl_api_det44_forward_t_handler(vl_api_det44_forward_t *mp)
vl_api_ip4_address_t in_addr
static void vl_api_nat_det_add_del_map_t_handler(vl_api_nat_det_add_del_map_t *mp)
Get values of timeouts for DET44 sessions (seconds)
static void vl_api_det44_session_dump_t_handler(vl_api_det44_session_dump_t *mp)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
ip4_address_t ext_host_addr
nat_timeouts_t det44_get_timeouts()
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_always_inline snat_det_map_t * snat_det_map_by_out(ip4_address_t *out_addr)
static void vl_api_nat_det_forward_t_handler(vl_api_nat_det_forward_t *mp)
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t ext_addr
vl_api_ip4_address_t ext_addr
snat_det_session_t * sessions
Close deterministic NAT session by outside address and port.
Get inside address from outside address and port.
Get outside address and port range from inside address.
vl_api_ip4_address_t in_addr
DET44 interface details response.
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t in_addr
snat_det_map_t * det_maps
vl_api_interface_index_t sw_if_index
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
Add/delete NAT deterministic mapping.
vl_api_ip4_address_t ext_addr
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)
Add/delete DET44 mapping.
sll srl srl sll sra u16x4 i
static void vl_api_det44_map_dump_t_handler(vl_api_det44_map_dump_t *mp)
vl_api_ip4_address_t out_addr
vl_api_ip4_address_t out_addr
Close DET44 session by inside address and port.
static void vl_api_det44_close_session_out_t_handler(vl_api_det44_close_session_out_t *mp)
clib_error_t * det44_api_hookup(vlib_main_t *vm)
static_always_inline void snat_det_ses_close(snat_det_map_t *dm, snat_det_session_t *ses)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Close DET44 session by outside address and port.
vl_api_ip4_address_t in_addr
int det44_set_timeouts(nat_timeouts_t *timeouts)
static void send_det44_session_details(snat_det_session_t *s, vl_api_registration_t *reg, u32 context)
static void sent_det44_map_details(snat_det_map_t *m, vl_api_registration_t *reg, u32 context)
#define DET44_SES_PER_USER
Get inside address from outside address and port reply.
vl_api_ip4_address_t in_addr
Close deterministic NAT session by inside address and port.
Dump determinstic NAT sessions.
#define det44_interface_is_inside(i)
Check if Deterministic NAT interface is inside.
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.
static void vl_api_nat_det_map_dump_t_handler(vl_api_nat_det_map_dump_t *mp)
static void vl_api_det44_close_session_in_t_handler(vl_api_det44_close_session_in_t *mp)
Enable/disable DET44 feature on the interface.
static void vl_api_nat_det_close_session_in_t_handler(vl_api_nat_det_close_session_in_t *mp)
det44_interface_t * interfaces
Dump NAT deterministic mappings.
Get outside address and port range from inside address.
Deterministic NAT sessions reply.
#define det44_interface_is_outside(i)
Check if Deterministic NAT interface is outside.
static void det44_send_interface_details(det44_interface_t *i, vl_api_registration_t *reg, u32 context)
static void vl_api_det44_interface_add_del_feature_t_handler(vl_api_det44_interface_add_del_feature_t *mp)
vl_api_ip4_address_t in_addr
int det44_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del)
vl_api_ip4_address_t out_addr
#define vec_foreach(var, vec)
Vector iterator.
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
static void vl_api_det44_add_del_map_t_handler(vl_api_det44_add_del_map_t *mp)
static_always_inline snat_det_map_t * snat_det_map_by_user(ip4_address_t *user_addr)
Get inside address from outside address and port.
vl_api_ip4_address_t user_addr
vl_api_ip4_address_t in_addr
vl_api_ip4_address_t in_addr
vl_api_ip4_address_t out_addr
Set values of timeouts for DET44 sessions (seconds)
Get outside address and port range from inside address.
vl_api_interface_index_t sw_if_index
Enable/disable DET44 plugin.
vl_api_ip4_address_t user_addr
#define VALIDATE_SW_IF_INDEX(mp)