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_OPT_H 17 #define FILLP_OPT_H 18 19 #include "constant.h" 20 #include "pdt_fc.h" 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 #define IP_HLEN 20 27 #define UDP_HLEN 8 28 29 #define FILLP_VLEN 1 30 31 struct NetBuf { 32 FILLP_INT len; // (data length+option) 33 FILLP_UINT8 padd[4]; 34 struct sockaddr_in6 addr; 35 struct FtSocket *ftSock; 36 FILLP_CHAR *p; 37 }; 38 39 40 #define FILLP_MAX_STACK_RATE (10 * 1000 * 1000) /* 10 Gbps */ 41 #define FILLP_MAX_STACK_RECV_RATE (10 * 1000 * 1000) /* 10 Gbps */ 42 43 #define FILLP_ITEM_MULT_NUM 2 /* fillp item multiplication number */ 44 #define FILLP_SPUNGE_EVENTG_MULT_NUM 3 /* multiplication number for spunge event queue */ 45 #define FILLP_TIME_PRECISION 3 /* time precision */ 46 47 #define FILLP_RTT_TIME_LEVEL1_HALF 100000 48 #define FILLP_RTT_TIME_LEVEL1 200000 /* rtt time */ 49 #define FILLP_RTT_TIME_LEVEL2 400000 /* min packet interval if rtt is more then default rtt */ 50 #define FILLP_NODATARECV_PACK_INTERVAL 500000 51 52 #define FILLP_ONE_THIRD_OF_RTT 3 /* one third part of rtt */ 53 #define FILLP_ONE_FOURTH_OF_RTT 4 /* one fourth part of rtt */ 54 #define FILLP_ONE_FIFTH_OF_RTT 5 /* one fifth part of rtt */ 55 #define FILLP_ONE_SIXTH_OF_RTT 6 56 #define FILLP_ONE_SEVEN_OF_RTT 7 57 #define FILLP_ONE_EIGHTH_OF_RTT 8 58 59 #define FILLP_MIN_NACK_INTERVAL 20000 60 61 /* max server allow send cache */ 62 #define FILLP_DEFAULT_APP_MAX_SERVER_ALLOW_SEND_CACHE FILLP_MAX_SERVER_ALLOW_SEND_RECV_CACHE 63 /* max server allow recv catche */ 64 #define FILLP_DEFAULT_APP_MAX_SERVER_ALLOW_RECV_CACHE FILLP_MAX_SERVER_ALLOW_SEND_RECV_CACHE 65 66 #define FILLP_WR_DATA_CHECK_INTERVAL (50 * 1000) 67 68 #define FILLP_DEFAULT_APP_OPPOSITE_SET_RATE 0 /* Only for Server */ 69 70 #define FILLP_DEFAULT_MB_TO_KB_FACTOR 1000 /* recv rate in MB */ 71 72 #define FILLP_DEFAULT_OPPOSITE_SET_PERCENTAGE 100 /* Only for Server */ 73 #define FILLP_DEFAULT_MAX_RATE_PERCENTAGE 100 74 #define FILLP_MAX_LOSS_PERCENTAGE 100 75 76 #ifdef __cplusplus 77 } 78 #endif 79 80 #endif /* FILLP_OPT_H */ 81