| #ifndef __NET_DROPDUMP_H |
| #define __NET_DROPDUMP_H |
| |
| #include <linux/types.h> |
| #include <linux/inet.h> |
| #include <linux/skbuff.h> |
| #include <linux/if_ether.h> |
| |
| static inline struct list_head *dropdump_ptype_head(const struct packet_type *pt) |
| { |
| #ifdef CONFIG_NET_SUPPORT_DROPDUMP |
| extern struct list_head ptype_log; |
| |
| if (unlikely(pt->type == htons(ETH_P_LOG))) |
| return &ptype_log; |
| #endif |
| return NULL; |
| } |
| |
| #define PACKET_NOLOG 0x00 |
| #define PACKET_NOKLOG 0x10 |
| #define PACKET_LOGED 0x20 |
| #define PACKET_DUMMY 0x80 |
| #define PACKET_IN 0x01 |
| #define PACKET_OUT 0x02 |
| |
| /* packet drop-point ID */ |
| |
| enum dropdump_drop_id { |
| NET_DROPDUMP_BASE_INPUT = 0, |
| |
| /* netfilter */ |
| NET_DROPDUMP_NETFILTER_DROP = 1, |
| NET_DROPDUMP_NETFILTER_STOLEN, |
| NET_DROPDUMP_NETFILTER_MAX, |
| |
| |
| /********************** |
| input pkt |
| ***********************/ |
| /* IPSTATS_MIB_ */ |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS = 10, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS1, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS2, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS3, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS4, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS5, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS6, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS7, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS8, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS9, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS10, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS11, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS12, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS13, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS14, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS15, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS16, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS17, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS18, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS19, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS20, |
| NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS21, |
| |
| NET_DROPDUMP_IPSTATS_MIB_INTOOBIGERRORS = 40, |
| NET_DROPDUMP_IPSTATS_MIB_INNOROUTES, |
| NET_DROPDUMP_IPSTATS_MIB_INNOROUTES1, |
| NET_DROPDUMP_IPSTATS_MIB_INNOROUTES2, |
| NET_DROPDUMP_IPSTATS_MIB_INNOROUTES3, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS1, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS2, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS3, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS4, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS5, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS6, |
| NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS7, |
| NET_DROPDUMP_IPSTATS_MIB_INUNKNOWNPROTOS, |
| NET_DROPDUMP_IPSTATS_MIB_INUNKNOWNPROTOS1, |
| |
| NET_DROPDUMP_IPSTATS_MIB_INTRUNCATEDPKTS = 60, |
| NET_DROPDUMP_IPSTATS_MIB_INTRUNCATEDPKTS1, |
| NET_DROPDUMP_IPSTATS_MIB_INTRUNCATEDPKTS2, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS1, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS2, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS3, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS4, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS5, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS6, |
| NET_DROPDUMP_IPSTATS_MIB_INDISCARDS7, |
| |
| NET_DROPDUMP_IPSTATS_MIB_CSUMERRORS = 80, |
| NET_DROPDUMP_IPSTATS_MIB_REASMFAILS, |
| NET_DROPDUMP_IPSTATS_MIB_REASMFAILS1, |
| NET_DROPDUMP_IPSTATS_MIB_REASMFAILS2, |
| NET_DROPDUMP_IPSTATS_MIB_REASMFAILS3, |
| NET_DROPDUMP_IPSTATS_MIB_REASMFAILS4, |
| NET_DROPDUMP_IPSTATS_MIB_REASMFAILS5, |
| NET_DROPDUMP_IPSTATS_MIB_IPRPFILTER, |
| |
| /* TCP_MIB_ */ |
| NET_DROPDUMP_TCP_MIB_INERRS = 100, |
| NET_DROPDUMP_TCP_MIB_INERRS1, |
| NET_DROPDUMP_TCP_MIB_INERRS2, |
| NET_DROPDUMP_TCP_MIB_INERRS3, |
| NET_DROPDUMP_TCP_MIB_INERRS4, |
| NET_DROPDUMP_TCP_MIB_INERRS5, |
| NET_DROPDUMP_TCP_MIB_INERRS6, |
| NET_DROPDUMP_TCP_MIB_INERRS7, |
| |
| NET_DROPDUMP_TCP_MIB_CSUMERRORS = 110, |
| NET_DROPDUMP_TCP_MIB_CSUMERRORS1, |
| NET_DROPDUMP_TCP_MIB_CSUMERRORS2, |
| NET_DROPDUMP_TCP_MIB_MINTTLDROP, |
| NET_DROPDUMP_TCP_MIB_MINTTLDROP1, |
| |
| |
| /* UDP_MIB_*/ |
| NET_DROPDUMP_UDP_MIB_INERRORS = 130, |
| NET_DROPDUMP_UDP_MIB_INERRORS1, |
| NET_DROPDUMP_UDP_MIB_INERRORS2, |
| NET_DROPDUMP_UDP_MIB_INERRORS3, |
| NET_DROPDUMP_UDP_MIB_INERRORS4, |
| NET_DROPDUMP_UDP_MIB_INERRORS5, |
| NET_DROPDUMP_UDP_MIB_INERRORS6, |
| NET_DROPDUMP_UDP_MIB_INERRORS7, |
| NET_DROPDUMP_UDP_MIB_INERRORS8, |
| NET_DROPDUMP_UDP_MIB_INERRORS9, |
| NET_DROPDUMP_UDP_MIB_INERRORS10, |
| NET_DROPDUMP_UDP_MIB_RCVBUFERRORS, |
| NET_DROPDUMP_UDP_MIB_CSUMERRORS, |
| NET_DROPDUMP_UDP_MIB_CSUMERRORS1, |
| NET_DROPDUMP_UDP_MIB_CSUMERRORS2, |
| NET_DROPDUMP_UDP_MIB_CSUMERRORS3, |
| NET_DROPDUMP_UDP_MIB_IGNOREDMULTI, |
| |
| |
| /* XFRM_MIB */ |
| NET_DROPDUMP_XFRM_MIB_INHDRERROR = 150, |
| NET_DROPDUMP_XFRM_MIB_INSTATEMISMATCH, |
| NET_DROPDUMP_XFRM_MIB_INPOLERROR, |
| NET_DROPDUMP_XFRM_MIB_INPOLERROR1, |
| NET_DROPDUMP_XFRM_MIB_INPOLERROR2, |
| NET_DROPDUMP_XFRM_MIB_MINNOPOLS, |
| NET_DROPDUMP_XFRM_MIB_POLICYCHECKFAIL, |
| |
| |
| /* Optional Mark */ |
| NET_DROPDUMP_OPT_CORE_BACKLOGFAIL = 160, |
| NET_DROPDUMP_OPT_CORE_BACKLOGFAIL1, |
| NET_DROPDUMP_OPT_CORE_GRODROP, |
| NET_DROPDUMP_OPT_TCP_BACKLOGDROP, |
| NET_DROPDUMP_OPT_TCP_BACKLOGDROP1, |
| NET_DROPDUMP_OPT_TCP_BACKLOGDROP2, |
| NET_DROPDUMP_OPT_TCP_V4RCVDISCARD, |
| NET_DROPDUMP_OPT_TCP_V6RCVDISCARD, |
| NET_DROPDUMP_OPT_TCP_PAWSREJECTED, |
| NET_DROPDUMP_OPT_TCP_INVALIDSEQ, |
| NET_DROPDUMP_OPT_TCP_NOTCONNECTED, |
| NET_DROPDUMP_OPT_TCP_RMEMSCHEDULEFAIL, |
| NET_DROPDUMP_OPT_TCP_OUTOFWINDOW, |
| NET_DROPDUMP_OPT_TCP_INVALIDACK, |
| NET_DROPDUMP_OPT_IP_UNKNOWNPROTO, |
| NET_DROPDUMP_OPT_IP_RCVFINISHFAIL, |
| NET_DROPDUMP_OPT_IP_TUNERROR, |
| NET_DROPDUMP_OPT_IP_TUNERROR1, |
| NET_DROPDUMP_OPT_IP_TUNERROR2, |
| NET_DROPDUMP_OPT_IP_TUNERROR3, |
| NET_DROPDUMP_OPT_IP_TUNERROR4, |
| NET_DROPDUMP_OPT_IP_TUNERROR5, |
| NET_DROPDUMP_OPT_IP_BPF, |
| NET_DROPDUMP_OPT_IP_OTHERHOST, |
| NET_DROPDUMP_OPT_UDP_UNREACH, |
| NET_DROPDUMP_OPT_UDP_UNREACH1, |
| |
| |
| |
| /********************** |
| output pkt |
| ***********************/ |
| NET_DROPTDUMP_BASE_OUTPUT = 190, |
| |
| /* Optional Mark */ |
| NET_DROPDUMP_OPT_MIF_TXFAIL = 190, |
| |
| /* SNMP Mark */ |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS = 200, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS1, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS2, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS3, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS4, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS5, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS6, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS7, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS8, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS9, |
| NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS10, |
| |
| NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES = 225, |
| NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES1, |
| NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES2, |
| NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES3, |
| NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES4, |
| NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES5, |
| |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS = 240, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS1, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS2, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS3, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS4, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS5, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS6, |
| NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS7, |
| |
| NET_DROPDUMP_CUSTOM_END = 255 |
| }; |
| |
| static const char * const dropdump_drop_str[] = { |
| /* strlen have to under 32 */ |
| [NET_DROPDUMP_BASE_INPUT] = "NOT_DEFINED", |
| [NET_DROPDUMP_NETFILTER_DROP] = "NETFILTER_DROP", |
| [NET_DROPDUMP_NETFILTER_STOLEN] = "NETFILTER_STOLEN", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS] = "IP_INHDRERR", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS1] = "IP_INHDRERR1", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS2] = "IP_INHDRERR2", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS3] = "IP_INHDRERR3", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS4] = "IP_INHDRERR4", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS5] = "IP_INHDRERR5", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS6] = "IP_INHDRERR6", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS7] = "IP_INHDRERR7", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS8] = "IP_INHDRERR8", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS9] = "IP_INHDRERR9", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS10] = "IP_INHDRERR10", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS11] = "IP_INHDRERR11", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS12] = "IP_INHDRERR12", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS13] = "IP_INHDRERR13", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS14] = "IP_INHDRERR14", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS15] = "IP_INHDRERR15", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS16] = "IP_INHDRERR16", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS17] = "IP_INHDRERR17", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS18] = "IP_INHDRERR18", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS19] = "IP_INHDRERR19", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS20] = "IP_INHDRERR20", |
| [NET_DROPDUMP_IPSTATS_MIB_INHDRERRORS21] = "IP_INHDRERR21", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_INTOOBIGERRORS] = "IP_INTOOBIGERR", |
| [NET_DROPDUMP_IPSTATS_MIB_INNOROUTES] = "IP_INNOROUTES", |
| [NET_DROPDUMP_IPSTATS_MIB_INNOROUTES1] = "IP_INNOROUTES1", |
| [NET_DROPDUMP_IPSTATS_MIB_INNOROUTES2] = "IP_INNOROUTES2", |
| [NET_DROPDUMP_IPSTATS_MIB_INNOROUTES3] = "IP_INNOROUTES3", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS] = "IP_INADDRERR", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS1] = "IP_INADDRERR1", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS2] = "IP_INADDRERR2", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS3] = "IP_INADDRERR3", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS4] = "IP_INADDRERR4", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS5] = "IP_INADDRERR5", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS6] = "IP_INADDRERR6", |
| [NET_DROPDUMP_IPSTATS_MIB_INADDRERRORS7] = "IP_INADDRERR7", |
| [NET_DROPDUMP_IPSTATS_MIB_INUNKNOWNPROTOS] = "IP_INUNKNOWNPROTOS", |
| [NET_DROPDUMP_IPSTATS_MIB_INUNKNOWNPROTOS1] = "IP_INUNKNOWNPROTOS1", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_INTRUNCATEDPKTS] = "IP_INTRUNCATEDPKTS", |
| [NET_DROPDUMP_IPSTATS_MIB_INTRUNCATEDPKTS1] = "IP_INTRUNCATEDPKTS1", |
| [NET_DROPDUMP_IPSTATS_MIB_INTRUNCATEDPKTS2] = "IP_INTRUNCATEDPKTS2", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS] = "IP_INDISCARDS", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS1] = "IP_INDISCARDS1", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS2] = "IP_INDISCARDS2", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS3] = "IP_INDISCARDS3", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS4] = "IP_INDISCARDS4", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS5] = "IP_INDISCARDS5", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS6] = "IP_INDISCARDS6", |
| [NET_DROPDUMP_IPSTATS_MIB_INDISCARDS7] = "IP_INDISCARDS7", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_CSUMERRORS] = "IP_CSUMERRORS", |
| [NET_DROPDUMP_IPSTATS_MIB_REASMFAILS] = "IP_REASMFAILS", |
| [NET_DROPDUMP_IPSTATS_MIB_REASMFAILS1] = "IP_REASMFAILS1", |
| [NET_DROPDUMP_IPSTATS_MIB_REASMFAILS2] = "IP_REASMFAILS2", |
| [NET_DROPDUMP_IPSTATS_MIB_REASMFAILS3] = "IP_REASMFAILS3", |
| [NET_DROPDUMP_IPSTATS_MIB_REASMFAILS4] = "IP_REASMFAILS4", |
| [NET_DROPDUMP_IPSTATS_MIB_REASMFAILS5] = "IP_REASMFAILS5", |
| [NET_DROPDUMP_IPSTATS_MIB_IPRPFILTER] = "IP_IPRPFILTER", |
| |
| [NET_DROPDUMP_TCP_MIB_INERRS] = "TCP_INERR", |
| [NET_DROPDUMP_TCP_MIB_INERRS1] = "TCP_INERR1", |
| [NET_DROPDUMP_TCP_MIB_INERRS2] = "TCP_INERR2", |
| [NET_DROPDUMP_TCP_MIB_INERRS3] = "TCP_INERR3", |
| [NET_DROPDUMP_TCP_MIB_INERRS4] = "TCP_INERR4", |
| [NET_DROPDUMP_TCP_MIB_INERRS5] = "TCP_INERR5", |
| [NET_DROPDUMP_TCP_MIB_INERRS6] = "TCP_INERR6", |
| [NET_DROPDUMP_TCP_MIB_INERRS7] = "TCP_INERR7", |
| |
| [NET_DROPDUMP_TCP_MIB_CSUMERRORS] = "TCP_CSUMERRS", |
| [NET_DROPDUMP_TCP_MIB_CSUMERRORS1] = "TCP_CSUMERRS1", |
| [NET_DROPDUMP_TCP_MIB_CSUMERRORS2] = "TCP_CSUMERRS2", |
| [NET_DROPDUMP_TCP_MIB_MINTTLDROP] = "TCP_MINTTLDROP", |
| [NET_DROPDUMP_TCP_MIB_MINTTLDROP1] = "TCP_MINTTLDROP1", |
| |
| [NET_DROPDUMP_UDP_MIB_INERRORS] = "UDP_INERR", |
| [NET_DROPDUMP_UDP_MIB_INERRORS1] = "UDP_INERR1", |
| [NET_DROPDUMP_UDP_MIB_INERRORS2] = "UDP_INERR2", |
| [NET_DROPDUMP_UDP_MIB_INERRORS3] = "UDP_INERR3", |
| [NET_DROPDUMP_UDP_MIB_INERRORS4] = "UDP_INERR4", |
| [NET_DROPDUMP_UDP_MIB_INERRORS5] = "UDP_INERR5", |
| [NET_DROPDUMP_UDP_MIB_INERRORS6] = "UDP_INERR6", |
| [NET_DROPDUMP_UDP_MIB_INERRORS7] = "UDP_INERR7", |
| [NET_DROPDUMP_UDP_MIB_INERRORS8] = "UDP_INERR8", |
| [NET_DROPDUMP_UDP_MIB_INERRORS9] = "UDP_INERR9", |
| [NET_DROPDUMP_UDP_MIB_INERRORS10] = "UDP_INERR10", |
| [NET_DROPDUMP_UDP_MIB_RCVBUFERRORS] = "UDP_RCVBUFERRS", |
| [NET_DROPDUMP_UDP_MIB_CSUMERRORS] = "UDP_CSUMERRS", |
| [NET_DROPDUMP_UDP_MIB_CSUMERRORS1] = "UDP_CSUMERRS1", |
| [NET_DROPDUMP_UDP_MIB_CSUMERRORS2] = "UDP_CSUMERRS2", |
| [NET_DROPDUMP_UDP_MIB_CSUMERRORS3] = "UDP_CSUMERRS3", |
| [NET_DROPDUMP_UDP_MIB_IGNOREDMULTI] = "UDP_IGNOREDMULTI", |
| |
| [NET_DROPDUMP_XFRM_MIB_INHDRERROR] = "XFRM_INHDRERR", |
| [NET_DROPDUMP_XFRM_MIB_INSTATEMISMATCH] = "XFRM_INSTATEMISMATCH", |
| [NET_DROPDUMP_XFRM_MIB_INPOLERROR] = "XFRM_INPOLERR", |
| [NET_DROPDUMP_XFRM_MIB_INPOLERROR1] = "XFRM_INPOLERR1", |
| [NET_DROPDUMP_XFRM_MIB_INPOLERROR2] = "XFRM_INPOLERR2", |
| [NET_DROPDUMP_XFRM_MIB_MINNOPOLS] = "XFRM_MINNOPOLS", |
| [NET_DROPDUMP_XFRM_MIB_POLICYCHECKFAIL] = "XFRM_POLICYCHECKFAIL", |
| |
| [NET_DROPDUMP_OPT_CORE_BACKLOGFAIL] = "OPT_CORE_BACKLOGFAIL", |
| [NET_DROPDUMP_OPT_CORE_BACKLOGFAIL1] = "OPT_CORE_BACKLOGFAIL1", |
| [NET_DROPDUMP_OPT_CORE_GRODROP] = "OPT_CORE_GRODROP", |
| [NET_DROPDUMP_OPT_TCP_BACKLOGDROP] = "OPT_TCP_BACKLOGDROP", |
| [NET_DROPDUMP_OPT_TCP_BACKLOGDROP1] = "OPT_TCP_BACKLOGDROP1", |
| [NET_DROPDUMP_OPT_TCP_BACKLOGDROP2] = "OPT_TCP_BACKLOGDROP2", |
| [NET_DROPDUMP_OPT_TCP_V4RCVDISCARD] = "OPT_TCP_V4RCVDISCARD", |
| [NET_DROPDUMP_OPT_TCP_V6RCVDISCARD] = "OPT_TCP_V6RCVDISCARD", |
| [NET_DROPDUMP_OPT_TCP_PAWSREJECTED] = "OPT_TCP_PAWSREJECTED", |
| [NET_DROPDUMP_OPT_TCP_INVALIDSEQ] = "OPT_TCP_INVALIDSEQ", |
| [NET_DROPDUMP_OPT_TCP_NOTCONNECTED] = "OPT_TCP_NOTCONNECTED", |
| [NET_DROPDUMP_OPT_TCP_RMEMSCHEDULEFAIL] = "OPT_TCP_RMEMSCHEDULEFAIL", |
| [NET_DROPDUMP_OPT_TCP_OUTOFWINDOW] = "OPT_TCP_OUTOFWINDOW", |
| [NET_DROPDUMP_OPT_TCP_INVALIDACK] = "OPT_TCP_INVALIDACK", |
| [NET_DROPDUMP_OPT_IP_UNKNOWNPROTO] = "OPT_IP_UNKNOWNPROTO", |
| [NET_DROPDUMP_OPT_IP_RCVFINISHFAIL] = "OPT_IP_RCVFINISHFAIL", |
| [NET_DROPDUMP_OPT_IP_TUNERROR] = "OPT_IP_TUNERR", |
| [NET_DROPDUMP_OPT_IP_TUNERROR1] = "OPT_IP_TUNERR1", |
| [NET_DROPDUMP_OPT_IP_TUNERROR2] = "OPT_IP_TUNERR2", |
| [NET_DROPDUMP_OPT_IP_TUNERROR3] = "OPT_IP_TUNERR3", |
| [NET_DROPDUMP_OPT_IP_TUNERROR4] = "OPT_IP_TUNERR4", |
| [NET_DROPDUMP_OPT_IP_TUNERROR5] = "OPT_IP_TUNERR5", |
| [NET_DROPDUMP_OPT_IP_BPF] = "OPT_IP_BPFERR", |
| [NET_DROPDUMP_OPT_IP_OTHERHOST] = "OPT_IP_OTHERHOST", |
| [NET_DROPDUMP_OPT_UDP_UNREACH] = "OPT_UDP_UNREACH", |
| [NET_DROPDUMP_OPT_UDP_UNREACH1] = "OPT_UDP_UNREACH1", |
| |
| [NET_DROPDUMP_OPT_MIF_TXFAIL] = "OPT_MIF_TXFAIL", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS] = "IP_OUTDISCARDS", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS1] = "IP_OUTDISCARDS1", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS2] = "IP_OUTDISCARDS2", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS3] = "IP_OUTDISCARDS3", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS4] = "IP_OUTDISCARDS4", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS5] = "IP_OUTDISCARDS5", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS6] = "IP_OUTDISCARDS6", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS7] = "IP_OUTDISCARDS7", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS8] = "IP_OUTDISCARDS8", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS9] = "IP_OUTDISCARDS9", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTDISCARDS10] = "IP_OUTDISCARDS10", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES] = "IP_OUTNOROUTES", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES1] = "IP_OUTNOROUTES1", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES2] = "IP_OUTNOROUTES2", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES3] = "IP_OUTNOROUTES3", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES4] = "IP_OUTNOROUTES4", |
| [NET_DROPDUMP_IPSTATS_MIB_OUTNOROUTES5] = "IP_OUTNOROUTES5", |
| |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS] = "IP_FRAGFAILS", |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS1] = "IP_FRAGFAILS1", |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS2] = "IP_FRAGFAILS2", |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS3] = "IP_FRAGFAILS3", |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS4] = "IP_FRAGFAILS4", |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS5] = "IP_FRAGFAILS5", |
| [NET_DROPDUMP_IPSTATS_MIB_FRAGFAILS6] = "IP_FRAGFAILS6", |
| |
| [NET_DROPDUMP_CUSTOM_END] = "NOT_DEFINED", |
| }; |
| |
| #ifdef CONFIG_NET_SUPPORT_DROPDUMP |
| #define DROPDUMP_QUEUE_SKB(skb, id) do { if (skb) {skb->dropid = id;} } while(0) |
| #define DROPDUMP_QPCAP_SKB(skb, id) do { if (skb) {skb->dropid = id; skb->dropmask |= PACKET_NOKLOG;} } while(0) |
| |
| #define DROPDUMP_CLEAR_SKB(skb) do { if (skb) {skb->dropmask = PACKET_NOLOG;} } while (0) |
| #define DROPDUMP_CHECK_SKB(skb) do { if (skb && !skb->dropid) skb->dropmask = PACKET_NOLOG; } while(0) |
| |
| extern int netdev_support_dropdump; |
| extern void dropdump_queue(struct sk_buff *skb); |
| extern bool dropdump_queue_skb(struct sk_buff *skb); |
| #else |
| #define DROPDUMP_QUEUE_SKB(skb, id) {} |
| #define DROPDUMP_QPCAP_SKB(skb, id) {} |
| |
| #define DROPDUMP_CLEAR_SKB(skb) {} |
| #define DROPDUMP_CHECK_SKB(skb) {} |
| |
| #define dropdump_queue(skb) {} |
| #define dropdump_queue_skb(skb) {} |
| #endif |
| |
| #endif //__NET_DROPDUMP_H |