1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FILLP_INC_H
17 #define FILLP_INC_H
18 #include "fillptypes.h"
19 #include "fillpcallbacks.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #pragma pack(push, 8)
26 
27 /**
28  * @ingroup FillPTraceInterfaces
29  * @brief  This callback function is used to call the application trace function.
30  *
31  * @param[in] traceObjType   Indicates a trace object of type FillpTraceTypeEnum.
32  * @param[in] traceHandle     Indicates the handle passed by application.
33  * @param[in] msgLength      Indicates the length of the message.
34  * @param[in] traceObj      Indicates the socket identifier for which the trace is currently provided.
35  * @param[in] traceDescript Indicates the structure FillpTraceDescriptSt.
36  * @param[in] traceMsg      Indicates the actual trace message. For commands from user, only the arguments are part
37  * of the indication. For network messages, the FillP header along with the IP header (port and IP) are given as part
38  * of indication.
39  * @return void.
40  * @par Related Topics
41  * stTraceInfo
42  * FtRegTraceCallbackFn
43  */
44 typedef void (*FillpTraceSend)(IN FILLP_UINT32 traceObjType, IN void *traceHandle,
45     IN FILLP_UINT32 msgLength, IN FILLP_UINT32 traceObj, IN FILLP_UINT8 *traceDescript,
46     IN FILLP_CHAR *traceMsg, ...);
47 
48 /**
49  * This structure provides the trace information.
50  */
51 struct TraceInfo {
52     FillpTraceSend fillpTraceSend; /* Specifies a pointer to the FillpTraceSend function. */
53     FILLP_BOOL  cmdTraceFlag;
54     FILLP_UINT8 padd[3];
55 #ifdef FILLP_64BIT_ALIGN
56     FILLP_UINT8 padd1[4];
57 #endif
58 };
59 
60 extern struct TraceInfo g_traceInfo;
61 
62 
63 /**
64  * @ingroup FillPSocketInterfaces
65  * @brief Sends a message on a socket. This function is the same as the send function of the TCP socket.
66  * If the socket is set as NON-Block, and if the non-block error happens, the the API returns -1 and the
67  * error number is set as ERR_EAGAIN. You can retrieve the last error number of the socket by calling the
68  * FtGetErrno() API.
69  *
70  * @param[in] fd        Indicates the socket created by FtSocket.
71  * @param[in] data      Indicates a data pointer.
72  * @param[in] size      Indicates the size of the message.
73  * @param[in] flag      Indicates the status.
74  * @return On success, returns 0
75  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
76  */
77 extern FILLP_INT DLL_API FtSend(FILLP_INT fd, FILLP_CONST void *data, size_t size, FILLP_INT flag);
78 
79 /**
80  * @ingroup FillPSocketInterfaces
81  * @brief Sends a video frame on a socket. This function is same with FtSend except the argument 'frame'
82  * If the socket is set as NON-Block, and if the non-block error happens, the the API returns -1 and the
83  * error number is set as ERR_EAGAIN. You can retrieve the last error number of the socket by calling the
84  * FtGetErrno() API.
85  *
86  * @param[in] fd        Indicates the socket created by FtSocket.
87  * @param[in] data      Indicates a data pointer.
88  * @param[in] size      Indicates the size of the message.
89  * @param[in] flag      Indicates the status.
90  * @param[in] frame     Indicates frame information (including the frame type I or P, etc.) of the video frame.
91  * @return On success, returns 0
92  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
93  */
94 extern FILLP_INT DLL_API FtSendFrame(FILLP_INT fd, FILLP_CONST void *data, size_t size, FILLP_INT flag,
95     FILLP_CONST struct FrameInfo *frame);
96 
97 /**
98  * @ingroup FillPSocketInterfaces
99  * @brief This interface is used to bind to a socket created by the FtSocket() API. The usage is the same as
100  * the bind function of the TCP socket.
101  *
102  * @param[in] fd        Specifies a descriptor identifying an unbound socket created by the FtSocket.
103  * @param[in] name      Specifies a pointer to a SockAddr structure of the local address to assign to the bound socket.
104  * @param[in] nameLen   Specifies the length, in bytes, of the value pointed to by the name parameter.
105  * @return On success, returns 0
106  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
107  * @note
108  * If the FtBind API returns failure, the user must call the FtClose API for same socket index and recreate the socket
109  * using the FtSocket() API.
110  * @par Limitations
111  * The FtBind API does not support  bind to INADDR_ANY address.
112  */
113 extern FILLP_INT DLL_API FtBind(FILLP_INT fd, FILLP_CONST struct sockaddr *name, FILLP_UINT32 nameLen);
114 
115 
116 /**
117  * @ingroup FillPSocketInterfaces
118  * @brief Creates an endpoint for communication and returns a descriptor. The usage is the same as
119  * the socket function of the TCP socket.
120  *
121  * @param[in] domain     Indicates the domain to communicate.
122  * @param[in] type       Indicates the type of connection.
123  * @param[in] protocol   Indicates the type of protocol used.
124  * @return On success, returns 0
125  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
126  */
127 extern FILLP_INT DLL_API FtSocket(IN FILLP_INT domain, IN FILLP_INT type, IN FILLP_INT protocol);
128 
129 
130 /**
131  * @ingroup FillPSocketInterfaces
132  * @brief Initiates a connection on a socket. This is same as the TCP connect function.
133  * If the socket is a non-block and there is a non-block error on the socket during FtConnect function,
134  * the API returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno API.
135  *
136  * @param[in] fd        Indicates a socket created by the FtSocket API.  This is of protocol family and this must be
137  * passed as PF_INET/AF_INET/AF_INET6 /PF_INET6.
138  * @param[in] name      Indicates the socket type, which must be of type SOCK_STREAM.
139  * @param[in] nameLen   This must be passed as IPPROTO_FILLP.
140  * @return On success, returns 0
141  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
142  */
143 extern FILLP_INT DLL_API FtConnect(FILLP_INT fd, FILLP_CONST FILLP_SOCKADDR *name, socklen_t nameLen);
144 
145 
146 /**
147  * @ingroup FillPSocketInterfaces
148  * @brief This is an interface for the user to receive messages from a socket. This is same as the TCP receive
149  * function. If the socket is a non-block and there is non-block error on the socket during FtConnect(), then the
150  * API will return -1. You can retrieve the last error number of the socket by calling the FtGetErrno API.
151  *
152  * @param[in] fd   Indicates a socket created by FtSocket().
153  * @param[in] mem  Indicates a pointer to the buffer where the message is stored.
154  * @param[in] len  Indicates the length, in bytes, of the buffer pointed by the buffer argument.
155  * @param[in] flag   Indicates the flag.
156  * @return On success, returns 0
157  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
158 
159  * @note
160  * If the  product uses FILLP EPOLL (FILLP EPOLL is edge triggered), then the FtRecv function must be called to
161  * receive the complete data upon reception of SPUNGE_EPOLLIN.
162  * In case of edge triggered epoll event notification method, the FtRecv API will behave same as
163  * the tcp recv() function.
164  */
165 extern FILLP_INT DLL_API FtRecv(FILLP_INT fd, void *mem, size_t len, FILLP_INT flag);
166 
167 #if defined(FILLP_LINUX) && defined(FILLP_MMSG_SUPPORT)
168 /**
169  * @ingroup FillPSocketInterfaces
170  * @brief This is an interface for the user to send a message on a socket.
171  * If the socket is set as NON-Block and if the non-block error happens then the API returns -1.
172  * The Last error number of the socket can be retrieved by calling the API FtGetErrno.
173  *
174  * @param[in] fd   A socket created by FtSocket.
175  * @param[in] iov  A pointer which points to an array of iovec structures.
176  * @param[in] iovCount  buffer count of data described by iov.
177  * @return On success, returns 0
178  */
179 extern FILLP_INT DLL_API FtWritev(FILLP_INT fd, const struct iovec *iov, FILLP_INT iovCount);
180 
181 /**
182  * @ingroup FillPSocketInterfaces
183  * @brief This is an interface for the user to recv a message on a socket.
184  * If the socket is set as NON-Block and if the non-block error happens then the API returns -1.
185  * The Last error number of the socket can be retrieved by calling the API FtGetErrno.
186  *
187  * @param[in] fd   A socket created by FtSocket.
188  * @param[in] iov  A pointer which points to an array of iovec structures.
189  * @param[in] iovCount  buffers of data described by iov.
190  * @return On success, returns 0
191  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
192  */
193 extern FILLP_INT DLL_API FtReadv(FILLP_INT fd, const struct iovec *iov, FILLP_INT iovCount);
194 
195 #endif
196 
197 /**
198  * @ingroup FillPSocketInterfaces
199  * @brief Closes the socket connection and releases all associated resources. This API is same as
200  * the close function of TCP socket.
201  *
202  * @param[in]    fd      This indicates a socket created by the FtSocket function.
203  * @return On success, returns 0
204  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
205  * @note Once FtClose is called for a socket, the application must not invoke any API to perform any operation
206  * on the closed socket.
207  * FillP recv_buff has data, say 2 KB.
208  * Adapter calls the FtRecv() API with the buffer length as 1 KB. The application checks the input buffer length
209  * and the return length of the FtRecv API. If both lengths are identical, the application must call the FtRecv
210  * API again. During that time, FillP copies the remaining 1 KB to the adapter.
211  * When there is no data in the FillP buffer, but the application calls the FtRecv() API, the API will
212  * return EAGAIN.
213  */
214 extern FILLP_INT DLL_API FtClose(FILLP_INT fd);
215 
216 
217 /**
218  * @ingroup FillPSocketInterfaces
219  * @brief Indicates graceful closure of socket.
220  * Initiates a graceful closure of the socket connection from initiating side (uni-directional).
221  *
222  * @param[in] fd   Indicates a socket created by FtSocket function.
223  * @param[in] how  If how is SHUT_RD, further receptions will be disallowed.  If how is SHUT_WR,
224  * further transmissions will be disallowed. If how is SHUT_RDWR, further receptions and
225  * @return On success, returns 0
226  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
227  * @note The socket resources will not be cleared just by calling the FtShutDown() API. To clear the
228  * socket resources, call the FtClose API.
229  * If the product uses fillp_epoll, after calling FtShutDown the product has to wait till it receives
230  * the SPUNGE_EPOLLERR event in FtEpollWait call, and then call the FtClose() API.
231  * If the product does not use fillp_epoll (for example, product which use blocking socket),
232  * then after calling FtShutDown, product can call FtClose(), say after 3 seconds.
233  */
234 extern FILLP_INT DLL_API FtShutDown(FILLP_INT fd, FILLP_INT how);
235 
236 
237 /**
238  * @ingroup FillPSocketInterfaces
239  * @brief fd a connection on a socket. This is same as the accept function of the TCP socket.
240  * @param[in] fd      Indicates a socket which is created by the FtSocket function.
241  * @param[in] addr        Indicates a pointer to a SockAddr structure that contains the address of the peer socket.
242  * @param[in] addrLen     Indicates the length of the SockAddr structure.
243  * @return On success, returns 0
244  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
245  * @note - The addr and addrLen pointers are optional in the FtAccept API. If the user passes a valid pointer in
246  * this API, the stack fills the peer address in this pointer after accepting the connection stack. If user is passing
247  * FILLP_NULL_PTR for these 2 pointers, the stack can accept peer connection but will not provide peer address.
248  * The addr and addrLen pointers should be address structures of IPv4 and IPv6 as per socket created in FtSocket().
249  * Else, the FtAccept() API may fail.
250  */
251 extern FILLP_INT DLL_API FtAccept(FILLP_INT fd, struct sockaddr *addr, socklen_t *addrLen);
252 
253 
254 /**
255  * @ingroup FillPSocketInterfaces
256  * @brief Listens for connections on a socket. This function is the as same as the listen function of the TCP socket.
257  *
258  * @param[in] fd        Indicates a socket created by the FtSocket API.
259  * @param[in] backLog   Defines the maximum length to which the queue of pending connections for fd can grow.
260  * @return On success, returns 0
261  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
262  * @note The backLog value provided in the FtListen() API must be between 0 and MAX CONNECTION configured during
263  * init. Else, stack will take default value, MAX CONNECTION number as the backLog.
264  */
265 extern FILLP_INT DLL_API FtListen(FILLP_INT fd, FILLP_INT backLog);
266 
267 
268 /**
269  * @ingroup FillPEpollInterfaces
270  * @brief This API is used to open an epoll file descriptor.
271  *
272  * @return On success, returns 0
273  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
274  * The following table provides information about the errors set by this API.
275  * <table>
276 
277    <tr><th>Errors                     <th>Error Message String
278    <tr><td>FILLP_EINVAL  <td>Invalid argument epNum passed.
279    <tr><td>FILLP_ENOMEM  <td>There was insufficient memory to create epoll object.
280    <tr><td>FILLP_EFAULT  <td>Error occurred due to semaphore or atomic operation.
281 
282    </table>
283  */
284 extern FILLP_INT DLL_API FtEpollCreate(void);
285 
286 /**
287  * @ingroup FillPEpollInterfaces
288  * @brief  This API is used to open an epoll file descriptor.
289  *
290  * @return On success, returns 0
291  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
292  *
293  */
294 extern FILLP_INT DLL_API FtEpollCreateLinux(FILLP_INT epNum);
295 
296 
297 /**
298  * @ingroup FillPEpollInterfaces
299  * @brief This API indicates the control interface for epoll file descriptor.
300  *
301  * @param[in]            epFd   Indicates a file descriptor on which the operation is performed.
302  * @param[in]            op     Indicates an operation which needs to be performed.
303  * @param[in]            fd     Indicates a file descriptor.
304  * @param[in]            event  Indicates an object linked to the file descriptor.
305  * @return On success, returns 0
306  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
307  * The following table provides information about the errors set by this API.
308  */
309 extern FILLP_INT DLL_API FtEpollCtl(FILLP_INT epFd, FILLP_INT op, FILLP_INT fd,
310     FILLP_CONST struct SpungeEpollEvent *event);
311 
312 
313 /**
314  * @ingroup FillPEpollInterfaces
315  * @brief This function indicates wait for an I/O event on an epoll file descriptor.
316  *
317  * @param[in]  epFd      Indicates an epoll file descriptor.
318  * @param[in]  events    Indicates the memory area pointed to the events, containing the events that will be
319  * available for the caller.
320  * @param[in]  maxEvents Indicates the maximum number of events.
321  * @param[in]  timeout   Indicates the maximum timeout value, in milliseconds.
322  * @return On success, returns 0
323  * On failure, returns -1. You can retrieve the last error number of the socket by calling the FtGetErrno() API.
324  * @note
325  * If timeout value is -1, the FillP/VTP stack will wait in blocking mode, till it does not get any event
326  * for the epoll list.
327  * If timeout value is 0, the FillP stack will wait in nonblocking mode. It will check for only current events
328  * available to inform.
329  * If timeout value is some other positive number, the stack will wait for the time indicated by the timeout
330  * parameter.
331  * Do not pass negative numbers other than -1 to this API.
332  */
333 extern FILLP_INT DLL_API FtEpollWait(FILLP_INT epFd, struct SpungeEpollEvent *events,
334     FILLP_INT maxEvents, FILLP_INT timeout);
335 
336 
337 /**
338  * @ingroup FillP_Control_Interfaces
339  * @brief This function is used to manipulate the file descriptor.
340  *
341  * @param[in] fd    Indicates a socket created by the FtSocket API.
342  * @param[in] cmd   Indicates the command to perform on the socket s.
343  * @param[in] val   Indicates the flag value used to set the blocking and non blocking socket.
344  * @return
345  * Upon success, returns the value which depends on command(cmd), or returns error codes on failure.
346  * @note
347  * This API must be used only in the Linux platform.
348  */
349 extern FILLP_INT DLL_API FtFcntl(FILLP_INT fd, FILLP_INT cmd, FILLP_INT val);
350 
351 
352 /**
353  * @ingroup FillP_Control_Interfaces
354  * @brief This function controls the I/O mode of a socket.
355  *
356  * @param[in] fd    Indicates a socket created by the FtSocket API.
357  * @param[in] cmd   Indicates the command to perform on the socket s.
358  * @param[in] val   Indicates the flag value used to set the blocking and non blocking socket.
359  * @return
360  * On success: FILLP_OK.
361  * On failure: error code on failure.
362  * @note
363  * This API must be used only in the Linux platform.
364  */
365 extern FILLP_INT DLL_API FtIoctl(FILLP_INT fd, FILLP_ULONG cmd, FILLP_CONST FILLP_INT *val);
366 
367 
368 /**
369  * @ingroup FillP_Control_Interfaces
370  * @brief This function controls the I/O mode of a socket.
371  *
372  * @param[in] fd    Indicates a socket created by the FtSocket API.
373  * @param[in] cmd   Indicates the command to perform on the socket s.
374  * @param[in] val   Indicates the flag value used to set the blocking and non blocking socket.
375  * @return
376  * On success: FILLP_OK.
377  * On failure: error code on failure.
378  * @note
379  * This API must be used only in Windows Platform.
380  */
381 extern FILLP_INT DLL_API FtIoctlSocket(FILLP_INT fd, FILLP_SLONG cmd, FILLP_CONST FILLP_INT *val);
382 
383 #define FILLP_CONFIG_ALL_SOCKET ((FILLP_UINT16)FILLP_MAX_UNSHORT_VAL)
384 
385 /**
386  * TRCE/ INTERFACE DEFINITION This structure represents the trace direction.
387  */
388 typedef struct FillpTraceDescriptStruct {
389     FILLP_UINT8 traceDirection; /* This is of type TYPE FillpTraceDirectEn. */
390 #ifdef FILLP_64BIT_ALIGN
391     FILLP_UINT8 res[7];
392 #else
393     FILLP_UINT8 res[3];
394 #endif
395 } FillpTraceDescriptSt;
396 
397 #define FILLP_TRACE_DESC_INIT(dir) \
398     { \
399         (dir), \
400         {0}, \
401     }
402 
403 /**
404  * TRCE/ INTERFACE DEFINITION This enum represents the trace direction.
405  */
406 typedef enum FillpTraceDirectEnum {
407     FILLP_TRACE_DIRECT_RECV = 0, /* Indicates FillP trace receive. */
408     FILLP_TRACE_DIRECT_SEND,     /* Indicates FillP trace send. */
409     FILLP_TRACE_DIRECT_NONE,     /* Indicates FillP trace none. */
410     FILLP_TRACE_DIRECT_END       /* Indicates FillP trace end. */
411 } FillpTraceDirectEn;
412 
413 
414 /**
415  * TRCE/ INTERFACE DEFINITION This enum represents type of FillP trace.
416  */
417 typedef enum FillpTraceTypeEnum {
418     FILLP_TRACE_DIRECT_DISABLE = 0,         /* Indicates that FillP/VTP trace is disabled. */
419     FILLP_TRACE_DIRECT_USER,                /* Indicates that FillP will trace all the user commands (socket API). */
420     FILLP_TRACE_DIRECT_NETWORK,             /* Indicates whether FillP packets are sent or received. */
421     FILLP_TRACE_DIRECT_USER_NETWORK_ENABLE, /* Enables FillP to send or receive packets. */
422     FILLP_TRACE_END                         /* Indicates the FillP/VTP trace type enum end.  */
423 } FillpTraceTypeEn;
424 
425 
426 /**
427  * @ingroup FillPTraceInterfaces
428  * @brief This function is called by the FillP adapter to start the trace of user APIs and
429  * network messages for a particular socket.
430  *
431  * @param[in] traceObjType   Indicates a trace object defined in FILLP_TRACE_OBJ_TYPE_ENUM and indicates
432  * the type of trace which must be done.
433  * @param[in] traceObj      A user must pass the FtSocket identification to set the trace for that particular
434  * socket (0xFFFFFFFF - means for all the sockets).
435  * @param[in] traceHandle    Provides a trace handle which is transparently passed to the user while giving trace.
436  * 0xFFFFFFFF is an invalid handle.
437  * @return
438  * On success: FILLP_OK.
439  * On failure: error code on failure. The error reason is returned by the error value.
440  */
441 extern FILLP_INT32 DLL_API FtStartTrace(IN FILLP_UINT8 traceObjType, IN FILLP_INT traceObj,
442     IN FILLP_CONST void *traceHandle);
443 
444 
445 /**
446  * @ingroup FillPTraceInterfaces
447  * @brief  This function is called by the FillP adapter to stop the trace for a particular socket.
448  *
449  * @param[in]  traceObjType      Indicates a trace object as defined in FILLP_TRACE_OBJ_TYPE_ENUM  and tells
450  * what kind of trace should be done.
451  * @param[in] traceObj          This is for a particular socket or for all the associations (0xFFFFFFFF).
452  * @return
453  * On success : FILLP_OK
454  * On failure : Error codes. The error reason is returned by the error value.
455  */
456 extern FILLP_INT32 DLL_API FtStopTrace(IN FILLP_UINT8 traceObjType, IN FILLP_INT traceObj);
457 
458 
459 /**
460  * @ingroup FillPTraceInterfaces
461  * @brief Registers the callback function for FillP message trace and FillP command trace.
462  *
463  * @param[in]    traceFuncCallback      Indicates a trace callback.
464  * @return
465  * On success :FILLP_OK
466  * On failure :Error codes
467  */
468 extern FILLP_INT32 DLL_API FtRegTraceCallbackFn(IN FILLP_CONST FillpTraceSend traceFuncCallback);
469 
470 
471 /**
472  * Indicates the enumeration for the debug commands.
473  */
474 typedef enum FillpDebugCmdEnum {
475     /* Provides the output information  about all other debug commands that you can use. */
476     FILLP_DBGCMD_HELP,
477     /* Sets the level of debug information which stack provides in the callback. Refer FillpDebugLevel for
478      * different levels. If level is set as FILLP_DBG_LVL_ERROR only error info is provided to user, if level is set as
479      * FILLP_DBG_LVL_WARNING both warning and error info are provided to the user. */
480     FILLP_DBGCMD_SET_PRINT_LEVEL,
481     /* Shows the current dynamically configured configuration parameters at application level. */
482     FILLP_DBGCMD_SHOW_PRINT_LEVEL,
483     /* Shows all the information about the FillP socket/connection. */
484     FILLP_DBGCMD_SHOW_SOCKET_INFO,
485     /* Shows  all the INIT configuration of the stack. */
486     FILLP_DBGCMD_SHOW_INIT_RESOURCE,
487     /* Shows all the global configuration parameters of the stack. */
488     FILLP_DBGCMD_SHOW_GLOBAL_CONFIG_RESOURCE,
489     /* Shows all the socket level configuration parameters of the stack. */
490     FILLP_DBGCMD_SHOW_SOCKET_CONFIG_RESOURCE,
491     FILLP_DBGCMD_BUTT
492 } FillpDebugCmdEn;
493 
494 
495 /**
496  * @ingroup FillP_Debug
497  * @brief FillP uses this function to control the debug command options. You can call this API and set the debug level.
498  *
499  * @param[in]    command       Indicates the debug command type of any value from @ref FillpDebugCmdEn
500  * @param[in]    content        Indicates debug control parameter.
501  * @return
502  * void. No errors are set.
503  */
504 extern void DLL_API FillpDebugControl(IN FILLP_UINT8 command, IN FILLP_CONST void *content);
505 
506 
507 /**
508  * @ingroup fillp_stack_api
509  * @brief  This function is called by the FillP adapter to register the adapter's callback function for
510  * LM functionality. If A function pointer is passed as NULL, then it is omitted  for copying. So, the user/adapter
511  * can call this function to register the function pointers separately.
512  *
513  * @param[in]    lmFuncCallback     Indicates the pointer to LM callback function struct.
514  * @return
515  * Success:   ERR_OK
516  * Failure: error code
517  */
518 extern FILLP_INT32 DLL_API FillpRegLMCallbackFn(IN FILLP_CONST FillpLmCallbackFunc *lmFuncCallback);
519 
520 
521 /**
522  * @ingroup fillp_stack_api
523  * @brief This function is called by the FillP adapter to get the address with which the requested socket is bound.
524  *
525  * @param[in]      fd                 Indicates the socket created.
526  * @param[out]     name               Indicates the socket address that needs to be connected.
527  * @param[in]      nameLen            Indicates the length of the address.
528  * @return
529  * On success : ERR_OK
530  * On failure : error code
531  */
532 extern FILLP_INT DLL_API FtGetSockName(FILLP_INT fd, FILLP_SOCKADDR *name, socklen_t *nameLen);
533 
534 /**
535  * @ingroup fillp_stack_api
536  * @brief This function is called by the Fillp adapter to get the peer address to which the
537  * requested socket is connected.
538  *
539  * @param[in]      fd                 Indicates the socket created.
540  * @param[out]     name               Indicates the socket address that needs to be connected.
541  * @param[in,out]  nameLen            Indicates the length of the address.
542  * @return
543  * On success : ERR_OK
544  * On failure : error code
545  */
546 extern FILLP_INT DLL_API FtGetPeerName(FILLP_INT fd, FILLP_SOCKADDR *name, socklen_t *nameLen);
547 
548 /**
549  * @ingroup fillp_stack_api
550  * @brief    This function is called by the Fillp Adapter to get system socket options. \n
551  * Note: All parameters are passed uninterpreted to the system interface.
552  * This function always returns failure for RAW socket.
553  *
554  * @param[in]      fd                 Indicates a socket created by FtSocket.
555  * @param[in]      level              Indicates the level at which the option resides and the name of the option must
556  * be specified, when manipulating socket options.
557  * @param[in]      optName            Indicates the Optname options which are passed uninterpreted to system interface.
558  * @param[out]     optValue             Indicates the option value obtained by invoking the FtGetSockOpt API.
559  * @param[out]     optLen             Indicates the option length obtained by invoking the FtGetSockOpt API.
560  * @return
561  * On success : ERR_OK
562  * On failure : error code
563  */
564 extern FILLP_INT DLL_API FtGetSockOpt(FILLP_INT fd, FILLP_INT level, FILLP_INT optName,
565     void *optValue, FILLP_INT *optLen);
566 
567 /**
568  * @ingroup fillp_stack_api
569  * @brief    This function is called by the Fillp Adapter to set system socket options. \n
570  * Note: All parameters are passed uninterpreted to the system interface. This function always returns failure
571  * for RAW socket.
572  *
573  * @param[in]      fd                 Indicates a socket created by FtSocket.
574  * @param[in]      level              Indicates the level at which the option resides and the name of the option must
575  * be specified, when manipulating socket options.
576  * @param[in]      optName            Indicates the Optname options which are passed uninterpreted to system interface.
577  * @param[in]      optValue             Indicates the option value obtained by invoking the FtGetSockOpt API.
578  * @param[in]      optLen             Indicates the option length obtained by invoking the FtGetSockOpt API.
579  * @return
580  * On success : ERR_OK
581  * On failure : error code
582  */
583 extern FILLP_INT DLL_API FtSetSockOpt(FILLP_INT fd, FILLP_INT level, FILLP_INT optName,
584     FILLP_CONST void *optValue, socklen_t optLen);
585 
586 
587 /* Indicates configuration of the enumerator members. */
588 #define FT_CONFIG_BASE_ENUM    1
589 
590 /**
591  * STATIC/Pure Init Configurations
592  *
593  * 1) Maximum Socket Number
594  *
595  * DYNAMIC/POST Init Configurations
596  *
597  * 1)     TX Burst
598  * 2)     RX Burst
599  * 3)     Send Cache
600  * 4)     Recv Cache
601  * 5)     Connection Timeout
602  * 6)     Keep Alive Time
603  * 7)     Full CPU
604  * 8)     Default Rate
605  * 9)     Packet Size
606  * 10)     NACK Repeat Times
607  * 11)     Packet Loss Allowed
608  * 12)    Pack Interval
609  * 13)     Self Adaption
610  * 14)     USE Redundancy
611  * 15)     Default rtt value
612  * 15)     Calculate rtt Dynamically
613  *
614  * List Of Stack Level Configurations
615  *
616  * 1)     Stack Maximum Socket Number
617  * 2)     Stack Maximum Connection Number
618  * 3)     Socket TX Burst
619  * 4)     Socket RX Burst
620  * 5)     Stack Send Cache
621  * 6)     Stack Recv Cache
622  * 7)    Socket Full CPU
623  * 8)     Stack Default Rate
624  * 9)     Stack Packet Size
625  * 10)    Stack NACK Repeat Times
626  * 11)    Stack Packet Loss Allowed
627  * 12)    Stack PACK Interval
628  * 13)     Socket Self Adaption
629  * 14)     Socket USE Redundancy
630  * 15)     Default rtt value
631  * 16)     STACK calculate rtt Dynamically
632  *
633  * List Of Socket Level Configurations
634  *
635  * 1)     Socket Send Cache
636  * 2)     Socket Recv Cache
637  * 3)    Socket OS Send Compensate
638  * 4) Socket NACK Repeat Times
639  * 5) Socket Packet Loss Allowed
640  *
641  * List of Timer Configuration (stack level and Dynamic)
642  * 1) Connect timer
643  * 2) disconnect timer
644  * 3) keep alive timer
645  * 4) pack timer
646  * 5) close pending
647  */
648 typedef enum FillpFecRedundancyLevelStrcut {
649     FILLP_FEC_REDUNDANCY_LEVEL_INVLAID = 0,
650     FILLP_FEC_REDUNDANCY_LEVEL_LOW,
651     FILLP_FEC_REDUNDANCY_LEVEL_MID,
652     FILLP_FEC_REDUNDANCY_LEVEL_HIGH,
653     FILLP_FEC_REDUNDANCY_LEVEL_REAL,
654     FILLP_FEC_REDUNDANCY_LEVEL_AUTO,
655     FILLP_FEC_REDUNDANCY_LEVEL_BUTT
656 } FillpFecRedundancyLevel;
657 
658 /**
659  * Provides the enum for FillP app list configuration.
660  */
661 /* Enum Declarations */
662 typedef enum FillpConfigAppListEnum {
663     FT_CONF_INIT_APP = FT_CONFIG_BASE_ENUM,
664     FT_CONF_INIT_STACK,
665 
666     FT_CONF_TX_BURST, /* Indicates the TX burst for UDP. */
667     FT_CONF_MAX_SERVER_ALLOW_SEND_CACHE, /* Indicates the maximum server allowed send cache. */
668     FT_CONF_MAX_SERVER_ALLOW_RECV_CACHE, /* Indicates the maximum server allowed receive cache. */
669     FT_CONF_SEND_CACHE, /* Indicates the FillP send cache. */
670     FT_CONF_RECV_CACHE, /* Indicates the FillP receive cache. */
671     FT_CONF_SEND_BUFFER_SIZE, /* Indicates the size of the send buffer. */
672     FT_CONF_RECV_BUFFER_SIZE, /* Indicates the size of the receive buffer. */
673     FT_CONF_OPPOSITE_SET_RATE, /* Indicates the FillP stack set rate. */
674     FT_CONF_PACKET_SIZE, /* Indicates the FillP stack packet size. */
675     FT_CONF_SLOW_START, /* Indicates the slow start. */
676     FT_CONF_MAX_RATE, /* Indicates the FillP stack maximum rate. */
677     FT_CONF_MAX_RECV_RATE, /* Indicates the maximum packet receive rate. */
678     FT_CONF_ENABLE_NACK_DELAY, /* Indicates the FillP NACK delay feature. */
679     FT_CONF_NACK_DELAY_TIMEOUT, /* Indicates the FillP NACK delay timeout. */
680     FT_CONF_ENLARGE_PACK_INTERVAL, /* Indicates about the enlarging pack duration when there is no much data send */
681     FT_CONF_TIMER_CONNECT, /* Indicates about the connection timeout duration */
682     FT_CONF_TIMER_CONNECTION_RETRY, /* Indicates about the connection retry duration */
683     FT_CONF_TIMER_DISCONNECT_RETRY_TIMEOUT, /* Indicates about the connection disconnect fin duration */
684     FT_CONF_TIMER_KEEP_ALIVE, /* Indicates about the keep alive time duration */
685     FT_CONF_FEC_REDUNDANCY_LEVEL, /* Indicates about the data loss packet retry redundancy level */
686     FT_CONF_RECV_JITTER, /* Indicates about the jitter  */
687     FT_CONF_APP_FC_RECV_RATE, /* Indicates about the periodRecvRate  */
688     FT_CONF_APP_FC_RECV_PKT_LOSS, /* Indicates about the periodRecvPktLoss  */
689     FT_CONF_CONST_RATE, /* Indicates about the constant send rate  */
690     FT_CONF_APP_FC_RECV_RATE_BPS, /* Indicates about the periodRecvRateBps  */
691     FT_CONF_APP_FC_STATISTICS, /* Indicates about the FILLP_APP_FC_STASTICS  */
692     FT_CONF_APP_FC_STASTICS_INTERVAL, /* Indicates about the app flow statics intterval  */
693     FT_CONF_APP_DIFFER_TRANSMIT, /* indicates the app flow using differentiated transmission,
694                                   * which means no flow control for I frame and BDP for P frame */
695     FT_CONF_APP_PACK_INTERVAL, /* Indicate the FillP default pack interval */
696 
697     FT_CONF_APP_CONFIG_BOUNDARY = 0x7f,
698 
699     FT_CONF_MAX_SOCK_NUM, /* Indicates about max socket number */
700     FT_CONF_MAX_CONNECTION_NUM, /* Indicates about max connection number */
701     FT_CONF_RECV_CACHE_PKT_NUM_BUFF_SIZE, /* Indicates about reac cache packet number buffer size */
702     FT_CONF_RX_BURST, /* Indicates about receiver burst count */
703     FT_CONF_FULL_CPU, /* Indicates about occupying the full core CPU */
704     FT_CONF_OUT_OF_ORDER_CATCHE_FEATURE, /* Indicates about enabling the out of order packet buffer feature */
705     FT_CONF_CPU_CORE_USE, /* Indicates about the CPU core to be used */
706     FT_CONF_OPPOSITE_SET_PERCENTAGE, /* Indicates about the opposite set rate percentage */
707     FT_CONF_MAX_RATE_PERCENTAGE, /* Indicates about the maximum set rate percentage */
708     FT_CONF_NACK_REPEAT_TIMES, /* Indicates about the nack control packet repeat count */
709     FT_CONF_PACKET_LOSS_ALLOWED, /* Indicates about the allowed packet loss */
710     FT_CONF_USE_FEC, /* Indicates about the flow control enable */
711     FT_CONF_SUPPORT_FAIRNESS, /* Indicates about the support for fairness */
712     FT_CONF_INITIAL_RATE, /* Indicates about the initial rate */
713     FT_CONF_CORE_MAX_RATE, /* Indicates about the overall rate on the sending channel */
714     FT_CONF_CORE_MAX_RECV_RATE, /* Indicates about the overall rate on the receiving channel */
715     FT_CONF_TIMER_RECV_CACHE_PKT_NUMBUFF, /* Indicates about the receive packet cache buffer number */
716     FT_CONF_ALG, /* Indicates about the flow control algorithm to be selected */
717     FT_CONF_INIT_STACK_EXT, /* Indicates about the configs which needs to be set for achieveing 3.2Gbps */
718     FT_CONF_BFULL_CPU_USE_THRESHOLD_RATE, /* Indicates about the full cpu rate(Kbps) */
719     FT_CONF_STACK_CORE_LIMIT_RATE, /* Indicates about the overall rate limit on the sending channel */
720     FT_CONF_STACK_CORE_SEND_CACHE, /* Indicates the FillP stack send cache. */
721     FT_CONF_STACK_CORE_RECV_CACHE, /* Indicates the FillP stack receive cache. */
722     FT_CONF_MAX_ASSIST_MSG_ITEM_NUM, /* Indicates the max assist msg item number. */
723     ENUM_FILLP_CONFIG_LIST_BUTT = 0xFF /* Indicates the maximum value for the enumeration. */
724 } FtConfigItemList;
725 
726 typedef struct FillpAppFcStasticsStruct {
727     /* Indicates the period trans delay, uint:ms */
728     FILLP_UINT32 periodRtt;
729     /* Indicates the period pkt loss rate on recv side, precision xx% lost rate is 1%, then 1 will returned */
730     FILLP_UINT32 periodRecvPktLoss;
731     /* Indicates the period recv rate, uint:kbps */
732     FILLP_UINT32 periodRecvRate;
733     /* Indicates the period pkt loss rate on recv side, precision xx.xx%, lost rate is 1.10%, then 110 will returned */
734     FILLP_UINT32 periodRecvPktLossHighPrecision;
735     /* Indicates the period pkt loss rate on send side, precision xx.xx%, lost rate is 1.10%, then 110 will returned */
736     FILLP_UINT32 periodSendPktLossHighPrecision;
737     /* Indicates the period recv rate, uint:bps */
738     FILLP_ULLONG periodRecvRateBps;
739     /* Indicates the period send rate, uint:bps */
740     FILLP_ULLONG periodSendRateBps;
741     /* Indicates the period send rate, uint:ms */
742     FILLP_LLONG jitter;
743 } FillpAppFcStasticsSt;
744 
745 /**
746  * Here provide one common lib to eBackup for both 200Mbps and 3.2Gbps requirement.
747  * Application can use this lib for both the requirements by following below method:
748  * 1) For eBackup (200Mbps) case, no change in Application code
749  * 2) For eBackup_perf (3.2Gbps) case, in Application code, before FtInit(), need to set below
750  * configuration using FtConfigSet with name as FT_CONF_INIT_STACK_EXT
751  *
752  * enableDefault10GConfigsForEbackupPdt:   Enable: Non Zero value; Disable: FILLP_FALSE
753  * pktLossThresHoldMax:
754  * timingWheelAccuracy;
755  * maximalAckNumLimit : 2000
756  * sendOneAckNum : 100
757  * cpuPauseTime : 0
758  * retransmitCmpTime : 0
759  * minRate : 350
760  * minPackInterval : 20000
761  * unsendBoxLoopCheckBurst : 1024
762  * instUnsendBoxSize: 819200
763  * nackRetryLen:600
764  * para :Reserved for future extension purpose
765  */
766 typedef struct FillpGlobalPreinitExtConfigsStruct {
767     FILLP_UINT8 enableDefault10GConfigsForEbackupPdt; /* Enable: Non Zero value; Disable: FILLP_FALSE */
768     FILLP_UINT8 pktLossThresHoldMax;
769     FILLP_UINT16 timingWheelAccuracy;
770     FILLP_UINT32 maximalAckNumLimit;
771     FILLP_UINT32 sendOneAckNum;
772     FILLP_UINT16 cpuPauseTime;
773     FILLP_UINT8 retransmitCmpTime;
774     FILLP_UINT8 reserve;
775     FILLP_UINT16 minRate;
776     FILLP_UINT16 minPackInterval;
777     FILLP_UINT16 unsendBoxLoopCheckBurst;
778     FILLP_UINT16 reserv;
779     FILLP_UINT32 instUnsendBoxSize;
780     FILLP_UINT16 nackRetryLen;
781     FILLP_UINT16 reserved;
782     void *para; /* For future extension purpose */
783 } FillpGlobalPreinitExtConfigsSt;
784 
785 
786 /**
787  * Represents the UDP resource data structure.
788  */
789 /* Structure Declarations */
790 typedef struct FillpUdpResourceStruct {
791     /* Indicates the  number of packets received at each send cycle. This value must be tuned properly for getting
792      * high end performance. The default value is 128. Range: 1 -- 0xFFFF */
793     FILLP_UINT16 rxBurst;
794     FILLP_UINT8 padd[2];
795 #ifdef FILLP_64BIT_ALIGN
796     FILLP_UINT32 reserve;
797 #endif
798 } FillpUdpResourceSt;
799 
800 /**
801  * Provides the values for the FillpCommonStruct data structure.
802  */
803 typedef struct FillpCommonStruct {
804     /* Indicates the receive cache packet number buffer size. The default value is 100.
805      * Valid values are 1 to 10000. */
806     FILLP_UINT32 recvCachePktNumBufferSize;
807     /* Indicates the socket numbers supported for the FillP Server.  For 32 value, the server creates the same number
808      * of ring queues. The default value is 64. Valid values are 1 to 64. */
809     FILLP_UINT16 maxSockNum;
810     /* Indicates the maximum connection numbers supported by each socket. This value cannot be greater than
811      * "maxSockNum" otherwise set as equal to "maxSockNum". The default value is 32. Valid values are 1 to 32. */
812     FILLP_UINT16 maxConnectionNum;
813     /* Indicates the CPU option.  If set to TRUE, the FillP main thread will not sleep. Instead of just sending,
814      * receiving data, and doing other processing, this will lead to better transfer rate control. It can have impact
815      * on CPU rate. If set to FALSE, the FillP main thread will sleep for certain interval based on the packet transfer
816      * rate. In this case, the CPU utilization is less but can have adverse impact on packet rate. You must select the
817      * option based on this trade-off and configure this flag properly. Example:  If we set the rate to 100 Mbps,
818      * we should send one packet per 100 us, and do sleep for 100 us. But, while sleep is done more time may be passed
819      * (more than 10 us). So when FillP awakes next, FillP has to send more packets at one time.
820      * The default value is FALSE. */
821     FILLP_BOOL fullCpu;
822     /* Indicates whether to support out of order cache feature. The default value is TRUE. */
823     FILLP_BOOL outOfOrderCacheFeature;
824     /* Indicates the end of the enum. */
825     FILLP_UINT8 padd[2]; /* add 2 bytes for byte alignment */
826     FILLP_UINT32 maxAssistMsgItemNum;
827 } FillpCommonSt;
828 
829 
830 /**
831  * Provides the values for flow control.
832  */
833 typedef struct FillpFlowControlStruct {
834     /* Indicates the maximum sending rate of the network. The default value is 950 Mbps. Range: non-zero to any */
835     FILLP_UINT32 maxRate;
836     /* Indicates the maximum receiving rate of the network. The default value is 950 Mbps. Range: non-zero to any */
837     FILLP_UINT32 maxRecvRate;
838     /* Indicates the rate with which FillP needs to start the data during the slow start. The default value is 2 Mbps.
839      * Range: non-zero to maxRate - 1 */
840     FILLP_UINT32 initialRate;
841     /* Indicates the opposite set percentage. */
842     FILLP_UINT16 oppositeSetPercentage;
843     /* Indicates the maximum rate percentage. */
844     FILLP_UINT16 maxRatePercentage;
845     /* Indicates the number of NACK packets to send from the system to avoid congestion and NACK Failure rate. If it
846      * set as 10, then NACK packets will be sent 10 times to remote end. The default value is 10. Range: 1 to 0xFF */
847     FILLP_UINT16 nackRepeatTimes;
848     /* Indicates the maximum allowed packet loss in the system. For High "pktLossAllow" value, the sending rate
849      * should be decreased. This value should be minimum in order to get a 2 Mbps sending rate.
850      * The default value is 10. */
851     FILLP_UINT16 pktLossAllow;
852     /* Enables or disables the redundant data retransmit feature. For data packet which is retransmitted multiple
853      * times due to multiple send failures, FillP can send redundant data packet at same time to further avoid the
854      * further packet loss. The default value is FALSE. */
855     FILLP_BOOL fecEnable;
856     /* Algorithm choice */
857     FILLP_UINT8 fcAlg;
858     /* Indicates whether fair sharing of bandwidth among the connections is required. If enabled, fairness would be
859      * provided. The default value is NO FAIRNESS. Range   = { FillpStackFairnessTypeEn } */
860     FILLP_UINT8 supportFairness;
861 #ifdef FILLP_64BIT_ALIGN
862     FILLP_UINT32 reserve;
863 #endif
864 } FillpFlowControlSt;
865 
866 
867 /**
868  * Provides the data structure for the FillP timer.
869  */
870 typedef struct FillpTimerStruct {
871     /* Indicates the receive packet time out. The default value is 20. Valid values are 10 to 300. */
872     FILLP_UINT16 recvCachePktNumBufferTimeout;
873     FILLP_UINT8 padd[2];
874 #ifdef FILLP_64BIT_ALIGN
875     FILLP_UINT32 reserve;
876 #endif
877 } FillpTimer;
878 
879 
880 /**
881  * Provides the global configurations.
882  */
883 typedef struct FillpGlobalConfigsStruct {
884     FillpUdpResourceSt udp; /* Indicates the UDP resource list. */
885     FillpCommonSt common; /* Indicates the common resource list. */
886     FillpFlowControlSt flowControl; /* Indicates the flow control resource list. */
887     FillpTimer timers; /* Indicates the set timers. */
888 } FillpGlobalConfigsSt;
889 
890 /**
891  * Provides UDP resource values.
892  */
893 typedef struct FillpAppUdpResourceStruct {
894     /* Indicates the number of packets sent at each send cycle. The TX burst value must be tuned properly for getting
895      * high end performance. \n Minimum Value: greater than 0 \n Maximum Value:  0x7fff \n Default Value: \n
896      * 4096 (Miracast PDT)  */
897     FILLP_UINT16 txBurst;
898     /* This padding is not required, but since this structure is member of another structure, padding to 4 bytes. */
899     FILLP_UINT8 padd[2];
900 #ifdef FILLP_64BIT_ALIGN
901     FILLP_UINT32 reserve;
902 #endif
903 } FillpAppUdpResourceSt;
904 
905 
906 /**
907  * Provides the values for the FillpAppCommonStruct data structure.
908  */
909 typedef struct FillpAppCommonStruct {
910     /* Indicates the maximum cache allowed by the server to send. Minimum Value: greater than 0 Maximum Value:
911      * No upper limit Default Value: 1638400   */
912     FILLP_UINT32 maxServerAllowSendCache;
913     /* Indicates the maximum cache allowed by the server to receive. Minimum Value: greater than 0
914      * Maximum Value:  No upper limit Default Value: 1638400 */
915     FILLP_UINT32 maxServerAllowRecvCache;
916     /* Indicates the cache pool size reserved to send data for each connection. Minimum Value: greater than 0
917      * Maximum Value: Less than or equal to 0x15D860 Default Value: 8192 (Miracast PDT)   */
918     FILLP_UINT32 sendCache;
919     /* Indicates the cache pool size reserved for received data for each connection. Minimum Value: greater than 0
920      * Maximum Value: Less than or equal to 0x15D860 Default Value: 8192 (Miracast PDT)   */
921     FILLP_UINT32 recvCache;
922     /* Indicates the size of the send buffer. Minimum Value: greater than or equal to 1500 Maximum Value:
923      * No maximum value Default Value: (16 * 1024 * 1024) */
924     FILLP_UINT32 udpSendBufSize;
925     /* Indicates the size of the receive buffer. Minimum Value: greater than or equal to 1500 Maximum Value:
926      * No maximum value Default Value: (16 * 1024 * 1024) */
927     FILLP_UINT32 recvBufSize;
928     /* Indicates the retry count for the  keep alive signal. Values: FILLP_TRUE or FILLP_FALSE Default Value:
929      * FILLP_FALSE (Miracast PDT) */
930     FILLP_BOOL enableNackDelay;
931     /* Indicates the the increase the pack interval when there is no data transmission. Values: Any value. Greater
932      * than 0 means that the feature is enabled Default Value: FILLP_TRUE (Miracast PDT) */
933     FILLP_BOOL enlargePackIntervalFlag;
934     FILLP_UINT16 paddShort;
935     FILLP_UINT32 paddUint32;
936     /* Indicates the duration for delaying nack packet. Minimum Value: greater than or equal to (10000 << 3)
937      * Maximum Value:  Less than or equal to 0x7fffffff  20000 Default Value: 20000 */
938     FILLP_LLONG nackDelayTimeout;
939 } FillpAppCommonSt;
940 
941 
942 /**
943  * Provides the values for flow control.
944  */
945 typedef struct FillpAppFlowControlStruct {
946     /* Indicates the  maximum send rate, in Mbps, the connection in this stack can reach. If set on a particular
947      * socket ID, then it is applicable for that socket ID, otherwise it will be set as default value for all the
948      * sockets which will be created later. Minimum Value: greater than 0 Maximum Value: Less than
949      * (10 * 1000 * 1000) Default Value: (20 * 1000) (Miracast PDT) */
950     FILLP_UINT32 maxRate;
951     /* Maximum rate to be used for receiving the traffic If set on a particular socket ID, then it is applicable for
952      * that socket ID, otherwise it will be set as default value for all the sockets which will be created later
953      * Minimum Value: greater than 0 Maximum Value: Less than (10 * 1000 * 1000) Default Value:
954      * (20 * 1000) (Miracast PDT) */
955     FILLP_UINT32 maxRecvRate;
956     /* Indicates the opposite set rate. Minimum Value: less than (10 * 1000 * 1000) Maximum Value: Less than
957      * maxRate Default Value: 0 */
958     FILLP_UINT32 oppositeSetRate;
959     /* Indicates the maximum size of packet supported for send and receive on FillP socket. If you change this value
960      * sendPktNum and send interval value are also changed. Minimum Value: 0 Maximum Value: Less than or equal
961      * to (FILLP_FRAME_MTU - FILLP_HLEN) Default Value: 1300  */
962     FILLP_UINT16 pktSize;
963     /* Indicates the slow start. Values: FILLP_TRUE and FILLP_FALSE Default Value: FILLP_FALSE (Miracast PDT) */
964     FILLP_BOOL slowStart;
965     /* Enables constant rate. Values: FILLP_TRUE and FILLP_FALSE Default Value: FILLP_FALSE */
966     FILLP_BOOL constRateEnbale;
967     /* enable differentiated transmission */
968     FILLP_BOOL differTransmit;
969 } FillpAppFlowControlSt;
970 
971 
972 /**
973  * Provides the app timer values.
974  */
975 typedef struct FillpAppTimerStruct {
976     /* Indicates the keep alive time, after which the connection will be disconnected if no messages are exchanged.
977      * Minimum Value: Greater than or equal to 100 ms Maximum Value: Less than or equal to (3600 * 1000) ms
978      * Default Value: (10*1000) */
979     FILLP_UINT32 keepAliveTime;
980     /* Indicates the disconnect retry timeout. Minimum Value: Greater than 0 Maximum Value: Less than or
981      * equal to (10 * 1000) ms Default Value: 200 */
982     FILLP_UINT32 disconnectRetrytimeout;
983     /* Indicates the maximum time for any connection to remain in connecting state. The connection is set to IDLE
984      * state after this timer expires. Minimum Value: Greater than 0 Maximum Value: Less than or equal to
985      * (300 * 1000) ms \n Default Value: (10 * 1000) */
986     FILLP_UINT32 connectTimeout;
987     FILLP_UINT16 reserve;  /* reserve */
988     /* Indicates the connection retry timeout. Minimum Value: Greater than 0  Maximum Value: Less than or
989      * equal to (10 * 1000) ms Default Value: 200 */
990     FILLP_UINT16 connRetrytimeout;
991     FILLP_UINT16 reserveExt;
992     FILLP_UINT8 padd[2];
993 #ifdef FILLP_64BIT_ALIGN
994     FILLP_UINT32 reserved;
995 #endif
996 } FillpAppTimerSt;
997 
998 /**
999  * Provides the global configurations.
1000  */
1001 typedef struct FillpAppGlobalConfigStruct {
1002     FillpAppUdpResourceSt udp; /* Indicates the UDP resource list. */
1003     FillpAppCommonSt common; /* Indicates the common resource list.  */
1004     FillpAppFlowControlSt flowControl; /* Indicates the flow control resource list. */
1005     FillpAppTimerSt timers; /* Indicates the timer list. */
1006 } FillpAppGlobalConfigsSt;
1007 
1008 /**
1009  * Provides the FillP stack fairness type.
1010  */
1011 typedef enum FillpStackFairnessTypeEnum {
1012     FILLP_FAIRNESS_TYPE_NONE = 0,         /* Indicates the fairness type none. */
1013     FILLP_FAIRNESS_TYPE_EQUAL_WEIGHT = 1, /* Indicates the equal weight fairness type. */
1014     FILLP_FAIRNESS_TYPE_CONN_SET_VAL = 2, /* Indicates the setting value. */
1015     FILLP_FAIRNESS_TYPE_END,              /* Indicates FillP fairness end. */
1016     FILLP_FAIRNESS_TYPE_BUTT = 0xFF       /* Indicates the FillP fairness type. */
1017 } FillpStackFairnessTypeEn;
1018 
1019 /**
1020  * @ingroup fillp_stack_api
1021  * @brief  Registers the system interface functions to be used by the FillP stack. The function pointers of all
1022  * system functions defined by this API are passed FillpSysLibCallbackFuncSt to FILLP stack to be registered
1023  * and used during the run time of the stack. Users must pass "FillpCryptoRandFunc cryptoRand" which is to register
1024  * cryptographically strong random number generator function. Others callback pointers are optional, if users pass
1025  * them as NULL, then default functions will be registered by FillP/VTP. This function should be called before
1026  * initializing the stack.
1027  *
1028  * @param[in] libSysFunc    Pointer to system interface callback function structure FillpSysLibCallbackFuncSt.
1029  * @param[in] para           This is a reserve parameter for future extension. User can pass it as FILLP_NULL_PTR.
1030  * @return
1031  * FILLP_SUCCESS : Upon successful
1032  * ERR_NULLPTR : Upon failure
1033  */
1034 extern FILLP_INT32 DLL_API FillpApiRegLibSysFunc(IN FILLP_CONST FillpSysLibCallbackFuncSt *libSysFunc,
1035     IN FILLP_CONST void *para);
1036 
1037 /**
1038  * @ingroup fillp_stack_api
1039  * @brief  Registers the APP functions to be used by the FillP stack. The function pointers of all APP functions
1040  * defined by this API are passed FillpAppCallbackFunc to FILLP stack to be registered and used during
1041  * the run time of the stack. This api can only invoked after FillpApiRegLibSysFunc.
1042  * fillpSockCloseCbkFunc callback pointers are optional and default value is NULL.
1043  *
1044  * @param[in] appCbkFunc       Pointer to APP callback function structure FillpAppCallbackFunc.
1045  * @return
1046  * 0 : Upon successful
1047  * -1 : Upon failure
1048  * The following table provides information about the errors set by this API.
1049  */
1050 extern FILLP_INT32 DLL_API FillpApiRegAppCallbackFunc(IN FILLP_CONST FillpAppCallbackFunc *appCbkFunc);
1051 
1052 /**
1053  * @ingroup fillp_stack_api
1054  * @brief  This API is used to initialize the VTP/FillP stack.
1055  * @note Two threads cannot call FtInit() simultaneously. Also FtInit() cannot be called multiple time once it is
1056  * successful. It is suggested that products use this API only once by a single thread to initialize VTP/FIllP stack.
1057  *
1058  * @return The error reason is returned by the return value.
1059  */
1060 extern FILLP_INT DLL_API FtInit(void);
1061 
1062 /**
1063  * @ingroup fillp_stack_api
1064  * @brief   This API is used to deinitialize the FillP stack.
1065  * @note
1066  * - User must close all the sockets created by FtSocket() / FtEpollCreate() before calling the FtDestroy() API.
1067  * Otherwise the  FtDestroy() API will block.  There is another API FtDestroyNonblock() which does not block,
1068  * so user can choose to use this API.
1069  * - Two threads cannot call FtDestroy() simultaneously. Also FtDestroy() cannot be called multiple time after it is
1070  * successful. It is suggested that products use this API only once by a single thread.
1071  *
1072  * @return  This API does not set any error.
1073  */
1074 extern void DLL_API FtDestroy(void);
1075 
1076 /**
1077  * @ingroup fillp_stack_api
1078  * @brief  This API is use  to deinit the fillp stack but not block.
1079  *
1080  * @return  This API does not set any error.
1081  */
1082 extern void DLL_API FtDestroyNonblock(void);
1083 
1084 /**
1085  * Provides the statistics types.
1086  */
1087 typedef enum FillpStatsTypeEnum {
1088     FILLP_STATS_DIRECT_PACK = 0,   /* Indicates the packet statistics. */
1089     FILLP_STATS_DIRECT_KEEP_ALIVE, /* Indicates the packet keep alive statistics. */
1090     FILLP_STATS_DIRECT_DEBUG,      /* Indicates the direct debug statistics. */
1091     FILLP_STATS_DIRECT_TRAFFIC,    /* Indicates the traffic statistics. */
1092     FILLP_STATS_DIRECT_ALL         /* Indicates the statistics for all packets. */
1093 } FillpStatsTypeEn;
1094 
1095 /**
1096  * Provides the FillP packet statistics.
1097  */
1098 struct FillpPackStastics {
1099     FILLP_LLONG packTimePassed; /* Indicates the packet time passed. */
1100     FILLP_LLONG packSendTime; /* Indicates the packet send time. */
1101     FILLP_LLONG packRttDetectTime; /* Indicates the packet rtt detect time. */
1102     FILLP_ULLONG periodRecvBits; /* Indicates the packet receive bits. */
1103     FILLP_UINT32 packInterval; /* Indicates the packet time interval. */
1104     FILLP_UINT32 lastPackRecvRate; /* Indicates the packet receive rate. */
1105     FILLP_UINT32 periodRecvRate; /* Indicates the packet receive rate. */
1106     FILLP_UINT32 maxRecvRate; /* Indicates the maximum packet receive rate. */
1107     FILLP_UINT32 packLostSeq; /* Indicates the packet lost sequence. */
1108     FILLP_UINT32 packPktNum; /* Indicates the packet number. */
1109 
1110     FILLP_UINT32 periodRecvedOnes; /* Indicates the received packets. */
1111     FILLP_UINT32 periodDroped; /* Indicates the dropped packets. */
1112 
1113     FILLP_UINT32 periodSendRate; /* Indicates the packet send rate. */
1114     FILLP_UINT32 periodAckByPackRate; /* Indicates the ack by packet rate. */
1115 
1116     FILLP_UINT32 packIntervalBackup; /* Records the packInterval as a backup. */
1117     FILLP_UINT16 periodRecvPktLoss; /* Indicates the packet receive loss. */
1118     FILLP_BOOL peerRtt; /* Indicates the peer value. */
1119     FILLP_UINT8 padd[5];
1120 };
1121 
1122 /* Provides the FillP NACK statistics. */
1123 struct FillpNackStastics {
1124     FILLP_LLONG nackDelayTimeout; /* Indicates the NACK delay timeout. */
1125     FILLP_UINT32 nackInterval; /* Indicates the NACK interval. */
1126     FILLP_UINT16 nackHistorySendQueueNum; /* Indicates the NACK history send queue number. */
1127     FILLP_UINT16 currentHistoryNackNum; /* Indicates the Ncurrent history NACK number. */
1128     FILLP_LLONG nackSendTime; /* Indicates the NACK send time. */
1129     FILLP_UINT32 historyNackQueueLen; /* Indicates the history NACK queue length. */
1130     FILLP_UINT8 fnsPadd[4];
1131 };
1132 
1133 /**
1134  * Provides the keep alive statistics.
1135  */
1136 struct FillpKeepAliveStastics {
1137     FILLP_LLONG lastRecvTime; /* Indicates the last receive time. */
1138     FILLP_LLONG lastDataRecvTime; /* Indicates the last data receive time. */
1139     FILLP_LLONG lastSendTime; /* Indicates the last send time. */
1140 };
1141 
1142 /**
1143  * Provides the debug pcb statistics.
1144  */
1145 struct FillpStatatisticsDebugPcb {
1146     FILLP_LLONG packRecvedTimeInterval; /* Indicates the packet received time interval. */
1147     FILLP_LLONG curPackDeltaUs;
1148     FILLP_INT multiRetry; /* Indicates multiple retries. */
1149     FILLP_INT retryOne; /* Indicates one time retry. */
1150     FILLP_INT retryThreeTimes; /* Indicates three times retry. */
1151     FILLP_INT retryFourthTimes; /* Indicates four times retry. */
1152     FILLP_INT retryMore; /* Indicates more retry. */
1153     FILLP_INT maxRetry; /* Indicates the maximum retry. */
1154     FILLP_UINT32 connReqSend; /* Indicates the connection request send. */
1155     FILLP_UINT32 connReqFailed; /* Indicates the connection request failed. */
1156     FILLP_UINT32 connReqAckSend; /* Indicates the connection request ACK send. */
1157     FILLP_UINT32 connReqAckFailed; /* Indicates the connection request ACK failed. */
1158     FILLP_UINT32 connConfirmSend; /* Indicates the connection confirm request send. */
1159     FILLP_UINT32 connConfirmFailed; /* Indicates the connection confirm request failed. */
1160     FILLP_UINT32 connConfirmAckSend; /* Indicates the connection confirm request ACK send. */
1161     FILLP_UINT32 connConfirmAckFailed; /* Indicates the connection confirm request ACK failed. */
1162     FILLP_UINT32 disconnReqSend; /* Indicates the disconnection request send. */
1163     FILLP_UINT32 disconnReqFailed; /* Indicates the disconnection request failed. */
1164     FILLP_UINT32 disconnRspSend; /* Indicates the disconnection response send. */
1165     FILLP_UINT32 disconnRspFailed; /* Indicates the disconnection response failed. */
1166     FILLP_UINT32 keepAliveProbeReqSend; /* Indicates the keep alive probe request send. */
1167     FILLP_UINT32 keepAliveProbeReqFailed; /* Indicates the keep alive probe request failed. */
1168     FILLP_UINT32 keepAliveProbeRspSend; /* Indicates the keep alive probe response send. */
1169     FILLP_UINT32 keepAliveProbeRspFailed; /* Indicates the keep alive probe response failed. */
1170     FILLP_UINT32 nackSend; /* Indicates the NACK send. */
1171     FILLP_UINT32 nackFailed; /* Indicates the NACK failed. */
1172     FILLP_UINT32 nackRcv; /* Indicates the NACK received. */
1173     FILLP_UINT32 packSend; /* Indicates the packet send. */
1174     FILLP_UINT32 packFailed; /* Indicates the packet failed. */
1175     FILLP_UINT32 packRcv; /* Indicates the packet received. */
1176     FILLP_UINT32 nackPktNum; /* Indicates the NACK packet number. */
1177     FILLP_UINT32 packIntervalPktNum; /* Indicates the packet number of the packet interval. */
1178     FILLP_UINT32 packIntervalSendBytes; /* Indicates the send bytes of the packet interval. */
1179     FILLP_UINT32 packIntervalSendPkt; /* Indicates the send packets of the packet interval. */
1180     FILLP_UINT8 onePktMaxSendCount; /* Indicates the maximum send count for one packet. */
1181     FILLP_UINT8 fsdpPadd[3];
1182 };
1183 
1184 /**
1185  * Provides the traffic statistics.
1186  */
1187 struct FillpStatisticsTraffic {
1188     FILLP_UINT32 totalRecved; /* Indicates the total packet received. */
1189     FILLP_UINT32 totalRecvedBytes; /* Indicates the total received bytes. */
1190     FILLP_UINT32 totalDroped; /* Indicates the total packets dropped. */
1191     FILLP_UINT32 totalRetryed; /* Indicates the total packets retried. */
1192     FILLP_UINT32 totalSendFailed; /* Indicates the total packet send failed. */
1193     FILLP_UINT32 totalSend; /* Indicates the total packets sent. */
1194     FILLP_UINT32 totalSendBytes; /* Indicates the total sent bytes. */
1195     FILLP_UINT32 totalOutOfOrder; /* Indicates the total packets out of order. */
1196     FILLP_UINT32 totalRecvLost; /* Indicates the total packet receive lost. */
1197     FILLP_UINT32 packSendBytes; /* Indicates the total sent bytes. */
1198     FILLP_UINT32 packExpSendBytes; /* Indicates the total sent bytes. */
1199 #ifdef FILLP_64BIT_ALIGN
1200     FILLP_UINT8 padd1[4];
1201 #endif
1202 };
1203 
1204 #define FILLP_NACK_HISTORY_NUM 10
1205 #define FILLP_NACK_HISTORY_ARR_NUM 2
1206 struct FillpNackHistory {
1207     FILLP_UINT32 lostPktGap;
1208 #ifdef FILLP_64BIT_ALIGN
1209     FILLP_UINT8 padd[4];
1210 #endif
1211     FILLP_LLONG timestamp;
1212 };
1213 
1214 struct FillpNackHistoryStastics {
1215     struct FillpNackHistory nackHistoryArr[FILLP_NACK_HISTORY_NUM];
1216     FILLP_UINT32 nackHistoryNum;
1217     FILLP_UINT16 pktLoss;
1218 #ifdef FILLP_64BIT_ALIGN
1219     FILLP_UINT8 padd64[2];
1220 #endif
1221     FILLP_UINT32 historyMinLostPktGap[FILLP_NACK_HISTORY_ARR_NUM]; /* 0: by time, 1: by all the member */
1222     FILLP_UINT32 historyAvgLostPktGap[FILLP_NACK_HISTORY_ARR_NUM];
1223     FILLP_UINT32 historyMaxLostPktGap[FILLP_NACK_HISTORY_ARR_NUM];
1224 };
1225 
1226 struct FillAppFcStastics {
1227     FILLP_LLONG periodTimePassed;
1228     FILLP_LLONG periodRecvBits;
1229     FILLP_UINT32 pktNum;
1230     FILLP_UINT32 periodRecvPkts;
1231     FILLP_UINT32 periodRecvPktLoss;
1232     FILLP_UINT32 periodRecvRate; /* kbps */
1233     FILLP_ULLONG periodRecvRateBps; /* bps */
1234     FILLP_UINT32 periodRtt; /* ms */
1235     FILLP_UINT32 periodRecvPktLossHighPrecision; /* for example when lost rate is 1.10%, then 110 will returned */
1236     FILLP_UINT32 periodSendLostPkts;
1237     FILLP_UINT32 periodSendPkts;
1238     FILLP_UINT32 periodSendPktLossHighPrecision; /* for example when lost rate is 1.10%, then 110 will returned */
1239     FILLP_ULLONG periodSendBits;
1240     FILLP_ULLONG periodSendRateBps; /* bps */
1241 };
1242 
1243 /**
1244  * Provides the pcb statistics.
1245  */
1246 struct FillpStatisticsPcb {
1247     struct FillpPackStastics pack; /* Indicates the packet statistics. */
1248     struct FillpKeepAliveStastics keepAlive; /* Indicates the keep alive statistics. */
1249     struct FillpStatatisticsDebugPcb debugPcb; /* Indicates the debug pcb statistics. */
1250     struct FillpStatisticsTraffic traffic; /* Indicates the traffic statistics. */
1251     struct FillpNackStastics nack; /* Indicates the NACK statistics. */
1252     struct FillpNackHistoryStastics nackHistory; /* Indicates the NACK history. */
1253     struct FillAppFcStastics appFcStastics; /* Indicates the app fc statistics. */
1254 };
1255 
1256 /**
1257  * @ingroup fillp_stastics_api
1258  * @brief   This function is called by the fillp Adapter to get the statistics information for a each type.
1259  *
1260  * @param[in]  fd       Indicates the socket index for which stats need to be provided.
1261  * @param[out] outStats Indicates fillp_statistics_pc, to which statistics are copied.
1262  * @return  Success: ERR_OK
1263  * Fail: Error code
1264  * The following table provides information about the errors set by this API.
1265  */
1266 extern FILLP_INT DLL_API FtFillpStatsGet(IN FILLP_INT fd, OUT struct FillpStatisticsPcb *outStats);
1267 
1268 
1269 /**
1270  * @ingroup fillp_stastics_api
1271  * @brief    This function is called by the FillP adapter to  to show the statistics information.
1272  *
1273  * @param[in] fillpStatsType   Indicates the statistics type.
1274  * @param[in] fd           Indicates the socket index.
1275  * @return  On Success : ERR_OK
1276  * On Failure : Error code
1277  * The following table provides information about the errors set by this API.
1278  */
1279 extern FILLP_INT DLL_API FtFillpStatShow(IN FILLP_UINT32 fillpStatsType, IN FILLP_INT fd);
1280 
1281 
1282 /**
1283  * @ingroup FillPSocketInterfaces
1284  * @brief
1285  * This function gives the error values. If any FillP API fails, then there will be errno set by FillP/VTP.
1286  * User can retrieve the errno by calling FtGetErrno()
1287  *
1288  * @param None
1289  * @par Error Numbers
1290  * The following table provides information about the errno set by FillP/VTP.
1291 
1292  * @return  This API does not set any errors.
1293  */
1294 extern FILLP_INT DLL_API FtGetErrno(void);
1295 
1296 /**
1297  * @ingroup FillP/VTP Stack Interfaces
1298  * @brief
1299  * Returns rtt in microseconds which was calculated while setting up the connection
1300  * for the sockFd socket.
1301  *
1302  * @param[in] fd  Indicates the socket index.
1303  * @return
1304  * On Success : calculated rtt value as a unsigned long long value
1305  * On Failure : FILLP_NULL
1306  * The following table provides information about the errors set by this API.
1307  */
1308 extern FILLP_ULLONG DLL_API FtGetRtt(FILLP_INT fd);
1309 
1310 
1311 /**
1312  * @ingroup fillp_stack_api
1313  * @brief
1314  * This function is called to get the current stack time in FillP/VTP.
1315  *
1316  * @param[in] instInx  Indicates the instance index to check.
1317  * @return
1318  * FILLP_ULLONG - Last time updated of stack.  This API does not set any errors.
1319  */
1320 extern FILLP_ULLONG DLL_API FtGetStackTime(FILLP_INT instInx);
1321 
1322 typedef char *FILLP_CHAR_PTR;
1323 /**
1324  * @ingroup fillp_stack_api
1325  * @brief   Gets the FillP version string.
1326  *
1327  * @return  FILLP_CHAR* - Version string. User must not free this pointer. This API does not set any errors.
1328  */
1329 extern FILLP_CHAR_PTR DLL_API FtGetVersion(void);
1330 /**
1331  * @ingroup fillpconfig
1332  * @brief  Gets individual FillP stack configuration items.
1333  *
1334  * @param[in]   name   Specifies the name of the configuration item to configure (FILLP_CONFIG_LIST enum).
1335  * @param[out]  value  Contains the value for the configuration item.
1336  * @param[in]   param  Contains the value for the configuration item, which requires additional information to config.
1337  * @par The following table provides configuration information:
1338  * @return
1339  * ERR_OK on success
1340  * Error codes on failure.
1341  * Error reason is returned by the return value.
1342  */
1343 extern FILLP_INT32 DLL_API FtConfigGet(IN FILLP_UINT32 name, IO void *value, IN FILLP_CONST void *param);
1344 /**
1345  * @ingroup fillpconfig
1346  * @brief  Sets individual FillP stack configuration items.
1347  *
1348  * @param[in]  name   Indicates the name of the configuration item to configure.
1349  * @param[in]  value  Contains the value for the configuration item.
1350  * @param[in]  param  Contains the value for the configuration item, which requires additional information to configure.
1351  * @par The following table provides configuration information:
1352  * @return
1353  * ERR_OK on success
1354  * Error codes on failure.
1355  * Error reason is returned by the return value.
1356  */
1357 extern FILLP_INT32 DLL_API FtConfigSet(IN FILLP_UINT32 name, IN FILLP_CONST void *value,
1358     IN FILLP_CONST void *param);
1359 
1360 
1361 struct FillpCurrentSendCacheInf {
1362     FILLP_UINT32 currentSendCacheSize; /* Indicates the total allocated size of send cache. */
1363     FILLP_UINT32 currentDataSizeInCache; /* Indicates the size of the pending data to be sent. */
1364 };
1365 
1366 /**
1367  * @ingroup fillpevt
1368  * @brief  Register the event callback function on the socket.
1369  *
1370  * @param[in] fd          Indicates a socket created by the FtSocket API.
1371  * @param[in] evtCbkFunc  Pointer to event callback function FillpEvtCbkFunc.
1372  * @return
1373  * On Success : returns 0
1374  * On Failure : returns -1
1375  */
1376 FILLP_INT DLL_API FtApiRegEventCallbackFunc(IN FILLP_INT fd, IN FillpEvtCbkFunc evtCbkFunc);
1377 
1378 /**
1379  * @ingroup fillpevt
1380  * @brief  unregister the event callback function on the socket.
1381  *
1382  * @param[in] fd          Indicates a socket created by the FtSocket API.
1383  * @param[in] evtCbkFunc  Pointer to event callback function FillpEvtCbkFunc.
1384  * @return
1385  * On Success : returns 0
1386  * On Failure : returns -1
1387  */
1388 FILLP_INT DLL_API FtApiUnregEventCallbackFunc(IN FILLP_INT fd, IN FillpEvtCbkFunc evtCbkFunc);
1389 
1390 /**
1391  * @ingroup fillpevt
1392  * @brief  Get the event info on the socket.
1393  *
1394  * @param[in]     fd    Indicates a socket created by the FtSocket API.
1395  * @param[in/out] info  Pointer to event callback information FtEventCbkInfo.
1396  * @return
1397  * On Success : returns 0
1398  * On Failure : returns -1
1399  */
1400 FILLP_INT DLL_API FtApiEventInfoGet(IN FILLP_INT fd, IO FtEventCbkInfo *info);
1401 
1402 /**
1403  * @ingroup fillpevt
1404  * @brief  register dfx event callback function
1405  *
1406  * @param[in] softObj   any useful message to evtCb
1407  * @param[in]    func   event callback function
1408  * @return
1409  * On Success : returns 0
1410  * On Failure : returns -1
1411  */
1412 extern FILLP_INT DLL_API FtSetDfxEventCb(void *softObj, FillpDfxEventCb evtCb);
1413 
1414 /**
1415  * @ingroup fillpevt
1416  * @brief   deal with HiDumper cmd
1417  *
1418  * @param[in]    argc   arg number
1419  * @param[in]    argv   arg value
1420  * @param[in] softObj   any useful message to dump
1421  * @param[in]    dump   function to printf data
1422  * @return
1423  * On Success : returns 0
1424  * On Failure : returns -1
1425  */
1426 extern FILLP_INT DLL_API FtDfxHiDumper(FILLP_UINT32 argc, const FILLP_CHAR **argv,
1427     void *softObj, FillpDfxDumpFunc dump);
1428 
1429 #pragma pack(pop)
1430 
1431 #ifdef __cplusplus
1432 }
1433 #endif
1434 
1435 #endif /* _FILLP_API_INC_H_ */
1436 
1437