Lines Matching +full:burst +full:- +full:wrap

1 /* SPDX-License-Identifier: GPL-2.0-only */
9 * Copyright (c) 2005-6 Ian McDonald <ian.mcdonald@jandi.co.nz>
20 * DCCP - specific warning and debugging macros.
59 * - DCCP-Response with ACK Subheader and 4 bytes of Service code OR
60 * - DCCP-Reset with ACK Subheader and 4 bytes of Reset Code fields
61 * Hence a safe upper bound for the maximum option length is 1020-28 = 992
65 #define DCCP_MAX_OPT_LEN (MAX_DCCP_SPECIFIC_HEADER - DCCP_MAX_PACKET_HDR)
68 /* Upper bound for initial feature-negotiation overhead (padded to 32 bits) */
71 #define DCCP_TIMEWAIT_LEN (60 * HZ) /* how long to wait to destroy TIME-WAIT
78 * The maximum back-off value for retransmissions. This is needed for
79 * - retransmitting client-Requests (sec. 8.1.1),
80 * - retransmitting Close/CloseReq when closing (sec. 8.3),
81 * - feature-negotiation retransmission (sec. 6.6.3),
82 * - Acks in client-PARTOPEN state (sec. 8.1.5).
101 * 48-bit sequence number arithmetic (signed and unsigned)
104 #define UINT48_MAX 0xFFFFFFFFFFFFLL /* 2^48 - 1 */
105 #define COMPLEMENT48(x) (0x1000000000000LL - (x)) /* 2^48 - x */
106 #define TO_SIGNED48(x) (((x) < INT48_MIN)? (x) : -COMPLEMENT48( (x)))
107 #define TO_UNSIGNED48(x) (((x) >= 0)? (x) : COMPLEMENT48(-(x)))
116 /* signed mod-2^48 distance: pos. if seqno1 < seqno2, neg. if seqno1 > seqno2 */
127 return (s64)((seq2 << 16) - (seq1 << 16)) > 0; in before48()
136 return (seq3 << 16) - (seq2 << 16) >= (seq1 << 16) - (seq2 << 16); in between48()
140 * dccp_loss_count - Approximate the number of lost data packets in a burst loss
150 delta -= ndp + 1; in dccp_loss_count()
156 * dccp_loss_free - Evaluate condition for data loss from RFC 4340, 7.7.1
199 if (dh->dccph_cscov == 0) in dccp_csum_coverage()
200 return skb->len; in dccp_csum_coverage()
201 return (dh->dccph_doff + dh->dccph_cscov - 1) * sizeof(u32); in dccp_csum_coverage()
208 if (cov >= skb->len) in dccp_csum_outgoing()
209 dccp_hdr(skb)->dccph_cscov = 0; in dccp_csum_outgoing()
211 skb->csum = skb_checksum(skb, 0, (cov > skb->len)? skb->len : cov, 0); in dccp_csum_outgoing()
317 if (dp->dccps_service == service) in dccp_bad_service_code()
319 return !dccp_list_has_service(dp->dccps_service_list, service); in dccp_bad_service_code()
323 * dccp_skb_cb - DCCP per-packet control information
350 #define DCCP_SKB_CB(__skb) ((struct dccp_skb_cb *)&((__skb)->cb[0]))
355 const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; in dccp_non_data_packet()
368 const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; in dccp_data_packet()
378 const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; in dccp_packet_without_ack()
389 dh->dccph_seq2 = 0; in dccp_hdr_set_seq()
390 dh->dccph_seq = htons((gss >> 32) & 0xfffff); in dccp_hdr_set_seq()
391 dhx->dccph_seq_low = htonl(gss & 0xffffffff); in dccp_hdr_set_seq()
397 dhack->dccph_reserved1 = 0; in dccp_hdr_set_ack()
398 dhack->dccph_ack_nr_high = htons(gsr >> 32); in dccp_hdr_set_ack()
399 dhack->dccph_ack_nr_low = htonl(gsr & 0xffffffff); in dccp_hdr_set_ack()
406 if (after48(seq, dp->dccps_gsr)) in dccp_update_gsr()
407 dp->dccps_gsr = seq; in dccp_update_gsr()
409 dp->dccps_swl = SUB48(ADD48(dp->dccps_gsr, 1), dp->dccps_r_seq_win / 4); in dccp_update_gsr()
416 * the feature-remote value of Sequence Window: nothing stops the peer in dccp_update_gsr()
421 * continually updating the feature-remote Sequence-Window. in dccp_update_gsr()
422 * If sequence numbers wrap it is bad luck. But that will take a while in dccp_update_gsr()
423 * (48 bit), and this measure prevents Sequence-number attacks. in dccp_update_gsr()
425 if (before48(dp->dccps_swl, dp->dccps_isr)) in dccp_update_gsr()
426 dp->dccps_swl = dp->dccps_isr; in dccp_update_gsr()
427 dp->dccps_swh = ADD48(dp->dccps_gsr, (3 * dp->dccps_r_seq_win) / 4); in dccp_update_gsr()
434 dp->dccps_gss = seq; in dccp_update_gss()
436 dp->dccps_awl = SUB48(ADD48(dp->dccps_gss, 1), dp->dccps_l_seq_win); in dccp_update_gss()
437 /* Adjust AWL so that it is not below ISS - see comment above for SWL */ in dccp_update_gss()
438 if (before48(dp->dccps_awl, dp->dccps_iss)) in dccp_update_gss()
439 dp->dccps_awl = dp->dccps_iss; in dccp_update_gss()
440 dp->dccps_awh = dp->dccps_gss; in dccp_update_gss()
445 return dccp_sk(sk)->dccps_hc_rx_ackvec != NULL && in dccp_ackvec_pending()
446 !dccp_ackvec_is_empty(dccp_sk(sk)->dccps_hc_rx_ackvec); in dccp_ackvec_pending()