Add NSH ping command

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@870 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2008-09-02 23:04:10 +00:00
parent db24d24ac2
commit 4dd12b73af
13 changed files with 245 additions and 37 deletions
+2
View File
@@ -366,5 +366,7 @@ extern uint16 uip_ipchksum(struct uip_driver_s *dev);
extern uint16 uip_tcpchksum(struct uip_driver_s *dev);
extern uint16 uip_udpchksum(struct uip_driver_s *dev);
extern uint16 uip_icmpchksum(struct uip_driver_s *dev);
#endif /* __UIP_ARCH_H */
+13
View File
@@ -194,4 +194,17 @@ struct uip_icmp_stats_s
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
EXTERN int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dsecs);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __NET_UIP_UIP_ICMP_H */
+2 -1
View File
@@ -47,6 +47,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <pthread.h>
#include <netinet/in.h>
@@ -85,7 +86,7 @@
* Return: Non-zero If the IP address was parsed.
*/
extern unsigned char uiplib_ipaddrconv(char *addrstr, unsigned char *addr);
extern boolean uiplib_ipaddrconv(const char *addrstr, ubyte *addr);
/* Get and set IP/MAC addresses */
+11 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* nuttx/clock.h
* include/nuttx/clock.h
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -78,6 +78,7 @@
# define MSEC_PER_TICK (10)
#endif
#define TICK_PER_DSEC (MSEC_PER_DSEC / MSEC_PER_TICK) /* Truncates! */
#define TICK_PER_SEC (MSEC_PER_SEC / MSEC_PER_TICK) /* Truncates! */
#define NSEC_PER_TICK (MSEC_PER_TICK * NSEC_PER_MSEC) /* Exact */
#define USEC_PER_TICK (MSEC_PER_TICK * USEC_PER_MSEC) /* Exact */
@@ -88,6 +89,13 @@
#define DSEC2TICK(dsec) MSEC2TICK((dsec)*MSEC_PER_DSEC)
#define SEC2TICK(sec) MSEC2TICK((sec)*MSEC_PER_SEC)
#define TICK2NSEC(tick) ((tick)*NSEC_PER_TICK) /* Exact */
#define TICK2USEC(tick) ((tick)*USEC_PER_TICK) /* Exact */
#define TICK2MSEC(tick) ((tick)*MSEC_PER_TICK) /* Exact */
#define TICK2DSEC(tick) (((tick)+(TICK_PER_DSEC/2))/TICK_PER_DSEC) /* Rounds */
#define TICK2SEC(tick) (((tick)+(TICK_PER_SEC/2))/TICK_PER_SEC) /* Rounds */
/****************************************************************************
* Global Data
****************************************************************************/