summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files/drivers/net/rtl819x/l3Driver/rtl865x_ip.h
blob: cf62525a8107d6f3783c617c99dab92676479219 (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
/*
* Copyright c                  Realtek Semiconductor Corporation, 2008  
* All rights reserved.
* 
* Program : ip table driver
* Abstract : 
* Author : hyking (hyking_liu@realsil.com.cn)  
*/
#ifndef	RTL865X_IP_H
#define	RTL865X_IP_H

#include <net/rtl/rtl865x_ip_api.h>

#if !defined(REDUCE_MEMORY_SIZE_FOR_16M)
#define REDUCE_MEMORY_SIZE_FOR_16M
#endif
#if defined (CONFIG_RTL_LOCAL_PUBLIC)
#define IP_NUMBER	8
#else
#if defined(REDUCE_MEMORY_SIZE_FOR_16M)
#define IP_NUMBER	2
#else
#define IP_NUMBER	8
#endif
#endif

typedef struct rtl865x_ip_entry_s
{
	ipaddr_t intIp; /*internal ip address*/
	ipaddr_t extIp; /*external ip address*/
	uint32 valid:1, /*valid*/
		type:2,  /*napt/nat/ls/reserved*/
		defNaptIp:1; /*this ip entry is default napt ip address?*/

#if 1
	/*now, this information is invalid...*/
	void *nexthop; /*point to a nexthop entry,in preversion SoC, 
				     *used for multiple session hardware forwarding...
				     */	
#endif
}rtl865x_ip_entry_t;


int32 rtl865x_initIpTable(void);
int32 rtl865x_reinitIpTable(void);
//int32 rtl865x_addIp(ipaddr_t intIp, ipaddr_t extIp, uint32 ip_type);
//int32 rtl865x_delIp(ipaddr_t extIp);
int32 rtl865x_getIPIdx(rtl865x_ip_entry_t *entry, int32 *idx);
int32 rtl865x_getIpIdxByExtIp(ipaddr_t extIp, int32 *idx);


#endif