summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2006-08-03 01:08:10 +0200
committerMichael Brown2006-08-03 01:08:10 +0200
commita0a872f7f1a7e26d8c66b190a9a12ceb89ed37f7 (patch)
treebe80a8cba5bf8c87fddd593635ea29d451426ccc /src/include
parentMoved the basic struct sockaddr out of in.h. (diff)
downloadipxe-a0a872f7f1a7e26d8c66b190a9a12ceb89ed37f7.tar.gz
ipxe-a0a872f7f1a7e26d8c66b190a9a12ceb89ed37f7.tar.xz
ipxe-a0a872f7f1a7e26d8c66b190a9a12ceb89ed37f7.zip
Updated PXE UDP implementation to use the new Etherboot UDP API.
Updated PXE API dispatcher to use copy_{to,from}_user, and moved to arch/i386 since the implementation is quite architecture-dependent. (The individual PXE API calls can be largely architecture-independent.)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/udp.h5
-rw-r--r--src/include/pxe.h30
2 files changed, 14 insertions, 21 deletions
diff --git a/src/include/gpxe/udp.h b/src/include/gpxe/udp.h
index a0e054da9..0104cc067 100644
--- a/src/include/gpxe/udp.h
+++ b/src/include/gpxe/udp.h
@@ -64,6 +64,9 @@ struct udp_operations {
* @v conn UDP connection
* @v data Data
* @v len Length of data
+ * @v st_src Source address
+ * @v st_dest Destination address
+ * @ret rc Return status code
*/
int ( * newdata ) ( struct udp_connection *conn, void *data,
size_t len, struct sockaddr_tcpip *st_src,
@@ -92,8 +95,10 @@ struct udp_connection {
*/
extern int udp_bind ( struct udp_connection *conn, uint16_t local_port );
+extern void udp_bind_promisc ( struct udp_connection *conn );
extern void udp_connect ( struct udp_connection *conn,
struct sockaddr_tcpip *peer );
+extern void udp_connect_promisc ( struct udp_connection *conn );
extern int udp_open ( struct udp_connection *conn, uint16_t local_port );
extern void udp_close ( struct udp_connection *conn );
diff --git a/src/include/pxe.h b/src/include/pxe.h
index f8e2de79b..7e61c6ac9 100644
--- a/src/include/pxe.h
+++ b/src/include/pxe.h
@@ -3,8 +3,13 @@
#include "pxe_types.h"
#include "pxe_api.h"
-#include "etherboot.h"
-#include "tftp.h"
+
+/* Parameter block for pxenv_unknown() */
+struct s_PXENV_UNKNOWN {
+ PXENV_STATUS_t Status; /**< PXE status code */
+} PACKED;
+
+typedef struct s_PXENV_UNKNOWN PXENV_UNKNOWN_t;
/* Union used for PXE API calls; we don't know the type of the
* structure until we interpret the opcode. Also, Status is available
@@ -14,6 +19,7 @@
union u_PXENV_ANY {
/* Make it easy to read status for any operation */
PXENV_STATUS_t Status;
+ struct s_PXENV_UNKNOWN unknown;
struct s_PXENV_UNLOAD_STACK unload_stack;
struct s_PXENV_GET_CACHED_INFO get_cached_info;
struct s_PXENV_TFTP_READ_FILE restart_tftp;
@@ -81,29 +87,11 @@ typedef enum {
typedef struct pxe_stack {
struct s_PXE pxe __attribute__ ((aligned(16)));
struct s_PXENV pxenv __attribute__ ((aligned(16)));
- pxe_stack_state_t state;
- union {
- BOOTPLAYER_t cached_info;
- char packet[ETH_FRAME_LEN];
- struct {
- uint32_t magic_cookie;
- unsigned int len;
- int eof;
- char data[TFTP_MAX_BLKSIZE];
- } tftpdata;
- struct {
- char *buffer;
- uint32_t offset;
- uint32_t bufferlen;
- } readfile;
- };
- struct {} arch_data __attribute__ ((aligned(16)));
+ pxe_stack_state_t state;
} pxe_stack_t;
extern int ensure_pxe_state ( pxe_stack_state_t wanted );
extern pxe_stack_t *pxe_stack;
-extern PXENV_EXIT_t pxe_api_call ( int opcode, union u_PXENV_ANY *any );
-
#endif /* PXE_H */