Merge branch 'master' of git.komect.net:ISG/secogateway
This commit is contained in:
commit
123c54f320
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef _DPI_TRIE_CACHE_H_
|
||||||
|
#define _DPI_TRIE_CACHE_H_
|
||||||
|
/*
|
||||||
|
* 三元组数据结构
|
||||||
|
*/
|
||||||
|
struct dpi_cache_node {
|
||||||
|
struct list_head list;
|
||||||
|
|
||||||
|
union {
|
||||||
|
struct in6_addr ip6;
|
||||||
|
struct in_addr ip4;
|
||||||
|
|
||||||
|
}ip;
|
||||||
|
|
||||||
|
__u16 proto;
|
||||||
|
__u16 port;
|
||||||
|
__u32 appid;
|
||||||
|
uint64_t uptime;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
@des:添加三元组到hash表
|
||||||
|
@input: node赋值三元组和appid
|
||||||
|
@outp: 成功:true,失败:false
|
||||||
|
*/
|
||||||
|
bool dpi_cache_node_add(struct dpi_cache_node node);
|
||||||
|
#endif
|
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef __RPDB_H__
|
||||||
|
#define __RPDB_H__
|
||||||
|
#define RPDB_ROUTE_ADD (0)
|
||||||
|
#define RPDB_ROUTE_DEL (1)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
@des:策略路由初始化
|
||||||
|
@output 成功true,错误false
|
||||||
|
*/
|
||||||
|
bool rpdb_init_route();
|
||||||
|
/*
|
||||||
|
@des
|
||||||
|
策略路由添加删除接口
|
||||||
|
@input
|
||||||
|
gateway:下一跳网关ip地址,根据此地址生成路由表和路由
|
||||||
|
tbl_name:路由表名字,不指定可以填为NULL,若指定则用tbl_name不用table_nexthop生成路由表
|
||||||
|
opt:标识是添加路由还是删除路由,RPDB_ROUTE_ADD/RPDB_ROUTE_DEL
|
||||||
|
@output
|
||||||
|
成功:返回mark值
|
||||||
|
错误: -1
|
||||||
|
*/
|
||||||
|
int rpdb_add_del_route(char* gateway,char *tbl_name,int opt);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue