tcp_reuse_buffer (vm, b);
- if (tc->rcv_las == tc->rcv_nxt)
- flags = TCP_FLAG_FIN;
- else
- flags = TCP_FLAG_FIN | TCP_FLAG_ACK;
-
+ flags = TCP_FLAG_FIN | TCP_FLAG_ACK;
tcp_make_ack_i (tc, b, TCP_STATE_ESTABLISHED, flags);
/* Reset flags, make sure ack is sent */
tcp_make_fin (tc, b);
tcp_enqueue_to_output (vm, b, bi, tc->c_is_ip4);
tc->flags |= TCP_CONN_FINSNT;
+ TCP_EVT_DBG (TCP_EVT_FIN_SENT, tc);
}
always_inline u8
vnet_buffer (b)->tcp.connection_index = tc->c_c_index;
tc->snd_nxt += data_len;
+ TCP_EVT_DBG (TCP_EVT_PKTIZE, tc);
}
/* Send delayed ACK when timer expires */
}
th0 = vlib_buffer_get_current (b0);
+ TCP_EVT_DBG (TCP_EVT_OUTPUT, tc0, th0->flags, b0->current_length);
if (is_ip4)
{
tc0->rtt_ts = tcp_time_now ();
tc0->rtt_seq = tc0->snd_nxt;
}
-
- if (1)
- {
- ELOG_TYPE_DECLARE (e) =
- {
- .format =
- "output: snd_una %u snd_una_max %u",.format_args =
- "i4i4",};
- struct
- {
- u32 data[2];
- } *ed;
- ed = ELOG_DATA (&vm->elog_main, e);
- ed->data[0] = tc0->snd_una - tc0->iss;
- ed->data[1] = tc0->snd_una_max - tc0->iss;
- }
}
/* Set the retransmit timer if not set already and not
vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
b0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
-
done:
- b0->error = error0 != 0 ? node->errors[error0] : 0;
+ b0->error = node->errors[error0];
if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
{
return tcp46_output_inline (vm, node, from_frame, 0 /* is_ip4 */ );
}
+/* *INDENT-OFF* */
VLIB_REGISTER_NODE (tcp4_output_node) =
{
.function = tcp4_output,.name = "tcp4-output",
/* Takes a vector of packets. */
- .vector_size = sizeof (u32),.n_errors = TCP_N_ERROR,.error_strings =
- tcp_error_strings,.n_next_nodes = TCP_OUTPUT_N_NEXT,.next_nodes =
- {
+ .vector_size = sizeof (u32),
+ .n_errors = TCP_N_ERROR,
+ .error_strings = tcp_error_strings,
+ .n_next_nodes = TCP_OUTPUT_N_NEXT,
+ .next_nodes = {
#define _(s,n) [TCP_OUTPUT_NEXT_##s] = n,
foreach_tcp4_output_next
#undef _
- }
-,.format_buffer = format_tcp_header,.format_trace = format_tcp_tx_trace,};
+ },
+ .format_buffer = format_tcp_header,
+ .format_trace = format_tcp_tx_trace,
+};
+/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (tcp4_output_node, tcp4_output)
+VLIB_NODE_FUNCTION_MULTIARCH (tcp4_output_node, tcp4_output);
+
+/* *INDENT-OFF* */
VLIB_REGISTER_NODE (tcp6_output_node) =
{
- .function = tcp6_output,.name = "tcp6-output",
+ .function = tcp6_output,
+ .name = "tcp6-output",
/* Takes a vector of packets. */
- .vector_size = sizeof (u32),.n_errors = TCP_N_ERROR,.error_strings =
- tcp_error_strings,.n_next_nodes = TCP_OUTPUT_N_NEXT,.next_nodes =
- {
+ .vector_size = sizeof (u32),
+ .n_errors = TCP_N_ERROR,
+ .error_strings = tcp_error_strings,
+ .n_next_nodes = TCP_OUTPUT_N_NEXT,
+ .next_nodes = {
#define _(s,n) [TCP_OUTPUT_NEXT_##s] = n,
foreach_tcp6_output_next
#undef _
- }
-,.format_buffer = format_tcp_header,.format_trace = format_tcp_tx_trace,};
+ },
+ .format_buffer = format_tcp_header,
+ .format_trace = format_tcp_tx_trace,
+};
+/* *INDENT-ON* */
+
+VLIB_NODE_FUNCTION_MULTIARCH (tcp6_output_node, tcp6_output);
-VLIB_NODE_FUNCTION_MULTIARCH (tcp6_output_node, tcp6_output) u32
+u32
tcp_push_header (transport_connection_t * tconn, vlib_buffer_t * b)
{
tcp_connection_t *tc;
next0 = TCP_RESET_NEXT_IP_LOOKUP;
done:
- b0->error = error0 != 0 ? node->errors[error0] : 0;
+ b0->error = node->errors[error0];
b0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
{
};
/* *INDENT-ON* */
+VLIB_NODE_FUNCTION_MULTIARCH (tcp4_reset_node, tcp4_send_reset);
+
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (tcp6_reset_node) = {
.function = tcp6_send_reset,
};
/* *INDENT-ON* */
+VLIB_NODE_FUNCTION_MULTIARCH (tcp6_reset_node, tcp6_send_reset);
+
/*
* fd.io coding-style-patch-verification: ON
*