1 struct net_proto_family { 2 int family; 3 int (*create)(struct net *net, struct socket *sock, int protocol); 4 struct module *owner; 5 }; 6 "include/linux/net.h" 365 lines 7 8 9 struct packet_sock { 10 /* struct sock has to be the first member of packet_sock */ 11 struct sock sk; 12 struct tpacket_stats stats; 13 #ifdef CONFIG_PACKET_MMAP 14 struct packet_ring_buffer rx_ring; 15 struct packet_ring_buffer tx_ring; 16 int copy_thresh; 17 #endif 18 struct packet_type prot_hook; 19 spinlock_t bind_lock; 20 struct mutex pg_vec_lock; 21 unsigned int running:1, /* prot_hook is attached*/ 22 auxdata:1, 23 origdev:1; 24 int ifindex; /* bound device */ 25 __be16 num; 26 struct packet_mclist *mclist; 27 #ifdef CONFIG_PACKET_MMAP 28 atomic_t mapped; 29 enum tpacket_versions tp_version; 30 unsigned int tp_hdrlen; 31 unsigned int tp_reserve; 32 unsigned int tp_loss:1; 33 #endif 34 }; 35 "./net/packet/af_packet.c" 2504 lines 36 37 struct socket { 38 socket_state state; 39 40 kmemcheck_bitfield_begin(type); 41 short type; 42 kmemcheck_bitfield_end(type); 43 44 unsigned long flags; 45 /* 46 * Please keep fasync_list & wait fields in the same cache line 47 */ 48 struct fasync_struct *fasync_list; 49 wait_queue_head_t wait; 50 51 struct file *file; 52 struct sock *sk; 53 const struct proto_ops *ops; 54 }; 55 "./include/linux/net.h" 365 lines