summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
AgeCommit message (Expand)AuthorFilesLines
2022-06-03session: fix double free in CLIFilip Tehlar1-7/+2
2022-05-14session: revert "fix session cli maybe parse wrong args if executed in files"Damjan Marion1-38/+27
2022-05-06session: fix session cli maybe parse wrong args if executed in filesXiaoming Jiang1-29/+28
2022-03-22session: use safe realloc for poolsFlorin Coras1-1/+0
2021-05-19session: cleanup event llist usageFlorin Coras1-2/+2
2021-05-10session: use half-open sessions for vc establishmentFlorin Coras1-2/+6
2021-03-26vlib: introduce vlib_get_elog_main()Damjan Marion1-1/+1
2020-12-24svm: split fifo into private and shared structsFlorin Coras1-2/+2
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-6/+6
2020-09-24session tcp udp tls quic: improve cli formattingFlorin Coras1-2/+5
2020-04-13session: cleanup debug codeFlorin Coras1-79/+0
2020-04-13session: adding debug eventsSrikanth Akula1-0/+79
2020-04-01session: fix fifos displayAloys Augustin1-5/+2
2020-03-25session: api to add new transport typesFlorin Coras1-12/+4
2020-02-11session: avoid scanning new io list under loadFlorin Coras1-0/+42
2019-11-20session tcp: add opaque data to show cliFlorin Coras1-2/+3
2019-11-19session: more show cli outputFlorin Coras1-1/+51
2019-11-08session: add space around ternary operatorVratko Polak1-0/+0
2019-11-03session: fix show cli with closed sessionFlorin Coras1-1/+3
2019-09-10session: fix session filter rangeFlorin Coras1-1/+1
2019-09-04session: improve cliFlorin Coras1-57/+284
2019-07-25session: add transport deleted stateFlorin Coras1-2/+2
2019-07-12quic: fix show session verboseAloys Augustin1-1/+2
2019-07-12session: add thread index to all formattersAloys Augustin1-2/+2
2019-04-03session: fix cli for sessions in created stateFlorin Coras1-1/+2
2019-04-02session: use app cb function wrappersFlorin Coras1-2/+1
2019-03-02session: cleanup/rename functionsFlorin Coras1-11/+11
2019-02-04session: cleanup part 1Florin Coras1-25/+23
2019-02-02session: improve show session cliFlorin Coras1-40/+58
2019-01-20session: add support for vrf in session unformat (VPP-1546)Florin Coras1-7/+22
2018-12-21http server: improvementsFlorin Coras1-2/+2
2018-12-19session: add cli option to dump session elogFlorin Coras1-3/+20
2018-11-18vcl/session: apps with process workersFlorin Coras1-4/+6
2018-10-31session: fix sh session cliFlorin Coras1-1/+1
2018-10-31session: add wrk contextFlorin Coras1-6/+7
2018-10-25session/tcp: improve cliFlorin Coras1-20/+17
2018-10-23c11 safe string handling supportDave Barach1-2/+2
2018-08-24session: add support for multiple app workersFlorin Coras1-2/+3
2018-07-27vcl: use events for epoll/select/read/writeFlorin Coras1-2/+4
2018-07-17session: send ctrl msg over mqFlorin Coras1-1/+1
2018-04-18udp/session: refactor to support dgram modeFlorin Coras1-0/+5
2018-04-16session: use generic session pool for listenersFlorin Coras1-16/+13
2017-12-11session: generalize handling of network transportsFlorin Coras1-1/+1
2017-12-10VPP-1077 Add meaningful error info, when executing command with enable/disabl...Swarup Nayak1-1/+1
2017-11-10session: use listener logic for proxy rulesFlorin Coras1-3/+27
2017-10-26VCL: add session namespace support.Dave Wallace1-5/+15
2017-10-16udp: refactor udp codeFlorin Coras1-11/+10
2017-10-10session: add support for application namespacingFlorin Coras1-20/+16
2017-09-18Fixes for issues Coverity has reported (VPP-972)Chris Luke1-30/+7
2017-09-01Add fixed-size, preallocated pool supportDave Barach1-2/+2
> = 0; /* And the outbound interface */ vnet_buffer (b0)->sw_if_index[VLIB_TX] = hw->sw_if_index; /* And output the packet on the correct interface */ f = vlib_get_frame_to_node (vm, hw->output_node_index); to_next = vlib_frame_vector_args (f); to_next[0] = bi0; f->n_vectors = 1; vlib_put_frame_to_node (vm, hw->output_node_index, f); } static int handle_marker_protocol (vlib_main_t * vm, slave_if_t * sif) { marker_pdu_t *marker = (marker_pdu_t *) sif->last_marker_pkt; /* * According to the spec, no checking on the version number and tlv types. * But we may check the tlv lengths. */ if ((marker->marker_info.tlv_length != sizeof (marker_information_t)) || (marker->terminator.tlv_length != 0)) return (LACP_ERROR_BAD_TLV); send_ethernet_marker_response_pdu (sif); return LACP_ERROR_NONE; } /* * lacp input routine */ lacp_error_t lacp_input (vlib_main_t * vm, vlib_buffer_t * b0, u32 bi0) { lacp_main_t *lm = &lacp_main; slave_if_t *sif; uword nbytes; lacp_error_t e; marker_pdu_t *marker; uword last_packet_signature; bond_if_t *bif; sif = bond_get_slave_by_sw_if_index (vnet_buffer (b0)->sw_if_index[VLIB_RX]); if ((sif == 0) || (sif->mode != BOND_MODE_LACP)) { return LACP_ERROR_DISABLED; } /* Handle marker protocol */ marker = (marker_pdu_t *) (b0->data + b0->current_data); if (marker->subtype == MARKER_SUBTYPE) { if (sif->last_marker_pkt) _vec_len (sif->last_marker_pkt) = 0; vec_validate (sif->last_marker_pkt, vlib_buffer_length_in_chain (vm, b0) - 1); nbytes = vlib_buffer_contents (vm, bi0, sif->last_marker_pkt); ASSERT (nbytes <= vec_len (sif->last_marker_pkt)); if (nbytes < sizeof (lacp_pdu_t)) return LACP_ERROR_TOO_SMALL; return (handle_marker_protocol (vm, sif)); } /* * typical clib idiom. Don't repeatedly allocate and free * the per-neighbor rx buffer. Reset its apparent length to zero * and reuse it. */ if (sif->last_rx_pkt) _vec_len (sif->last_rx_pkt) = 0; /* * Make sure the per-neighbor rx buffer is big enough to hold * the data we're about to copy */ vec_validate (sif->last_rx_pkt, vlib_buffer_length_in_chain (vm, b0) - 1); /* * Coalesce / copy the buffer chain into the per-neighbor * rx buffer */ nbytes = vlib_buffer_contents (vm, bi0, sif->last_rx_pkt); ASSERT (nbytes <= vec_len (sif->last_rx_pkt)); if (nbytes < sizeof (lacp_pdu_t)) { return LACP_ERROR_TOO_SMALL; } last_packet_signature = hash_memory (sif->last_rx_pkt, vec_len (sif->last_rx_pkt), 0xd00b); bif = bond_get_master_by_dev_instance (sif->bif_dev_instance); if (sif->last_packet_signature_valid && (sif->last_packet_signature == last_packet_signature) && hash_get (bif->active_slave_by_sw_if_index, sif->sw_if_index)) { lacp_start_current_while_timer (lm->vlib_main, sif, sif->ttl_in_seconds); e = LACP_ERROR_CACHE_HIT; } else { /* Actually scan the packet */ e = lacp_packet_scan (vm, sif); sif->last_packet_signature_valid = 1; sif->last_packet_signature = last_packet_signature; } if (sif->last_rx_pkt) _vec_len (sif->last_rx_pkt) = 0; return e; } /* * setup neighbor hash table */ static clib_error_t * lacp_init (vlib_main_t * vm) { clib_error_t *error; if ((error = vlib_call_init_function (vm, lacp_periodic_init))) return error; return 0; } VLIB_INIT_FUNCTION (lacp_init); /* * packet trace format function, very similar to * lacp_packet_scan except that we call the per TLV format * functions instead of the per TLV processing functions */ u8 * lacp_input_format_trace (u8 * s, va_list * args) { CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); lacp_input_trace_t *t = va_arg (*args, lacp_input_trace_t *); lacp_pdu_t *lacpdu = &t->pkt.lacpdu; marker_pdu_t *marker = &t->pkt.marker; int i, len; u8 *p; lacp_state_struct *state_entry; s = format (s, "%U:\n", format_vnet_sw_if_index_name, vnet_get_main (), t->sw_if_index); s = format (s, "Length: %d\n", t->len); if (t->len >= sizeof (lacp_pdu_t)) { switch (lacpdu->subtype) { case MARKER_SUBTYPE: if (marker->version_number == MARKER_PROTOCOL_VERSION) s = format (s, " Markerv1\n"); else s = format (s, " Subtype %u, Version %u\n", marker->subtype, marker->version_number); s = format (s, " Marker Information TLV: type %u\n", marker->marker_info.tlv_type); s = format (s, " Marker Information TLV: length %u\n", marker->marker_info.tlv_length); s = format (s, " Requester port: %u\n", marker->marker_info.requester_port); s = format (s, " Requester system: %U\n", format_ethernet_address, marker->marker_info.requester_system); s = format (s, " Requester transaction ID: %u\n", marker->marker_info.requester_transaction_id); break; case LACP_SUBTYPE: if (lacpdu->version_number == LACP_ACTOR_LACP_VERSION) s = format (s, " LACPv1\n"); else s = format (s, " Subtype %u, Version %u\n", lacpdu->subtype, lacpdu->version_number); s = format (s, " Actor Information TLV: length %u\n", lacpdu->actor.tlv_length); s = format (s, " System %U\n", format_ethernet_address, lacpdu->actor.port_info.system); s = format (s, " System priority %u\n", ntohs (lacpdu->actor.port_info.system_priority)); s = format (s, " Key %u\n", ntohs (lacpdu->actor.port_info.key)); s = format (s, " Port priority %u\n", ntohs (lacpdu->actor.port_info.port_priority)); s = format (s, " Port number %u\n", ntohs (lacpdu->actor.port_info.port_number)); s = format (s, " State 0x%x\n", lacpdu->actor.port_info.state); state_entry = (lacp_state_struct *) & lacp_state_array; while (state_entry->str) { if (lacpdu->actor.port_info.state & (1 << state_entry->bit)) s = format (s, " %s (%d)\n", state_entry->str, state_entry->bit); state_entry++; } s = format (s, " Partner Information TLV: length %u\n", lacpdu->partner.tlv_length); s = format (s, " System %U\n", format_ethernet_address, lacpdu->partner.port_info.system); s = format (s, " System priority %u\n", ntohs (lacpdu->partner.port_info.system_priority)); s = format (s, " Key %u\n", ntohs (lacpdu->partner.port_info.key)); s = format (s, " Port priority %u\n", ntohs (lacpdu->partner.port_info.port_priority)); s = format (s, " Port number %u\n", ntohs (lacpdu->partner.port_info.port_number)); s = format (s, " State 0x%x\n", lacpdu->partner.port_info.state); state_entry = (lacp_state_struct *) & lacp_state_array; while (state_entry->str) { if (lacpdu->partner.port_info.state & (1 << state_entry->bit)) s = format (s, " %s (%d)\n", state_entry->str, state_entry->bit); state_entry++; } break; default: break; } } if (t->len > sizeof (lacp_pdu_t)) len = sizeof (lacp_pdu_t); else len = t->len; p = (u8 *) lacpdu; for (i = 0; i < len; i++) { if ((i % 16) == 0) { if (i) s = format (s, "\n"); s = format (s, " 0x%04x: ", i); } if ((i % 2) == 0) s = format (s, " "); s = format (s, "%02x", p[i]); } return s; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */