22 #define vl_msg_id(n,h) n, 24 #include <kubeproxy/kp.api.h> 33 #include <kubeproxy/kp.api.h> 38 #include <kubeproxy/kp.api.h> 41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 44 #define vl_api_version(n,v) static u32 api_version=(v); 45 #include <kubeproxy/kp.api.h> 48 #define vl_msg_name_crc_list 49 #include <kubeproxy/kp.api.h> 50 #undef vl_msg_name_crc_list 53 #define REPLY_MSG_ID_BASE kpm->msg_id_base 60 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + kpm->msg_id_base); 61 foreach_vl_msg_name_crc_kp;
68 vl_print (handle, (char *)s); \ 77 vl_api_kp_conf_reply_t * rmp;
90 s =
format (0,
"SCRIPT: kp_conf ");
102 vl_api_kp_conf_reply_t * rmp;
104 ip46_address_t prefix;
110 memcpy(&prefix.ip4, mp->
ip_prefix,
sizeof(prefix.ip4));
111 prefix.pad[0] = prefix.pad[1] = prefix.pad[2] = 0;
115 memcpy(&prefix.ip6, mp->
ip_prefix,
sizeof(prefix.ip6));
143 s =
format (0,
"SCRIPT: kp_add_del_vip ");
160 vl_api_kp_conf_reply_t * rmp;
164 ip46_address_t vip_ip_prefix;
169 vip_prefix_length += 96;
171 sizeof(vip_ip_prefix.ip4));
172 vip_ip_prefix.pad[0] = vip_ip_prefix.pad[1] = vip_ip_prefix.pad[2] = 0;
177 sizeof(vip_ip_prefix.ip6));
180 ip46_address_t pod_address;
185 sizeof(pod_address.ip4));
186 pod_address.pad[0] = pod_address.pad[1] = pod_address.pad[2] = 0;
191 sizeof(pod_address.ip6));
210 s =
format (0,
"SCRIPT: kp_add_del_pod ");
220 #define foreach_kp_plugin_api_msg \ 221 _(KP_CONF, kp_conf) \ 222 _(KP_ADD_DEL_VIP, kp_add_del_vip) \ 223 _(KP_ADD_DEL_POD, kp_add_del_pod) 228 u8 *name =
format (0,
"kp_%08x%c", api_version, 0);
233 vl_msg_api_set_handlers((VL_API_##N + kpm->msg_id_base), \ 235 vl_api_##n##_t_handler, \ 237 vl_api_##n##_t_endian, \ 238 vl_api_##n##_t_print, \ 239 sizeof(vl_api_##n##_t), 1);
Configure Kube-proxy global parameters.
u16 vl_msg_api_get_msg_ids(const char *name, int n)
u8 * format_ip46_prefix(u8 *s, va_list *args)
static void * vl_api_kp_add_del_pod_t_print(vl_api_kp_add_del_pod_t *mp, void *handle)
u32 sticky_buckets_per_core
static clib_error_t * kp_api_init(vlib_main_t *vm)
static void * vl_api_kp_conf_t_print(vl_api_kp_conf_t *mp, void *handle)
kp_vip_type_t
kube-proxy supports IPv4 and IPv6 traffic and NAT4 and NAT6.
int kp_vip_add(ip46_address_t *prefix, u8 plen, kp_vip_type_t type, u32 new_length, u32 *vip_index, u16 port, u16 target_port, u16 node_port)
#define VLIB_INIT_FUNCTION(x)
int kp_vip_del(u32 vip_index)
static void * vl_api_kp_add_del_vip_t_print(vl_api_kp_add_del_vip_t *mp, void *handle)
u32 new_flows_table_length
#define foreach_kp_plugin_api_msg
int kp_vip_del_pods(u32 vip_index, ip46_address_t *addresses, u32 n)
API main structure, used by both vpp and binary API clients.
static void vl_api_kp_add_del_vip_t_handler(vl_api_kp_add_del_vip_t *mp)
static void vl_api_kp_add_del_pod_t_handler(vl_api_kp_add_del_pod_t *mp)
Add a pod for a given VIP.
static void setup_message_id_table(kp_main_t *kpm, api_main_t *am)
static void vl_api_kp_conf_t_handler(vl_api_kp_conf_t *mp)
u16 msg_id_base
API dynamically registered base ID.
Add a virtual address (or prefix)
int kp_vip_add_pods(u32 vip_index, ip46_address_t *addresses, u32 n)
int kp_vip_find_index(ip46_address_t *prefix, u8 plen, u32 *vip_index)
int kp_conf(u32 per_cpu_sticky_buckets, u32 flow_timeout)
Fix global kube-proxy parameters.