|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
36 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
43 #define foreach_punt_api_msg \
44 _(SET_PUNT, set_punt) \
45 _(PUNT_SOCKET_REGISTER, punt_socket_register) \
46 _(PUNT_SOCKET_DEREGISTER, punt_socket_deregister) \
47 _(PUNT_SOCKET_DUMP, punt_socket_dump) \
48 _(PUNT_REASON_DUMP, punt_reason_dump)
53 in = clib_net_to_host_u32 (in);
58 case PUNT_API_TYPE_##v: \
59 *out = PUNT_TYPE_##v; \
68 static vl_api_punt_type_t
77 pt = PUNT_API_TYPE_##v; \
83 return (clib_host_to_net_u32 (pt));
97 out->
port = clib_net_to_host_u16 (in->port);
122 out->
reason = clib_net_to_host_u32 (in->id);
142 case PUNT_TYPE_EXCEPTION:
145 case PUNT_TYPE_IP_PROTO:
158 out->port = clib_net_to_host_u16 (in->
port);
163 vl_api_punt_ip_proto_t * out)
171 vl_api_punt_exception_t * out)
173 out->id = clib_host_to_net_u32 (in->
reason);
186 case PUNT_TYPE_IP_PROTO:
189 case PUNT_TYPE_EXCEPTION:
191 &out->punt.exception);
199 vl_api_set_punt_reply_t *rmp;
270 mp->_vl_msg_id =
ntohs (VL_API_PUNT_SOCKET_DETAILS);
304 vl_api_punt_socket_deregister_reply_t *rmp;
352 mp->_vl_msg_id =
ntohs (VL_API_PUNT_REASON_DETAILS);
355 mp->
reason.id = clib_host_to_net_u32 (
id);
383 #define vl_msg_name_crc_list
384 #include <vnet/ip/punt.api.h>
385 #undef vl_msg_name_crc_list
390 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
391 foreach_vl_msg_name_crc_punt;
401 vl_msg_api_set_handlers(VL_API_##N, #n, \
402 vl_api_##n##_t_handler, \
404 vl_api_##n##_t_endian, \
405 vl_api_##n##_t_print, \
406 sizeof(vl_api_##n##_t), 1);
enum vlib_punt_reason_t_ vlib_punt_reason_t
The 'syatem' defined punt reasons.
static clib_error_t * punt_api_hookup(vlib_main_t *vm)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static int vl_api_punt_exception_decode(const vl_api_punt_exception_t *in, punt_exception_t *out)
#define REPLY_MACRO2(t, body)
A registration, by a client, to direct punted traffic to a given node.
struct punt_socket_send_ctx_t_ punt_socket_send_ctx_t
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_punt_reason_t reason
static int vl_api_punt_decode(const vl_api_punt_t *in, punt_reg_t *out)
Punt traffic to the host via socket.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void punt_reason_walk(punt_reason_walk_cb_t cb, void *ctx)
vl_api_ip_proto_t ip_proto_encode(ip_protocol_t ipp)
#define clib_error_report(e)
VLIB_API_INIT_FUNCTION(punt_api_hookup)
char * vnet_punt_get_server_pathname(void)
#define vec_cmp(v1, v2)
Compare two vectors (only applicable to vectors of signed numbers).
static void setup_message_id_table(api_main_t *am)
static void vl_api_punt_exception_encode(const punt_exception_t *in, vl_api_punt_exception_t *out)
static void vl_api_punt_socket_register_t_handler(vl_api_punt_socket_register_t *mp)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static vl_api_punt_type_t vl_api_punt_type_encode(punt_type_t in)
int ip_address_family_decode(vl_api_address_family_t af, ip_address_family_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
static int punt_reason_dump_walk_cb(vlib_punt_reason_t id, const u8 *name, void *args)
punt_exception_t exception
An API client registration, only in vpp/vlib.
vl_api_punt_reason_t reason
vl_api_registration_t * reg
void punt_client_walk(punt_type_t pt, punt_client_walk_cb_t cb, void *ctx)
Dump all or one of the exception punt reasons.
static api_main_t * vlibapi_get_main(void)
static void vl_api_punt_socket_deregister_t_handler(vl_api_punt_socket_deregister_t *mp)
clib_error_t * vnet_punt_socket_del(vlib_main_t *vm, const punt_reg_t *pr)
static void vl_api_punt_socket_dump_t_handler(vl_api_punt_socket_dump_t *mp)
vl_api_address_family_t ip_address_family_encode(ip_address_family_t af)
static walk_rc_t vl_api_punt_socket_send_details(const punt_client_t *pc, void *args)
static void vl_api_punt_l4_encode(const punt_l4_t *in, vl_api_punt_l4_t *out)
static void vl_api_punt_ip_proto_encode(const punt_ip_proto_t *in, vl_api_punt_ip_proto_t *out)
API main structure, used by both vpp and binary API clients.
static void vl_api_punt_reason_dump_t_handler(vl_api_punt_reason_dump_t *mp)
#define vec_free(V)
Free vector's memory (no header).
static int vl_api_punt_type_decode(vl_api_punt_type_t in, punt_type_t *out)
static int vl_api_punt_l4_decode(const vl_api_punt_l4_t *in, punt_l4_t *out)
Definitions for punt infrastructure.
clib_error_t * vnet_punt_add_del(vlib_main_t *vm, const punt_reg_t *pr, bool is_add)
static void vl_api_set_punt_t_handler(vl_api_set_punt_t *mp)
int vl_api_vec_to_api_string(const u8 *vec, vl_api_string_t *str)
#define foreach_punt_api_msg
vlib_punt_reason_t reason
enum punt_type_t_ punt_type_t
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
clib_error_t * vnet_punt_socket_add(vlib_main_t *vm, u32 header_version, const punt_reg_t *pr, char *client_pathname)
Punt traffic to the host.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
struct punt_reason_dump_walk_ctx_t_ punt_reason_dump_walk_ctx_t
static vlib_main_t * vlib_get_main(void)
int ip_proto_decode(vl_api_ip_proto_t ipp, ip_protocol_t *out)
static void vl_api_punt_encode(const punt_reg_t *in, vl_api_punt_t *out)
int vlib_punt_reason_validate(vlib_punt_reason_t reason)
Validate that a punt reason is assigned.
static int vl_api_punt_ip_proto_decode(const vl_api_punt_ip_proto_t *in, punt_ip_proto_t *out)
enum walk_rc_t_ walk_rc_t
Walk return code.
void * vl_msg_api_alloc(int nbytes)
vl_api_registration_t * reg