Lines Matching refs:chunk

46 						 struct sctp_chunk *chunk);
48 struct sctp_chunk *chunk);
50 struct sctp_chunk *chunk);
52 struct sctp_chunk *chunk,
122 struct sctp_chunk *chunk = sctp_get_ecne_prepend(asoc); in sctp_packet_config() local
124 if (chunk) in sctp_packet_config()
125 sctp_packet_append_chunk(packet, chunk); in sctp_packet_config()
163 struct sctp_chunk *chunk, *tmp; in sctp_packet_free() local
167 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) { in sctp_packet_free()
168 list_del_init(&chunk->list); in sctp_packet_free()
169 sctp_chunk_free(chunk); in sctp_packet_free()
181 struct sctp_chunk *chunk, in sctp_packet_transmit_chunk() argument
187 packet, packet->size, chunk, chunk->skb ? chunk->skb->len : -1); in sctp_packet_transmit_chunk()
189 switch ((retval = (sctp_packet_append_chunk(packet, chunk)))) { in sctp_packet_transmit_chunk()
196 chunk->skb->sk->sk_err = -error; in sctp_packet_transmit_chunk()
203 chunk); in sctp_packet_transmit_chunk()
217 static enum sctp_xmit sctp_packet_bundle_pad(struct sctp_packet *pkt, struct sctp_chunk *chunk) in sctp_packet_bundle_pad() argument
223 if (!chunk->pmtu_probe) in sctp_packet_bundle_pad()
235 chunk->transport = t; in sctp_packet_bundle_pad()
242 struct sctp_chunk *chunk) in sctp_packet_bundle_auth() argument
255 if (chunk->chunk_hdr->type == SCTP_CID_AUTH || pkt->has_auth) in sctp_packet_bundle_auth()
261 if (!chunk->auth) in sctp_packet_bundle_auth()
264 auth = sctp_make_auth(asoc, chunk->shkey->key_id); in sctp_packet_bundle_auth()
268 auth->shkey = chunk->shkey; in sctp_packet_bundle_auth()
281 struct sctp_chunk *chunk) in sctp_packet_bundle_sack() argument
288 if (sctp_chunk_is_data(chunk) && !pkt->has_sack && in sctp_packet_bundle_sack()
329 struct sctp_chunk *chunk) in __sctp_packet_append_chunk() argument
331 __u16 chunk_len = SCTP_PAD4(ntohs(chunk->chunk_hdr->length)); in __sctp_packet_append_chunk()
335 retval = sctp_packet_will_fit(packet, chunk, chunk_len); in __sctp_packet_append_chunk()
340 switch (chunk->chunk_hdr->type) { in __sctp_packet_append_chunk()
344 sctp_packet_append_data(packet, chunk); in __sctp_packet_append_chunk()
352 chunk->sent_at = jiffies; in __sctp_packet_append_chunk()
354 chunk->sent_count++; in __sctp_packet_append_chunk()
362 if (chunk->asoc) in __sctp_packet_append_chunk()
363 chunk->asoc->stats.osacks++; in __sctp_packet_append_chunk()
368 packet->auth = chunk; in __sctp_packet_append_chunk()
373 list_add_tail(&chunk->list, &packet->chunk_list); in __sctp_packet_append_chunk()
375 chunk->transport = packet->transport; in __sctp_packet_append_chunk()
384 struct sctp_chunk *chunk) in sctp_packet_append_chunk() argument
388 pr_debug("%s: packet:%p chunk:%p\n", __func__, packet, chunk); in sctp_packet_append_chunk()
394 if (sctp_chunk_is_data(chunk)) { in sctp_packet_append_chunk()
395 retval = sctp_packet_can_append_data(packet, chunk); in sctp_packet_append_chunk()
401 retval = sctp_packet_bundle_auth(packet, chunk); in sctp_packet_append_chunk()
406 retval = sctp_packet_bundle_sack(packet, chunk); in sctp_packet_append_chunk()
410 retval = __sctp_packet_append_chunk(packet, chunk); in sctp_packet_append_chunk()
414 retval = sctp_packet_bundle_pad(packet, chunk); in sctp_packet_append_chunk()
441 struct sctp_chunk *chunk, *tmp; in sctp_packet_pack() local
459 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, in sctp_packet_pack()
461 int padded = SCTP_PAD4(chunk->skb->len); in sctp_packet_pack()
463 if (chunk == packet->auth) in sctp_packet_pack()
480 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) { in sctp_packet_pack()
483 list_del_init(&chunk->list); in sctp_packet_pack()
484 if (sctp_chunk_is_data(chunk)) { in sctp_packet_pack()
485 if (!sctp_chunk_retransmitted(chunk) && in sctp_packet_pack()
487 chunk->rtt_in_progress = 1; in sctp_packet_pack()
492 padding = SCTP_PAD4(chunk->skb->len) - chunk->skb->len; in sctp_packet_pack()
494 skb_put_zero(chunk->skb, padding); in sctp_packet_pack()
496 if (chunk == packet->auth) in sctp_packet_pack()
500 skb_put_data(nskb, chunk->skb->data, chunk->skb->len); in sctp_packet_pack()
503 chunk, in sctp_packet_pack()
504 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)), in sctp_packet_pack()
505 chunk->has_tsn ? "TSN" : "No TSN", in sctp_packet_pack()
506 chunk->has_tsn ? ntohl(chunk->subh.data_hdr->tsn) : 0, in sctp_packet_pack()
507 ntohs(chunk->chunk_hdr->length), chunk->skb->len, in sctp_packet_pack()
508 chunk->rtt_in_progress); in sctp_packet_pack()
510 pkt_size -= SCTP_PAD4(chunk->skb->len); in sctp_packet_pack()
512 if (!sctp_chunk_is_data(chunk) && chunk != packet->auth) in sctp_packet_pack()
513 sctp_chunk_free(chunk); in sctp_packet_pack()
573 struct sctp_chunk *chunk, *tmp; in sctp_packet_transmit() local
582 chunk = list_entry(packet->chunk_list.next, struct sctp_chunk, list); in sctp_packet_transmit()
583 sk = chunk->skb->sk; in sctp_packet_transmit()
585 if (packet->size > tp->pathmtu && !packet->ipfragok && !chunk->pmtu_probe) { in sctp_packet_transmit()
658 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) { in sctp_packet_transmit()
659 list_del_init(&chunk->list); in sctp_packet_transmit()
660 if (!sctp_chunk_is_data(chunk)) in sctp_packet_transmit()
661 sctp_chunk_free(chunk); in sctp_packet_transmit()
673 struct sctp_chunk *chunk) in sctp_packet_can_append_data() argument
697 datasize = sctp_data_size(chunk); in sctp_packet_can_append_data()
717 if (chunk->fast_retransmit != SCTP_NEED_FRTX && in sctp_packet_can_append_data()
742 if (chunk->skb->len + q->out_qlen > transport->pathmtu - in sctp_packet_can_append_data()
743 packet->overhead - sctp_datachk_len(&chunk->asoc->stream) - 4) in sctp_packet_can_append_data()
748 if (!chunk->msg->can_delay) in sctp_packet_can_append_data()
757 struct sctp_chunk *chunk) in sctp_packet_append_data() argument
760 size_t datasize = sctp_data_size(chunk); in sctp_packet_append_data()
777 sctp_chunk_assign_tsn(chunk); in sctp_packet_append_data()
778 asoc->stream.si->assign_number(chunk); in sctp_packet_append_data()
782 struct sctp_chunk *chunk, in sctp_packet_will_fit() argument
793 if ((packet->auth && chunk->shkey != packet->auth->shkey) || in sctp_packet_will_fit()
794 (!packet->auth && chunk->shkey && in sctp_packet_will_fit()
795 chunk->chunk_hdr->type != SCTP_CID_AUTH)) in sctp_packet_will_fit()
814 (!packet->has_data && chunk->auth)) { in sctp_packet_will_fit()
840 if (!sctp_chunk_is_data(chunk) && packet->has_data) in sctp_packet_will_fit()