lkml.org 
[lkml]   [2009]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectprotocol lookup tables
Date

hi,

i'm a new comer in the Linux kernel programming. now we are doing
something with socket system calls and related data structures. i'm a
little confused with the concept "protocol lookup tables", because in
the sock.h, there are several protocol lookup tables involved with the
sock_common structure:

struct sock_common {
unsigned short skc_family;
volatile unsigned char skc_state;
unsigned char skc_reuse;
int skc_bound_dev_if;
struct hlist_node skc_node;
struct hlist_node skc_bind_node;
atomic_t skc_refcnt;
unsigned int skc_hash;
struct proto *skc_prot;
#ifdef CONFIG_NET_NS
struct net *skc_net;
#endif
};

the comment lines stated that the @skc_node stands for "main hash
linkage for various protocol tables", while the @skc_bind_node for the
"bind hash linkage for various protocol lookup tables", and so my
question is: what is the difference between the "main hash" and the
"bind hash"?

another related question is: what is the relationship between the sock
data structure and the the bind bucket (tb)? how are they playing the
role in the interactions between socket library and the protocol stack?

thanks and regards,
maoke



\
 
 \ /
  Last update: 2009-02-02 06:39    [W:0.157 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site