mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
Merge TCP aborted(), timedout() and closed() methods into a single
closed() method with a reason code.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user