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