tcp.c文件的tcp_enqueue_partial函数(19)
时间:2009-08-27 来源:978计划
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语句注释
此处语句比较简单,请参见1至18文章中的注释。