as before neighborhood subsystem initialization, linux source code version 2.6.21void __init arp_init (void) (net /ipv4 /arp.c) {//neighbor table initialization neigh_table_init (& arp_tbl); //Register arp protocol dev_add_pack (& amp; arp_packet_type); //establish proc objects arp_proc_init (); # ifdef CONFIG_SYSCTLneigh_sysctl_register (NULL, & arp_tbl.parms, NET_IPV4, NET_IPV4_NEIGH, " ipv4 " , NULL); #endif //event notification list register_netdevice_notifier (& arp_netdev_notifier); } In neigh_table_init (& arp_tbl);, the neighbor table is initialized accordingly, in particular, a garbage collection timer is initialized. The content of the discussion arp_packet_type is: static struct packet_type arp_packet_type = {.type = __constant_htons(ETH_P_ARP), (protocol number corresponding to the link layer). func = arp_rcv, "packet processing function" can be seen from above out, when receiving the data arp packet, () treated with five arp_rcv: neighbor system data structure analysis neigh_table structure: struct neigh_table {//a next neighbor struct neigh_table * next; //protocol stack int family; //inlet length, i.e. the size of a neighbor structure is initialized to sizeof (neighbour) +4 (4 for the length of an IP address) int entry_size; //key hash value of a length that is the length of an IP address for 4int key_len; //Ha The count function of the hash value (the hash value is calculated by the corresponding device net_device and the destination Ip) __u32 (*hash) (const void *pkey, const struct net_device *); //neighbor initialization function int (*constructor) (struct Neighbor *);int (*pconstructor)(struct pneigh_entry *);void (*pdestructor)(struct pneigh_entry *);void (*proxy_redo)(struct sk_buff *skb);//The name of the neighbor table char *id;struct Neigh_parms parms;/* HACK. gc_* shoul follow parms without a gap! *///regular garbage collection int gc_interval; int gc_thresh1; //second threshold, if the neighbor exceeds this value, when creating a new neighbor If /if there is no refresh for more than five seconds, it must be refreshed immediately, forcing garbage collection int gc_thresh2; //allow the upper limit of the neighbor int gc_thresh3; //recent refresh time unsigned long last_flush; //regular garbage collection timer struct timer_list gc_timer ;struct timer_list proxy_timer;struct sk_buff_head proxy_queue;//number of neighbors in the entire table int entries;rwlock_t lock;unsigned long last_rand;struct neigh_parms *parms_list;kmem_cache_t *kmem_cachep;struct neigh_statistics *stats;//Hash array, stored in Neighbor struct neighbour **hash_buckets;//Hash array size mask unsigned int hash_mask;__u32 hash_rnd;unsigned int hash_chain_gc;//related to proxy arp struct pneigh_entry **phash_buckets;#ifdef CONFIG_PROC_FSstruct proc_dir_entry *pde;#endif} Neighbour structure: struct neighbour{//next neighbor struct neighbou r *next; //where the neighbor table struct neigh_table * tbl; //arp transfer parameter struct neigh_parms * parms; //neighbors corresponding network device struct net_device * dev; //last use time unsigned long used; unsigned long Confirmed; //update time unsigned long updated; __u8 flags; //neighbors corresponding state __u8 nud_state; __u8 type; //survival flag, if dead is 1, then the garbage collection function will delete this item __u8 dead; //Retry the number of times to send arp request atomic_t probes; rwlock_t lock; //corresponding neighbor's header cache unsigned char ha [(MAX_ADDR_LEN + sizeof (unsigned long) -1) & ~ (sizeof (unsigned long) -1) Struct hh_cache *hh; //reference count atomic_t refcnt; //neighbor corresponding to the send function int (*output) (struct sk_buff * skb); //corresponding send skb queue struct sk_buff_head arp_queue; //timer struct Timer_list timer;struct neigh_ops *ops;//hash keyword u8 primary_key[0];};
single, enter single-user mode, then change the startup mode to id:3:initdefault: in /etc/inittab (t
In order to ensure the normal operation of the Linux system and accurately solve various system prob
Ext2Fsd is a good tool for reading and writing Linux partitions. This software is introduced in the
Too many open files Errors are common faults in Linux systems. Solutions can be easily found on the
How to install bt5 - bt5 combat installation tutorial under windows8 system
Linux startup script learning tutorial
Linux rz transfer large files why it crashes
Linux prompt bash:command not found
Use of svn command under linux
Linux Internet settings classic
AMH VPS control panel always fails to log in. The password is not registered.
Quick Win7 and 8.x remove gadgets for Windows 10 upgrade notifications download
3 ways to lock the computer under XP
Large capacity hard disk typical partitioning scheme
Linux background running and closing, view background tasks
Win10 preview version of the blue screen how to do
Is the computer streaking? How do the Win8 computer streaking?
How to create restore points in Windows 8
Let the Win7 desktop display multiple clocks in the lower right corner.