1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/EN7526G_3.18Kernel_SDK/linux-3.18.21/net/ecnt_net.h
2024-07-22 01:58:46 -03:00

71 lines
1.6 KiB
C
Executable File

#ifndef _LINUX_ECNT_NET_H
#define _LINUX_ECNT_NET_H
#include <uapi/linux/in.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <net/sock.h>
#include <net/inet_sock.h>
#include <ecnt_hook/ecnt_hook.h>
/*for alg switch*/
extern int nf_conntrack_ftp_enable;
extern int nf_conntrack_sip_enable;
extern int nf_conntrack_h323_enable;
extern int nf_conntrack_rtsp_enable;
extern int nf_conntrack_l2tp_enable;
extern int nf_conntrack_ipsec_enable;
extern int nf_conntrack_pptp_enable;
extern int nf_conntrack_portscan_enable;
extern int nf_conntrack_ftp_port;
extern int nf_conntrack_esp_timeout;
static inline int ecnt_skbmark_to_sockmark_copy
(struct sock *sk, struct sk_buff *skb)
{
if ( !sk || !skb )
return ECNT_CONTINUE;
sk->sk_mark &= 0x0fffffff;
/* not change QoS info stored into sk->sk_mark */
sk->sk_mark |= (skb->mark & (~QOS_FILTER_MARK));
return ECNT_CONTINUE;
}
#if defined(TCSUPPORT_CT_VLAN_BIND)
static inline int ecnt_dns_vlanid_store
(struct inet_sock *inet, struct sock *sk, struct sk_buff *skb)
{
if ( !inet || !sk || !skb )
return ECNT_CONTINUE;
if( ( VBIND_DNSPORT == inet->inet_sport)
&& (sk->lVlanId < VBIND_INVALID_VLANID) )
{
skb->vlan_tags[0] = sk->lVlanId;
skb->vlan_tag_flag |= VLAN_TAG_FOR_DNS;
}
return ECNT_CONTINUE;
}
#endif
#if defined(TCSUPPORT_CT_QOS)
static inline int ecnt_set_qoshigh_hook
(struct sk_buff *skb)
{
/* set arp packet to first queue */
skb->mark &= (~QOS_FILTER_MARK);
skb->mark |= QOS_HH_PRIORITY;
/* printk("v4 arp packet to first queue.skb->mark is 0x%x\n", skb->mark); */
return ECNT_CONTINUE;
}
#endif
#endif