diff options
author | Michael Brown | 2005-05-09 16:27:29 +0200 |
---|---|---|
committer | Michael Brown | 2005-05-09 16:27:29 +0200 |
commit | 0fe74493f48c25bb92373e68bf6856eda7ac5667 (patch) | |
tree | dc52d59e0531c6d2526013fde650581386f60eb6 /src/include | |
parent | off_t should be signed. (diff) | |
download | ipxe-0fe74493f48c25bb92373e68bf6856eda7ac5667.tar.gz ipxe-0fe74493f48c25bb92373e68bf6856eda7ac5667.tar.xz ipxe-0fe74493f48c25bb92373e68bf6856eda7ac5667.zip |
Protocols now load data into a buffer; they don't execute it.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/dev.h | 13 | ||||
-rw-r--r-- | src/include/proto.h | 10 | ||||
-rw-r--r-- | src/include/tftp.h | 9 |
3 files changed, 10 insertions, 22 deletions
diff --git a/src/include/dev.h b/src/include/dev.h index 8bf17355..0d0d4d8e 100644 --- a/src/include/dev.h +++ b/src/include/dev.h @@ -3,6 +3,7 @@ #include "stdint.h" #include "string.h" +#include "buffer.h" #include "dhcp.h" /* for dhcp_dev_id */ #include "tables.h" @@ -182,10 +183,7 @@ struct type_driver { struct type_dev *type_dev; /* single instance */ char * ( * describe_device ) ( struct type_dev *type_dev ); int ( * configure ) ( struct type_dev *type_dev ); - int ( * load ) ( struct type_dev *type_dev, - int ( * process ) ( unsigned char *data, - unsigned int blocknum, - unsigned int len, int eof ) ); + int ( * load ) ( struct type_dev *type_dev, struct buffer *buffer ); }; #define __type_driver __attribute__ (( used, __table_section(type_driver,01) )) @@ -277,11 +275,8 @@ static inline int configure ( struct dev *dev ) { return dev->type_driver->configure ( dev->type_dev ); } /* Boot from a device */ -static inline int load ( struct dev *dev, - int ( * process ) ( unsigned char *data, - unsigned int blocknum, - unsigned int len, int eof ) ) { - return dev->type_driver->load ( dev->type_dev, process ); +static inline int load ( struct dev *dev, struct buffer *buffer ) { + return dev->type_driver->load ( dev->type_dev, buffer ); } #endif /* DEV_H */ diff --git a/src/include/proto.h b/src/include/proto.h index 2c157ee4..fb4e4137 100644 --- a/src/include/proto.h +++ b/src/include/proto.h @@ -2,18 +2,14 @@ #define PROTO_H #include "tables.h" +#include "buffer.h" #include "in.h" struct protocol { char *name; in_port_t default_port; - int ( * load ) ( char *url, - struct sockaddr_in *server, - char *file, - int ( * process ) ( unsigned char *data, - unsigned int blocknum, - unsigned int len, - int eof ) ); + int ( * load ) ( char *url, struct sockaddr_in *server, char *file, + struct buffer *buffer ); }; /* diff --git a/src/include/tftp.h b/src/include/tftp.h index 5f129ead..70192067 100644 --- a/src/include/tftp.h +++ b/src/include/tftp.h @@ -2,6 +2,7 @@ #define TFTP_H #include "in.h" +#include "buffer.h" #include "nic.h" #define TFTP_PORT 69 @@ -83,11 +84,7 @@ struct tftpblk_info_t { */ extern int tftp_block ( struct tftpreq_info_t *request, struct tftpblk_info_t *block ); -extern int tftp ( char *url, - struct sockaddr_in *server, - char *file, - int ( * process ) ( unsigned char *data, - unsigned int blocknum, - unsigned int len, int eof ) ); +extern int tftp ( char *url, struct sockaddr_in *server, char *file, + struct buffer *buffer ); #endif /* TFTP_H */ |