#include <linux/ktime.h> #include <linux/generic-radix-tree.h> #include <linux/rhashtable-types.h> #include <linux/socket.h> /* linux/in.h needs this!! */ #include <linux/in.h> /* We get struct sockaddr_in. */ #include <linux/in6.h> /* We get struct in6_addr */ #include <linux/ipv6.h> #include <asm/param.h> /* We get MAXHOSTNAMELEN. */ #include <linux/atomic.h> /* This gets us atomic counters. */ #include <linux/skbuff.h> /* We need sk_buff_head. */ #include <linux/workqueue.h> /* We need tq_struct. */ #include <linux/sctp.h> /* We need sctp* header structs. */ #include <net/sctp/auth.h> /* We need auth specific structs */ #include <net/ip.h> /* For inet_skb_parm */
/* A convenience structure for handling sockaddr structures. *Weshouldweanourselvesoffthis.
*/ union sctp_addr { struct sockaddr_inet sa; /* Large enough for both address families */ struct sockaddr_in v4; struct sockaddr_in6 v6;
};
/* Used for hashing all associations. */ struct sctp_hashbucket {
rwlock_t lock; struct hlist_head chain;
} __attribute__((__aligned__(8)));
/* The SCTP globals structure. */ externstruct sctp_globals { /* This is a list of groups of functions for each address *familythatwesupport.
*/ struct list_head address_families;
/* This is the hash of all endpoints. */ struct sctp_hashbucket *ep_hashtable; /* This is the sctp port control hash. */ struct sctp_bind_hashbucket *port_hashtable; /* This is the hash of all transports. */ struct rhltable transport_hashtable;
/* Sizes of above hashtables. */ int ep_hashsize; int port_hashsize;
/* Default initialization values to be applied to new associations. */
__u16 max_instreams;
__u16 max_outstreams;
/* Flag to indicate whether computing and verifying checksum
* is disabled. */ bool checksum_disable;
} sctp_globals;
/* Per socket SCTP information. */ struct sctp_sock { /* inet_sock has to be the first member of sctp_sock */ struct inet_sock inet; /* What kind of a socket is this? */ enum sctp_socket_type type;
/* PF_ family specific functions. */ struct sctp_pf *pf;
/* Heartbeat interval: The endpoint sends out a Heartbeat chunk to *thedestinationaddresseveryheartbeatinterval.Thisvalue *willbeinheritedbyallnewassociations.
*/
__u32 hbinterval;
__u32 probe_interval;
__be16 udp_port;
__be16 encap_port;
/* This is the max_retrans value for new associations. */
__u16 pathmaxrxt;
__u32 flowlabel;
__u8 dscp;
__u16 pf_retrans;
__u16 ps_retrans;
/* The initial Path MTU to use for new associations. */
__u32 pathmtu;
/* The default SACK delay timeout for new associations. */
__u32 sackdelay;
__u32 sackfreq;
/* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* This is our APPLICATION-SPECIFIC state cookie. *THISISNOTDICTATEDBYTHESPECIFICATION.
*/ /* These are the parts of an association which we send in the cookie. *Mostofthesearestraightoutof: *RFC296012.2Parametersnecessaryperassociation(i.e.theTCB) *
*/
struct sctp_cookie {
/* My : Tag expected in every inbound packet and sent *Verification:intheINITorINITACKchunk. *Tag:
*/
__u32 my_vtag;
/* Peer's : Tag expected in every outbound packet except *Verification:intheINITchunk. *Tag:
*/
__u32 peer_vtag;
/* The rest of these are not from the spec, but really need to *beinthecookie.
*/
/* My Tie Tag : Assist in discovering a restarting association. */
__u32 my_ttag;
/* Peer's Tie Tag: Assist in discovering a restarting association. */
__u32 peer_ttag;
/* When does this cookie expire? */
ktime_t expiration;
/* Number of inbound/outbound streams which are set *andnegotiatedduringtheINITprocess.
*/
__u16 sinit_num_ostreams;
__u16 sinit_max_instreams;
/* This is the first sequence number I used. */
__u32 initial_tsn;
/* This holds the originating address of the INIT packet. */ union sctp_addr peer_addr;
/* This is a shim for my peer's INIT packet, followed by *acopyoftherawaddresslistoftheassociation. *Thelengthoftherawaddresslistissavedinthe *raw_addr_list_lenfield,whichwillbeusedatthetimewhen *theassociationTCBisre-constructedfromthecookie.
*/
__u32 raw_addr_list_len; /* struct sctp_init_chunk peer_init[]; */
};
/* The format of our cookie that we send to our peer. */ struct sctp_signed_cookie {
__u8 signature[SCTP_SECRET_SIZE];
__u32 __pad; /* force sctp_cookie alignment to 64 bits */ struct sctp_cookie c;
} __packed;
/* This is another convenience type to allocate memory for address *paramsforthemaximumsizeandpasssuchstructuresaround *internally.
*/ union sctp_addr_param { struct sctp_paramhdr p; struct sctp_ipv4addr_param v4; struct sctp_ipv6addr_param v6;
};
/* A convenience type to allow walking through the various *parametersandavoidcastingallovertheplace.
*/ union sctp_params { void *v; struct sctp_paramhdr *p; struct sctp_cookie_preserve_param *life; struct sctp_hostname_param *dns; struct sctp_cookie_param *cookie; struct sctp_supported_addrs_param *sat; struct sctp_ipv4addr_param *v4; struct sctp_ipv6addr_param *v6; union sctp_addr_param *addr; struct sctp_adaptation_ind_param *aind; struct sctp_supported_ext_param *ext; struct sctp_random_param *random; struct sctp_chunks_param *chunks; struct sctp_hmac_algo_param *hmac_algo; struct sctp_addip_param *addip;
};
/* What is the current SSN number for this stream? */ #define sctp_ssn_peek(stream, type, sid) \
(sctp_stream_##type((stream), (sid))->ssn)
/* Return the next SSN number for this stream. */ #define sctp_ssn_next(stream, type, sid) \
(sctp_stream_##type((stream), (sid))->ssn++)
/* Skip over this ssn and all below. */ #define sctp_ssn_skip(stream, type, sid, ssn) \
(sctp_stream_##type((stream), (sid))->ssn = ssn + 1)
/* What is the current MID number for this stream? */ #define sctp_mid_peek(stream, type, sid) \
(sctp_stream_##type((stream), (sid))->mid)
/* Return the next MID number for this stream. */ #define sctp_mid_next(stream, type, sid) \
(sctp_stream_##type((stream), (sid))->mid++)
/* Skip over this mid and all below. */ #define sctp_mid_skip(stream, type, sid, mid) \
(sctp_stream_##type((stream), (sid))->mid = mid + 1)
/* What is the current MID_uo number for this stream? */ #define sctp_mid_uo_peek(stream, type, sid) \
(sctp_stream_##type((stream), (sid))->mid_uo)
/* Return the next MID_uo number for this stream. */ #define sctp_mid_uo_next(stream, type, sid) \
(sctp_stream_##type((stream), (sid))->mid_uo++)
/* *PointerstoaddressrelatedSCTPfunctions. *(i.e.thingsthatdependontheaddressfamily.)
*/ struct sctp_af { int (*sctp_xmit) (struct sk_buff *skb, struct sctp_transport *); int (*setsockopt) (struct sock *sk, int level, int optname,
sockptr_t optval, unsignedint optlen); int (*getsockopt) (struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); void (*get_dst) (struct sctp_transport *t, union sctp_addr *saddr, struct flowi *fl, struct sock *sk); void (*get_saddr) (struct sctp_sock *sk, struct sctp_transport *t, struct flowi *fl); void (*copy_addrlist) (struct list_head *, struct net_device *); int (*cmp_addr) (constunion sctp_addr *addr1, constunion sctp_addr *addr2); void (*addr_copy) (union sctp_addr *dst, union sctp_addr *src); void (*from_skb) (union sctp_addr *, struct sk_buff *skb, int saddr); void (*from_sk) (union sctp_addr *, struct sock *sk); bool (*from_addr_param) (union sctp_addr *, union sctp_addr_param *,
__be16 port, int iif); int (*to_addr_param) (constunion sctp_addr *, union sctp_addr_param *); int (*addr_valid) (union sctp_addr *, struct sctp_sock *, conststruct sk_buff *); enum sctp_scope (*scope)(union sctp_addr *); void (*inaddr_any) (union sctp_addr *, __be16); int (*is_any) (constunion sctp_addr *); int (*available) (union sctp_addr *, struct sctp_sock *); int (*skb_iif) (conststruct sk_buff *sk); int (*skb_sdif)(conststruct sk_buff *sk); int (*is_ce) (conststruct sk_buff *sk); void (*seq_dump_addr)(struct seq_file *seq, union sctp_addr *addr); void (*ecn_capable)(struct sock *sk);
__u16 net_header_len; int sockaddr_len; int (*ip_options_len)(struct sock *sk);
sa_family_t sa_family; struct list_head list;
};
struct sctp_af *sctp_get_af_specific(sa_family_t); int sctp_register_af(struct sctp_af *);
/* Protocol family functions. */ struct sctp_pf { void (*event_msgname)(struct sctp_ulpevent *, char *, int *); void (*skb_msgname) (struct sk_buff *, char *, int *); int (*af_supported) (sa_family_t, struct sctp_sock *); int (*cmp_addr) (constunion sctp_addr *, constunion sctp_addr *, struct sctp_sock *); int (*bind_verify) (struct sctp_sock *, union sctp_addr *); int (*send_verify) (struct sctp_sock *, union sctp_addr *); int (*supported_addrs)(conststruct sctp_sock *, __be16 *); struct sock *(*create_accept_sk) (struct sock *sk, struct sctp_association *asoc, bool kern); int (*addr_to_user)(struct sctp_sock *sk, union sctp_addr *addr); void (*to_sk_saddr)(union sctp_addr *, struct sock *sk); void (*to_sk_daddr)(union sctp_addr *, struct sock *sk); void (*copy_ip_options)(struct sock *sk, struct sock *newsk); struct sctp_af *af;
};
/* Structure to track chunk fragments that have been acked, but peer *fragmentsofthesamemessagehavenot.
*/ struct sctp_datamsg { /* Chunks waiting to be submitted to lower layer. */ struct list_head chunks; /* Reference counting. */
refcount_t refcnt; /* When is this message no longer interesting to the peer? */ unsignedlong expires_at; /* Did the message fail to send? */ int send_error;
u8 send_failed:1,
can_delay:1, /* should this message be Nagle delayed */
abandoned:1; /* should this message be abandoned */
};
/* How many times this chunk have been sent, for prsctp RTX policy */ int sent_count;
union { /* This is our link to the per-transport transmitted list. */ struct list_head transmitted_list; /* List in specific stream outq */ struct list_head stream_list;
};
/* This field is used by chunks that hold fragmented data. *Forthefirstfragmentthisisthelistthatholdstherestof *fragments.Fortheremainingfragments,thisisthelinktothe *frag_listmaintainedinthefirstfragment.
*/ struct list_head frag_list;
/* This points to the sk_buff containing the actual data. */ struct sk_buff *skb;
union { /* In case of GSO packets, this will store the head one */ struct sk_buff *head_skb; /* In case of auth enabled, this will point to the shkey */ struct sctp_shared_key *shkey;
};
/* These are the SCTP headers by reverse order in a packet. *Notethatsomeofthesemayhappenmorethanonce.Inthat *case,wepointatthe"current"one,whateverthatmeans *forthatlevelofheader.
*/
/* We point this at the FIRST TLV parameter to chunk_hdr. */ union sctp_params param_hdr; union {
__u8 *v; struct sctp_datahdr *data_hdr; struct sctp_inithdr *init_hdr; struct sctp_sackhdr *sack_hdr; struct sctp_heartbeathdr *hb_hdr; struct sctp_sender_hb_info *hbs_hdr; struct sctp_shutdownhdr *shutdown_hdr; struct sctp_signed_cookie *cookie_hdr; struct sctp_ecnehdr *ecne_hdr; struct sctp_cwrhdr *ecn_cwr_hdr; struct sctp_errhdr *err_hdr; struct sctp_addiphdr *addip_hdr; struct sctp_fwdtsn_hdr *fwdtsn_hdr; struct sctp_authhdr *auth_hdr; struct sctp_idatahdr *idata_hdr; struct sctp_ifwdtsn_hdr *ifwdtsn_hdr;
} subh;
/* This needs to be recoverable for SCTP_SEND_FAILED events. */ struct sctp_sndrcvinfo sinfo;
/* Which association does this belong to? */ struct sctp_association *asoc;
/* What endpoint received this chunk? */ struct sctp_ep_common *rcvr;
/* We fill this in if we are calculating RTT. */ unsignedlong sent_at;
/* What is the origin IP address for this chunk? */ union sctp_addr source; /* Destination address for this chunk. */ union sctp_addr dest;
/* For outbound message, track all fragments for SEND_FAILED. */ struct sctp_datamsg *msg;
/* For an inbound chunk, this tells us where it came from. *Foranoutboundchunk,ittellsuswherewe'dlikeitto *go.ItisNULLifwehavenopreference.
*/ struct sctp_transport *transport;
/* SCTP-AUTH: For the special case inbound processing of COOKIE-ECHO *weneedsaveapointertotheAUTHchunk,sincetheSCTP-AUTH *specviolatestheprinciplepremisthatallchunksareprocessed *inorder.
*/ struct sk_buff *auth_chunk;
#define SCTP_CAN_FRTX 0x0 #define SCTP_NEED_FRTX 0x1 #define SCTP_DONT_FRTX 0x2
__u16 rtt_in_progress:1, /* This chunk used for RTT calc? */
has_tsn:1, /* Does this chunk have a TSN yet? */
has_ssn:1, /* Does this chunk have a SSN yet? */ #define has_mid has_ssn
singleton:1, /* Only chunk in the packet? */
end_of_packet:1, /* Last chunk in the packet? */
ecn_ce_done:1, /* Have we processed the ECN CE bit? */
pdiscard:1, /* Discard the whole packet now? */
tsn_gap_acked:1, /* Is this chunk acked by a GAP ACK? */
data_accepted:1, /* At least 1 chunk accepted */
auth:1, /* IN: was auth'ed | OUT: needs auth */
has_asconf:1, /* IN: have seen an asconf before */
pmtu_probe:1, /* Used by PLPMTUD, can be set in s HB chunk */
tsn_missing_report:2, /* Data chunk missing counter. */
fast_retransmit:2; /* Is this chunk fast retransmitted? */
};
enum {
SCTP_ADDR_NEW, /* new address added to assoc/ep */
SCTP_ADDR_SRC, /* address can be used as source */
SCTP_ADDR_DEL, /* address about to be deleted */
};
/* This is a structure for holding either an IPv6 or an IPv4 address. */ struct sctp_sockaddr_entry { struct list_head list; struct rcu_head rcu; union sctp_addr a;
__u8 state;
__u8 valid;
};
#define SCTP_ADDRESS_TICK_DELAY 500
/* This structure holds lists of chunks as we are assembling for *transmission.
*/ struct sctp_packet { /* These are the SCTP header values (host order) for the packet. */
__u16 source_port;
__u16 destination_port;
__u32 vtag;
/* This contains the payload chunks. */ struct list_head chunk_list;
/* This is the overhead of the sctp and ip headers. */
size_t overhead; /* This is the total size of all chunks INCLUDING padding. */
size_t size; /* This is the maximum size this packet may have */
size_t max_size;
/* The packet is destined for this transport address. *Thefunctionwefinallyusetopassdowntothenextlower *layerlivesinthetransportstructure.
*/ struct sctp_transport *transport;
/* pointer to the auth chunk for this packet */ struct sctp_chunk *auth;
u8 has_cookie_echo:1, /* This packet contains a COOKIE-ECHO chunk. */
has_sack:1, /* This packet contains a SACK chunk. */
has_auth:1, /* This packet contains an AUTH chunk */
has_data:1, /* This packet contains at least 1 DATA chunk */
ipfragok:1; /* So let ip fragment this packet */
};
/* This represents a remote transport address. *Forlocaltransportaddresses,wejustuseunionsctp_addr. * *RFC2960Section1.4KeyTerms * *oTransportaddress:ATransportAddressistraditionallydefined *byNetworkLayeraddress,TransportLayerprotocolandTransport *Layerportnumber.InthecaseofSCTPrunningoverIP,a *transportaddressisdefinedbythecombinationofanIPaddress *andanSCTPportnumber(whereSCTPistheTransportprotocol). * *RFC2960Section7.1SCTPDifferencesfromTCPCongestioncontrol * *oThesenderkeepsaseparatecongestioncontrolparametersetfor *eachofthedestinationaddressesitcansendto(noteach *source-destinationpairbutforeachdestination).Theparameters *shoulddecayiftheaddressisnotusedforalongenoughtime *period. *
*/ struct sctp_transport { /* A list of transports. */ struct list_head transports; struct rhlist_head node;
/* Reference counting. */
refcount_t refcnt;
__u32 dead:1, /* RTO-Pending : A flag used to track if one of the DATA *chunkssenttothisaddressiscurrentlybeing *usedtocomputeaRTT.Ifthisflagis0, *thenextDATAchunksenttothisdestination *shouldbeusedtocomputeaRTTandthisflag *shouldbeset.EverytimetheRTT *calculationcompletes(i.e.theDATAchunk *isSACK'd)clearthisflag.
*/
rto_pending:1,
/* Heartbeat interval: The endpoint sends out a Heartbeat chunk to *thedestinationaddresseveryheartbeatinterval.
*/ unsignedlong hbinterval; unsignedlong probe_interval;
/* When was the last time that we heard from this transport? We use *thistopicknewactiveandretranpaths.
*/
ktime_t last_time_heard;
/* When was the last time that we sent a chunk using this *transport?Weusethistocheckforidletransports
*/ unsignedlong last_time_sent;
/* Last time(in jiffies) when cwnd is reduced due to the congestion *indicationbasedonECNEchunk.
*/ unsignedlong last_time_ecne_reduced;
__be16 encap_port;
/* This is the max_retrans value for the transport and will *beinitializedfromtheassocsvalue.Thiscanbechanged *usingtheSCTP_SET_PEER_ADDR_PARAMSsocketoption.
*/
__u16 pathmaxrxt;
__u32 flowlabel;
__u8 dscp;
/* This is the partially failed retrans value for the transport *andwillbeinitializedfromtheassocsvalue.Thiscanbechanged *usingtheSCTP_PEER_ADDR_THLDSsocketoption
*/
__u16 pf_retrans; /* Used for primary path switchover. */
__u16 ps_retrans; /* PMTU : The current known path MTU. */
__u32 pathmtu;
/* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* The number of times INIT has been sent on this transport. */ int init_sent_count;
/* state : The current state of this destination, *:i.e.SCTP_ACTIVE,SCTP_INACTIVE,SCTP_UNKNOWN.
*/ int state;
/* These are the error stats for this destination. */
/* Error count : The current error count for this destination. */ unsignedshort error_count;
/* Per : A timer used by each destination. *Destination: *Timer: * *[EverywhereelseinthetextthisiscalledT3-rtx.-ed]
*/ struct timer_list T3_rtx_timer;
/* Heartbeat timer is per destination. */ struct timer_list hb_timer;
/* Timer to handle ICMP proto unreachable envets */ struct timer_list proto_unreach_timer;
/* Timer to send a probe HB packet for PLPMTUD */ struct timer_list probe_timer;
/* Since we're using per-destination retransmission timers *(seeabove),we'realsousingper-destination"transmitted" *queues.Thisprobablyoughttobeaprivatestruct *accessibleonlywithintheoutqueue,butit'snot,yet.
*/ struct list_head transmitted;
/* We build bundle-able packets for this transport here. */ struct sctp_packet packet;
/* This is the list of transports that have chunks to send. */ struct list_head send_ready;
/* State information saved for SFR_CACC algorithm. The key *ideainSFR_CACCistomaintainstateatthesenderona *per-destinationbasiswhenachangeoverhappens. *charchangeover_active; *charcycling_changeover; *__u32next_tsn_at_change; *charcacc_saw_newack;
*/ struct { /* An unsigned integer, which stores the next TSN to be *usedbythesender,atthemomentofchangeover.
*/
__u32 next_tsn_at_change;
/* A flag which indicates the occurrence of a changeover */ char changeover_active;
/* A flag which indicates whether the change of primary is *thefirstswitchtothisdestinationaddressduringan *activeswitch.
*/ char cycling_changeover;
/* A temporary flag, which is used during the processing of *aSACKtoestimatethecausativeTSN(s)'sgroup.
*/ char cacc_saw_newack;
} cacc;
/* This is the structure we use to queue packets as they come into *SCTP.Wewritepacketstoitandreadchunksfromit.
*/ struct sctp_inq { /* This is actually a queue of sctp_chunk each *containingapartiallydecodedpacket.
*/ struct list_head in_chunk_list; /* This is the packet which is currently off the in queue and is *beingworkedonthroughtheinboundchunkprocessing.
*/ struct sctp_chunk *in_progress;
/* This is the delayed task to finish delivering inbound *messages.
*/ struct work_struct immediate;
};
/* This is the structure we use to hold outbound chunks. You push *chunksinandtheyautomaticallypopouttheotherendasbundled *packets(itcalls(*output_handler)()). * *Thisstructurecoverssections6.3,6.4,6.7,6.8,6.10,7.,8.1, *and8.2ofthev13draft. * *Ithandlesretransmissions.Theconnectiontothetimeoutportion *ofthestatemachineisthroughsctp_..._timeout()andtimeout_handler. * *IfyoufeeditSACKs,itwilleatthem. * *Ifyougiveitbigchunks,itwillfragmentthem. * *ItassignsTSN'stodatachunks.Thishappensatthelastpossible *instantbeforetransmission. * *Whenfree()'d,itemptiesitselfoutviaoutput_handler().
*/ struct sctp_outq { struct sctp_association *asoc;
/* Data pending that has never been transmitted. */ struct list_head out_chunk_list;
/* Stream scheduler being used */ struct sctp_sched_ops *sched;
unsignedint out_qlen; /* Total length of queued data chunks. */
/* Error of send failed, may used in SCTP_SEND_FAILED event. */ unsignedint error;
/* These are control chunks we want to send. */ struct list_head control_chunk_list;
/* These are chunks that have been sacked but are above the *CTSN,orcumulativetsnackpoint.
*/ struct list_head sacked;
/* Put chunks on this list to schedule them for *retransmission.
*/ struct list_head retransmit;
/* Put chunks on this list to save them for FWD TSN processing as *theywereabandoned.
*/ struct list_head abandoned;
/* How many unackd bytes do we have in-flight? */
__u32 outstanding_bytes;
/* Are we doing fast-rtx on this queue */ char fast_rtx;
struct sctp_ep_common { /* Runtime type information. What kind of endpoint is this? */ enum sctp_endpoint_type type;
/* Some fields to help us manage this object. *refcnt-Referencecountaccesstothisobject. *dead-Donotattempttousethisobject.
*/
refcount_t refcnt; bool dead;
/* What socket does this endpoint belong to? */ struct sock *sk;
/* Cache netns and it won't change once set */ struct net *net;
/* This is where we receive inbound chunks. */ struct sctp_inq inqueue;
/* This substructure includes the defining parameters of the *endpoint: *bind_addr.portisoursharedportnumber. *bind_addr.address_listisoursetoflocalIPaddresses.
*/ struct sctp_bind_addr bind_addr;
};
struct sctp_endpoint { /* Common substructure for endpoint and association. */ struct sctp_ep_common base;
/* Fields to help us manage our entries in the hash tables. */ struct hlist_node node; int hashent;
/* Associations: A list of current associations and mappings *tothedataconsumersforeachassociation.This *maybeintheformofahashtableorother *implementationdependentstructure.Thedata *consumersmaybeprocessidentification *informationsuchasfiledescriptors,namedpipe *pointer,ortablepointersdependentonhowSCTP *isimplemented.
*/ /* This is really a list of struct sctp_association entries. */ struct list_head asocs;
/* Secret Key: A secret key used by this endpoint to compute *theMAC.ThisSHOULDbeacryptographicquality *randomnumberwithasufficientlength. *Discussionin[RFC1750]canbehelpfulin *selectionofthekey.
*/
__u8 secret_key[SCTP_SECRET_SIZE];
/* digest: This is a digest of the sctp cookie. This field is *onlyusedonthereceivepathwhenwetrytovalidate *thatthecookiehasnotbeentamperedwith.Weput *thisheresowepre-allocatethisonceandcanre-use *oneveryreceive.
*/
__u8 *digest;
/* sendbuf acct. policy. */
__u32 sndbuf_policy;
/* rcvbuf acct. policy. */
__u32 rcvbuf_policy;
/* SCTP AUTH: array of the HMACs that will be allocated *weneedthisperassociationsothatwedon'tserialize
*/ struct crypto_shash **auth_hmacs;
/* SCTP-AUTH: hmacs for the endpoint encoded into parameter */ struct sctp_hmac_algo_param *auth_hmacs_list;
/* SCTP-AUTH: chunks to authenticate encoded into parameter */ struct sctp_chunks_param *auth_chunk_list;
struct sctp_stream_priorities { /* List of priorities scheduled */ struct list_head prio_sched; /* List of streams scheduled */ struct list_head active; /* The next stream in line */ struct sctp_stream_out_ext *next;
__u16 prio;
__u16 users;
};
__u16 outcnt;
__u16 incnt; /* Current stream being sent, if any */ struct sctp_stream_out *out_curr; union { /* Fields used by priority scheduler */ struct { /* List of priorities scheduled */ struct list_head prio_list;
}; /* Fields used by RR scheduler */ struct { /* List of streams scheduled */ struct list_head rr_list; /* The next stream in line */ struct sctp_stream_out_ext *rr_next;
}; struct { struct list_head fc_list;
};
}; struct sctp_stream_interleave *si;
};
/* SCTP_GET_ASSOC_STATS counters */ struct sctp_priv_assoc_stats { /* Maximum observed rto in the association during subsequent *observations.Valueissetto0ifnoRTOmeasurementtookplace *Thetransportwherethemax_rtowasobservedisreturnedin *obs_rto_ipaddr
*/ struct sockaddr_storage obs_rto_ipaddr;
__u64 max_obs_rto; /* Total In and Out SACKs received and sent */
__u64 isacks;
__u64 osacks; /* Total In and Out packets received and sent */
__u64 opackets;
__u64 ipackets; /* Total retransmitted chunks */
__u64 rtxchunks; /* TSN received > next expected */
__u64 outofseqtsns; /* Duplicate Chunks received */
__u64 idupchunks; /* Gap Ack Blocks received */
__u64 gapcnt; /* Unordered data chunks sent and received */
__u64 ouodchunks;
__u64 iuodchunks; /* Ordered data chunks sent and received */
__u64 oodchunks;
__u64 iodchunks; /* Control chunks sent and received */
__u64 octrlchunks;
__u64 ictrlchunks;
};
/* Here we have information about each individual association. */ struct sctp_association {
/* A base structure common to endpoint and association. *Inthiscontext,itrepresentstheassociations'sview *ofthelocalendpointoftheassociation.
*/ struct sctp_ep_common base;
/* Associations on the same socket. */ struct list_head asocs;
/* association id. */
sctp_assoc_t assoc_id;
/* This is our parent endpoint. */ struct sctp_endpoint *ep;
/* These are those association elements needed in the cookie. */ struct sctp_cookie c;
/* This is all information about our peer. */ struct { /* transport_addr_list * *Peer:AlistofSCTPtransportaddressesthatthe *Transport:peerisboundto.Thisinformationisderived *Address:fromtheINITorINITACKandisusedto *List:associateaninboundpacketwithagiven *:association.Normallythisinformationis *:hashedorkeyedforquicklookupandaccess *:oftheTCB. *:Thelistisalsoinitializedwiththelist *:ofaddressespassedwiththesctp_connectx() *:call. * *ItisalistofSCTP_transport's.
*/ struct list_head transport_addr_list;
/* This mask is used to disable sending the ASCONF chunk *withspecifiedparametertopeer.
*/
__be16 addip_disabled_mask;
/* These are capabilities which our peer advertised. */
__u16 ecn_capable:1, /* Can peer do ECN? */
ipv4_address:1, /* Peer understands IPv4 addresses? */
ipv6_address:1, /* Peer understands IPv6 addresses? */
asconf_capable:1, /* Does peer support ADDIP? */
prsctp_capable:1, /* Can peer do PR-SCTP? */
reconf_capable:1, /* Can peer do RE-CONFIG? */
intl_capable:1, /* Can peer do INTERLEAVE */
auth_capable:1, /* Is peer doing SCTP-AUTH? */ /* sack_needed: *Thisflagindicatesifthenextreceived *packetistoberespondedtowitha *SACK.Thisisinitializedto0.Whenapacket *isreceivedsack_cntisincremented.Ifthisvalue *reaches2ormore,aSACKissentandthe *valueisresetto0.Note:Thisisusedonly *whennoDATAchunksarereceivedoutof *order.WhenDATAchunksareoutoforder, *SACK'sarenotdelayed(seeSection6).
*/
sack_needed:1, /* Do we need to sack the peer? */
sack_generation:1,
zero_window_announced:1;
struct sctp_inithdr_host i; void *cookie; int cookie_len;
/* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. *C1)..."Peer-Serial-Number'.ThisvalueMUSTbeinitializedtothe *InitialTSNValueminus1
*/
__u32 addip_serial;
/* SCTP-AUTH: We need to know pears random number, hmac list *andauthenticatedchunklist.Allthatispartofthe *cookieandthesearejustpointerstothoselocations
*/ struct sctp_random_param *peer_random; struct sctp_chunks_param *peer_chunks; struct sctp_hmac_algo_param *peer_hmacs;
} peer;
/* State : A state variable indicating what state the *:associationisin,i.e.COOKIE-WAIT, *:COOKIE-ECHOED,ESTABLISHED,SHUTDOWN-PENDING, *:SHUTDOWN-SENT,SHUTDOWN-RECEIVED,SHUTDOWN-ACK-SENT. * *Note:No"CLOSED"stateisillustratedsinceifa *associationis"CLOSED"itsTCBSHOULDberemoved. * *InthisimplementationweDOhaveaCLOSED *statewhichisusedduringinitiationandshutdown. * *StatetakesvaluesfromSCTP_STATE_*.
*/ enum sctp_state state;
/* Overall : The overall association error count. *ErrorCount:[ClearthisanytimeIgetsomething.]
*/ int overall_error_count;
/* The cookie life I award for any cookie. */
ktime_t cookie_life;
/* These are the association's initial, max, and min RTO values. *Thesevalueswillbeinitializedbysystemdefaults,butcan *bemodifiedviatheSCTP_RTOINFOsocketoption.
*/ unsignedlong rto_initial; unsignedlong rto_max; unsignedlong 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 *beinitializedfromsystemdefaults,butcanbe *modifiedbytheSCTP_ASSOCINFOsocketoption.
*/ int max_retrans;
/* This is the partially failed retrans value for the transport *andwillbeinitializedfromtheassocsvalue.Thiscanbe *changedusingtheSCTP_PEER_ADDR_THLDSsocketoption
*/
__u16 pf_retrans; /* Used for primary path switchover. */
__u16 ps_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 */ unsignedlong max_init_timeo;
/* Heartbeat interval: The endpoint sends out a Heartbeat chunk to *thedestinationaddresseveryheartbeatinterval.Thisvalue *willbeinheritedbyallnewtransports.
*/ unsignedlong hbinterval; unsignedlong probe_interval;
__be16 encap_port;
/* This is the max_retrans value for new transports in the *association.
*/
__u16 pathmaxrxt;
__u32 flowlabel;
__u8 dscp;
/* Flag that path mtu update is pending */
__u8 pmtu_pending;
/* Association : The smallest PMTU discovered for all of the *PMTU:peer'stransportaddresses.
*/
__u32 pathmtu;
/* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* Transport to which SHUTDOWN chunk was last sent. */ struct sctp_transport *shutdown_last_sent_to;
/* Transport to which INIT chunk was last sent. */ struct sctp_transport *init_last_sent_to;
/* How many times have we resent a SHUTDOWN */ int shutdown_retries;
/* Next TSN : The next TSN number to be assigned to a new *:DATAchunk.ThisissentintheINITorINIT *:ACKchunktothepeerandincrementedeach *:timeaDATAchunkisassignedaTSN *:(normallyjustpriortotransmitorduring *:fragmentation).
*/
__u32 next_tsn;
/* Highest TSN that is acknowledged by incoming SACKs. */
__u32 highest_sacked;
/* TSN marking the fast recovery exit point */
__u32 fast_recovery_exit;
/* Flag to track the current fast recovery state */
__u8 fast_recovery;
/* The number of unacknowledged data chunks. Reported through *theSCTP_STATUSsockopt.
*/
__u16 unack_data;
/* The total number of data chunks that we've had to retransmit *astheresultofaT3timerexpiration
*/
__u32 rtx_data_chunks;
/* This is the association's receive buffer space. This value is used *toseta_rwndfieldinanINIToraSACKchunk.
*/
__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 *toslopoveramaximumoftheassociation'sfrag_point.
*/
__u32 rwnd_over;
/* Keeps treack of rwnd pressure. This happens when we have *awindow,butnotreceivebuffer(i.esmallpackets).Thisone *isreleasesslowly(1PMTUatatime).
*/
__u32 rwnd_press;
/* This is the sndbuf size in use for the association. *Thiscorrespondstothesndbufsizefortheassociation, *asspecifiedinthesk->sndbuf.
*/ int sndbuf_used;
/* This is the amount of memory that this association has allocated *inthereceivepathatanygiventime.
*/
atomic_t rmem_alloc;
/* This is the wait queue head for send requests waiting on *theassociationsndbufspace.
*/
wait_queue_head_t wait;
/* The message size at which SCTP fragmentation will occur. */
__u32 frag_point;
__u32 user_frag;
/* Counter used to count INIT errors. */ int init_err_counter;
/* Count the number of INIT cycles (for doubling timeout). */ int init_cycle;
/* All outbound chunks go through this structure. */ struct sctp_outq outqueue;
/* A smart pipe that will handle reordering and fragmentation, *aswellashandlepassingeventsuptotheULP.
*/ 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;
/* These are to support *"SCTPExtensionsforDynamicReconfigurationofIPAddresses *andEnforcementofFlowandMessageLimits" *<draft-ietf-tsvwg-addip-sctp-02.txt> *or"ADDIP"forshort.
*/
/* SCTP AUTH: list of the endpoint shared keys. These *keysareprovidedoutofbandbytheuserapplication *andcan'tchangeduringthelifetimeoftheassociation
*/ struct list_head endpoint_shared_keys;
/* SCTP AUTH: hmac id of the first peer requested algorithm *thatwesupport.
*/
__u16 default_hmac_id;
__u16 active_key_id;
__u8 need_ecne:1, /* Need to send an ECNE Chunk? */
temp:1, /* Is it a temporary association? */
pf_expose:2, /* Expose pf state? */
force_delay:1;
__u8 strreset_enable;
__u8 strreset_outstanding; /* request param count on the fly */
__u32 strreset_outseq; /* Update after receiving response */
__u32 strreset_inseq; /* Update after receiving request */
__u32 strreset_result[2]; /* save the results of last 2 responses */
struct sctp_chunk *strreset_chunk; /* save request chunk */
/* Security identifiers from incoming (INIT). These are set by *security_sctp_assoc_request().Thesewillonlybeusedby *SCTPTCPtypesocketsandpeeledoffconnectionsasthey *causeanewsockettobegenerated.security_sctp_sk_clone() *willthenplugtheseintothenewsocket.
*/
u32 secid;
u32 peer_secid;
struct rcu_head rcu;
};
/* An eyecatcher for determining if we are really looking at an *associationdatastructure.
*/ enum {
SCTP_ASSOC_EYECATCHER = 0xa550c123,
};
/* Recover the outer association structure. */ staticinlinestruct sctp_association *sctp_assoc(struct sctp_ep_common *base)
{ struct sctp_association *asoc;
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.44Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.