You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/F-Stack_API_Reference.md
+22-22Lines changed: 22 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# F-Stack API Reference
2
2
3
-
F-Stack is a highperformance network framework based on DPDK.
3
+
F-Stack (FF) is a high-performance network framework based on DPDK.
4
4
5
-
FF API provides standard Kqueue/Epoll interface, and a micro threading framework (SPP).
5
+
FF API provides the standard Kqueue/Epoll interface, and a micro threading framework (SPP).
6
6
7
-
In order to facilitate a variety of services can use F-Stack simpler and faster, F-Stack has integrated Nginx and Redis。
7
+
In order to facilitate a variety of services to use F-Stack simpler and faster, F-Stack has been integrated with Nginx and Redis。
8
8
9
9
## FF API
10
10
11
-
The header file ff_api.h defines the following API, which should be used to replace the system called when using the F-Sstack.
11
+
The header file ff_api.h defines the following API, which should be used to replace the system calls when using F-Stack.
12
12
13
13
### Initialize
14
14
@@ -18,12 +18,12 @@ In order to facilitate a variety of services can use F-Stack simpler and faster,
18
18
conf:Profile path
19
19
argv:-c <coremask>,the coremask parameters can cover the coremask in configuration file
20
20
21
-
Initialize F-Stack,include DPDK/FreeBSD network stack, etc.
21
+
Initialize F-Stack,including DPDK/FreeBSD network stack, etc.
22
22
23
23
#### ff_run
24
24
25
25
void ff_run(loop_func_t loop, void *arg);
26
-
loop is a callbask function,the service logic is implemented by the user, and be called by each poll of F-Stack .
26
+
loop is a callbask function,the service logic is implemented by the user, and called by each poll of F-Stack .
27
27
28
28
### Control API
29
29
@@ -32,31 +32,31 @@ loop is a callbask function,the service logic is implemented by the user, and
32
32
int ff_fcntl(int fd, int cmd, ...);
33
33
34
34
fcntl() performs one of the operations described below on the open file descriptor fd. The operation is determined by cmd.
35
-
more info see man fcntl
35
+
more info see man fcntl.
36
36
37
37
#### ff_sysctl
38
38
39
39
int ff_sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
40
40
const void *newp, size_t newlen);
41
41
42
42
ff_sysctl is used to modify kernel parameters at runtime.
43
-
However, it is currently only supported before F-Stack is started.
43
+
However, it is supported only before F-Stack is started.
44
44
45
45
#### ff_ioctl
46
46
47
47
int ff_ioctl(int fd, unsigned long request, ...);
48
48
49
49
The ioctl() function manipulates the underlying device parameters of special files.
50
-
more info see man ioctl
50
+
more info see man ioctl.
51
51
52
52
### Network API
53
53
54
54
#### ff_socket
55
55
56
56
int ff_socket(int domain, int type, int protocol);
57
57
58
-
creates an endpoint for communication and returns a file descriptor that refers to that endpoint.
59
-
more info see man socket
58
+
ff_socket creates an endpoint for communication and returns a file descriptor that refers to that endpoint.
59
+
more info see man socket.
60
60
61
61
#### ff_setsockopt & ff_getsockopt
62
62
@@ -65,15 +65,15 @@ However, it is currently only supported before F-Stack is started.
65
65
int ff_setsockopt(int s, int level, int optname, const void *optval,
66
66
socklen_t optlen);
67
67
68
-
getsockopt() and setsockopt() manipulate options for the socket referred to by the file descriptor sockfd.
68
+
getsockopt() and setsockopt() manipulate options for the socket denoted by the file descriptor sockfd.
69
69
more info see man getsockopt and man setsockopt.
70
70
71
71
#### ff_socketpair
72
72
73
73
int ff_socketpair(int domain, int type, int protocol, int *sv);
74
74
75
-
The socketpair() call creates an unnamed pair of connected sockets in the specified domain, of the specified type, and using the optionally specified protocol.
76
-
more info see man socketpair
75
+
The socketpair() call creates an unnamed pair of connected sockets in the given domain in the specified type, and uses the optionally given protocol.
76
+
more info see man socketpair.
77
77
78
78
#### Socket operation function
79
79
@@ -123,7 +123,7 @@ However, it is currently only supported before F-Stack is started.
ssize_t ff_recvmsg(int s, struct msghdr *msg, int flags);
134
134
135
-
receive a message from a socket.
135
+
Functions to receive a message from a socket.
136
136
more info see man recv.
137
137
138
138
#### ff_select
@@ -146,7 +146,7 @@ However, it is currently only supported before F-Stack is started.
146
146
147
147
int ff_poll(struct pollfd fds[], nfds_t nfds, int timeout);
148
148
149
-
wait for some event on a file descriptor.
149
+
ff_poll waits for events on a file descriptor.
150
150
more info see man poll.
151
151
152
152
### Kqueue API
@@ -156,7 +156,7 @@ However, it is currently only supported before F-Stack is started.
156
156
int ff_kqueue(void);
157
157
int ff_kevent(int kq, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout);
158
158
159
-
The kqueue() system call provides a generic methodof notifying the user when an event happens or acondition holds, based on the results of small pieces of kernel code termed filters.
159
+
The kqueue() system call provides a generic methodof notifying the user when an event occurs or acondition holds, based on the results of small pieces of kernel code termed filters.
160
160
more info see man kqueue on FreeBSD System Calls Manual.
161
161
162
162
### Epoll API
@@ -172,12 +172,12 @@ However, it is currently only supported before F-Stack is started.
172
172
173
173
int ff_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
174
174
175
-
This system call performs control operations on the epoll(7) instance referred to by the file descriptor epfd.
175
+
This system call performs control operations on the epoll(7) instance referred by the file descriptor epfd.
176
176
more info see man epoll_ctl.
177
177
178
178
### Micro Thread API `micro_thread/mt_api.h`
179
179
180
-
In order to develop asynchronous program convenient without complex asynchronous logic processing, reference [SPP's micro thread framework](https://github.com/Tencent/MSEC/tree/master/spp_rpc) F-Stack provides a micro thread framework, synchronous programming can be achieved using the asynchronous call.
180
+
In order to develop asynchronous program convenient without complex asynchronous logic processing (reference [SPP's micro thread framework](https://github.com/Tencent/MSEC/tree/master/spp_rpc)), F-Stack provides a micro thread framework so that synchronous programming can be achieved using asynchronous calls.
181
181
182
182
#### UDP send/recv interface
183
183
@@ -204,7 +204,7 @@ However, it is currently only supported before F-Stack is started.
204
204
205
205
int mt_tcpsendrcv_ex(struct sockaddr_in* dst, void* pkg, int len, void* rcv_buf, int* buf_size, int timeout, MtFuncTcpMsgLen func, MT_TCP_CONN_TYPE type = MT_TCP_LONG);
206
206
207
-
Tcp send and recv interface, you can choose if the connection is keep-alive or close.The parameter of buf can't use `static`.
207
+
TCP send and recv interface, you can choose if the connection is keep-alive or close.The parameter of buf can't use `static`.
208
208
209
209
210
210
int mt_tcpsendrcv_ex(struct sockaddr_in* dst, void* pkg, int len, void*& rcv_buf, int& recv_pkg_size, int timeout, MtFuncTcpMsgChecker check_func, void* msg_ctx=NULL, MT_TCP_CONN_TYPE type = MT_TCP_LONG, bool keep_rcv_buf=false);
@@ -217,6 +217,6 @@ However, it is currently only supported before F-Stack is started.
217
217
218
218
Use connection pool to send and recv tcp packet, keep-alive default are 10 mintues. The parameter of buf can't use `static`.
0 commit comments