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_ALGORITHM_H 17 #define FILLP_ALGORITHM_H 18 19 #include "fillptypes.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /* Calculate fillp pack interval */ 26 typedef void (*fillpAlgCalPackInterval)(void *argPcb); 27 typedef void (*fillpAlgPackTimer)(void *argPcb); 28 typedef void (*fillpAlgAnalysePack)(void *argPcb, FILLP_CONST void *argPack); 29 typedef void (*fillpAlgAnalyseNack)(void *argPcb, FILLP_CONST void *argNack); 30 typedef void (*fillpAlgHdlPackFlag)(void *argPcb, FILLP_CONST void *argPack); 31 typedef FILLP_INT (*fillpAlgFcInit)(void *argPcb); 32 typedef void (*fillpAlgFcDeinit)(void *argPcb); 33 typedef FILLP_UINT16 (*fillpAlgGetRedunCount)(void *argPcb, void *item); 34 typedef void (*fillpAlgFcUpdateExpectSendBytes)(void *argPcb, FILLP_UINT32 *expectBytes); 35 typedef void (*fillpAlgFcTimer)(void *argPcb); 36 typedef FILLP_UINT32 (*fillpAlgFcGetSrtt)(void *argPcb); 37 38 struct FillpAlgFuncs { 39 fillpAlgFcInit fcInit; 40 fillpAlgFcDeinit fcDeinit; 41 fillpAlgCalPackInterval calPackInterval; 42 fillpAlgPackTimer packTimer; 43 fillpAlgHdlPackFlag hdlPackFlag; 44 fillpAlgAnalysePack analysisPack; 45 fillpAlgAnalyseNack analysisNack; 46 fillpAlgGetRedunCount getRedunCount; 47 fillpAlgFcUpdateExpectSendBytes updateExpectSendBytes; 48 fillpAlgFcTimer fcTime; 49 }; 50 51 extern struct FillpAlgFuncs g_fillpAlg0; 52 53 FILLP_INT FillpAlg0FcInit(void *argPcb); 54 55 void FillpAlg0FcDeinit(void *argPcb); 56 57 void FillpAlg0CalPackInterval(void *argPcb); 58 59 void FillpAlg0AnalysePack(void *argPcb, FILLP_CONST void *argPack); 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 #endif /* FILLP_ALGORITHM_H */ 66