36 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 43 #define foreach_vpe_api_msg \ 44 _(SYSLOG_SET_SENDER, syslog_set_sender) \ 45 _(SYSLOG_GET_SENDER, syslog_get_sender) \ 46 _(SYSLOG_SET_FILTER, syslog_set_filter) \ 47 _(SYSLOG_GET_FILTER, syslog_get_filter) 58 *s = SYSLOG_SEVERITY_EMERGENCY;
61 *s = SYSLOG_SEVERITY_ALERT;
64 *s = SYSLOG_SEVERITY_CRITICAL;
67 *s = SYSLOG_SEVERITY_ERROR;
70 *s = SYSLOG_SEVERITY_WARNING;
73 *s = SYSLOG_SEVERITY_NOTICE;
76 *s = SYSLOG_SEVERITY_INFORMATIONAL;
79 *s = SYSLOG_SEVERITY_DEBUG;
82 rv = VNET_API_ERROR_INVALID_VALUE;
94 case SYSLOG_SEVERITY_EMERGENCY:
97 case SYSLOG_SEVERITY_ALERT:
100 case SYSLOG_SEVERITY_CRITICAL:
103 case SYSLOG_SEVERITY_ERROR:
106 case SYSLOG_SEVERITY_WARNING:
109 case SYSLOG_SEVERITY_NOTICE:
112 case SYSLOG_SEVERITY_INFORMATIONAL:
115 case SYSLOG_SEVERITY_DEBUG:
119 rv = VNET_API_ERROR_INVALID_VALUE;
129 vl_api_syslog_set_sender_reply_t *rmp;
170 vl_api_syslog_set_filter_reply_t *rmp;
200 #define vl_msg_name_crc_list 202 #undef vl_msg_name_crc_list 207 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 208 foreach_vl_msg_name_crc_syslog;
218 vl_msg_api_set_handlers(VL_API_##N, #n, \ 219 vl_api_##n##_t_handler, \ 221 vl_api_##n##_t_endian, \ 222 vl_api_##n##_t_print, \ 223 sizeof(vl_api_##n##_t), 1); u16 collector_port
UDP port number of remote host (destination)
Get syslog sender configuration.
static void vl_api_syslog_set_filter_t_handler(vl_api_syslog_set_filter_t *mp)
static void setup_message_id_table(api_main_t *am)
Get syslog sender configuration reply.
static clib_error_t * syslog_api_hookup(vlib_main_t *vm)
#define REPLY_MACRO2(t, body)
vl_api_syslog_severity_t severity
u32 fib_index
FIB table index.
u32 max_msg_size
message size limit
#define clib_memcpy(d, s, n)
static int syslog_severity_encode(syslog_severity_t v, vl_api_syslog_severity_t *s)
#define foreach_vpe_api_msg
API main structure, used by both vpp and binary API clients.
vl_api_ip4_address_t collector_address
syslog_severity_t severity_filter
severity filter (specified severity and greater match)
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
syslog_main_t syslog_main
static void vl_api_syslog_get_filter_t_handler(vl_api_syslog_get_filter_t *mp)
ip4_address_t src_address
IPv4 address of sender (source)
vl_api_syslog_severity_t severity
vl_api_ip4_address_t src_address
VLIB_API_INIT_FUNCTION(syslog_api_hookup)
Set syslog sender configuration.
static api_main_t * vlibapi_get_main(void)
static int syslog_severity_decode(vl_api_syslog_severity_t v, syslog_severity_t *s)
ip4_address_t collector
IPv4 address of remote host (destination)
vl_api_ip4_address_t src_address
vnet_api_error_t set_syslog_sender(ip4_address_t *collector, u16 collector_port, ip4_address_t *src, u32 vrf_id, u32 max_msg_size)
Set syslog sender configuration.
static void vl_api_syslog_set_sender_t_handler(vl_api_syslog_set_sender_t *mp)
static void vl_api_syslog_get_sender_t_handler(vl_api_syslog_get_sender_t *mp)
vl_api_ip4_address_t collector_address