#include <ipxe/timer.h>
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
+#include <ipxe/init.h>
#include <ipxe/retry.h>
#include <ipxe/refcnt.h>
#include <ipxe/xfer.h>
/* Remove from list and drop reference */
stop_timer ( &tcp->timer );
+ stop_timer ( &tcp->wait );
list_del ( &tcp->list );
ref_put ( &tcp->refcnt );
DBGC ( tcp, "TCP %p connection deleted\n", tcp );
.discard = tcp_discard,
};
+/**
+ * Shut down all TCP connections
+ *
+ */
+static void tcp_shutdown ( int booting __unused ) {
+ struct tcp_connection *tcp;
+
+ while ( ( tcp = list_first_entry ( &tcp_conns, struct tcp_connection,
+ list ) ) != NULL ) {
+ tcp->tcp_state = TCP_CLOSED;
+ tcp_dump_state ( tcp );
+ tcp_close ( tcp, -ECANCELED );
+ }
+}
+
+/** TCP shutdown function */
+struct startup_fn tcp_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+ .shutdown = tcp_shutdown,
+};
+
/***************************************************************************
*
* Data transfer interface