AW: [En-Nut-Discussion] icmp sockets

Ernst Stippl ernst at stippl.org
Wed Oct 26 11:11:02 CEST 2005


Hi Hektor!

Some time ago I found on Ethernut home page a link to:

//---------------
// from sock_var.h

#include <sys/types.h>
#include <dev/netbuf.h>
#include <sys/device.h>
typedef struct icmp_socket ICMPSOCKET;

struct icmp_socket {
    ICMPSOCKET *so_next;     /*!< Link to next tcp socket structure. */
    u_short so_local_port;  /*!< Local port number in net byte order. */
    u_char	protocol;
    u_char	ttl;
    u_short sequence_no;
    NETBUF  *so_rx_nb;      /*!< Received, but not read by application. */
    HANDLE  so_rx_rdy;      /*!< Receiver event queue. */
};

//from socket.h

#include <sys/sock_var.h>
#include <netinet/in.h>


extern ICMPSOCKET *NutIcmpCreateSocket(u_char protocol,u_short port);
extern int NutIcmpSendTo(ICMPSOCKET *sock,u_long addr,u_char type,u_char
code,void* data,u_short len);
extern int NutIcmpReceiveFrom( ICMPSOCKET *sock,u_long* addr,u_char*
type,u_char* code, void* data,u_short size,u_long timeout);
extern int NutIcmpDestroySocket(ICMPSOCKET * sock);
extern ICMPSOCKET *NutIcmpFindSocket(u_short port,u_char protocol);
extern int NutIcmpSetTTL(ICMPSOCKET *sock,u_char ttl);
//--------------- 

hope that helps.

regards
ernst


-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Pan Hektor
Gesendet: Dienstag, 25. Oktober 2005 13:20
An: En-Nut-Discussion at egnite.de
Betreff: [En-Nut-Discussion] icmp sockets

Hello,
 is there any icmp socket support in nutos? my version is
3.9.8.2<http://3.9.8.2>.
I've found
http://www.egnite.de/pipermail/en-nut-discussion/2003-September/001205.html
but no socket sources. Does anybody have these sources, or is there a better
way to handle icmp packets (ping esp.)?
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list