lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] ping out?


From: Larry Piggins
Subject: Re: [lwip-users] ping out?
Date: Thu, 19 Jun 2003 10:00:37 -0700 (PDT)

Adam's suggestions sound good to me, and my
implementation would be very easy to modify for this
purpose.

A word on the callback: In the icmp_input function
there is a switch() where the default case is for icmp
types not handled by LWIP. My code makes the callback
at that point, and if the callback returns ERR_OK,
then the case breaks. This allows the app to handle
whatever icmp types it wants, while still allowing
LWIP to handle incoming ECHO_REQUESTs. With this
method, the app will never see an incoming
ECHO_REQUEST (LWIP handles it) but it does have the
option of handling all other icmp types.

--- Adam Dunkels <address@hidden> wrote:
> Hi!
> 
> How about adding a generic function for sending out
> an ICMP packet with
> any type, something like icmp_send(u8_t type, u8_t
> code, u8_t *data,
> 16_t len), where "data" would be copied into the
> ICMP header starting
> after the checksum? The ICMP ECHO_REPLY callback
> could even be
> generalized to supporting any kind of ICMP input, so
> that an application
> could listen to all incoming ICMP packets (without
> adding to
> complexity).
> 
> It would be somewhere inbetween the simple ICMP
> ECHO_REPLY listener, but
> slightly less complex than a full SOCK_RAW.
> 
> I think that ICMP is special enough in many ways to
> warrant a special
> way to interact with it, but I'm not sure that it is
> worth a lot (or how
> much) of extras... Would it be possible to have a
> SOCK_RAW with
> callbacks, or would it require the socket interface
> layer?
> 
> Cheers,
> 
> /adam
> -- 
> Adam Dunkels <address@hidden>
> http://www.sics.se/~adam/
> 
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-users


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]