Lines Matching refs:peer

167 	asoc->peer.rwnd = SCTP_DEFAULT_MAXWINDOW;
203 INIT_LIST_HEAD(&asoc->peer.transport_addr_list);
216 asoc->peer.sack_needed = 1;
217 asoc->peer.sack_generation = 1;
236 /* Assume that peer would support both address types unless we are
239 asoc->peer.ipv4_address = 1;
241 asoc->peer.ipv6_address = 1;
346 sctp_tsnmap_free(&asoc->peer.tsn_map);
367 /* Free peer's cached cookie. */
368 kfree(asoc->peer.cookie);
369 kfree(asoc->peer.peer_random);
370 kfree(asoc->peer.peer_chunks);
371 kfree(asoc->peer.peer_hmacs);
374 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
381 asoc->peer.transport_count = 0;
420 /* Change the primary destination address for the peer. */
429 if (asoc->peer.primary_path != NULL &&
430 asoc->peer.primary_path != transport)
433 asoc->peer.primary_path = transport;
438 memcpy(&asoc->peer.primary_addr, &transport->ipaddr,
446 asoc->peer.active_path = transport;
481 struct sctp_transport *peer)
488 __func__, asoc, &peer->ipaddr.sa);
491 * to the next peer before removing this peer from the list.
493 if (asoc->peer.retran_path == peer)
496 /* Remove this peer from the list. */
497 list_del_rcu(&peer->transports);
498 /* Remove this peer from the transport hashtable */
499 sctp_unhash_transport(peer);
502 pos = asoc->peer.transport_addr_list.next;
505 /* Update any entries that match the peer to be deleted. */
506 if (asoc->peer.primary_path == peer)
508 if (asoc->peer.active_path == peer)
509 asoc->peer.active_path = transport;
510 if (asoc->peer.retran_path == peer)
511 asoc->peer.retran_path = transport;
512 if (asoc->peer.last_data_from == peer)
513 asoc->peer.last_data_from = transport;
516 asoc->strreset_chunk->transport == peer) {
526 if (asoc->init_last_sent_to == peer)
534 if (asoc->shutdown_last_sent_to == peer)
541 asoc->addip_last_asconf->transport == peer)
547 if (!list_empty(&peer->transmitted)) {
548 struct sctp_transport *active = asoc->peer.active_path;
551 list_for_each_entry(ch, &peer->transmitted,
557 list_splice_tail_init(&peer->transmitted,
571 if (ch->transport == peer)
574 asoc->peer.transport_count--;
576 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_REMOVED, 0);
577 sctp_transport_free(peer);
586 struct sctp_transport *peer;
599 if (0 == asoc->peer.port)
600 asoc->peer.port = port;
603 peer = sctp_assoc_lookup_paddr(asoc, addr);
604 if (peer) {
609 if (peer->state == SCTP_UNKNOWN) {
610 peer->state = SCTP_ACTIVE;
612 return peer;
615 peer = sctp_transport_new(asoc->base.net, addr, gfp);
616 if (!peer)
619 sctp_transport_set_owner(peer, asoc);
621 /* Initialize the peer's heartbeat interval based on the
624 peer->hbinterval = asoc->hbinterval;
627 peer->pathmaxrxt = asoc->pathmaxrxt;
630 peer->pf_retrans = asoc->pf_retrans;
632 peer->ps_retrans = asoc->ps_retrans;
634 /* Initialize the peer's SACK delay timeout based on the
637 peer->sackdelay = asoc->sackdelay;
638 peer->sackfreq = asoc->sackfreq;
644 peer->flowlabel = ntohl(info & IPV6_FLOWLABEL_MASK);
645 peer->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
647 peer->flowlabel = asoc->flowlabel;
650 peer->dscp = asoc->dscp;
655 peer->param_flags = asoc->param_flags;
658 sctp_transport_route(peer, NULL, sp);
661 * initialize the association PMTU to the peer's PMTU.
663 * peer's PMTU, reset the association PMTU to the new peer's PMTU.
666 min_t(int, peer->pathmtu, asoc->pathmtu) :
667 peer->pathmtu);
669 peer->pmtu_pending = 0;
671 /* The asoc->peer.port might not be meaningful yet, but
674 sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port,
675 asoc->peer.port);
687 peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
693 peer->ssthresh = SCTP_DEFAULT_MAXWINDOW;
695 peer->partial_bytes_acked = 0;
696 peer->flight_size = 0;
697 peer->burst_limited = 0;
700 peer->rto = asoc->rto_initial;
701 sctp_max_rto(asoc, peer);
703 /* Set the peer's active state. */
704 peer->state = peer_state;
706 /* Add this peer into the transport hashtable */
707 if (sctp_hash_transport(peer)) {
708 sctp_transport_free(peer);
713 list_add_tail_rcu(&peer->transports, &asoc->peer.transport_addr_list);
714 asoc->peer.transport_count++;
716 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_ADDED, 0);
719 if (!asoc->peer.primary_path) {
720 sctp_assoc_set_primary(asoc, peer);
721 asoc->peer.retran_path = peer;
724 if (asoc->peer.active_path == asoc->peer.retran_path &&
725 peer->state != SCTP_UNCONFIRMED) {
726 asoc->peer.retran_path = peer;
729 return peer;
740 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
743 /* Do book keeping for removing the peer and free it. */
757 /* Cycle through all transports searching for a peer address. */
759 list_for_each_entry(t, &asoc->peer.transport_addr_list,
775 list_for_each_entry_safe(t, temp, &asoc->peer.transport_addr_list,
940 active = asoc->peer.active_path;
952 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
1020 * been sent to the peer during the association setup. It
1031 asoc->peer.last_data_from = chunk->transport;
1100 /* Copy in new parameters of peer. */
1102 asoc->peer.rwnd = new->peer.rwnd;
1103 asoc->peer.sack_needed = new->peer.sack_needed;
1104 asoc->peer.auth_capable = new->peer.auth_capable;
1105 asoc->peer.i = new->peer.i;
1107 if (!sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL,
1108 asoc->peer.i.initial_tsn, GFP_ATOMIC))
1111 /* Remove any peer addresses not present in the new association. */
1112 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
1125 * current next_tsn in case data sent to peer
1134 * and peer's streams.
1151 /* Add any peer addresses from the new association. */
1152 list_for_each_entry(trans, &new->peer.transport_addr_list,
1169 /* SCTP-AUTH: Save the peer parameters from the new associations
1172 kfree(asoc->peer.peer_random);
1173 asoc->peer.peer_random = new->peer.peer_random;
1174 new->peer.peer_random = NULL;
1176 kfree(asoc->peer.peer_chunks);
1177 asoc->peer.peer_chunks = new->peer.peer_chunks;
1178 new->peer.peer_chunks = NULL;
1180 kfree(asoc->peer.peer_hmacs);
1181 asoc->peer.peer_hmacs = new->peer.peer_hmacs;
1182 new->peer.peer_hmacs = NULL;
1268 struct sctp_transport *trans = asoc->peer.retran_path;
1272 if (asoc->peer.transport_count == 1)
1277 if (asoc->peer.active_path == asoc->peer.retran_path &&
1278 asoc->peer.active_path->state == SCTP_ACTIVE)
1285 if (&trans->transports == &asoc->peer.transport_addr_list)
1294 if (trans == asoc->peer.retran_path)
1298 asoc->peer.retran_path = trans_next;
1301 __func__, asoc, &asoc->peer.retran_path->ipaddr.sa);
1310 list_for_each_entry(trans, &asoc->peer.transport_addr_list,
1344 if ((asoc->peer.primary_path->state == SCTP_ACTIVE ||
1345 asoc->peer.primary_path->state == SCTP_UNKNOWN) &&
1346 asoc->peer.primary_path != trans_pri) {
1348 trans_pri = asoc->peer.primary_path;
1362 trans_pri = sctp_trans_elect_best(asoc->peer.active_path, trans_pf);
1367 asoc->peer.active_path = trans_pri;
1368 asoc->peer.retran_path = trans_sec;
1380 return asoc->peer.active_path;
1382 if (last_sent_to == asoc->peer.retran_path)
1385 return asoc->peer.retran_path;
1426 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) {
1439 /* Should we send a SACK to update our peer? */
1509 asoc->peer.sack_needed = 0;
1561 * local endpoint and the remote peer.
1575 if (asoc->peer.ipv4_address)
1577 if (asoc->peer.ipv6_address)
1678 htonl(asoc->peer.addip_serial))