Messages in this thread | | | From | Maoke Chen <> | Subject | protocol lookup tables | Date | Mon, 2 Feb 2009 14:37:38 +0900 |
| |
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
| |