26 #include <stn/stn.api_enum.h> 27 #include <stn/stn.api_types.h> 29 #define REPLY_MSG_ID_BASE stn_main.msg_id_base 32 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 36 vl_print (handle, (char *)s); \ 51 s =
format (0,
"SCRIPT: stn_add_del_rule ");
62 vl_api_stn_add_del_rule_reply_t *rmp;
107 send_stn_rules_details (r, reg, mp->context);
112 #include <stn/stn.api.c>
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
u32 sw_if_index
TX interface to send packets to.
int stn_rule_add_del(stn_rule_add_del_args_t *args)
Add or delete an stn rule.
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
void * vl_msg_api_alloc(int nbytes)
ip46_address_t address
Destination address of intercepted packets.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
u8 del
Whether to delete the rule.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
static void vl_api_stn_add_del_rule_t_handler(vl_api_stn_add_del_rule_t *mp)
STN response to rules request.
static void vl_api_stn_rules_dump_t_handler(vl_api_stn_rules_dump_t *mp)
vl_api_address_t ip_address
format_function_t format_ip46_address
An API client registration, only in vpp/vlib.
vl_api_address_t ip_address
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void * vl_api_stn_add_del_rule_t_print(vl_api_stn_add_del_rule_t *mp, void *handle)
API message custom-dump function.
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
clib_error_t * stn_api_init(vlib_main_t *vm, stn_main_t *sm)
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
static void send_stn_rules_details(stn_rule_t *r, vl_api_registration_t *reg, u32 context)