Chinaunix首页 | 论坛 | 博客
  • 博客访问: 154533
  • 博文数量: 41
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 425
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-14 10:16
文章分类
文章存档

2011年(1)

2010年(5)

2009年(35)

我的朋友

分类: LINUX

2009-08-27 10:34:27

tcp.c文件的tcp_enqueue_partial函数

978计划工作组 2009-8-27

1函数源码

/*

 *     Queue a partial frame

 */

 

void tcp_enqueue_partial(struct sk_buff * skb, struct sock * sk)

{

         struct sk_buff * tmp;

         unsigned long flags;

 

         save_flags(flags);

         cli();

         tmp = sk->partial;

         if (tmp)

                   del_timer(&sk->partial_timer);

         sk->partial = skb;

         init_timer(&sk->partial_timer);

         /*

          *     Wait up to 1 second for the buffer to fill.

          */

         sk->partial_timer.expires = HZ;

         sk->partial_timer.function = (void (*)(unsigned long)) tcp_send_partial;

         sk->partial_timer.data = (unsigned long) sk;

         add_timer(&sk->partial_timer);

         restore_flags(flags);

         if (tmp)

                   tcp_send_skb(sk, tmp);

}

2函数用途

负责将入参的skb增加到partial对列中,如partial对列中已有数据则将其通过调用tcp_send_skb函数发送出去。

3调用关系

tcp_write

|__tcp_enqueue_partial

|__tcp_send_partial

        |__tcp_dequeue_partial ->tcp_send_skb

4语句注释

此处语句比较简单,请参见118文章中的注释。

阅读(1303) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~