2 * Copyright (c) 2020 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
20 #ifndef SRC_VNET_TCP_TCP_BT_H_
21 #define SRC_VNET_TCP_TCP_BT_H_
23 #include <vnet/tcp/tcp_types.h>
26 * Byte tracker initialize
28 * @param tc connection for which the byte tracker should be allocated and
31 void tcp_bt_init (tcp_connection_t * tc);
33 * Byte tracker cleanup
35 * @param tc connection for which the byte tracker should be cleaned up
37 void tcp_bt_cleanup (tcp_connection_t * tc);
39 * Flush byte tracker samples
41 * @param tc tcp connection for which samples should be flushed
43 void tcp_bt_flush_samples (tcp_connection_t * tc);
45 * Track a tcp tx burst
47 * @param tc tcp connection
49 void tcp_bt_track_tx (tcp_connection_t * tc, u32 len);
51 * Track a tcp retransmission
53 * @param tc tcp connection
54 * @param start start sequence number
55 * @param end end sequence number
57 void tcp_bt_track_rxt (tcp_connection_t * tc, u32 start, u32 end);
59 * Generate a delivery rate sample from recently acked bytes
61 * @param tc tcp connection
62 * @param rs resulting rate sample
64 void tcp_bt_sample_delivery_rate (tcp_connection_t * tc,
65 tcp_rate_sample_t * rs);
67 * Check if sample to be generated is app limited
69 * @param tc tcp connection
71 void tcp_bt_check_app_limited (tcp_connection_t * tc);
73 * Check if the byte tracker is in sane state
75 * Should be used only for testing
77 * @param bt byte tracker
79 int tcp_bt_is_sane (tcp_byte_tracker_t * bt);
81 format_function_t format_tcp_bt;
83 #endif /* SRC_VNET_TCP_TCP_BT_H_ */
86 * fd.io coding-style-patch-verification: ON
89 * eval: (c-set-style "gnu")