diff options
author | Michael Brown | 2006-04-30 18:59:45 +0200 |
---|---|---|
committer | Michael Brown | 2006-04-30 18:59:45 +0200 |
commit | 9e1becaf8a2bd12b5f75ee77b6bb138992bb1a6c (patch) | |
tree | 0e4a50f1b14abc877b9d24736eff4d77b43a8d05 /src/include | |
parent | Half-way tidy (diff) | |
download | ipxe-9e1becaf8a2bd12b5f75ee77b6bb138992bb1a6c.tar.gz ipxe-9e1becaf8a2bd12b5f75ee77b6bb138992bb1a6c.tar.xz ipxe-9e1becaf8a2bd12b5f75ee77b6bb138992bb1a6c.zip |
Merge TCP aborted(), timedout() and closed() methods into a single
closed() method with a reason code.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gpxe/ftp.h | 6 | ||||
-rw-r--r-- | src/include/gpxe/tcp.h | 26 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/include/gpxe/ftp.h b/src/include/gpxe/ftp.h index f2db5a13..6063abe9 100644 --- a/src/include/gpxe/ftp.h +++ b/src/include/gpxe/ftp.h @@ -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, diff --git a/src/include/gpxe/tcp.h b/src/include/gpxe/tcp.h index 9b7ecc80..699512bd 100644 --- a/src/include/gpxe/tcp.h +++ b/src/include/gpxe/tcp.h @@ -19,28 +19,24 @@ struct tcp_connection; * */ struct tcp_operations { - /** - * Connection aborted (RST received) - * - * @v conn TCP connection - */ - void ( * aborted ) ( struct tcp_connection *conn ); - /** - * Connection timed out + /* + * Connection closed * * @v conn TCP connection - */ - void ( * timedout ) ( struct tcp_connection *conn ); - /** - * Connection aborted (FIN received) + * @v status Error code, if any * - * @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) * |