#ifndef _NET_NEIGHBOUR_H#define _NET_NEIGHBOUR_H#include<linux/neighbour.h>/* * Generic neighbour manipulation * * Authors: * Pedro Roque <roque@di.fc.ul.pt> * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> * * Changes: * * Harald Welte: <laforge@gnumonks.org> * - Add neighbour cache statistics like rtstat */#include<asm/atomic.h>#include<linux/netdevice.h>#include<linux/skbuff.h>#include<linux/rcupdate.h>#include<linux/seq_file.h>#include<linux/err.h>#include<linux/sysctl.h>#include<linux/workqueue.h>#include<net/rtnetlink.h>/* * NUD stands for "neighbor unreachability detection" */#define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_REACHABLE|NUD_DELAY|NUD_PROBE)#define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)#define NUD_CONNECTED (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE)structneighbour;structneigh_parms{#ifdef CONFIG_NET_NSstructnet*net;#endifstructnet_device*dev;structneigh_parms*next;int(*neigh_setup)(structneighbour*);void(*neigh_cleanup)(structneighbour*);structneigh_table*tbl;void*sysctl_table;intdead;atomic_trefcnt;structrcu_headrcu_head;intbase_reachable_time;intretrans_time;intgc_staletime;intreachable_time;intdelay_probe_time;intqueue_len;intucast_probes;intapp_probes;intmcast_probes;intanycast_delay;intproxy_delay;intproxy_qlen;intlocktime;};structneigh_statistics{unsignedlongallocs;/* number of allocated neighs */unsignedlongdestroys;/* number of destroyed neighs */unsignedlonghash_grows;/* number of hash resizes */unsignedlongres_failed;/* number of failed resolutions */unsignedlonglookups;/* number of lookups */unsignedlonghits;/* number of hits (among lookups) */unsignedlongrcv_probes_mcast;/* number of received mcast ipv6 */unsignedlongrcv_probes_ucast;/* number of received ucast ipv6 */unsignedlongperiodic_gc_runs;/* number of periodic GC runs */unsignedlongforced_gc_runs;/* number of forced GC runs */unsignedlongunres_discards;/* number of unresolved drops */};#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)structneighbour{structneighbour__rcu*next;structneigh_table*tbl;structneigh_parms*parms;unsignedlongconfirmed;unsignedlongupdated;rwlock_tlock;atomic_trefcnt;structsk_buff_headarp_queue;structtimer_listtimer;unsignedlongused;atomic_tprobes;__u8flags;__u8nud_state;__u8type;__u8dead;seqlock_tha_lock;unsignedcharha[ALIGN(MAX_ADDR_LEN,sizeof(unsignedlong))];structhh_cache*hh;int(*output)(structsk_buff*skb);conststructneigh_ops*ops;structrcu_headrcu;structnet_device*dev;u8primary_key[0];};structneigh_ops{intfamily;void(*solicit)(structneighbour*,structsk_buff*);void(*error_report)(structneighbour*,structsk_buff*);