Skip to content

Commit 068e2f9

Browse files
committed
[lwIP] remove IP_INPUT_HOOK
1 parent 87171f0 commit 068e2f9

File tree

4 files changed

+5
-30
lines changed

4 files changed

+5
-30
lines changed

components/net/lwip-1.4.1/src/arch/sys_arch.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -601,26 +601,6 @@ u32_t sys_now(void)
601601
return rt_tick_get() * (1000 / RT_TICK_PER_SECOND);
602602
}
603603

604-
/*
605-
* lwIP IPv4 input hook
606-
*/
607-
#ifdef LWIP_USING_IP4INPUT_HOOK
608-
static int (*_lwip_ip_input_hook)(struct pbuf *p, struct netif *inp) = RT_NULL;
609-
610-
void lwip_ip_input_set_hook(int (*hook)(struct pbuf *p, struct netif *inp))
611-
{
612-
_lwip_ip_input_hook = hook;
613-
}
614-
615-
int lwip_ip_input_hook(struct pbuf *p, struct netif *inp)
616-
{
617-
if (_lwip_ip_input_hook != RT_NULL)
618-
return _lwip_ip_input_hook(p, inp);
619-
620-
return 0;
621-
}
622-
#endif
623-
624604
#ifdef RT_LWIP_PPP
625605
u32_t sio_read(sio_fd_t fd, u8_t *buf, u32_t size)
626606
{

components/net/lwip-1.4.1/src/lwipopts.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,10 @@
161161
*/
162162
#define SYS_LIGHTWEIGHT_PROT (NO_SYS==0)
163163

164-
#ifdef LWIP_USING_IP4INPUT_HOOK
165-
struct pbuf;
166-
struct netif;
167-
int lwip_ip_input_hook(struct pbuf *p, struct netif *inp);
168-
169-
#define LWIP_HOOK_IP4_INPUT lwip_ip_input_hook
164+
#ifdef LWIP_USING_NAT
165+
#define LWIP_NAT 1
166+
#else
167+
#define LWIP_NAT 0
170168
#endif
171169

172170
/* ---------- TCP options ---------- */

components/net/lwip_nat/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ src = Glob('*.c')
55

66
CPPPATH = [cwd]
77

8-
group = DefineGroup('LwIP', src, depend = ['RT_USING_LWIP', 'LWIP_USING_NAT', 'LWIP_USING_IP4INPUT_HOOK'], CPPPATH = CPPPATH)
8+
group = DefineGroup('LwIP', src, depend = ['RT_USING_LWIP', 'LWIP_USING_NAT'], CPPPATH = CPPPATH)
99

1010
Return('group')

components/net/lwip_nat/ipv4_nat.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ ip_nat_init(void)
252252
/* we must lock scheduler to protect following code */
253253
rt_enter_critical();
254254

255-
/* register to the ipv4 hook function */
256-
lwip_ip_input_set_hook(ip_nat_input);
257-
258255
/* add a lwip timer for NAT */
259256
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC, nat_timer, NULL);
260257

0 commit comments

Comments
 (0)