Lines Matching refs:peer

170 	asoc->peer.rwnd = SCTP_DEFAULT_MAXWINDOW;
206 INIT_LIST_HEAD(&asoc->peer.transport_addr_list);
219 asoc->peer.sack_needed = 1;
220 asoc->peer.sack_generation = 1;
238 /* Assume that peer would support both address types unless we are
241 asoc->peer.ipv4_address = 1;
243 asoc->peer.ipv6_address = 1;
347 sctp_tsnmap_free(&asoc->peer.tsn_map);
368 /* Free peer's cached cookie. */
369 kfree(asoc->peer.cookie);
370 kfree(asoc->peer.peer_random);
371 kfree(asoc->peer.peer_chunks);
372 kfree(asoc->peer.peer_hmacs);
375 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
382 asoc->peer.transport_count = 0;
421 /* Change the primary destination address for the peer. */
430 if (asoc->peer.primary_path != NULL &&
431 asoc->peer.primary_path != transport)
434 asoc->peer.primary_path = transport;
439 memcpy(&asoc->peer.primary_addr, &transport->ipaddr,
447 asoc->peer.active_path = transport;
482 struct sctp_transport *peer)
489 __func__, asoc, &peer->ipaddr.sa);
492 * to the next peer before removing this peer from the list.
494 if (asoc->peer.retran_path == peer)
497 /* Remove this peer from the list. */
498 list_del_rcu(&peer->transports);
499 /* Remove this peer from the transport hashtable */
500 sctp_unhash_transport(peer);
503 pos = asoc->peer.transport_addr_list.next;
506 /* Update any entries that match the peer to be deleted. */
507 if (asoc->peer.primary_path == peer)
509 if (asoc->peer.active_path == peer)
510 asoc->peer.active_path = transport;
511 if (asoc->peer.retran_path == peer)
512 asoc->peer.retran_path = transport;
513 if (asoc->peer.last_data_from == peer)
514 asoc->peer.last_data_from = transport;
517 asoc->strreset_chunk->transport == peer) {
527 if (asoc->init_last_sent_to == peer)
535 if (asoc->shutdown_last_sent_to == peer)
542 asoc->addip_last_asconf->transport == peer)
548 if (!list_empty(&peer->transmitted)) {
549 struct sctp_transport *active = asoc->peer.active_path;
552 list_for_each_entry(ch, &peer->transmitted,
558 list_splice_tail_init(&peer->transmitted,
572 if (ch->transport == peer)
575 asoc->peer.transport_count--;
577 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_REMOVED, 0);
578 sctp_transport_free(peer);
587 struct sctp_transport *peer;
600 if (0 == asoc->peer.port)
601 asoc->peer.port = port;
604 peer = sctp_assoc_lookup_paddr(asoc, addr);
605 if (peer) {
610 if (peer->state == SCTP_UNKNOWN) {
611 peer->state = SCTP_ACTIVE;
613 return peer;
616 peer = sctp_transport_new(asoc->base.net, addr, gfp);
617 if (!peer)
620 sctp_transport_set_owner(peer, asoc);
622 /* Initialize the peer's heartbeat interval based on the
625 peer->hbinterval = asoc->hbinterval;
626 peer->probe_interval = asoc->probe_interval;
628 peer->encap_port = asoc->encap_port;
631 peer->pathmaxrxt = asoc->pathmaxrxt;
634 peer->pf_retrans = asoc->pf_retrans;
636 peer->ps_retrans = asoc->ps_retrans;
638 /* Initialize the peer's SACK delay timeout based on the
641 peer->sackdelay = asoc->sackdelay;
642 peer->sackfreq = asoc->sackfreq;
648 peer->flowlabel = ntohl(info & IPV6_FLOWLABEL_MASK);
649 peer->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
651 peer->flowlabel = asoc->flowlabel;
654 peer->dscp = asoc->dscp;
659 peer->param_flags = asoc->param_flags;
662 sctp_transport_route(peer, NULL, sp);
665 * initialize the association PMTU to the peer's PMTU.
667 * peer's PMTU, reset the association PMTU to the new peer's PMTU.
670 min_t(int, peer->pathmtu, asoc->pathmtu) :
671 peer->pathmtu);
673 peer->pmtu_pending = 0;
675 /* The asoc->peer.port might not be meaningful yet, but
678 sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port,
679 asoc->peer.port);
691 peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
697 peer->ssthresh = SCTP_DEFAULT_MAXWINDOW;
699 peer->partial_bytes_acked = 0;
700 peer->flight_size = 0;
701 peer->burst_limited = 0;
704 peer->rto = asoc->rto_initial;
705 sctp_max_rto(asoc, peer);
707 /* Set the peer's active state. */
708 peer->state = peer_state;
710 /* Add this peer into the transport hashtable */
711 if (sctp_hash_transport(peer)) {
712 sctp_transport_free(peer);
716 sctp_transport_pl_reset(peer);
719 list_add_tail_rcu(&peer->transports, &asoc->peer.transport_addr_list);
720 asoc->peer.transport_count++;
722 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_ADDED, 0);
725 if (!asoc->peer.primary_path) {
726 sctp_assoc_set_primary(asoc, peer);
727 asoc->peer.retran_path = peer;
730 if (asoc->peer.active_path == asoc->peer.retran_path &&
731 peer->state != SCTP_UNCONFIRMED) {
732 asoc->peer.retran_path = peer;
735 return peer;
746 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
749 /* Do book keeping for removing the peer and free it. */
763 /* Cycle through all transports searching for a peer address. */
765 list_for_each_entry(t, &asoc->peer.transport_addr_list,
781 list_for_each_entry_safe(t, temp, &asoc->peer.transport_addr_list,
948 active = asoc->peer.active_path;
960 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
1028 * been sent to the peer during the association setup. It
1039 asoc->peer.last_data_from = chunk->transport;
1108 /* Copy in new parameters of peer. */
1110 asoc->peer.rwnd = new->peer.rwnd;
1111 asoc->peer.sack_needed = new->peer.sack_needed;
1112 asoc->peer.auth_capable = new->peer.auth_capable;
1113 asoc->peer.i = new->peer.i;
1115 if (!sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL,
1116 asoc->peer.i.initial_tsn, GFP_ATOMIC))
1119 /* Remove any peer addresses not present in the new association. */
1120 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
1133 * current next_tsn in case data sent to peer
1142 * and peer's streams.
1159 /* Add any peer addresses from the new association. */
1160 list_for_each_entry(trans, &new->peer.transport_addr_list,
1177 /* SCTP-AUTH: Save the peer parameters from the new associations
1180 kfree(asoc->peer.peer_random);
1181 asoc->peer.peer_random = new->peer.peer_random;
1182 new->peer.peer_random = NULL;
1184 kfree(asoc->peer.peer_chunks);
1185 asoc->peer.peer_chunks = new->peer.peer_chunks;
1186 new->peer.peer_chunks = NULL;
1188 kfree(asoc->peer.peer_hmacs);
1189 asoc->peer.peer_hmacs = new->peer.peer_hmacs;
1190 new->peer.peer_hmacs = NULL;
1276 struct sctp_transport *trans = asoc->peer.retran_path;
1280 if (asoc->peer.transport_count == 1)
1285 if (asoc->peer.active_path == asoc->peer.retran_path &&
1286 asoc->peer.active_path->state == SCTP_ACTIVE)
1293 if (&trans->transports == &asoc->peer.transport_addr_list)
1302 if (trans == asoc->peer.retran_path)
1306 asoc->peer.retran_path = trans_next;
1309 __func__, asoc, &asoc->peer.retran_path->ipaddr.sa);
1318 list_for_each_entry(trans, &asoc->peer.transport_addr_list,
1352 if ((asoc->peer.primary_path->state == SCTP_ACTIVE ||
1353 asoc->peer.primary_path->state == SCTP_UNKNOWN) &&
1354 asoc->peer.primary_path != trans_pri) {
1356 trans_pri = asoc->peer.primary_path;
1370 trans_pri = sctp_trans_elect_best(asoc->peer.active_path, trans_pf);
1375 asoc->peer.active_path = trans_pri;
1376 asoc->peer.retran_path = trans_sec;
1388 return asoc->peer.active_path;
1390 if (last_sent_to == asoc->peer.retran_path)
1393 return asoc->peer.retran_path;
1434 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) {
1447 /* Should we send a SACK to update our peer? */
1517 asoc->peer.sack_needed = 0;
1569 * local endpoint and the remote peer.
1583 if (asoc->peer.ipv4_address)
1585 if (asoc->peer.ipv6_address)
1687 htonl(asoc->peer.addip_serial))