summaryrefslogtreecommitdiffstats
path: root/src/vpp-api
AgeCommit message (Expand)AuthorFilesLines
2020-02-11vppinfra: remove the historical mheap memory allocatorDave Barach1-11/+0
2020-02-05stats: fix state counter removalVladimir Isaev1-0/+3
2019-12-19papi: lazily initialize stats clientPaul Vinciguerra1-5/+25
2019-12-17build: export vapi generation in vpp-devOliver Giles1-48/+11
2019-12-10api: multiple connections per processDave Barach3-15/+15
2019-12-05papi: add call statsOle Troan1-1/+23
2019-12-03papi: add a per-call _timeout optionPaul Vinciguerra3-8/+14
2019-11-27misc: add address sanitizer heap instrumentationBenoƮt Ganne2-0/+7
2019-11-27papi: fix typo in reprPaul Vinciguerra1-1/+1
2019-11-24papi: fix papi default handlingOle Troan1-17/+18
2019-11-24papi: add missing base types to serializerPaul Vinciguerra1-2/+4
2019-11-23papi: add repr to packer types for troubleshootingPaul Vinciguerra1-0/+47
2019-11-22papi: support default for type alias decaying to basetypeOle Troan1-18/+63
2019-11-13papi: enhance MACAddress() equalityPaul Vinciguerra1-1/+7
2019-11-12papi: add wrapper to validate crc manifestOle Troan1-0/+28
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto4-4/+4
2019-10-28vapi: switch to python3Ole Troan3-4/+4
2019-10-23papi: fix default handlingOle Troan2-40/+51
2019-10-21bier: tests support python3Ole Troan1-8/+9
2019-10-18ipsec: make tests support python3Ole Troan1-2/+6
2019-10-14papi: fix socket sendall callsVratko Polak1-4/+6
2019-10-11papi: harden socket handlingVratko Polak1-18/+24
2019-10-09papi: introduce read_blockingVratko Polak1-3/+29
2019-09-25papi: truncate long logger messagesKlement Sekera1-1/+4
2019-09-19api: split vl_api_prefix into twoOle Troan5-19/+201
2019-09-16api: autogenerate api trace print/endianOle Troan1-2/+2
2019-09-10papi: let async calls return contextVratko Polak1-1/+6
2019-09-04api: memclnt api use string type.Ole Troan3-6/+6
2019-09-03api: enforce vla is last and fixed string typeOle Troan4-20/+83
2019-08-27api: revert use string type for strings in memclnt.apiOle Troan2-51/+73
2019-08-27api: use string type for strings in memclnt.apiOle Troan2-73/+51
2019-08-15stats: refactor header filesDave Barach2-49/+42
2019-08-09stats: create /run/vpp before stat socket bind()YohanPipereau2-1/+3
2019-08-08api: vppapitrace JSON/API trace converterOle Troan2-141/+153
2019-08-08api: api socket respect unix runtime directoryOle Troan1-1/+1
2019-07-31api papi: add alias for timestamp(datetime)/timedeltaPaul Vinciguerra1-1/+8
2019-07-24vapi: add python scripts to vpp-dev packageVratko Polak1-7/+19
2019-07-24papi: add additional types to vpp_serializerPaul Vinciguerra1-0/+3
2019-07-16papi: use the injected logger wherever possibleVratko Polak1-18/+6
2019-07-12papi: fix vpp_format from change in vl_api_prefix_tPaul Vinciguerra2-12/+10
2019-07-09papi: update VPPEnumType for python3Paul Vinciguerra1-1/+4
2019-07-08map gbp papi: match endianess of f64Paul Vinciguerra1-1/+1
2019-07-05sctp: move to plugins, disabled by defaultFlorin Coras1-0/+3
2019-07-01papi: refactor set_errors_strPaul Vinciguerra1-3/+3
2019-06-26papi: prevent message_table inconsistenciesVratko Polak1-0/+2
2019-06-26api: refactor format_vl_api_prefix_t return keysPaul Vinciguerra2-13/+13
2019-06-25api: fix vac_read return codesPaul Vinciguerra2-4/+13
2019-06-20misc: papi - add __repr__ to FuncWrapperPaul Vinciguerra1-0/+3
2019-06-18misc: vpp_papi- add tests, clean up pep8Paul Vinciguerra7-18/+202
2019-06-17misc: vpp-api - add __repr__ to VPPApiClient.Paul Vinciguerra1-0/+13
0 to the current next frame */ bi0 = from[0]; from += 1; n_left_from -= 1; b0 = vlib_get_buffer (vm, bi0); /* udp_local hands us a pointer to the udp data */ data0 = vlib_buffer_get_current (b0); udp0 = (udp_header_t *) (data0 - sizeof (*udp0)); fib_index0 = vnet_buffer (b0)->ip.fib_index; if (is_ip4) { /* TODO: must fix once udp_local does ip options correctly */ ip40 = (ip4_header_t *) (((u8 *) udp0) - sizeof (*ip40)); s0 = session_lookup_safe4 (fib_index0, &ip40->dst_address, &ip40->src_address, udp0->dst_port, udp0->src_port, TRANSPORT_PROTO_UDP); lcl_addr = &ip40->dst_address; rmt_addr = &ip40->src_address; } else { ip60 = (ip6_header_t *) (((u8 *) udp0) - sizeof (*ip60)); s0 = session_lookup_safe6 (fib_index0, &ip60->dst_address, &ip60->src_address, udp0->dst_port, udp0->src_port, TRANSPORT_PROTO_UDP); lcl_addr = &ip60->dst_address; rmt_addr = &ip60->src_address; } if (PREDICT_FALSE (!s0)) { error0 = UDP_ERROR_NO_LISTENER; goto trace0; } if (s0->session_state == SESSION_STATE_OPENED) { /* TODO optimization: move cl session to right thread * However, since such a move would affect the session handle, * which we pass 'raw' to the app, we'd also have notify the * app of the change or change the way we pass handles to apps. */ tc0 = session_get_transport (s0); uc0 = udp_get_connection_from_transport (tc0); if (uc0->flags & UDP_CONN_F_CONNECTED) { if (s0->thread_index != vlib_get_thread_index ()) { /* * Clone the transport. It will be cleaned up with the * session once we notify the session layer. */ new_uc0 = udp_connection_clone_safe (s0->connection_index, s0->thread_index); ASSERT (s0->session_index == new_uc0->c_s_index); /* * Drop the 'lock' on pool resize */ session_pool_remove_peeker (s0->thread_index); session_dgram_connect_notify (&new_uc0->connection, s0->thread_index, &s0); tc0 = &new_uc0->connection; uc0 = new_uc0; queue_event = 0; } else s0->session_state = SESSION_STATE_READY; } } else if (s0->session_state == SESSION_STATE_READY) { tc0 = session_get_transport (s0); uc0 = udp_get_connection_from_transport (tc0); } else if (s0->session_state == SESSION_STATE_LISTENING) { tc0 = listen_session_get_transport (s0); uc0 = udp_get_connection_from_transport (tc0); if (uc0->flags & UDP_CONN_F_CONNECTED) { child0 = udp_connection_alloc (my_thread_index); if (is_ip4) { ip_set (&child0->c_lcl_ip, &ip40->dst_address, 1); ip_set (&child0->c_rmt_ip, &ip40->src_address, 1); } else { ip_set (&child0->c_lcl_ip, &ip60->dst_address, 0); ip_set (&child0->c_rmt_ip, &ip60->src_address, 0); } child0->c_lcl_port = udp0->dst_port; child0->c_rmt_port = udp0->src_port; child0->c_is_ip4 = is_ip4; child0->c_fib_index = tc0->fib_index; child0->flags |= UDP_CONN_F_CONNECTED; if (session_stream_accept (&child0->connection, tc0->s_index, tc0->thread_index, 1)) { error0 = UDP_ERROR_CREATE_SESSION; goto trace0; } s0 = session_get (child0->c_s_index, child0->c_thread_index); s0->session_state = SESSION_STATE_READY; tc0 = &child0->connection; uc0 = udp_get_connection_from_transport (tc0); error0 = UDP_ERROR_LISTENER; } } else { error0 = UDP_ERROR_NOT_READY; goto trace0; } if (svm_fifo_max_enqueue_prod (s0->rx_fifo) < b0->current_length + sizeof (session_dgram_hdr_t)) { error0 = UDP_ERROR_FIFO_FULL; goto trace0; } hdr0.data_length = b0->current_length; hdr0.data_offset = 0; ip_set (&hdr0.lcl_ip, lcl_addr, is_ip4); ip_set (&hdr0.rmt_ip, rmt_addr, is_ip4); hdr0.lcl_port = udp0->dst_port; hdr0.rmt_port = udp0->src_port; hdr0.is_ip4 = is_ip4; clib_spinlock_lock (&uc0->rx_lock); /* If session is owned by another thread and rx event needed, * enqueue event now while we still have the peeker lock */ if (s0->thread_index != my_thread_index) { wrote0 = session_enqueue_dgram_connection (s0, &hdr0, b0, TRANSPORT_PROTO_UDP, /* queue event */ 0); if (queue_event && !svm_fifo_has_event (s0->rx_fifo)) session_enqueue_notify (s0); } else { wrote0 = session_enqueue_dgram_connection (s0, &hdr0, b0, TRANSPORT_PROTO_UDP, queue_event); } clib_spinlock_unlock (&uc0->rx_lock); ASSERT (wrote0 > 0); if (s0->session_state != SESSION_STATE_LISTENING) session_pool_remove_peeker (s0->thread_index); trace0: b0->error = node->errors[error0]; if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) && (b0->flags & VLIB_BUFFER_IS_TRACED))) { udp_input_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->connection = s0 ? s0->connection_index : ~0; t->disposition = error0; t->thread_index = my_thread_index; } } vlib_buffer_free (vm, first_buffer, frame->n_vectors); errors = session_main_flush_enqueue_events (TRANSPORT_PROTO_UDP, my_thread_index); udp_input_inc_counter (vm, is_ip4, UDP_ERROR_EVENT_FIFO_FULL, errors); return frame->n_vectors; } static uword udp4_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return udp46_input_inline (vm, node, frame, 1); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (udp4_input_node) = { .function = udp4_input, .name = "udp4-input", .vector_size = sizeof (u32), .format_trace = format_udp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = ARRAY_LEN (udp_error_strings), .error_strings = udp_error_strings, .n_next_nodes = UDP_INPUT_N_NEXT, .next_nodes = { #define _(s, n) [UDP_INPUT_NEXT_##s] = n, foreach_udp_input_next #undef _ }, }; /* *INDENT-ON* */ static uword udp6_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return udp46_input_inline (vm, node, frame, 0); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (udp6_input_node) = { .function = udp6_input, .name = "udp6-input", .vector_size = sizeof (u32), .format_trace = format_udp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = ARRAY_LEN (udp_error_strings), .error_strings = udp_error_strings, .n_next_nodes = UDP_INPUT_N_NEXT, .next_nodes = { #define _(s, n) [UDP_INPUT_NEXT_##s] = n, foreach_udp_input_next #undef _ }, }; /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */