⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 structs.h

📁 h内核
💻 H
📖 第 1 页 / 共 4 页
字号:
		/* primary_path		 *		 * Primary     : This is the current primary destination		 * Path	       : transport address of the peer endpoint.  It		 *	       : may also specify a source transport address		 *	       : on this endpoint.		 *		 * All of these paths live on transport_addr_list.		 *		 * At the bakeoffs, we discovered that the intent of		 * primaryPath is that it only changes when the ULP		 * asks to have it changed.  We add the activePath to		 * designate the connection we are currently using to		 * transmit new data and most control chunks.		 */		struct sctp_transport *primary_path;		/* Cache the primary path address here, when we		 * need a an address for msg_name.		 */		union sctp_addr primary_addr;		/* active_path		 *   The path that we are currently using to		 *   transmit new data and most control chunks.		 */		struct sctp_transport *active_path;		/* retran_path		 *		 * RFC2960 6.4 Multi-homed SCTP Endpoints		 * ...		 * Furthermore, when its peer is multi-homed, an		 * endpoint SHOULD try to retransmit a chunk to an		 * active destination transport address that is		 * different from the last destination address to		 * which the DATA chunk was sent.		 */		struct sctp_transport *retran_path;		/* Pointer to last transport I have sent on.  */		struct sctp_transport *last_sent_to;		/* This is the last transport I have received DATA on.	*/		struct sctp_transport *last_data_from;		/*		 * Mapping  An array of bits or bytes indicating which out of		 * Array    order TSN's have been received (relative to the		 *	    Last Rcvd TSN). If no gaps exist, i.e. no out of		 *	    order packets have been received, this array		 *	    will be set to all zero. This structure may be		 *	    in the form of a circular buffer or bit array.		 *		 * Last Rcvd   : This is the last TSN received in		 * TSN	       : sequence. This value is set initially by		 *	       : taking the peer's Initial TSN, received in		 *	       : the INIT or INIT ACK chunk, and subtracting		 *	       : one from it.		 *		 * Throughout most of the specification this is called the		 * "Cumulative TSN ACK Point".	In this case, we		 * ignore the advice in 12.2 in favour of the term		 * used in the bulk of the text.  This value is hidden		 * in tsn_map--we get it by calling sctp_tsnmap_get_ctsn().		 */		struct sctp_tsnmap tsn_map;		__u8 _map[sctp_tsnmap_storage_size(SCTP_TSN_MAP_SIZE)];		/* Ack State   : This flag indicates if the next received		 *             : packet is to be responded to with a		 *             : SACK. This is initializedto 0.  When a packet		 *             : is received it is incremented. If this value		 *             : reaches 2 or more, a SACK is sent and the		 *             : value is reset to 0. Note: This is used only		 *             : when no DATA chunks are received out of		 *             : order.  When DATA chunks are out of order,		 *             : SACK's are not delayed (see Section 6).		 */		__u8    sack_needed;     /* Do we need to sack the peer? */		/* These are capabilities which our peer advertised.  */		__u8	ecn_capable;	 /* Can peer do ECN? */		__u8	ipv4_address;	 /* Peer understands IPv4 addresses? */		__u8	ipv6_address;	 /* Peer understands IPv6 addresses? */		__u8	hostname_address;/* Peer understands DNS addresses? */		__u8    asconf_capable;  /* Does peer support ADDIP? */		__u8    prsctp_capable;  /* Can peer do PR-SCTP? */		__u32   adaption_ind;	 /* Adaption Code point. */		/* This mask is used to disable sending the ASCONF chunk		 * with specified parameter to peer.		 */		__u16 addip_disabled_mask;		struct sctp_inithdr i;		int cookie_len;		void *cookie;		/* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.		 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the		 * Initial TSN Value minus 1		 */		__u32 addip_serial;	} peer;	/* State       : A state variable indicating what state the	 *	       : association is in, i.e. COOKIE-WAIT,	 *	       : COOKIE-ECHOED, ESTABLISHED, SHUTDOWN-PENDING,	 *	       : SHUTDOWN-SENT, SHUTDOWN-RECEIVED, SHUTDOWN-ACK-SENT.	 *	 *		Note: No "CLOSED" state is illustrated since if a	 *		association is "CLOSED" its TCB SHOULD be removed.	 *	 *		In this implementation we DO have a CLOSED	 *		state which is used during initiation and shutdown.	 *	 *		State takes values from SCTP_STATE_*.	 */	sctp_state_t state;	/* The cookie life I award for any cookie.  */	struct timeval cookie_life;	/* Overall     : The overall association error count.	 * Error Count : [Clear this any time I get something.]	 */	int overall_error_count;	/* These are the association's initial, max, and min RTO values.	 * These values will be initialized by system defaults, but can	 * be modified via the SCTP_RTOINFO socket option.	 */	__u32 rto_initial;	__u32 rto_max;	__u32 rto_min;	/* Maximum number of new data packets that can be sent in a burst.  */	int max_burst;	/* This is the max_retrans value for the association.  This value will	 * be initialized initialized from system defaults, but can be	 * modified by the SCTP_ASSOCINFO socket option.	 */	int max_retrans;	/* Maximum number of times the endpoint will retransmit INIT  */	__u16 max_init_attempts;	/* How many times have we resent an INIT? */	__u16 init_retries;	/* The largest timeout or RTO value to use in attempting an INIT */	__u16 max_init_timeo;	int timeouts[SCTP_NUM_TIMEOUT_TYPES];	struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES];	/* Transport to which SHUTDOWN chunk was last sent.  */	struct sctp_transport *shutdown_last_sent_to;	/* Next TSN    : The next TSN number to be assigned to a new	 *	       : DATA chunk.  This is sent in the INIT or INIT	 *	       : ACK chunk to the peer and incremented each	 *	       : time a DATA chunk is assigned a TSN	 *	       : (normally just prior to transmit or during	 *	       : fragmentation).	 */	__u32 next_tsn;	/*	 * Last Rcvd   : This is the last TSN received in sequence.  This value	 * TSN	       : is set initially by taking the peer's Initial TSN,	 *	       : received in the INIT or INIT ACK chunk, and	 *	       : subtracting one from it.	 *	 * Most of RFC 2960 refers to this as the Cumulative TSN Ack Point.	 */	__u32 ctsn_ack_point;	/* PR-SCTP Advanced.Peer.Ack.Point */	__u32 adv_peer_ack_point;	/* Highest TSN that is acknowledged by incoming SACKs. */	__u32 highest_sacked;	/* The number of unacknowledged data chunks.  Reported through	 * the SCTP_STATUS sockopt.	 */	__u16 unack_data;	/* This is the association's receive buffer space.  This value is used	 * to set a_rwnd field in an INIT or a SACK chunk.	 */	__u32 rwnd;	/* This is the last advertised value of rwnd over a SACK chunk. */	__u32 a_rwnd;	/* Number of bytes by which the rwnd has slopped.  The rwnd is allowed	 * to slop over a maximum of the association's frag_point.	 */	__u32 rwnd_over;	/* This is the sndbuf size in use for the association.	 * This corresponds to the sndbuf size for the association,	 * as specified in the sk->sndbuf.	 */	int sndbuf_used;	/* This is the wait queue head for send requests waiting on	 * the association sndbuf space.	 */	wait_queue_head_t	wait;	/* Association : The smallest PMTU discovered for all of the	 * PMTU	       : peer's transport addresses.	 */	__u32 pmtu;	/* The message size at which SCTP fragmentation will occur. */	__u32 frag_point;	/* Currently only one counter is used to count INIT errors. */	int counters[SCTP_NUMBER_COUNTERS];	/* Default send parameters. */	__u16 default_stream;	__u16 default_flags;	__u32 default_ppid;	__u32 default_context;	__u32 default_timetolive;	/* This tracks outbound ssn for a given stream.	 */	struct sctp_ssnmap *ssnmap;	/* All outbound chunks go through this structure.  */	struct sctp_outq outqueue;	/* A smart pipe that will handle reordering and fragmentation,	 * as well as handle passing events up to the ULP.	 */	struct sctp_ulpq ulpq;	/* Last TSN that caused an ECNE Chunk to be sent.  */	__u32 last_ecne_tsn;	/* Last TSN that caused a CWR Chunk to be sent.	 */	__u32 last_cwr_tsn;	/* How many duplicated TSNs have we seen?  */	int numduptsns;	/* Number of seconds of idle time before an association is closed.  */	__u32 autoclose;	/* These are to support	 * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses	 *  and Enforcement of Flow and Message Limits"	 * <draft-ietf-tsvwg-addip-sctp-02.txt>	 * or "ADDIP" for short.	 */	/* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks	 *	 * R1) One and only one ASCONF Chunk MAY be in transit and	 * unacknowledged at any one time.  If a sender, after sending	 * an ASCONF chunk, decides it needs to transfer another	 * ASCONF Chunk, it MUST wait until the ASCONF-ACK Chunk	 * returns from the previous ASCONF Chunk before sending a	 * subsequent ASCONF. Note this restriction binds each side,	 * so at any time two ASCONF may be in-transit on any given	 * association (one sent from each endpoint).	 *	 * [This is our one-and-only-one ASCONF in flight.  If we do	 * not have an ASCONF in flight, this is NULL.]	 */	struct sctp_chunk *addip_last_asconf;	/* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.	 *	 * IMPLEMENTATION NOTE: As an optimization a receiver may wish	 * to save the last ASCONF-ACK for some predetermined period	 * of time and instead of re-processing the ASCONF (with the	 * same serial number) it may just re-transmit the	 * ASCONF-ACK. It may wish to use the arrival of a new serial	 * number to discard the previously saved ASCONF-ACK or any	 * other means it may choose to expire the saved ASCONF-ACK.	 *	 * [This is our saved ASCONF-ACK.  We invalidate it when a new	 * ASCONF serial number arrives.]	 */	struct sctp_chunk *addip_last_asconf_ack;	/* These ASCONF chunks are waiting to be sent.	 *	 * These chunaks can't be pushed to outqueue until receiving	 * ASCONF_ACK for the previous ASCONF indicated by	 * addip_last_asconf, so as to guarantee that only one ASCONF	 * is in flight at any time.	 *	 * ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks	 *	 * In defining the ASCONF Chunk transfer procedures, it is	 * essential that these transfers MUST NOT cause congestion	 * within the network.	To achieve this, we place these	 * restrictions on the transfer of ASCONF Chunks:	 *	 * R1) One and only one ASCONF Chunk MAY be in transit and	 * unacknowledged at any one time.  If a sender, after sending	 * an ASCONF chunk, decides it needs to transfer another	 * ASCONF Chunk, it MUST wait until the ASCONF-ACK Chunk	 * returns from the previous ASCONF Chunk before sending a	 * subsequent ASCONF. Note this restriction binds each side,	 * so at any time two ASCONF may be in-transit on any given	 * association (one sent from each endpoint).	 *	 *	 * [I really think this is EXACTLY the sort of intelligence	 *  which already resides in sctp_outq.	 Please move this	 *  queue and its supporting logic down there.	--piggy]	 */	struct sk_buff_head addip_chunks;	/* ADDIP Section 4.1 ASCONF Chunk Procedures	 *	 * A2) A serial number should be assigned to the Chunk. The	 * serial number SHOULD be a monotonically increasing	 * number. The serial number SHOULD be initialized at	 * the start of the association to the same value as the	 * Initial TSN and every time a new ASCONF chunk is created	 * it is incremented by one after assigning the serial number	 * to the newly created chunk.	 *	 * ADDIP	 * 3.1.1  Address/Stream Configuration Change Chunk (ASCONF)	 *	 * Serial Number : 32 bits (unsigned integer)	 *	 * This value represents a Serial Number for the ASCONF	 * Chunk. The valid range of Serial Number is from 0 to	 * 4294967295 (2^32 - 1).  Serial Numbers wrap back to 0	 * after reaching 4294967295.	 */	__u32 addip_serial;	/* Need to send an ECNE Chunk? */	char need_ecne;	/* Is it a temporary association? */	char temp;};/* An eyecatcher for determining if we are really looking at an * association data structure. */enum {	SCTP_ASSOC_EYECATCHER = 0xa550c123,};/* Recover the outter association structure. */static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base){	struct sctp_association *asoc;	asoc = container_of(base, struct sctp_association, base);	return asoc;}/* These are function signatures for manipulating associations.	 */struct sctp_association *sctp_association_new(const struct sctp_endpoint *, const struct sock *,		     sctp_scope_t scope, int gfp);void sctp_association_free(struct sctp_association *);void sctp_association_put(struct sctp_association *);void sctp_association_hold(struct sctp_association *);struct sctp_transport *sctp_assoc_choose_shutdown_transport(	struct sctp_association *);void sctp_assoc_update_retran_path(struct sctp_association *);struct sctp_transport *sctp_assoc_lookup_paddr(const struct sctp_association *,					  const union sctp_addr *);int sctp_assoc_lookup_laddr(struct sctp_association *asoc,			    const union sctp_addr *laddr);struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *,				     const union sctp_addr *address,				     const int gfp);void sctp_assoc_del_peer(struct sctp_association *asoc,			 const union sctp_addr *addr);void sctp_assoc_control_transport(struct sctp_association *,				  struct sctp_transport *,				  sctp_transport_cmd_t, sctp_sn_error_t);struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *, __u32);struct sctp_transport *sctp_assoc_is_match(struct sctp_association *,					   const union sctp_addr *,					   const union sctp_addr *);void sctp_assoc_migrate(struct sctp_association *, struct sock *);void sctp_assoc_update(struct sctp_association *old,		       struct sctp_association *new);__u32 sctp_association_get_next_tsn(struct sctp_association *);void sctp_assoc_sync_pmtu(struct sctp_association *);void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned);void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned);void sctp_assoc_set_primary(struct sctp_association *,			    struct sctp_transport *);int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int);int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,					 struct sctp_cookie*, int gfp);int sctp_cmp_addr_exact(const union sctp_addr *ss1,			const union sctp_addr *ss2);struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc);/* A convenience structure to parse out SCTP specific CMSGs. */typedef struct sctp_cmsgs {	struct sctp_initmsg *init;	struct sctp_sndrcvinfo *info;} sctp_cmsgs_t;/* Structure for tracking memory objects */typedef struct {	char *label;	atomic_t *counter;} sctp_dbg_objcnt_entry_t;#endif /* __sctp_structs_h__ */

⌨️ 快捷键说明

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