-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathksocket.h
52 lines (31 loc) · 1.49 KB
/
ksocket.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __DMAP_KSOCKET_H__
#define __DMAP_KSOCKET_H__
#include <linux/net.h>
u16 ksock_self_port(struct socket *sock);
u16 ksock_peer_port(struct socket *sock);
u32 ksock_peer_addr(struct socket *sock);
u32 ksock_self_addr(struct socket *sock);
int ksock_create(struct socket **sockp,
__u32 local_ip, int local_port);
int ksock_set_sendbufsize(struct socket *sock, int size);
int ksock_set_rcvbufsize(struct socket *sock, int size);
int ksock_connect(struct socket **sockp, __u32 local_ip, int local_port,
__u32 peer_ip, int peer_port);
void ksock_release(struct socket *sock);
int ksock_write_timeout(struct socket *sock, void *buffer, u32 nob,
u64 ticks, u32 *pwrote);
int ksock_read_timeout(struct socket *sock, void *buffer, u32 nob,
u64 ticks, u32 *pread);
int ksock_read(struct socket *sock, void *buffer, u32 nob, u32 *pread);
int ksock_write(struct socket *sock, void *buffer, u32 nob, u32 *pwrote);
int ksock_send(struct socket *sock, void *buf, int len);
int ksock_recv(struct socket *sock, void *buf, int len);
int ksock_listen(struct socket **sockp, __u32 local_ip, int local_port,
int backlog);
int ksock_accept(struct socket **newsockp, struct socket *sock);
void ksock_abort_accept(struct socket *sock);
int ksock_ioctl(struct socket *sock, int cmd, unsigned long arg);
int ksock_set_nodelay(struct socket *sock, bool no_delay);
int ksock_connect_host(struct socket **sockp, char *host, u16 port);
int ksock_listen_host(struct socket **sockp, char *host, int port, int backlog);
#endif