diff options
| author | Qiuwen Lu <[email protected]> | 2017-05-03 22:15:41 +0800 |
|---|---|---|
| committer | Qiuwen Lu <[email protected]> | 2017-05-03 22:15:41 +0800 |
| commit | fac2798e64708a83a5624df2ab3bd93ad021ee0c (patch) | |
| tree | 7c2f57813fc643d63443f135b195330ce78bbdd5 /app/include | |
| parent | c045d9d7a30e935301325772e50ea96f011207dc (diff) | |
重构Sendpath部分,增加多种Sendpath的统一接口。支持对Sendpath进行选项设置。重构快速发包路径。
Diffstat (limited to 'app/include')
| -rw-r--r-- | app/include/sendpath.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/app/include/sendpath.h b/app/include/sendpath.h index a9b3bac..b38b1fe 100644 --- a/app/include/sendpath.h +++ b/app/include/sendpath.h @@ -5,13 +5,22 @@ typedef int(*fn_layer_construct_t)(struct mr_sendpath * sendpath, struct rte_mbuf * mbuf[], unsigned int nr_mbuf); typedef int(*fn_requery_t)(struct mr_sendpath * sendpath); +typedef int(*fn_option_set_t)(struct mr_instance * instance, struct mr_sendpath * sendpath, int opt, va_list va_list); +typedef int(*fn_option_get_t)(struct mr_instance * instance, struct mr_sendpath * sendpath, int opt, va_list va_list); +typedef void(*fn_destory_t)(struct mr_sendpath * sendpath); struct mr_sendpath { - unsigned int sendpath_type; + enum mr_sendpath_type sendpath_type; unsigned int create_time; unsigned int can_use; + /* 选项设置回调函数 */ + fn_option_set_t fn_option_set; + /* 选项读取回调函数 */ + fn_option_get_t fn_option_get; + /* 销毁回调函数 */ + fn_destory_t fn_destory; /* 重查询回调函数 */ fn_requery_t fn_requery; /* 二层负载构建函数 */ @@ -25,15 +34,25 @@ struct mr_sendpath struct vdev_instance * target_vdi; /* Instance */ struct mr_instance * instance; +}; - /* 二层构建参数 */ - struct ether_addr src_eth_addr; - struct ether_addr dst_eth_addr; +struct __mr_sendpath_vdev +{ + struct mr_sendpath _father; +}; - /* 三层构建参数 */ +struct __mr_sendpath_route +{ + struct mr_sendpath _father; + + /* 三层报文构建信息 */ struct in_addr src_addr; struct in_addr dst_addr; - /* 重查询参数 */ + /* 二层报文构建信息 */ + struct ether_addr src_eth_addr; + struct ether_addr dst_eth_addr; + + /* 重查询使用的目标IP地址 */ struct in_addr target_addr; };
\ No newline at end of file |
