aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/net.h
blob: 4f6819f941fee331a0874b9c0aadc37fc92afc8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 */