1 | #ifndef _NET_H |
---|
2 | #define _NET_H |
---|
3 | |
---|
4 | #include <stdint.h> |
---|
5 | #include <stdbool.h> |
---|
6 | #include <stddef.h> |
---|
7 | |
---|
8 | void net_core_init(void); |
---|
9 | void net_parse_dhcp(void); |
---|
10 | |
---|
11 | struct pxe_pvt_inode; |
---|
12 | |
---|
13 | int core_udp_open(struct pxe_pvt_inode *socket); |
---|
14 | void core_udp_close(struct pxe_pvt_inode *socket); |
---|
15 | |
---|
16 | void core_udp_connect(struct pxe_pvt_inode *socket, |
---|
17 | uint32_t ip, uint16_t port); |
---|
18 | void core_udp_disconnect(struct pxe_pvt_inode *socket); |
---|
19 | |
---|
20 | int core_udp_recv(struct pxe_pvt_inode *socket, void *buf, uint16_t *buf_len, |
---|
21 | uint32_t *src_ip, uint16_t *src_port); |
---|
22 | |
---|
23 | void core_udp_send(struct pxe_pvt_inode *socket, |
---|
24 | const void *data, size_t len); |
---|
25 | |
---|
26 | void core_udp_sendto(struct pxe_pvt_inode *socket, const void *data, size_t len, |
---|
27 | uint32_t ip, uint16_t port); |
---|
28 | |
---|
29 | void probe_undi(void); |
---|
30 | void pxe_init_isr(void); |
---|
31 | |
---|
32 | struct inode; |
---|
33 | |
---|
34 | int core_tcp_open(struct pxe_pvt_inode *socket); |
---|
35 | int core_tcp_connect(struct pxe_pvt_inode *socket, uint32_t ip, uint16_t port); |
---|
36 | bool core_tcp_is_connected(struct pxe_pvt_inode *socket); |
---|
37 | int core_tcp_write(struct pxe_pvt_inode *socket, const void *data, |
---|
38 | size_t len, bool copy); |
---|
39 | void core_tcp_close_file(struct inode *inode); |
---|
40 | void core_tcp_fill_buffer(struct inode *inode); |
---|
41 | |
---|
42 | #endif /* _NET_H */ |
---|