mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 01:15:26 +08:00
[lwIP] remove IP_INPUT_HOOK
This commit is contained in:
parent
87171f003c
commit
068e2f95a1
@ -601,26 +601,6 @@ u32_t sys_now(void)
|
|||||||
return rt_tick_get() * (1000 / RT_TICK_PER_SECOND);
|
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
|
#ifdef RT_LWIP_PPP
|
||||||
u32_t sio_read(sio_fd_t fd, u8_t *buf, u32_t size)
|
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)
|
#define SYS_LIGHTWEIGHT_PROT (NO_SYS==0)
|
||||||
|
|
||||||
#ifdef LWIP_USING_IP4INPUT_HOOK
|
#ifdef LWIP_USING_NAT
|
||||||
struct pbuf;
|
#define LWIP_NAT 1
|
||||||
struct netif;
|
#else
|
||||||
int lwip_ip_input_hook(struct pbuf *p, struct netif *inp);
|
#define LWIP_NAT 0
|
||||||
|
|
||||||
#define LWIP_HOOK_IP4_INPUT lwip_ip_input_hook
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ---------- TCP options ---------- */
|
/* ---------- TCP options ---------- */
|
||||||
|
@ -5,6 +5,6 @@ src = Glob('*.c')
|
|||||||
|
|
||||||
CPPPATH = [cwd]
|
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')
|
Return('group')
|
||||||
|
@ -252,9 +252,6 @@ ip_nat_init(void)
|
|||||||
/* we must lock scheduler to protect following code */
|
/* we must lock scheduler to protect following code */
|
||||||
rt_enter_critical();
|
rt_enter_critical();
|
||||||
|
|
||||||
/* register to the ipv4 hook function */
|
|
||||||
lwip_ip_input_set_hook(ip_nat_input);
|
|
||||||
|
|
||||||
/* add a lwip timer for NAT */
|
/* add a lwip timer for NAT */
|
||||||
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC, nat_timer, NULL);
|
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC, nat_timer, NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user