分类: LINUX
2014-06-24 11:39:31
netfilet_bridge.h 中定义
|/* Bridge Hooks */
/* After promisc drops, checksum checks. */#define NF_BR_PRE_ROUTING 0/* If the packet is destined for this box. */#define NF_BR_LOCAL_IN 1/* If the packet is destined for another interface. */#define NF_BR_FORWARD 2/* Packets coming from a local process. */#define NF_BR_LOCAL_OUT 3/* Packets about to hit the wire. */#define NF_BR_POST_ROUTING 4/* Not really a hook, but used for the ebtables broute table */#define NF_BR_BROUTING 5#define NF_BR_NUMHOOKS 6
钩子协议类型(pf) : NFPROTO_BRIDGE netfilet.h中定义或者 AF_BRIDGE socket.h(include/linux) 中定义 两者值相等
netfilet_arp.h 中定义
|/* ARP Hooks */#define NF_ARP_IN 0#define NF_ARP_OUT 1#define NF_ARP_FORWARD 2#define NF_ARP_NUMHOOKS 3
钩子协议类型(pf):NFPROTO_ARP netfilet.h中定义
netfilet_ipv4.h中定义
/* IP Hooks *//* After promisc drops, checksum checks. */#define NF_IP_PRE_ROUTING 0/* If the packet is destined for this box. */#define NF_IP_LOCAL_IN 1/* If the packet is destined for another interface. */#define NF_IP_FORWARD 2/* Packets coming from a local process. */#define NF_IP_LOCAL_OUT 3/* Packets about to hit the wire. */#define NF_IP_POST_ROUTING 4#define NF_IP_NUMHOOKS 5
钩子协议类型(pf) : NFPROTO_IPV4 netfilet.h中定义或者 AF_INET socket.h(include/linux) 中定义 两者值相等
netfilet_ip6.h中定义/* IP6 Hooks *//* After promisc drops, checksum checks. */#define NF_IP6_PRE_ROUTING 0/* If the packet is destined for this box. */#define NF_IP6_LOCAL_IN 1/* If the packet is destined for another interface. */#define NF_IP6_FORWARD 2/* Packets coming from a local process. */#define NF_IP6_LOCAL_OUT 3/* Packets about to hit the wire. */#define NF_IP6_POST_ROUTING 4#define NF_IP6_NUMHOOKS 5
钩子协议类型(pf) : NFPROTO_IPV6 netfilet.h中定义或者 AF_INET6 socket.h(include/linux) 中定义 两者值相等
钩子号称或者用如下名称:
|在netfilter.h中定义enum nf_inet_hooks {NF_INET_PRE_ROUTING,NF_INET_LOCAL_IN,NF_INET_FORWARD,NF_INET_LOCAL_OUT,NF_INET_POST_ROUTING,NF_INET_NUMHOOKS};该值与IPV4和IPV6的钩子号相等(IPV4和IPV6的钩子号相等,但钩子协议号不同)