/*
- * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
#include <vnet/vnet.h>
#include <vnet/session/transport.h>
-typedef enum transport_dequeue_type_
-{
- TRANSPORT_TX_PEEK, /**< reliable transport protos */
- TRANSPORT_TX_DEQUEUE, /**< unreliable transport protos */
- TRANSPORT_TX_INTERNAL, /**< apps acting as transports */
- TRANSPORT_TX_DGRAM, /**< datagram mode */
- TRANSPORT_TX_N_FNS
-} transport_tx_fn_type_t;
-
-typedef enum transport_service_type_
-{
- TRANSPORT_SERVICE_VC, /**< virtual circuit service */
- TRANSPORT_SERVICE_CL, /**< connectionless service */
- TRANSPORT_SERVICE_APP, /**< app transport service */
- TRANSPORT_N_SERVICES
-} transport_service_type_t;
-
/*
* Transport protocol virtual function table
*/
u32 (*send_space) (transport_connection_t * tc);
u32 (*tx_fifo_offset) (transport_connection_t * tc);
void (*update_time) (f64 time_now, u8 thread_index);
+ void (*flush_data) (transport_connection_t *tconn);
/*
* Connection retrieval
const transport_proto_vft_t * vft,
fib_protocol_t fib_proto, u32 output_node);
transport_proto_vft_t *transport_protocol_get_vft (transport_proto_t tp);
-transport_service_type_t transport_protocol_service_type (transport_proto_t);
-transport_tx_fn_type_t transport_protocol_tx_fn_type (transport_proto_t tp);
void transport_update_time (f64 time_now, u8 thread_index);
+transport_connection_t *transport_get_connection (transport_proto_t tp,
+ u32 conn_index,
+ u8 thread_index);
+transport_connection_t *transport_get_listener (transport_proto_t tp,
+ u32 conn_index);
void transport_enable_disable (vlib_main_t * vm, u8 is_en);
+always_inline u32
+transport_elog_track_index (transport_connection_t * tc)
+{
+#if TRANSPORT_DEBUG
+ return tc->elog_track.track_index_plus_one - 1;
+#else
+ return ~0;
+#endif
+}
+
+void transport_connection_tx_pacer_reset (transport_connection_t * tc,
+ u32 rate_bytes_per_sec,
+ u32 initial_bucket, u64 time_now);
/**
* Initialize tx pacer for connection
*