blob: 64f5191999418d75fe46430bd7238345336d221f [file] [log] [blame]
/* * Copyright (c) 2011 Qualcomm Atheros, Inc. * */
#ifndef _FAST_NAT_H
#define _FAST_NAT_H
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/udp.h>
#include <linux/tcp.h>
#include <linux/icmp.h>
#include <net/ip.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_arp.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter/xt_multiport.h>
#include <linux/netfilter/xt_iprange.h>
#include <linux/netfilter/nf_conntrack_tcp.h>
#include <net/checksum.h>
#include <net/dsfield.h>
#include <net/route.h>
#include <net/netfilter/nf_nat.h>
#include <net/netfilter/nf_nat_core.h>
#include <net/netfilter/nf_nat_rule.h>
#include <net/netfilter/nf_conntrack_helper.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <net/SI/fast_common.h>
#include <net/SI/pkt_lost_track.h>
/******************************ºê¶¨Òå***********************/
/******************************ºê¶¨Òå***********************/
/******************************ºê¶¨Òå***********************/
/******************************½á¹¹Ì嶨Òå***********************/
/******************************½á¹¹Ì嶨Òå***********************/
/******************************½á¹¹Ì嶨Òå***********************/
typedef struct ack_delay_stats_s{
unsigned long total_count; //×ÓÍø·¢Ë͸øÍâÍø¿ÚµÄ¶Ìack×ܸöÊý
unsigned long forword_count; //ÕæÕý·¢Ë͸øÍâÍø¿ÚµÄ¶Ìack±¨ÎĸöÊý
unsigned long drop_count; //Ö÷¶¯¶ªÆúµÄ¶Ìack±¨ÎĸöÊý
unsigned long timeout_xmit_count; //ack³¬Ê±ºó³ö·¢µÄ¶Ìack·¢Ë͸öÊý
unsigned long timeout_drop_count; //ûÓÐʵ¼ÊÒâÒ壬½¨ÒéÈ¥³ý
}ack_delay_stats_t;
/******************************±äÁ¿ÉùÃ÷***********************/
/******************************±äÁ¿ÉùÃ÷***********************/
/******************************±äÁ¿ÉùÃ÷***********************/
extern spinlock_t fastnat_spinlock; //×ÔÐýËø£¬±£»¤Á´±íµÄ²Ù×÷
extern fast_list_t working_list;
extern struct hlist_nulls_head *working_hash;
extern traverse_command_t timeout_cmd;
extern struct ack_delay_stats_s ack_delay_stats;
extern int ackdrop_maxnum;
extern int ackdrop_tick_num;
extern int fastnat_ack_param;
/******************************½Ó¿ÚÉùÃ÷***********************/
/******************************½Ó¿ÚÉùÃ÷***********************/
/******************************½Ó¿ÚÉùÃ÷***********************/
int fast_nat_get_tuple(struct sk_buff *skb, struct nf_conntrack_tuple *tuple);
int fast_nat_recv(struct sk_buff *skb);
unsigned int napt_handle(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out, int (*okfn) (struct sk_buff *));
int ackfilter(struct sk_buff *skb, fast_entry_t *nat_entry, fast_list_t *list_head);
int tcpack_timeout(fast_entry_t *entry, unsigned long *next_schedule, int *set_next);
int tcpack_rel(fast_entry_t *entry);
#endif //_FAST_NAT_H