1060ff233Sopenharmony_ci/* 2060ff233Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 3060ff233Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4060ff233Sopenharmony_ci * you may not use this file except in compliance with the License. 5060ff233Sopenharmony_ci * You may obtain a copy of the License at 6060ff233Sopenharmony_ci * 7060ff233Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8060ff233Sopenharmony_ci * 9060ff233Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10060ff233Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11060ff233Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12060ff233Sopenharmony_ci * See the License for the specific language governing permissions and 13060ff233Sopenharmony_ci * limitations under the License. 14060ff233Sopenharmony_ci */ 15060ff233Sopenharmony_ci 16060ff233Sopenharmony_ci#ifndef FILLP_OPT_H 17060ff233Sopenharmony_ci#define FILLP_OPT_H 18060ff233Sopenharmony_ci 19060ff233Sopenharmony_ci#include "fillptypes.h" 20060ff233Sopenharmony_ci#include "constant.h" 21060ff233Sopenharmony_ci#include "pdt_fc.h" 22060ff233Sopenharmony_ci 23060ff233Sopenharmony_ci#ifdef __cplusplus 24060ff233Sopenharmony_ciextern "C" { 25060ff233Sopenharmony_ci#endif 26060ff233Sopenharmony_ci 27060ff233Sopenharmony_ci#define IP_HLEN 20 28060ff233Sopenharmony_ci#define UDP_HLEN 8 29060ff233Sopenharmony_ci 30060ff233Sopenharmony_ci#define FILLP_VLEN 1 31060ff233Sopenharmony_ci 32060ff233Sopenharmony_cistruct NetBuf { 33060ff233Sopenharmony_ci FILLP_INT len; // (data length+option) 34060ff233Sopenharmony_ci FILLP_UINT8 padd[4]; 35060ff233Sopenharmony_ci struct sockaddr_in6 addr; 36060ff233Sopenharmony_ci struct FtSocket *ftSock; 37060ff233Sopenharmony_ci FILLP_CHAR *p; 38060ff233Sopenharmony_ci}; 39060ff233Sopenharmony_ci 40060ff233Sopenharmony_ci 41060ff233Sopenharmony_ci#define FILLP_MAX_STACK_RATE (10 * 1000 * 1000) /* 10 Gbps */ 42060ff233Sopenharmony_ci#define FILLP_MAX_STACK_RECV_RATE (10 * 1000 * 1000) /* 10 Gbps */ 43060ff233Sopenharmony_ci 44060ff233Sopenharmony_ci#define FILLP_ITEM_MULT_NUM 2 /* fillp item multiplication number */ 45060ff233Sopenharmony_ci#define FILLP_SPUNGE_EVENTG_MULT_NUM 3 /* multiplication number for spunge event queue */ 46060ff233Sopenharmony_ci#define FILLP_TIME_PRECISION 3 /* time precision */ 47060ff233Sopenharmony_ci 48060ff233Sopenharmony_ci#define FILLP_RTT_TIME_LEVEL1_HALF 100000 49060ff233Sopenharmony_ci#define FILLP_RTT_TIME_LEVEL1 200000 /* rtt time */ 50060ff233Sopenharmony_ci#define FILLP_RTT_TIME_LEVEL2 400000 /* min packet interval if rtt is more then default rtt */ 51060ff233Sopenharmony_ci#define FILLP_NODATARECV_PACK_INTERVAL 500000 52060ff233Sopenharmony_ci 53060ff233Sopenharmony_ci#define FILLP_ONE_THIRD_OF_RTT 3 /* one third part of rtt */ 54060ff233Sopenharmony_ci#define FILLP_ONE_FOURTH_OF_RTT 4 /* one fourth part of rtt */ 55060ff233Sopenharmony_ci#define FILLP_ONE_FIFTH_OF_RTT 5 /* one fifth part of rtt */ 56060ff233Sopenharmony_ci#define FILLP_ONE_SIXTH_OF_RTT 6 57060ff233Sopenharmony_ci#define FILLP_ONE_SEVEN_OF_RTT 7 58060ff233Sopenharmony_ci#define FILLP_ONE_EIGHTH_OF_RTT 8 59060ff233Sopenharmony_ci 60060ff233Sopenharmony_ci#define FILLP_MIN_NACK_INTERVAL 20000 61060ff233Sopenharmony_ci 62060ff233Sopenharmony_ci/* max server allow send cache */ 63060ff233Sopenharmony_ci#define FILLP_DEFAULT_APP_MAX_SERVER_ALLOW_SEND_CACHE FILLP_MAX_SERVER_ALLOW_SEND_RECV_CACHE 64060ff233Sopenharmony_ci/* max server allow recv catche */ 65060ff233Sopenharmony_ci#define FILLP_DEFAULT_APP_MAX_SERVER_ALLOW_RECV_CACHE FILLP_MAX_SERVER_ALLOW_SEND_RECV_CACHE 66060ff233Sopenharmony_ci 67060ff233Sopenharmony_ci#define FILLP_WR_DATA_CHECK_INTERVAL (50 * 1000) 68060ff233Sopenharmony_ci 69060ff233Sopenharmony_ci#define FILLP_DEFAULT_APP_OPPOSITE_SET_RATE 0 /* Only for Server */ 70060ff233Sopenharmony_ci 71060ff233Sopenharmony_ci#define FILLP_DEFAULT_MB_TO_KB_FACTOR 1000 /* recv rate in MB */ 72060ff233Sopenharmony_ci 73060ff233Sopenharmony_ci#define FILLP_DEFAULT_OPPOSITE_SET_PERCENTAGE 100 /* Only for Server */ 74060ff233Sopenharmony_ci#define FILLP_DEFAULT_MAX_RATE_PERCENTAGE 100 75060ff233Sopenharmony_ci#define FILLP_MAX_LOSS_PERCENTAGE 100 76060ff233Sopenharmony_ci 77060ff233Sopenharmony_ci#ifdef __cplusplus 78060ff233Sopenharmony_ci} 79060ff233Sopenharmony_ci#endif 80060ff233Sopenharmony_ci 81060ff233Sopenharmony_ci#endif /* FILLP_OPT_H */ 82