32 #define vl_msg_id(n,h) n, 35 #include <pppoe/pppoe.api.h> 43 #include <pppoe/pppoe.api.h> 48 #include <pppoe/pppoe.api.h> 52 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 54 #include <pppoe/pppoe.api.h> 58 #define vl_api_version(n,v) static u32 api_version=(v); 59 #include <pppoe/pppoe.api.h> 62 #define vl_msg_name_crc_list 63 #include <pppoe/pppoe.api.h> 64 #undef vl_msg_name_crc_list 66 #define REPLY_MSG_ID_BASE pem->msg_id_base 73 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + pem->msg_id_base); 74 foreach_vl_msg_name_crc_pppoe;
78 #define foreach_pppoe_plugin_api_msg \ 79 _(PPPOE_ADD_DEL_SESSION, pppoe_add_del_session) \ 80 _(PPPOE_SESSION_DUMP, pppoe_session_dump) 94 rv = VNET_API_ERROR_NO_SUCH_INNER_FIB;
97 decap_fib_index = p[0];
102 .decap_fib_index = decap_fib_index,
108 u32 sw_if_index = ~0;
129 memset (rmp, 0,
sizeof (*rmp));
130 rmp->_vl_msg_id = ntohs (VL_API_PPPOE_SESSION_DETAILS);
168 if (~0 == sw_if_index)
173 send_pppoe_session_details(t, q, mp->context);
195 u8 *name =
format (0,
"pppoe_%08x%c", api_version, 0);
200 vl_msg_api_set_handlers((VL_API_##N + pem->msg_id_base), \ 202 vl_api_##n##_t_handler, \ 204 vl_api_##n##_t_endian, \ 205 vl_api_##n##_t_print, \ 206 sizeof(vl_api_##n##_t), 1);
u16 vl_msg_api_get_msg_ids(const char *name, int n)
#define REPLY_MACRO2(t, body)
Set or delete an PPPOE session.
static clib_error_t * pppoe_api_hookup(vlib_main_t *vm)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
void * vl_msg_api_alloc(int nbytes)
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
API main structure, used by both vpp and binary API clients.
#define ip46_address_is_ip4(ip46)
u32 ft_table_id
Table ID (hash key) for this FIB.
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static void vl_api_pppoe_session_dump_t_handler(vl_api_pppoe_session_dump_t *mp)
pppoe_session_t * sessions
dump details of an PPPOE session
static ip46_address_t to_ip46(u32 is_ipv6, u8 *buf)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
static void setup_message_id_table(pppoe_main_t *pem, api_main_t *am)
u32 * session_index_by_sw_if_index
int vnet_pppoe_add_del_session(vnet_pppoe_add_del_session_args_t *a, u32 *sw_if_indexp)
#define foreach_pppoe_plugin_api_msg
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 decap_fib_index
FIB indices - inner IP packet lookup here.
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
reply for set or delete an PPPOE session
VLIB_API_INIT_FUNCTION(pppoe_api_hookup)
struct fib_table_t_ * fibs
struct _unix_shared_memory_queue unix_shared_memory_queue_t
static void send_pppoe_session_details(pppoe_session_t *t, unix_shared_memory_queue_t *q, u32 context)
static void vl_api_pppoe_add_del_session_t_handler(vl_api_pppoe_add_del_session_t *mp)