MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_init_asoc

Function sctp_init_asoc

freebsd/netinet/sctputil.c:1113–1371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1111}
1112
1113int
1114sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1115 uint32_t override_tag, uint32_t vrf_id, uint16_t o_strms)
1116{
1117 struct sctp_association *asoc;
1118
1119 /*
1120 * Anything set to zero is taken care of by the allocation routine's
1121 * bzero
1122 */
1123
1124 /*
1125 * Up front select what scoping to apply on addresses I tell my peer
1126 * Not sure what to do with these right now, we will need to come up
1127 * with a way to set them. We may need to pass them through from the
1128 * caller in the sctp_aloc_assoc() function.
1129 */
1130 int i;
1131#if defined(SCTP_DETAILED_STR_STATS)
1132 int j;
1133#endif
1134
1135 asoc = &stcb->asoc;
1136 /* init all variables to a known value. */
1137 SCTP_SET_STATE(stcb, SCTP_STATE_INUSE);
1138 asoc->max_burst = inp->sctp_ep.max_burst;
1139 asoc->fr_max_burst = inp->sctp_ep.fr_max_burst;
1140 asoc->heart_beat_delay = sctp_ticks_to_msecs(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]);
1141 asoc->cookie_life = inp->sctp_ep.def_cookie_life;
1142 asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off;
1143 asoc->ecn_supported = inp->ecn_supported;
1144 asoc->prsctp_supported = inp->prsctp_supported;
1145 asoc->auth_supported = inp->auth_supported;
1146 asoc->asconf_supported = inp->asconf_supported;
1147 asoc->reconfig_supported = inp->reconfig_supported;
1148 asoc->nrsack_supported = inp->nrsack_supported;
1149 asoc->pktdrop_supported = inp->pktdrop_supported;
1150 asoc->idata_supported = inp->idata_supported;
1151 asoc->sctp_cmt_pf = (uint8_t)0;
1152 asoc->sctp_frag_point = inp->sctp_frag_point;
1153 asoc->sctp_features = inp->sctp_features;
1154 asoc->default_dscp = inp->sctp_ep.default_dscp;
1155 asoc->max_cwnd = inp->max_cwnd;
1156#ifdef INET6
1157 if (inp->sctp_ep.default_flowlabel) {
1158 asoc->default_flowlabel = inp->sctp_ep.default_flowlabel;
1159 } else {
1160 if (inp->ip_inp.inp.inp_flags & IN6P_AUTOFLOWLABEL) {
1161 asoc->default_flowlabel = sctp_select_initial_TSN(&inp->sctp_ep);
1162 asoc->default_flowlabel &= 0x000fffff;
1163 asoc->default_flowlabel |= 0x80000000;
1164 } else {
1165 asoc->default_flowlabel = 0;
1166 }
1167 }
1168#endif
1169 asoc->sb_send_resv = 0;
1170 if (override_tag) {

Callers 1

sctp_aloc_assocFunction · 0.85

Calls 5

sctp_ticks_to_msecsFunction · 0.85
sctp_select_initial_TSNFunction · 0.85
sctp_select_a_tagFunction · 0.85
maxFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected