提交 068e2f95 编写于 作者: B Bernard Xiong

[lwIP] remove IP_INPUT_HOOK

上级 87171f00
......@@ -601,26 +601,6 @@ u32_t sys_now(void)
return rt_tick_get() * (1000 / RT_TICK_PER_SECOND);
}
/*
* lwIP IPv4 input hook
*/
#ifdef LWIP_USING_IP4INPUT_HOOK
static int (*_lwip_ip_input_hook)(struct pbuf *p, struct netif *inp) = RT_NULL;
void lwip_ip_input_set_hook(int (*hook)(struct pbuf *p, struct netif *inp))
{
_lwip_ip_input_hook = hook;
}
int lwip_ip_input_hook(struct pbuf *p, struct netif *inp)
{
if (_lwip_ip_input_hook != RT_NULL)
return _lwip_ip_input_hook(p, inp);
return 0;
}
#endif
#ifdef RT_LWIP_PPP
u32_t sio_read(sio_fd_t fd, u8_t *buf, u32_t size)
{
......
......@@ -161,12 +161,10 @@
*/
#define SYS_LIGHTWEIGHT_PROT (NO_SYS==0)
#ifdef LWIP_USING_IP4INPUT_HOOK
struct pbuf;
struct netif;
int lwip_ip_input_hook(struct pbuf *p, struct netif *inp);
#define LWIP_HOOK_IP4_INPUT lwip_ip_input_hook
#ifdef LWIP_USING_NAT
#define LWIP_NAT 1
#else
#define LWIP_NAT 0
#endif
/* ---------- TCP options ---------- */
......
......@@ -5,6 +5,6 @@ src = Glob('*.c')
CPPPATH = [cwd]
group = DefineGroup('LwIP', src, depend = ['RT_USING_LWIP', 'LWIP_USING_NAT', 'LWIP_USING_IP4INPUT_HOOK'], CPPPATH = CPPPATH)
group = DefineGroup('LwIP', src, depend = ['RT_USING_LWIP', 'LWIP_USING_NAT'], CPPPATH = CPPPATH)
Return('group')
......@@ -252,9 +252,6 @@ ip_nat_init(void)
/* we must lock scheduler to protect following code */
rt_enter_critical();
/* register to the ipv4 hook function */
lwip_ip_input_set_hook(ip_nat_input);
/* add a lwip timer for NAT */
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC, nat_timer, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册