yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | /* * Copyright (c) 2011 Qualcomm Atheros, Inc. * */ |
| 2 | #ifndef _FAST_6_H |
| 3 | #define _FAST_6_H |
| 4 | |
| 5 | #include <linux/in.h> |
| 6 | #include <linux/ip.h> |
| 7 | #include <linux/udp.h> |
| 8 | #include <linux/tcp.h> |
| 9 | #include <linux/icmp.h> |
| 10 | #include <net/ip.h> |
| 11 | #include <linux/if_arp.h> |
| 12 | |
| 13 | #include <linux/inetdevice.h> |
| 14 | #include <linux/netfilter.h> |
| 15 | #include <linux/netfilter_ipv6.h> |
| 16 | #include <linux/netfilter_arp.h> |
| 17 | //#include <linux/netfilter_ipv4/ip_tables.h> |
| 18 | #include <linux/netfilter/xt_multiport.h> |
| 19 | #include <linux/netfilter/xt_iprange.h> |
| 20 | #include <linux/netfilter/nf_conntrack_tcp.h> |
| 21 | #include <net/checksum.h> |
| 22 | #include <net/dsfield.h> |
| 23 | #include <net/route.h> |
| 24 | #include <net/netfilter/nf_nat.h> |
| 25 | #include <net/netfilter/nf_nat_core.h> |
| 26 | #include <net/netfilter/nf_nat_rule.h> |
| 27 | #include <net/netfilter/nf_conntrack_helper.h> |
| 28 | #include <linux/module.h> |
| 29 | |
| 30 | #include <linux/proc_fs.h> |
| 31 | |
| 32 | #include <net/SI/fast_common.h> |
| 33 | |
| 34 | /* *******************************ºê¶¨Òå******************************* */ |
| 35 | /* *******************************ºê¶¨Òå******************************* */ |
| 36 | /* *******************************ºê¶¨Òå******************************* */ |
| 37 | |
| 38 | /* *****************************½á¹¹Ì嶨Òå***************************** */ |
| 39 | /* *****************************½á¹¹Ì嶨Òå***************************** */ |
| 40 | /* *****************************½á¹¹Ì嶨Òå***************************** */ |
| 41 | struct ip6_opthdr |
| 42 | { |
| 43 | unsigned char nxt; |
| 44 | unsigned char len; |
| 45 | }; |
| 46 | |
| 47 | struct ip6_hdr |
| 48 | { |
| 49 | union |
| 50 | { |
| 51 | struct ip6_hdrctl |
| 52 | { |
| 53 | uint32_t ip6_un1_flow; /* 4 bits version, 8 bits TC, |
| 54 | 20 bits flow-ID */ |
| 55 | uint16_t ip6_un1_plen; /* payload length */ |
| 56 | uint8_t ip6_un1_nxt; /* next header */ |
| 57 | uint8_t ip6_un1_hlim; /* hop limit */ |
| 58 | } ip6_un1; |
| 59 | uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits tclass */ |
| 60 | } ip6_ctlun; |
| 61 | struct in6_addr ip6_src; /* source address */ |
| 62 | struct in6_addr ip6_dst; /* destination address */ |
| 63 | }; |
| 64 | |
| 65 | #define ip6_vfc ip6_ctlun.ip6_un2_vfc |
| 66 | #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow |
| 67 | #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen |
| 68 | #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt |
| 69 | #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim |
| 70 | #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim |
| 71 | |
| 72 | /* *****************************±äÁ¿ÉùÃ÷***************************** */ |
| 73 | /* *****************************±äÁ¿ÉùÃ÷***************************** */ |
| 74 | /* *****************************±äÁ¿ÉùÃ÷***************************** */ |
| 75 | extern spinlock_t fast6_spinlock; //×ÔÐýËø£¬±£»¤Á´±íµÄ²Ù×÷ |
| 76 | extern fast_list_t working_list6 ; |
| 77 | extern struct hlist_nulls_head *working_hash6; |
| 78 | |
| 79 | /* *****************************½Ó¿ÚÉùÃ÷***************************** */ |
| 80 | /* *****************************½Ó¿ÚÉùÃ÷***************************** */ |
| 81 | /* *****************************½Ó¿ÚÉùÃ÷***************************** */ |
| 82 | int fast6_get_tuple(struct sk_buff *skb, struct nf_conntrack_tuple *tuple); |
| 83 | |
| 84 | int fast6_recv(struct sk_buff *skb); |
| 85 | |
| 86 | unsigned int napt6_handle(unsigned int hooknum, |
| 87 | struct sk_buff *skb, |
| 88 | const struct net_device *in, |
| 89 | const struct net_device *out, int (*okfn) (struct sk_buff *)); |
| 90 | |
| 91 | #endif //_FAST_6_H |
| 92 | |