protocol lookup tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux