protocol lookup tables

From: Maoke Chen
Date: Mon Feb 02 2009 - 00:37:54 EST



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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/