Merge TCP aborted(), timedout() and closed() methods into a single

closed() method with a reason code.
This commit is contained in:
Michael Brown
2006-04-30 16:59:45 +00:00
parent 8afb6303fb
commit 9e1becaf8a
6 changed files with 131 additions and 102 deletions

View File

@@ -10,6 +10,12 @@
#include <stdint.h>
#include <gpxe/tcp.h>
/**
* FTP states
*
* These @b must be sequential, i.e. a successful FTP session must
* pass through each of these states in order.
*/
enum ftp_state {
FTP_CONNECT = 0,
FTP_USER,

View File

@@ -19,28 +19,24 @@ struct tcp_connection;
*
*/
struct tcp_operations {
/**
* Connection aborted (RST received)
/*
* Connection closed
*
* @v conn TCP connection
*/
void ( * aborted ) ( struct tcp_connection *conn );
/**
* Connection timed out
* @v status Error code, if any
*
* @v conn TCP connection
*/
void ( * timedout ) ( struct tcp_connection *conn );
/**
* Connection aborted (FIN received)
*
* @v conn TCP connection
* This is called when the connection is closed for any
* reason, including timeouts or aborts. The status code
* contains the negative error number, if the closure is due
* to an error.
*
* Note that acked() and newdata() may be called after
* closed(), if the packet containing the FIN also
* acknowledged data or contained new data.
* acknowledged data or contained new data. Note also that
* connected() may not have been called before closed(), if
* the close is due to an error.
*/
void ( * closed ) ( struct tcp_connection *conn );
void ( * closed ) ( struct tcp_connection *conn, int status );
/**
* Connection established (SYNACK received)
*