sctpconstants.h

来自「TCPDUMP的C语言源代码,是在数据链路层的应用」· C头文件 代码 · 共 572 行 · 第 1/2 页

H
572
字号
/* number of simultaneous timers running */#define SCTP_MAX_NET_TIMERS     6	/* base of where net timers start */#define SCTP_NUMBER_TIMERS	12	/* allows up to 6 destinations *//* Of course we really don't collect stale cookies, being * folks of decerning taste. However we do count them, if * we get to many before the association comes up.. we * give up. Below is the constant that dictates when * we give it up...this is a implemenation dependant * treatment. In ours we do not ask for a extension of * time, but just retry this many times... */#define SCTP_MAX_STALE_COOKIES_I_COLLECT 10/* max number of TSN's dup'd that I will hold */#define SCTP_MAX_DUP_TSNS      20/* Here we define the types used when * setting the retry ammounts. *//* constants for type of set */#define SCTP_MAXATTEMPT_INIT 2#define SCTP_MAXATTEMPT_SEND 3/* Here we define the default timers and the * default number of attemts we make for * each respective side (send/init). *//* init timer def = 3sec  */#define SCTP_INIT_SEC	3#define SCTP_INIT_NSEC	0/* send timer def = 3 seconds */#define SCTP_SEND_SEC	1#define SCTP_SEND_NSEC	0/* recv timer def = 200ms (in nsec) */#define SCTP_RECV_SEC	0#define SCTP_RECV_NSEC	200000000/* 30 seconds + RTO */#define SCTP_HB_SEC	30#define SCTP_HB_NSEC	0/* 300 ms */#define SCTP_SHUTDOWN_SEC	0#define SCTP_SHUTDOWN_NSEC	300000000#define SCTP_RTO_UPPER_BOUND 60000000 /* 60 sec in micro-second's */#define SCTP_RTO_UPPER_BOUND_SEC 60  /* for the init timer */#define SCTP_RTO_LOWER_BOUND  1000000 /* 1 sec in micro-sec's */#define SCTP_DEF_MAX_INIT 8#define SCTP_DEF_MAX_SEND 10#define SCTP_DEF_PMTU_RAISE 600  /* 10 Minutes between raise attempts */#define SCTP_DEF_PMTU_MIN   600#define SCTP_MSEC_IN_A_SEC  1000#define SCTP_USEC_IN_A_SEC  1000000#define SCTP_NSEC_IN_A_SEC  1000000000/* Events that SCTP will look for, these * are or'd together to declare what SCTP * wants. Each select mask/poll list should be * set for the fd, if the bit is on. */#define SCTP_EVENT_READ		0x000001#define SCTP_EVENT_WRITE	0x000002#define SCTP_EVENT_EXCEPT	0x000004/* The following constant is a value for this * particular implemenation. It is quite arbitrary and * is used to limit how much data will be queued up to * a sender, waiting for cwnd to be larger than flightSize. * All implementations will need this protection is some * way due to buffer size constraints. */#define SCTP_MAX_OUTSTANDING_DG	10000/* This constant (SCTP_MAX_READBUFFER) define * how big the read/write buffer is * when we enter the fd event notification * the buffer is put on the stack, so the bigger * it is the more stack you chew up, however it * has got to be big enough to handle the bigest * message this O/S will send you. In solaris * with sockets (not TLI) we end up at a value * of 64k. In TLI we could do partial reads to * get it all in with less hassel.. but we * write to sockets for generality. */#define SCTP_MAX_READBUFFER 65536#define SCTP_ADDRMAX 60/* amount peer is obligated to have in rwnd or * I will abort */#define SCTP_MIN_RWND	1500#define SCTP_WINDOW_MIN	1500	/* smallest rwnd can be */#define SCTP_WINDOW_MAX 1048576	/* biggest I can grow rwnd to				 * My playing around suggests a				 * value greater than 64k does not				 * do much, I guess via the kernel				 * limitations on the stream/socket.				 */#define SCTP_MAX_BUNDLE_UP 256	/* max number of chunks I can bundle *//*  I can handle a 1meg re-assembly */#define SCTP_DEFAULT_MAXMSGREASM 1048576#define SCTP_DEFAULT_MAXWINDOW	32768	/* default rwnd size */#define SCTP_DEFAULT_MAXSEGMENT 1500	/* MTU size, this is the default                                         * to which we set the smallestMTU					 * size to. This governs what is the					 * largest size we will use, of course					 * PMTU will raise this up to					 * the largest interface MTU or the					 * ceiling below if there is no					 * SIOCGIFMTU.					 */#ifdef LYNX#define DEFAULT_MTU_CEILING  1500 	/* Since Lynx O/S is brain dead					 * in the way it handles the					 * raw IP socket, insisting					 * on makeing its own IP					 * header, we limit the growth					 * to that of the e-net size					 */#else#define DEFAULT_MTU_CEILING  2048	/* If no SIOCGIFMTU, highest value					 * to raise the PMTU to, i.e.					 * don't try to raise above this					 * value. Tune this per your					 * largest MTU interface if your					 * system does not support the					 * SIOCGIFMTU ioctl.					 */#endif#define SCTP_DEFAULT_MINSEGMENT 512	/* MTU size ... if no mtu disc */#define SCTP_HOW_MANY_SECRETS 2		/* how many secrets I keep *//* This is how long a secret lives, NOT how long a cookie lives */#define SCTP_HOW_LONG_COOKIE_LIVE 3600	/* how many seconds the current secret will live */#define SCTP_NUMBER_OF_SECRETS	8	/* or 8 * 4 = 32 octets */#define SCTP_SECRET_SIZE 32		/* number of octets in a 256 bits */#ifdef USE_MD5#define SCTP_SIGNATURE_SIZE 16	/* size of a MD5 signature */#else#define SCTP_SIGNATURE_SIZE 20	/* size of a SLA-1 signature */#endif/* Here are the notification constants * that the code and upper layer will get *//* association is up */#define SCTP_NOTIFY_ASSOC_UP		1/* association is down */#define SCTP_NOTIFY_ASSOC_DOWN		2/* interface on a association is down * and out of consideration for selection. */#define SCTP_NOTIFY_INTF_DOWN		3/* interface on a association is up * and now back in consideration for selection. */#define SCTP_NOTIFY_INTF_UP		4/* The given datagram cannot be delivered * to the peer, this will probably be followed * by a SCTP_NOTFIY_ASSOC_DOWN. */#define SCTP_NOTIFY_DG_FAIL		5/* Sent dg on non-open stream extreme code error! */#define SCTP_NOTIFY_STRDATA_ERR 	6#define SCTP_NOTIFY_ASSOC_ABORTED	7/* The stream ones are not used yet, but could * be when a association opens. */#define SCTP_NOTIFY_PEER_OPENED_STR	8#define SCTP_NOTIFY_STREAM_OPENED_OK	9/* association sees a restart event */#define SCTP_NOTIFY_ASSOC_RESTART	10/* a user requested HB returned */#define SCTP_NOTIFY_HB_RESP             11/* a result from a REL-REQ */#define SCTP_NOTIFY_RELREQ_RESULT_OK		12#define SCTP_NOTIFY_RELREQ_RESULT_FAILED	13/* clock variance is 10ms or 10,000 us's */#define SCTP_CLOCK_GRAINULARITY 10000#define IP_HDR_SIZE 40		/* we use the size of a IP6 header here				 * this detracts a small amount for ipv4				 * but it simplifies the ipv6 addition				 */#define SCTP_NUM_FDS 3/* raw IP filedescriptor */#define SCTP_FD_IP   0/* raw ICMP filedescriptor */#define SCTP_FD_ICMP 1/* processes contact me for requests here */#define SCTP_REQUEST 2#define SCTP_DEAMON_PORT 9899/* Deamon registration message types/responses */#define DEAMON_REGISTER       0x01#define DEAMON_REGISTER_ACK   0x02#define DEAMON_DEREGISTER     0x03#define DEAMON_DEREGISTER_ACK 0x04#define DEAMON_CHECKADDR_LIST 0x05#define DEAMON_MAGIC_VER_LEN 0xff/* max times I will attempt to send a message to deamon */#define SCTP_MAX_ATTEMPTS_AT_DEAMON 5#define SCTP_TIMEOUT_IN_POLL_FOR_DEAMON 1500 /* 1.5 seconds *//* modular comparison *//* True if a > b (mod = M) */#define compare_with_wrap(a, b, M) ((a > b) && ((a - b) < (M >> 1))) || \              ((b > a) && ((b - a) > (M >> 1)))#ifndef TIMEVAL_TO_TIMESPEC#define TIMEVAL_TO_TIMESPEC(tv, ts)			\{							\    (ts)->tv_sec  = (tv)->tv_sec;			\    (ts)->tv_nsec = (tv)->tv_usec * 1000;		\}#endif/* pegs */#define SCTP_NUMBER_OF_PEGS 21/* peg index's */#define SCTP_PEG_SACKS_SEEN 0#define SCTP_PEG_SACKS_SENT 1#define SCTP_PEG_TSNS_SENT  2#define SCTP_PEG_TSNS_RCVD  3#define SCTP_DATAGRAMS_SENT 4#define SCTP_DATAGRAMS_RCVD 5#define SCTP_RETRANTSN_SENT 6#define SCTP_DUPTSN_RECVD   7#define SCTP_HBR_RECV	    8#define SCTP_HBA_RECV       9#define SCTP_HB_SENT	   10#define SCTP_DATA_DG_SENT  11#define SCTP_DATA_DG_RECV  12#define SCTP_TMIT_TIMER    13#define SCTP_RECV_TIMER    14#define SCTP_HB_TIMER      15#define SCTP_FAST_RETRAN   16#define SCTP_PEG_TSNS_READ 17#define SCTP_NONE_LFT_TO   18#define SCTP_NONE_LFT_RWND 19#define SCTP_NONE_LFT_CWND 20#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?