diff options
| author | Matt Fleming <matt.fleming@intel.com> | 2013-02-26 16:24:56 +0000 |
|---|---|---|
| committer | Matt Fleming <matt.fleming@intel.com> | 2013-03-06 17:04:39 +0000 |
| commit | 16aa878d78086e9bc1c1f1053dc24da295f81e05 (patch) | |
| tree | 3da29f8f502ec1014105c565985848ea18d7ce92 /core/include | |
| parent | 990f1ace09e79f99a196574f60e5484a5bb4a2d4 (diff) | |
| download | syslinux-16aa878d78086e9bc1c1f1053dc24da295f81e05.tar.gz | |
net: Return of the legacy network stack
While it's nice having the shiny new lwIP stack, there is definitely
merit in being able to choose between two different network stacks. We
want to keep the legacy network stack around as it is known to handle
funky BIOS implementations and provides a good reference point when
bugs are suspected in the lwIP code.
Users now have a choice of .0 files. pxelinux.0 uses the legacy
network stack, while lpxelinux.0 uses lwIP.
Note that not every protocol is converted to using this new API. The
http, ftp and tcp code is still inherently tied to the netconn API,
and is only available with lpxelinux.0 and the lwIP stack. It's
unlikely that this code will ever be fixed up to work with the legacy
network stack.
Network stack operations are abstracted behind the net_core_*
interface, and each network stack has private data fields contained
within a struct net_private.
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core/include')
| -rw-r--r-- | core/include/net.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/include/net.h b/core/include/net.h new file mode 100644 index 00000000..4f6819f9 --- /dev/null +++ b/core/include/net.h @@ -0,0 +1,33 @@ +#ifndef _NET_H +#define _NET_H + +#include <stdint.h> +#include <stddef.h> + +/* Protocol family */ +enum net_core_proto { + NET_CORE_TCP, + NET_CORE_UDP, +}; + +void net_core_init(void); + +struct pxe_pvt_inode; + +int net_core_open(struct pxe_pvt_inode *socket, enum net_core_proto proto); +void net_core_close(struct pxe_pvt_inode *socket); + +void net_core_connect(struct pxe_pvt_inode *socket, + uint32_t ip, uint16_t port); +void net_core_disconnect(struct pxe_pvt_inode *socket); + +int net_core_recv(struct pxe_pvt_inode *socket, void *buf, uint16_t *buf_len, + uint32_t *src_ip, uint16_t *src_port); + +void net_core_send(struct pxe_pvt_inode *socket, + const void *data, size_t len); + +void probe_undi(void); +void pxe_init_isr(void); + +#endif /* _NET_H */ |
