aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/net.h')
-rw-r--r--core/include/net.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/core/include/net.h b/core/include/net.h
index 4f6819f9..a5dcd724 100644
--- a/core/include/net.h
+++ b/core/include/net.h
@@ -2,32 +2,38 @@
#define _NET_H
#include <stdint.h>
+#include <stdbool.h>
#include <stddef.h>
-/* Protocol family */
-enum net_core_proto {
- NET_CORE_TCP,
- NET_CORE_UDP,
-};
-
void net_core_init(void);
+void net_parse_dhcp(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);
+int core_udp_open(struct pxe_pvt_inode *socket);
+void core_udp_close(struct pxe_pvt_inode *socket);
-void net_core_connect(struct pxe_pvt_inode *socket,
+void core_udp_connect(struct pxe_pvt_inode *socket,
uint32_t ip, uint16_t port);
-void net_core_disconnect(struct pxe_pvt_inode *socket);
+void core_udp_disconnect(struct pxe_pvt_inode *socket);
-int net_core_recv(struct pxe_pvt_inode *socket, void *buf, uint16_t *buf_len,
+int core_udp_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,
+void core_udp_send(struct pxe_pvt_inode *socket,
const void *data, size_t len);
void probe_undi(void);
void pxe_init_isr(void);
+struct inode;
+
+int core_tcp_open(struct pxe_pvt_inode *socket);
+int core_tcp_connect(struct pxe_pvt_inode *socket, uint32_t ip, uint16_t port);
+bool core_tcp_is_connected(struct pxe_pvt_inode *socket);
+int core_tcp_write(struct pxe_pvt_inode *socket, const void *data,
+ size_t len, bool copy);
+void core_tcp_close_file(struct inode *inode);
+void core_tcp_fill_buffer(struct inode *inode);
+
#endif /* _NET_H */