2 * net/dccp/ccids/ccid2.c
4 * Copyright (c) 2005, 2006 Andrea Bittau <a.bittau@cs.ucl.ac.uk>
6 * Changes to meet Linux coding standards, and DCCP infrastructure fixes.
8 * Copyright (c) 2006 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 * This implementation should follow: draft-ietf-dccp-ccid2-10.txt
29 * - sequence number wrapping
36 static int ccid2_debug;
38 #ifdef CONFIG_IP_DCCP_CCID2_DEBUG
39 #define ccid2_pr_debug(format, a...) \
40 do { if (ccid2_debug) \
41 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \
44 #define ccid2_pr_debug(format, a...)
47 static const int ccid2_seq_len = 128;
49 #ifdef CONFIG_IP_DCCP_CCID2_DEBUG
50 static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx)
54 struct ccid2_seq *seqp = hctx->ccid2hctx_seqh;
56 /* there is data in the chain */
57 if (seqp != hctx->ccid2hctx_seqt) {
58 seqp = seqp->ccid2s_prev;
60 if (!seqp->ccid2s_acked)
63 while (seqp != hctx->ccid2hctx_seqt) {
64 struct ccid2_seq *prev = seqp->ccid2s_prev;
67 if (!prev->ccid2s_acked)
70 /* packets are sent sequentially */
71 BUG_ON(seqp->ccid2s_seq <= prev->ccid2s_seq);
72 BUG_ON(time_before(seqp->ccid2s_sent,
74 BUG_ON(len > ccid2_seq_len);
80 BUG_ON(pipe != hctx->ccid2hctx_pipe);
81 ccid2_pr_debug("len of chain=%d\n", len);
84 seqp = seqp->ccid2s_prev;
86 BUG_ON(len > ccid2_seq_len);
87 } while (seqp != hctx->ccid2hctx_seqh);
89 BUG_ON(len != ccid2_seq_len);
90 ccid2_pr_debug("total len=%d\n", len);
93 #define ccid2_hc_tx_check_sanity(hctx) do {} while (0)
96 static int ccid2_hc_tx_send_packet(struct sock *sk,
97 struct sk_buff *skb, int len)
99 struct ccid2_hc_tx_sock *hctx;
101 switch (DCCP_SKB_CB(skb)->dccpd_type) {
102 case 0: /* XXX data packets from userland come through like this */
104 case DCCP_PKT_DATAACK:
106 /* No congestion control on other packets */
111 hctx = ccid2_hc_tx_sk(sk);
113 ccid2_pr_debug("pipe=%d cwnd=%d\n", hctx->ccid2hctx_pipe,
114 hctx->ccid2hctx_cwnd);
116 if (hctx->ccid2hctx_pipe < hctx->ccid2hctx_cwnd) {
117 /* OK we can send... make sure previous packet was sent off */
118 if (!hctx->ccid2hctx_sendwait) {
119 hctx->ccid2hctx_sendwait = 1;
124 return 1; /* XXX CCID should dequeue when ready instead of polling */
127 static void ccid2_change_l_ack_ratio(struct sock *sk, int val)
129 struct dccp_sock *dp = dccp_sk(sk);
131 * XXX I don't really agree with val != 2. If cwnd is 1, ack ratio
132 * should be 1... it shouldn't be allowed to become 2.
136 const struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
137 int max = hctx->ccid2hctx_cwnd / 2;
140 if (hctx->ccid2hctx_cwnd & 1)
147 ccid2_pr_debug("changing local ack ratio to %d\n", val);
149 dp->dccps_l_ack_ratio = val;
152 static void ccid2_change_cwnd(struct sock *sk, int val)
154 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
159 /* XXX do we need to change ack ratio? */
160 ccid2_pr_debug("change cwnd to %d\n", val);
163 hctx->ccid2hctx_cwnd = val;
166 static void ccid2_start_rto_timer(struct sock *sk);
168 static void ccid2_hc_tx_rto_expire(unsigned long data)
170 struct sock *sk = (struct sock *)data;
171 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
175 if (sock_owned_by_user(sk)) {
176 sk_reset_timer(sk, &hctx->ccid2hctx_rtotimer,
181 ccid2_pr_debug("RTO_EXPIRE\n");
183 ccid2_hc_tx_check_sanity(hctx);
186 hctx->ccid2hctx_rto <<= 1;
188 s = hctx->ccid2hctx_rto / HZ;
190 hctx->ccid2hctx_rto = 60 * HZ;
192 ccid2_start_rto_timer(sk);
194 /* adjust pipe, cwnd etc */
195 hctx->ccid2hctx_pipe = 0;
196 hctx->ccid2hctx_ssthresh = hctx->ccid2hctx_cwnd >> 1;
197 if (hctx->ccid2hctx_ssthresh < 2)
198 hctx->ccid2hctx_ssthresh = 2;
199 ccid2_change_cwnd(sk, 1);
201 /* clear state about stuff we sent */
202 hctx->ccid2hctx_seqt = hctx->ccid2hctx_seqh;
203 hctx->ccid2hctx_ssacks = 0;
204 hctx->ccid2hctx_acks = 0;
205 hctx->ccid2hctx_sent = 0;
207 /* clear ack ratio state. */
208 hctx->ccid2hctx_arsent = 0;
209 hctx->ccid2hctx_ackloss = 0;
210 hctx->ccid2hctx_rpseq = 0;
211 hctx->ccid2hctx_rpdupack = -1;
212 ccid2_change_l_ack_ratio(sk, 1);
213 ccid2_hc_tx_check_sanity(hctx);
219 static void ccid2_start_rto_timer(struct sock *sk)
221 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
223 ccid2_pr_debug("setting RTO timeout=%ld\n", hctx->ccid2hctx_rto);
225 BUG_ON(timer_pending(&hctx->ccid2hctx_rtotimer));
226 sk_reset_timer(sk, &hctx->ccid2hctx_rtotimer,
227 jiffies + hctx->ccid2hctx_rto);
230 static void ccid2_hc_tx_packet_sent(struct sock *sk, int more, int len)
232 struct dccp_sock *dp = dccp_sk(sk);
233 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
236 ccid2_hc_tx_check_sanity(hctx);
238 BUG_ON(!hctx->ccid2hctx_sendwait);
239 hctx->ccid2hctx_sendwait = 0;
240 hctx->ccid2hctx_pipe++;
241 BUG_ON(hctx->ccid2hctx_pipe < 0);
243 /* There is an issue. What if another packet is sent between
244 * packet_send() and packet_sent(). Then the sequence number would be
250 hctx->ccid2hctx_seqh->ccid2s_seq = seq;
251 hctx->ccid2hctx_seqh->ccid2s_acked = 0;
252 hctx->ccid2hctx_seqh->ccid2s_sent = jiffies;
253 hctx->ccid2hctx_seqh = hctx->ccid2hctx_seqh->ccid2s_next;
255 ccid2_pr_debug("cwnd=%d pipe=%d\n", hctx->ccid2hctx_cwnd,
256 hctx->ccid2hctx_pipe);
258 if (hctx->ccid2hctx_seqh == hctx->ccid2hctx_seqt) {
259 /* XXX allocate more space */
263 hctx->ccid2hctx_sent++;
265 /* Ack Ratio. Need to maintain a concept of how many windows we sent */
266 hctx->ccid2hctx_arsent++;
267 /* We had an ack loss in this window... */
268 if (hctx->ccid2hctx_ackloss) {
269 if (hctx->ccid2hctx_arsent >= hctx->ccid2hctx_cwnd) {
270 hctx->ccid2hctx_arsent = 0;
271 hctx->ccid2hctx_ackloss = 0;
274 /* No acks lost up to now... */
275 /* decrease ack ratio if enough packets were sent */
276 if (dp->dccps_l_ack_ratio > 1) {
277 /* XXX don't calculate denominator each time */
278 int denom = dp->dccps_l_ack_ratio * dp->dccps_l_ack_ratio -
279 dp->dccps_l_ack_ratio;
281 denom = hctx->ccid2hctx_cwnd * hctx->ccid2hctx_cwnd / denom;
283 if (hctx->ccid2hctx_arsent >= denom) {
284 ccid2_change_l_ack_ratio(sk, dp->dccps_l_ack_ratio - 1);
285 hctx->ccid2hctx_arsent = 0;
288 /* we can't increase ack ratio further [1] */
289 hctx->ccid2hctx_arsent = 0; /* or maybe set it to cwnd*/
293 /* setup RTO timer */
294 if (!timer_pending(&hctx->ccid2hctx_rtotimer))
295 ccid2_start_rto_timer(sk);
297 #ifdef CONFIG_IP_DCCP_CCID2_DEBUG
298 ccid2_pr_debug("pipe=%d\n", hctx->ccid2hctx_pipe);
299 ccid2_pr_debug("Sent: seq=%llu\n", seq);
301 struct ccid2_seq *seqp = hctx->ccid2hctx_seqt;
303 while (seqp != hctx->ccid2hctx_seqh) {
304 ccid2_pr_debug("out seq=%llu acked=%d time=%lu\n",
305 seqp->ccid2s_seq, seqp->ccid2s_acked,
307 seqp = seqp->ccid2s_next;
310 ccid2_pr_debug("=========\n");
311 ccid2_hc_tx_check_sanity(hctx);
315 /* XXX Lame code duplication!
316 * returns -1 if none was found.
317 * else returns the next offset to use in the function call.
319 static int ccid2_ackvector(struct sock *sk, struct sk_buff *skb, int offset,
320 unsigned char **vec, unsigned char *veclen)
322 const struct dccp_hdr *dh = dccp_hdr(skb);
323 unsigned char *options = (unsigned char *)dh + dccp_hdr_len(skb);
324 unsigned char *opt_ptr;
325 const unsigned char *opt_end = (unsigned char *)dh +
326 (dh->dccph_doff * 4);
327 unsigned char opt, len;
328 unsigned char *value;
333 if (opt_ptr >= opt_end)
336 while (opt_ptr != opt_end) {
341 /* Check if this isn't a single byte option */
342 if (opt > DCCPO_MAX_RESERVED) {
343 if (opt_ptr == opt_end)
344 goto out_invalid_option;
348 goto out_invalid_option;
350 * Remove the type and len fields, leaving
351 * just the value size
357 if (opt_ptr > opt_end)
358 goto out_invalid_option;
362 case DCCPO_ACK_VECTOR_0:
363 case DCCPO_ACK_VECTOR_1:
366 return offset + (opt_ptr - options);
373 BUG_ON(1); /* should never happen... options were previously parsed ! */
377 static void ccid2_hc_tx_kill_rto_timer(struct sock *sk)
379 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
381 sk_stop_timer(sk, &hctx->ccid2hctx_rtotimer);
382 ccid2_pr_debug("deleted RTO timer\n");
385 static inline void ccid2_new_ack(struct sock *sk,
386 struct ccid2_seq *seqp,
387 unsigned int *maxincr)
389 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
392 if (hctx->ccid2hctx_cwnd < hctx->ccid2hctx_ssthresh) {
393 hctx->ccid2hctx_acks = 0;
395 /* We can increase cwnd at most maxincr [ack_ratio/2] */
397 /* increase every 2 acks */
398 hctx->ccid2hctx_ssacks++;
399 if (hctx->ccid2hctx_ssacks == 2) {
400 ccid2_change_cwnd(sk, hctx->ccid2hctx_cwnd + 1);
401 hctx->ccid2hctx_ssacks = 0;
402 *maxincr = *maxincr - 1;
405 /* increased cwnd enough for this single ack */
406 hctx->ccid2hctx_ssacks = 0;
409 hctx->ccid2hctx_ssacks = 0;
410 hctx->ccid2hctx_acks++;
412 if (hctx->ccid2hctx_acks >= hctx->ccid2hctx_cwnd) {
413 ccid2_change_cwnd(sk, hctx->ccid2hctx_cwnd + 1);
414 hctx->ccid2hctx_acks = 0;
419 if (hctx->ccid2hctx_srtt == -1 ||
420 time_after(jiffies, hctx->ccid2hctx_lastrtt + hctx->ccid2hctx_srtt)) {
421 unsigned long r = (long)jiffies - (long)seqp->ccid2s_sent;
424 /* first measurement */
425 if (hctx->ccid2hctx_srtt == -1) {
426 ccid2_pr_debug("R: %lu Time=%lu seq=%llu\n",
427 r, jiffies, seqp->ccid2s_seq);
428 hctx->ccid2hctx_srtt = r;
429 hctx->ccid2hctx_rttvar = r >> 1;
432 long tmp = hctx->ccid2hctx_srtt - r;
437 hctx->ccid2hctx_rttvar *= 3;
438 hctx->ccid2hctx_rttvar >>= 2;
439 hctx->ccid2hctx_rttvar += tmp;
442 hctx->ccid2hctx_srtt *= 7;
443 hctx->ccid2hctx_srtt >>= 3;
445 hctx->ccid2hctx_srtt += tmp;
447 s = hctx->ccid2hctx_rttvar << 2;
448 /* clock granularity is 1 when based on jiffies */
451 hctx->ccid2hctx_rto = hctx->ccid2hctx_srtt + s;
453 /* must be at least a second */
454 s = hctx->ccid2hctx_rto / HZ;
455 /* DCCP doesn't require this [but I like it cuz my code sux] */
458 hctx->ccid2hctx_rto = HZ;
462 hctx->ccid2hctx_rto = HZ * 60;
464 hctx->ccid2hctx_lastrtt = jiffies;
466 ccid2_pr_debug("srtt: %ld rttvar: %ld rto: %ld (HZ=%d) R=%lu\n",
467 hctx->ccid2hctx_srtt, hctx->ccid2hctx_rttvar,
468 hctx->ccid2hctx_rto, HZ, r);
469 hctx->ccid2hctx_sent = 0;
472 /* we got a new ack, so re-start RTO timer */
473 ccid2_hc_tx_kill_rto_timer(sk);
474 ccid2_start_rto_timer(sk);
477 static void ccid2_hc_tx_dec_pipe(struct sock *sk)
479 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
481 hctx->ccid2hctx_pipe--;
482 BUG_ON(hctx->ccid2hctx_pipe < 0);
484 if (hctx->ccid2hctx_pipe == 0)
485 ccid2_hc_tx_kill_rto_timer(sk);
488 static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
490 struct dccp_sock *dp = dccp_sk(sk);
491 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
493 struct ccid2_seq *seqp;
494 unsigned char *vector;
495 unsigned char veclen;
499 unsigned int maxincr = 0;
501 ccid2_hc_tx_check_sanity(hctx);
502 /* check reverse path congestion */
503 seqno = DCCP_SKB_CB(skb)->dccpd_seq;
505 /* XXX this whole "algorithm" is broken. Need to fix it to keep track
506 * of the seqnos of the dupacks so that rpseq and rpdupack are correct
509 /* need to bootstrap */
510 if (hctx->ccid2hctx_rpdupack == -1) {
511 hctx->ccid2hctx_rpdupack = 0;
512 hctx->ccid2hctx_rpseq = seqno;
514 /* check if packet is consecutive */
515 if ((hctx->ccid2hctx_rpseq + 1) == seqno)
516 hctx->ccid2hctx_rpseq++;
517 /* it's a later packet */
518 else if (after48(seqno, hctx->ccid2hctx_rpseq)) {
519 hctx->ccid2hctx_rpdupack++;
521 /* check if we got enough dupacks */
522 if (hctx->ccid2hctx_rpdupack >=
523 hctx->ccid2hctx_numdupack) {
524 hctx->ccid2hctx_rpdupack = -1; /* XXX lame */
525 hctx->ccid2hctx_rpseq = 0;
527 ccid2_change_l_ack_ratio(sk, dp->dccps_l_ack_ratio << 1);
532 /* check forward path congestion */
533 /* still didn't send out new data packets */
534 if (hctx->ccid2hctx_seqh == hctx->ccid2hctx_seqt)
537 switch (DCCP_SKB_CB(skb)->dccpd_type) {
539 case DCCP_PKT_DATAACK:
545 ackno = DCCP_SKB_CB(skb)->dccpd_ack_seq;
546 seqp = hctx->ccid2hctx_seqh->ccid2s_prev;
548 /* If in slow-start, cwnd can increase at most Ack Ratio / 2 packets for
549 * this single ack. I round up.
552 maxincr = dp->dccps_l_ack_ratio >> 1;
555 /* go through all ack vectors */
556 while ((offset = ccid2_ackvector(sk, skb, offset,
557 &vector, &veclen)) != -1) {
558 /* go through this ack vector */
560 const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK;
563 dccp_set_seqno(&ackno_end_rl, ackno - rl);
564 ccid2_pr_debug("ackvec start:%llu end:%llu\n", ackno,
566 /* if the seqno we are analyzing is larger than the
567 * current ackno, then move towards the tail of our
570 while (after48(seqp->ccid2s_seq, ackno)) {
571 if (seqp == hctx->ccid2hctx_seqt) {
575 seqp = seqp->ccid2s_prev;
580 /* check all seqnos in the range of the vector
583 while (between48(seqp->ccid2s_seq,ackno_end_rl,ackno)) {
584 const u8 state = *vector &
585 DCCP_ACKVEC_STATE_MASK;
587 /* new packet received or marked */
588 if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED &&
589 !seqp->ccid2s_acked) {
591 DCCP_ACKVEC_STATE_ECN_MARKED) {
594 ccid2_new_ack(sk, seqp,
597 seqp->ccid2s_acked = 1;
598 ccid2_pr_debug("Got ack for %llu\n",
600 ccid2_hc_tx_dec_pipe(sk);
602 if (seqp == hctx->ccid2hctx_seqt) {
606 seqp = seqp->ccid2s_next;
612 dccp_set_seqno(&ackno, ackno_end_rl - 1);
619 /* The state about what is acked should be correct now
620 * Check for NUMDUPACK
622 seqp = hctx->ccid2hctx_seqh->ccid2s_prev;
625 if (seqp->ccid2s_acked) {
627 if (done == hctx->ccid2hctx_numdupack)
630 if (seqp == hctx->ccid2hctx_seqt)
632 seqp = seqp->ccid2s_prev;
635 /* If there are at least 3 acknowledgements, anything unacknowledged
636 * below the last sequence number is considered lost
638 if (done == hctx->ccid2hctx_numdupack) {
639 struct ccid2_seq *last_acked = seqp;
641 /* check for lost packets */
643 if (!seqp->ccid2s_acked) {
645 ccid2_hc_tx_dec_pipe(sk);
647 if (seqp == hctx->ccid2hctx_seqt)
649 seqp = seqp->ccid2s_prev;
652 hctx->ccid2hctx_seqt = last_acked;
655 /* trim acked packets in tail */
656 while (hctx->ccid2hctx_seqt != hctx->ccid2hctx_seqh) {
657 if (!hctx->ccid2hctx_seqt->ccid2s_acked)
660 hctx->ccid2hctx_seqt = hctx->ccid2hctx_seqt->ccid2s_next;
664 /* XXX do bit shifts guarantee a 0 as the new bit? */
665 ccid2_change_cwnd(sk, hctx->ccid2hctx_cwnd >> 1);
666 hctx->ccid2hctx_ssthresh = hctx->ccid2hctx_cwnd;
667 if (hctx->ccid2hctx_ssthresh < 2)
668 hctx->ccid2hctx_ssthresh = 2;
671 ccid2_hc_tx_check_sanity(hctx);
674 static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
676 struct ccid2_hc_tx_sock *hctx = ccid_priv(ccid);
677 int seqcount = ccid2_seq_len;
680 hctx->ccid2hctx_cwnd = 1;
681 /* Initialize ssthresh to infinity. This means that we will exit the
682 * initial slow-start after the first packet loss. This is what we
685 hctx->ccid2hctx_ssthresh = ~0;
686 hctx->ccid2hctx_numdupack = 3;
688 /* XXX init ~ to window size... */
689 hctx->ccid2hctx_seqbuf = kmalloc(sizeof(*hctx->ccid2hctx_seqbuf) *
690 seqcount, gfp_any());
691 if (hctx->ccid2hctx_seqbuf == NULL)
694 for (i = 0; i < (seqcount - 1); i++) {
695 hctx->ccid2hctx_seqbuf[i].ccid2s_next =
696 &hctx->ccid2hctx_seqbuf[i + 1];
697 hctx->ccid2hctx_seqbuf[i + 1].ccid2s_prev =
698 &hctx->ccid2hctx_seqbuf[i];
700 hctx->ccid2hctx_seqbuf[seqcount - 1].ccid2s_next =
701 hctx->ccid2hctx_seqbuf;
702 hctx->ccid2hctx_seqbuf->ccid2s_prev =
703 &hctx->ccid2hctx_seqbuf[seqcount - 1];
705 hctx->ccid2hctx_seqh = hctx->ccid2hctx_seqbuf;
706 hctx->ccid2hctx_seqt = hctx->ccid2hctx_seqh;
707 hctx->ccid2hctx_sent = 0;
708 hctx->ccid2hctx_rto = 3 * HZ;
709 hctx->ccid2hctx_srtt = -1;
710 hctx->ccid2hctx_rttvar = -1;
711 hctx->ccid2hctx_lastrtt = 0;
712 hctx->ccid2hctx_rpdupack = -1;
714 hctx->ccid2hctx_rtotimer.function = &ccid2_hc_tx_rto_expire;
715 hctx->ccid2hctx_rtotimer.data = (unsigned long)sk;
716 init_timer(&hctx->ccid2hctx_rtotimer);
718 ccid2_hc_tx_check_sanity(hctx);
722 static void ccid2_hc_tx_exit(struct sock *sk)
724 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
726 ccid2_hc_tx_kill_rto_timer(sk);
727 kfree(hctx->ccid2hctx_seqbuf);
728 hctx->ccid2hctx_seqbuf = NULL;
731 static void ccid2_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
733 const struct dccp_sock *dp = dccp_sk(sk);
734 struct ccid2_hc_rx_sock *hcrx = ccid2_hc_rx_sk(sk);
736 switch (DCCP_SKB_CB(skb)->dccpd_type) {
738 case DCCP_PKT_DATAACK:
739 hcrx->ccid2hcrx_data++;
740 if (hcrx->ccid2hcrx_data >= dp->dccps_r_ack_ratio) {
742 hcrx->ccid2hcrx_data = 0;
748 static struct ccid_operations ccid2 = {
750 .ccid_name = "ccid2",
751 .ccid_owner = THIS_MODULE,
752 .ccid_hc_tx_obj_size = sizeof(struct ccid2_hc_tx_sock),
753 .ccid_hc_tx_init = ccid2_hc_tx_init,
754 .ccid_hc_tx_exit = ccid2_hc_tx_exit,
755 .ccid_hc_tx_send_packet = ccid2_hc_tx_send_packet,
756 .ccid_hc_tx_packet_sent = ccid2_hc_tx_packet_sent,
757 .ccid_hc_tx_packet_recv = ccid2_hc_tx_packet_recv,
758 .ccid_hc_rx_obj_size = sizeof(struct ccid2_hc_rx_sock),
759 .ccid_hc_rx_packet_recv = ccid2_hc_rx_packet_recv,
762 module_param(ccid2_debug, int, 0444);
763 MODULE_PARM_DESC(ccid2_debug, "Enable debug messages");
765 static __init int ccid2_module_init(void)
767 return ccid_register(&ccid2);
769 module_init(ccid2_module_init);
771 static __exit void ccid2_module_exit(void)
773 ccid_unregister(&ccid2);
775 module_exit(ccid2_module_exit);
777 MODULE_AUTHOR("Andrea Bittau <a.bittau@cs.ucl.ac.uk>");
778 MODULE_DESCRIPTION("DCCP TCP-Like (CCID2) CCID");
779 MODULE_LICENSE("GPL");
780 MODULE_ALIAS("net-dccp-ccid-2");