summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files/include/net/rtl/rtl865x_localPublic.h
blob: 8d638ada81b7844a64fdab3085b5ee2362bf8449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef RTL865X_LOCAL_PUBLIC_H
#define RTL865X_LOCAL_PUBLIC_H

#if defined(CONFIG_RTL_HW_QOS_SUPPORT)
#include <common/rtl865x_netif.h>
#endif

#define FROM_LOCAL_PUBLIC	1
#define TO_LOCAL_PUBLIC		2	
#define RX_LAN_PACKET	1
#define RX_WAN_PACKET	2
#define TX_LAN_PACKET	3
#define TX_WAN_PACKET	4

#define MAX_HW_LOCAL_PUBLIC_NUM 2
#define DEF_LOCAL_PUBLIC_NUM	32
#define MAX_LOCAL_PUBLIC_NUM	32

#define LOCAL_PUBLIC_VLAN_START 	3198
#define LOCAL_PUBLIC_VLAN_END		4094
#define MCAST_NETIF_VLAN_ID		3197	

struct rtl865x_localPublic
{
	unsigned int ipAddr;
	unsigned int netMask;
	unsigned int defGateway;
	unsigned int hw;
	unsigned int inAsic;
	
	unsigned char port;
	unsigned char mac[6];
	unsigned char dev[16];
	
	unsigned char lpNetif[16];
	unsigned int lpVid;
	unsigned char defGwMac[6];
	
	//must at the tail...
	struct 
	{								
		struct rtl865x_localPublic *tqe_next;	
		struct rtl865x_localPublic**tqe_prev;
	}next;
	
};

#if defined(CONFIG_RTL_PUBLIC_SSID)
struct rtl865x_public_ssid_entry
{
	struct list_head list;
	unsigned int public_addr;
	unsigned int flags;
};
#endif
	
struct rtl865x_pktInfo
{
	/*input parameter*/
	unsigned char *data;
	unsigned char port;
	unsigned char action;
	unsigned char dev[16];
	
	/*output parameter*/
	unsigned char *arpHdr;
	unsigned char *ipHdr;
	unsigned char fromLocalPublic;
	unsigned char toLocalPublic;
	unsigned int srcIp;
	unsigned int dstIp;
};

struct rtl865x_localPublicPara
{
	unsigned int maxEntryNum;
};

struct rtl865x_interface_info
{
	unsigned char 			ifname[16];
	unsigned char 			isWan;
	unsigned short			if_type;
	unsigned short			vid;
	unsigned short			fid;
	unsigned int				memPort;
	unsigned int				untagSet;
	unsigned int				mtu;
};

int rtl865x_initLocalPublic(struct rtl865x_localPublicPara* para);

int rtl865x_reInitLocalPublic(void);

int rtl865x_addLocalPublic(struct rtl865x_localPublic* newEntry);

int rtl865x_delLocalPublic(struct rtl865x_localPublic* delEntry);

int rtl865x_checkLocalPublic(struct rtl865x_pktInfo *pktInfo);

int rtl865x_isLocalPublicIp(unsigned int ipAddr);

int rtl865x_getLocalPublicInfo(unsigned int ipAddr, struct rtl865x_localPublic  *localPublicInfo);

int rtl865x_localPublicEnabled(void);
int rtl865x_getLocalPublicMac(unsigned int ip, unsigned char mac[]);
int rtl865x_getAllLocalPublic(struct rtl865x_localPublic localPublicArray[], int arraySize);
#if defined(CONFIG_RTL_HW_QOS_SUPPORT)
int rtl_checkLocalPublicNetifIngressRule(rtl865x_AclRule_t *rule);
#endif
#if defined(CONFIG_RTL_PUBLIC_SSID)
int rtl865x_is_public_ssid_entry(unsigned int ipAddr);
int rtl865x_from_public_ssid_device(unsigned char *name);
#endif

int rtl865x_setMCastSrcMac(unsigned char *srcMac);
#endif