summaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Expand)AuthorFilesLines
2020-01-16tcp: fix rxt delivered without sacksFlorin Coras1-1/+1
2020-01-16udp: fix ipv6 listen port registrationFlorin Coras1-1/+1
2020-01-16tcp: fix listen node coverity warningFlorin Coras1-11/+12
2020-01-15build: Add missing version.h dependency in vnetChris Luke1-1/+1
2020-01-15ip: align reass.save_rewrite_lengthv20.05-rc0Klement Sekera3-20/+13
2020-01-15tcp: fix tcp check tx offload issueSimon Zhang1-2/+6
2020-01-15ip6: during icmp to icmp6 translation truncate error messagesAlexander Chernavin1-2/+2
2020-01-15srv6-mobile: Revert "srv6-mobile:"Andrew Yourtchenko1-7/+0
2020-01-14tcp: handle ack advancement with no holes and renegingFlorin Coras1-1/+1
2020-01-14srv6-mobile:Tetsuya Murakami1-0/+7
2020-01-14classify: Reduce the include dependencies on vnet_classify.hNeale Ranns7-1/+6
2020-01-13misc: feature file for unsupported feature l2tpOle Troan1-0/+8
2020-01-11ip: avoid fib lookup for consecutive pkts having same source IPNitin Saxena1-5/+5
2020-01-10gso: add FEATURE.yamlMohsin Kazmi1-0/+12
2020-01-10sr: feature YAML files for Segment Routingpcamaril2-0/+25
2020-01-10docs: Edit FEATURE.yaml files so they can be publishedJohn DeNisco17-30/+30
2020-01-09bonding: process lacp when bond is admin downMatthew Smith1-1/+0
2020-01-09fib: leverage well-optimized clib_memcpyZhiyong Yang3-6/+6
2020-01-09session: remove io event dispatch dbg msgFlorin Coras1-4/+1
2020-01-09tcp: fix persist assertFlorin Coras1-4/+1
2020-01-09misc: fix feature description spellingOle Troan3-6/+5
2020-01-08tcp: fix scoreboard assertFlorin Coras1-1/+1
2020-01-08virtio: fix ip4 checksum offloadMohsin Kazmi1-2/+14
2020-01-08tap: split gso and checksum offload functionalityMohsin Kazmi5-19/+108
2020-01-08virtio: split gso and checksum offload functionalityMohsin Kazmi9-44/+312
2020-01-08tls: improve connection formatingFlorin Coras1-13/+43
2020-01-08tcp: fix last sacked with no holesFlorin Coras1-0/+2
2020-01-08l2: fix MAC learn counter update on adding MAC entryJohn Lo1-1/+1
2020-01-07tcp: fix duplicate sack whith renegingFlorin Coras1-6/+9
2020-01-07bonding: fix feature.yaml errorOle Troan1-1/+1
2020-01-07bonding: Add FEATURE.yamlSteven Luong1-0/+16
2020-01-07ipsec: Add FEATURE/yamlNeale Ranns1-0/+11
2020-01-07qos: Add FEATURE.yamlNeale Ranns1-0/+12
2020-01-07mpls: Add FEATURE.yamlNeale Ranns1-0/+10
2020-01-06ip-neighbor: Add FEATURE.yamlNeale Ranns1-0/+10
2020-01-06l2: Update FEATURE.yamlJohn Lo1-0/+3
2020-01-06gre: fix feature.yaml errorOle Troan1-2/+2
2020-01-06lb: add FEATURE file for lb/pppoe/gtpu/vxlan-gpe/pppoeHongjun Ni1-0/+10
2020-01-06gre: Add FEATURE.yamlNeale Ranns1-0/+13
2020-01-05ip6-nd: Add FEATURE.yamlNeale Ranns1-0/+12
2020-01-04misc: fix feature.yamlOle Troan2-2/+0
2020-01-04vxlan: Add FEATURE.yamlJohn Lo2-1/+15
2020-01-04l2: Add FEATURE.yamlJohn Lo1-0/+21
2020-01-04ipsec: AH copy destination and source address from templateNeale Ranns1-1/+1
2020-01-04ipsec: Targeted unit testingNeale Ranns6-97/+114
2020-01-03tcp: fix rate samples for old acksFlorin Coras1-2/+24
2020-01-03fib: Add dpo FEATURE.yaml fileNeale Ranns1-0/+15
2020-01-03bfd: add feature.yamlKlement Sekera1-0/+9
2020-01-03tcp: api clenupJakub Grajciar2-15/+25
2020-01-03lldp: add feature.yamlKlement Sekera1-0/+9
n class="o">->is_add) { int i; for (i = 0; i < mp->n_addrs; i++) { ip46_address_t *addr; void *src, *dst; int len; vec_add2 (addrs, addr, 1); if (ntohl (mp->addrs[i].af) == ADDRESS_IP4) { src = &mp->addrs[i].un.ip4; dst = &addr->ip4; len = sizeof (addr->ip4); } else { src = &mp->addrs[i].un.ip6; dst = &addr->ip6; len = sizeof (addr->ip6); } clib_memcpy (dst, src, len); } vr_conf.vr_addrs = addrs; } if (vr_conf.priority == 0) { clib_warning ("VR priority must be > 0"); rv = VNET_API_ERROR_INVALID_VALUE; } else if (vr_conf.adv_interval == 0) { clib_warning ("VR advertisement interval must be > 0"); rv = VNET_API_ERROR_INVALID_VALUE; } else if (vr_conf.vr_id == 0) { clib_warning ("VR ID must be > 0"); rv = VNET_API_ERROR_INVALID_VALUE; } else rv = vrrp_vr_add_del (mp->is_add, &vr_conf); vec_free (addrs); REPLY_MACRO (VL_API_VRRP_VR_ADD_DEL_REPLY); } static void send_vrrp_vr_details (vrrp_vr_t * vr, vl_api_registration_t * reg, u32 context) { vrrp_main_t *vmp = &vrrp_main; vl_api_vrrp_vr_details_t *mp; int n_addrs, msg_size; ip46_address_t *addr; vl_api_address_t *api_addr; u32 api_flags = 0; n_addrs = vec_len (vr->config.vr_addrs); msg_size = sizeof (*mp) + n_addrs * sizeof (*api_addr); mp = vl_msg_api_alloc (msg_size); if (!mp) return; clib_memset (mp, 0, msg_size); mp->_vl_msg_id = htons (VL_API_VRRP_VR_DETAILS + vmp->msg_id_base); mp->context = context; /* config */ mp->config.sw_if_index = htonl (vr->config.sw_if_index); mp->config.vr_id = vr->config.vr_id; mp->config.priority = vr->config.priority; mp->config.interval = htons (vr->config.adv_interval); if (vr->config.flags & VRRP_VR_PREEMPT) api_flags |= VRRP_API_VR_PREEMPT; if (vr->config.flags & VRRP_VR_ACCEPT) api_flags |= VRRP_API_VR_ACCEPT; if (vrrp_vr_is_unicast (vr)) api_flags |= VRRP_API_VR_UNICAST; if (vrrp_vr_is_ipv6 (vr)) api_flags |= VRRP_API_VR_IPV6; mp->config.flags = htonl (api_flags); /* runtime */ switch (vr->runtime.state) { case VRRP_VR_STATE_INIT: mp->runtime.state = htonl (VRRP_API_VR_STATE_INIT); break; case VRRP_VR_STATE_BACKUP: mp->runtime.state = htonl (VRRP_API_VR_STATE_BACKUP); break; case VRRP_VR_STATE_MASTER: mp->runtime.state = htonl (VRRP_API_VR_STATE_MASTER); break; case VRRP_VR_STATE_INTF_DOWN: mp->runtime.state = htonl (VRRP_API_VR_STATE_INTF_DOWN); break; default: break; } mp->runtime.master_adv_int = htons (vr->runtime.master_adv_int); mp->runtime.skew = htons (vr->runtime.skew); mp->runtime.master_down_int = htons (vr->runtime.master_down_int); clib_memcpy (&mp->runtime.mac, &vr->runtime.mac, sizeof (vr->runtime.mac)); mp->runtime.tracking.interfaces_dec = htonl (vr->tracking.interfaces_dec); mp->runtime.tracking.priority = vrrp_vr_priority (vr); /* addrs */ mp->n_addrs = vec_len (vr->config.vr_addrs); api_addr = mp->addrs; vec_foreach (addr, vr->config.vr_addrs) { void *src, *dst; size_t len; if (vrrp_vr_is_ipv6 (vr)) { api_addr->af = htonl (ADDRESS_IP6); dst = &api_addr->un.ip6; src = &addr->ip6; len = sizeof (addr->ip6); } else { api_addr->af = htonl (ADDRESS_IP4); dst = &api_addr->un.ip4; src = &addr->ip4; len = sizeof (addr->ip4); } clib_memcpy (dst, src, len); api_addr++; } vl_api_send_msg (reg, (u8 *) mp); } static void vl_api_vrrp_vr_dump_t_handler (vl_api_vrrp_vr_dump_t * mp) { vrrp_main_t *vmp = &vrrp_main; vl_api_registration_t *reg; vrrp_vr_t *vr; u32 sw_if_index; reg = vl_api_client_index_to_registration (mp->client_index); sw_if_index = htonl (mp->sw_if_index); /* *INDENT-OFF* */ pool_foreach (vr, vmp->vrs, ({ if (sw_if_index && (sw_if_index != ~0) && (sw_if_index != vr->config.sw_if_index)) continue; send_vrrp_vr_details (vr, reg, mp->context); })); /* *INDENT-ON* */ } static void vl_api_vrrp_vr_start_stop_t_handler (vl_api_vrrp_vr_start_stop_t * mp) { vrrp_main_t *vmp = &vrrp_main; vl_api_vrrp_vr_start_stop_reply_t *rmp; vrrp_vr_key_t vr_key; int rv; clib_memset (&vr_key, 0, sizeof (vr_key)); vr_key.sw_if_index = ntohl (mp->sw_if_index); vr_key.vr_id = mp->vr_id; vr_key.is_ipv6 = (mp->is_ipv6 != 0); rv = vrrp_vr_start_stop ((mp->is_start != 0), &vr_key); REPLY_MACRO (VL_API_VRRP_VR_START_STOP_REPLY); } static void vl_api_vrrp_vr_set_peers_t_handler (vl_api_vrrp_vr_set_peers_t * mp) { vrrp_main_t *vmp = &vrrp_main; vl_api_vrrp_vr_set_peers_reply_t *rmp; vrrp_vr_key_t vr_key; ip46_address_t *peer_addrs = 0; int i; int rv; clib_memset (&vr_key, 0, sizeof (vr_key)); vr_key.sw_if_index = ntohl (mp->sw_if_index); vr_key.vr_id = mp->vr_id; vr_key.is_ipv6 = (mp->is_ipv6 != 0); for (i = 0; i < mp->n_addrs; i++) { ip46_address_t *peer; vec_add2 (peer_addrs, peer, 1); if (mp->is_ipv6) clib_memcpy (&peer->ip6, mp->addrs[i].un.ip6, 16); else clib_memcpy (&peer->ip4, mp->addrs[i].un.ip4, 4); } rv = vrrp_vr_set_peers (&vr_key, peer_addrs); vec_free (peer_addrs); REPLY_MACRO (VL_API_VRRP_VR_SET_PEERS_REPLY); } static void send_vrrp_vr_peer_details (vrrp_vr_t * vr, vl_api_registration_t * reg, u32 context) { vrrp_main_t *vmp = &vrrp_main; vl_api_vrrp_vr_peer_details_t *mp; int n_addrs, msg_size; ip46_address_t *addr; vl_api_address_t *api_addr; n_addrs = vec_len (vr->config.peer_addrs); msg_size = sizeof (*mp) + n_addrs * sizeof (*api_addr); mp = vl_msg_api_alloc (msg_size); if (!mp) return; clib_memset (mp, 0, msg_size); mp->_vl_msg_id = htons (VL_API_VRRP_VR_PEER_DETAILS + vmp->msg_id_base); mp->context = context; mp->sw_if_index = htonl (vr->config.sw_if_index); mp->vr_id = vr->config.vr_id; mp->is_ipv6 = vrrp_vr_is_ipv6 (vr); /* addrs */ mp->n_peer_addrs = n_addrs; api_addr = mp->peer_addrs; vec_foreach (addr, vr->config.peer_addrs) { void *src, *dst; size_t len; if (vrrp_vr_is_ipv6 (vr)) { api_addr->af = htonl (ADDRESS_IP6); dst = &api_addr->un.ip6; src = &addr->ip6; len = sizeof (addr->ip6); } else { api_addr->af = htonl (ADDRESS_IP4); dst = &api_addr->un.ip4; src = &addr->ip4; len = sizeof (addr->ip4); } clib_memcpy (dst, src, len); api_addr++; } vl_api_send_msg (reg, (u8 *) mp); } static void vl_api_vrrp_vr_peer_dump_t_handler (vl_api_vrrp_vr_peer_dump_t * mp) { vrrp_main_t *vmp = &vrrp_main; vl_api_registration_t *reg; vrrp_vr_t *vr; vrrp_vr_key_t vr_key; reg = vl_api_client_index_to_registration (mp->client_index); vr_key.sw_if_index = ntohl (mp->sw_if_index); if (vr_key.sw_if_index && (vr_key.sw_if_index != ~0)) { uword *p; u32 vr_index = ~0; vr_key.vr_id = mp->vr_id; vr_key.is_ipv6 = mp->is_ipv6; p = mhash_get (&vmp->vr_index_by_key, &vr_key); if (!p) return; vr_index = p[0]; vr = pool_elt_at_index (vmp->vrs, vr_index); send_vrrp_vr_peer_details (vr, reg, mp->context); return; } /* *INDENT-OFF* */ pool_foreach (vr, vmp->vrs, ({ if (!vec_len (vr->config.peer_addrs)) continue; send_vrrp_vr_details (vr, reg, mp->context); })); /* *INDENT-ON* */ } static void vl_api_vrrp_vr_track_if_add_del_t_handler (vl_api_vrrp_vr_track_if_add_del_t * mp) { vrrp_main_t *vmp = &vrrp_main; vl_api_vrrp_vr_track_if_add_del_reply_t *rmp; vrrp_vr_t *vr; vrrp_vr_tracking_if_t *track_if, *track_ifs = 0; int rv = 0, i; /* lookup VR and return error if it does not exist */ vr = vrrp_vr_lookup (ntohl (mp->sw_if_index), mp->vr_id, (mp->is_ipv6 != 0)); if (!vr) { rv = VNET_API_ERROR_INVALID_VALUE; goto done; } for (i = 0; i < mp->n_ifs; i++) { vl_api_vrrp_vr_track_if_t *api_track_if = &mp->ifs[i]; vec_add2 (track_ifs, track_if, 1); track_if->sw_if_index = ntohl (api_track_if->sw_if_index); track_if->priority = api_track_if->priority; } rv = vrrp_vr_tracking_ifs_add_del (vr, track_ifs, mp->is_add != 0); done: vec_free (track_ifs); REPLY_MACRO (VL_API_VRRP_VR_TRACK_IF_ADD_DEL_REPLY); } static void send_vrrp_vr_track_if_details (vrrp_vr_t * vr, vl_api_registration_t * reg, u32 context) { vrrp_main_t *vmp = &vrrp_main; vl_api_vrrp_vr_track_if_details_t *mp; int n_ifs, msg_size; vl_api_vrrp_vr_track_if_t *api_track_if; vrrp_vr_tracking_if_t *track_if; if (!vr) return; n_ifs = vec_len (vr->tracking.interfaces); msg_size = sizeof (*mp) + n_ifs * sizeof (*api_track_if); mp = vl_msg_api_alloc (msg_size); if (!mp) return; clib_memset (mp, 0, msg_size); mp->_vl_msg_id = htons (VL_API_VRRP_VR_TRACK_IF_DETAILS + vmp->msg_id_base); mp->context = context; mp->sw_if_index = htonl (vr->config.sw_if_index); mp->vr_id = vr->config.vr_id; mp->is_ipv6 = vrrp_vr_is_ipv6 (vr); /* tracked interfaces */ mp->n_ifs = n_ifs; api_track_if = mp->ifs; vec_foreach (track_if, vr->tracking.interfaces) { api_track_if->sw_if_index = htonl (track_if->sw_if_index); api_track_if->priority = track_if->priority; api_track_if += 1; } vl_api_send_msg (reg, (u8 *) mp); } static void vl_api_vrrp_vr_track_if_dump_t_handler (vl_api_vrrp_vr_track_if_dump_t * mp) { vrrp_main_t *vmp = &vrrp_main; vl_api_registration_t *reg; vrrp_vr_t *vr; reg = vl_api_client_index_to_registration (mp->client_index); if (!mp->dump_all) { vr = vrrp_vr_lookup (ntohl (mp->sw_if_index), mp->vr_id, mp->is_ipv6); send_vrrp_vr_track_if_details (vr, reg, mp->context); return; } /* *INDENT-OFF* */ pool_foreach (vr, vmp->vrs, ({ if (!vec_len (vr->tracking.interfaces)) continue; send_vrrp_vr_track_if_details (vr, reg, mp->context); })); /* *INDENT-ON* */ } /* Set up the API message handling tables */ #include <vrrp/vrrp.api.c> clib_error_t * vrrp_plugin_api_hookup (vlib_main_t * vm) { vrrp_main_t *vmp = &vrrp_main; /* Ask for a correctly-sized block of API message decode slots */ vmp->msg_id_base = setup_message_id_table (); return 0; } /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */