📄 sctp.h
字号:
/***************************************************************************** @(#) sctp.h,v 0.7.8.1 2001/12/11 13:26:32 brian Exp ----------------------------------------------------------------------------- Copyright (C) 2001 OpenSS7 Corporation <http://www.openss7.com> All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ----------------------------------------------------------------------------- U.S. GOVERNMENT RESTRICTED RIGHTS. If you are licensing this Software on behalf of the U.S. Government ("Government"), the following provisions apply to you. If the Software is supplied by the Department of Defense ("DoD"), it is classified as "Commercial Computer Software" under paragraph 252.227-7014 of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any successor regulations) and the Government is acquiring only the license rights granted herein (the license rights customarily provided to non-Government users). If the Software is supplied to any unit or agency of the Government other than DoD, it is classified as "Restricted Computer Software" and the Government's rights in the Software are defined in paragraph 52.227-19 of the Federal Acquisition Regulations ("FAR") (or any success regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or any successor regulations). ----------------------------------------------------------------------------- Last Modified 2001/12/11 13:26:32 by brian *****************************************************************************/#ifndef __SCTP_H__#define __SCTP_H__#ifndef tid_ttypedef int tid_t;#endif/* * ========================================================================= * * DEFAULT Protocol Values * * ========================================================================= */#define SCTP_HMAC_NONE 0#define SCTP_HMAC_SHA_1 1#define SCTP_HMAC_MD5 2/* ip defaults */#define SCTP_DEFAULT_IP_TOS (0x0)#define SCTP_DEFAULT_IP_TTL (64)#define SCTP_DEFAULT_IP_PROTO (132)#define SCTP_DEFAULT_IP_DONTROUTE (0)#define SCTP_DEFAULT_IP_BROADCAST (0)#define SCTP_DEFAULT_IP_PRIORITY (0)/* per association defaults */#define SCTP_DEFAULT_MAX_INIT_RETRIES (8)#define SCTP_DEFAULT_VALID_COOKIE_LIFE (60*HZ)#define SCTP_DEFAULT_MAX_SACK_DELAY (200*HZ/1000)#define SCTP_DEFAULT_ASSOC_MAX_RETRANS (10)#define SCTP_DEFAULT_MAC_TYPE (SCTP_HMAC_NONE)#define SCTP_DEFAULT_COOKIE_INC (1*HZ)#define SCTP_DEFAULT_THROTTLE_ITVL (50*HZ/1000)#define SCTP_DEFAULT_REQ_OSTREAMS (1)#define SCTP_DEFAULT_MAX_ISTREAMS (33)#define SCTP_DEFAULT_RMEM (0) /* not used */#define SCTP_DEFAULT_PPI (0)#define SCTP_DEFAULT_SID (0)/* per destination defaults */#define SCTP_DEFAULT_PATH_MAX_RETRANS (5)#define SCTP_DEFAULT_RTO_INITIAL (3*HZ)#define SCTP_DEFAULT_RTO_MIN (1*HZ)#define SCTP_DEFAULT_RTO_MAX (60*HZ)#define SCTP_DEFAULT_HEARTBEAT_ITVL (30*HZ)/* ip defaults */extern uint sctp_default_ip_tos;extern uint sctp_default_ip_ttl;extern uint sctp_default_ip_proto;extern uint sctp_default_ip_dontroute;extern uint sctp_default_ip_broadcast;extern uint sctp_default_ip_priority;/* per association defaults */extern size_t sctp_default_max_init_retries;extern size_t sctp_default_valid_cookie_life;extern size_t sctp_default_max_sack_delay;extern size_t sctp_default_assoc_max_retrans;extern size_t sctp_default_mac_type;extern size_t sctp_default_cookie_inc;extern size_t sctp_default_throttle_itvl;extern size_t sctp_default_req_ostreams;extern size_t sctp_default_max_istreams;extern size_t sctp_default_rmem;extern size_t sctp_default_ppi;extern size_t sctp_default_sid;/* per destination defaults */extern size_t sctp_default_path_max_retrans;extern size_t sctp_default_rto_initial;extern size_t sctp_default_rto_min;extern size_t sctp_default_rto_max;extern size_t sctp_default_heartbeat_itvl;/* * ========================================================================= * * DATA STRUCTURES * * ========================================================================= */struct sctp_dup { struct sctp_dup *next; struct sctp_dup **prev; uint32_t tsn;};struct sctp_strm { struct sctp_strm *next; /* linkage to stream list */ struct sctp_strm **prev; /* linkage to stream list */ struct sctp *sp; uint16_t sid; /* stream identifier */ uint16_t ssn; /* stream sequence number */ struct { uint32_t ppi; /* payload protocol id */ mblk_t *head; /* head pointer */ uint more; /* more data in (E)TSDU */ } x, n; /* expedited (x) and normal (n) */};struct sctp_saddr { struct sctp_saddr *next; /* linkage for srce address list */ struct sctp_saddr **prev; /* linkage for srce address list */ struct sctp *sp; /* linkage for srce address list */ uint32_t saddr; /* srce address (network order) */};struct sctp_daddr { struct sctp_daddr *next; /* linkage for dest address list */ struct sctp_daddr **prev; /* linkage for dest address list */ struct sctp *sp; /* linkage for dest address list */ uint32_t daddr; /* dest address (network order) */ uint32_t saddr; /* srce address (network order) */ uint dif; /* device interface */ uint flags; /* flags for this destination */ size_t header_len; /* header length */ size_t mtu; /* mtu */ uint hb_onoff; /* activation of heartbeats */ uint hb_fill; /* fill for heartbeat (PMTUDISC) */ size_t in_flight; /* bytes in flight */ size_t retransmits; /* retransmits this dest */ size_t max_retrans; /* max path retransmits */ size_t dups; /* number of duplicates */ size_t cwnd; /* congestion window */ size_t ssthresh; /* slow start threshold */ tid_t timer_heartbeat; /* heartbeat timer (for acks) */ tid_t timer_retrans; /* retrans (RTO) timer */ tid_t timer_idle; /* idle timer */ ulong when; /* last time transmitting */ size_t ack_accum; /* accumulator for acks */ ulong hb_time; /* time of last heartbeat sent */ ulong hb_itvl; /* interval between heartbeats */ ulong rto_max; /* maximum RTO value */ ulong rto_min; /* minimum RTO value */ ulong rto; /* current RTO value */ ulong rttvar; /* current RTT variance */ ulong srtt; /* current smoothed RTT */ struct dst_entry *dst_cache; /* destination cache */ size_t packets; /* packet count */};/* * Some destination flags. */#define SCTP_DESTF_INACTIVE 0x01 /* DEST is inactive */#define SCTP_DESTF_HBACTIVE 0x02 /* DEST heartbeats */#define SCTP_DESTF_TIMEDOUT 0x04 /* DEST timeout occured */#define SCTP_DESTF_PMTUDISC 0x08 /* DEST pmtu discovered */#define SCTP_DESTF_ROUTFAIL 0x10 /* DEST routing failure */#define SCTP_DESTF_UNUSABLE 0x20 /* DEST unusable */#define SCTP_DESTF_CONGESTD 0x40 /* DEST congested */#define SCTP_DESTM_DONT_USE (SCTP_DESTF_INACTIVE| \ SCTP_DESTF_UNUSABLE| \ SCTP_DESTF_ROUTFAIL| \ SCTP_DESTF_CONGESTD| \ SCTP_DESTF_TIMEDOUT)#define SCTP_DESTM_CANT_USE (SCTP_DESTF_UNUSABLE| \ SCTP_DESTF_ROUTFAIL)struct sctp_ifops; /* interface operations */struct sctp { struct sctp *next; /* linkage for master list */ struct sctp **prev; /* linkage for master list */ ushort cmajor; /* major device number */ ushort cminor; /* minor device number */ queue_t *rq; /* read queue */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -