summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-02 23:04:10 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-02 23:04:10 +0000
commit9f60d09c6faaac732a62a188228a88321aad7368 (patch)
tree4404ee0e25d63abaad5e23b9aa8dce9ed6a9c8e9 /nuttx/include
parent8a2d54981a1c1ee6563f3444cffc1d2d4784156e (diff)
downloadpx4-nuttx-9f60d09c6faaac732a62a188228a88321aad7368.tar.gz
px4-nuttx-9f60d09c6faaac732a62a188228a88321aad7368.tar.bz2
px4-nuttx-9f60d09c6faaac732a62a188228a88321aad7368.zip
Add NSH ping command
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@870 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/net/uip/uip-arch.h2
-rw-r--r--nuttx/include/net/uip/uip-icmp.h13
-rw-r--r--nuttx/include/net/uip/uip-lib.h3
-rw-r--r--nuttx/include/nuttx/clock.h14
4 files changed, 28 insertions, 4 deletions
diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h
index 6f2781eb3..c0044fdfe 100644
--- a/nuttx/include/net/uip/uip-arch.h
+++ b/nuttx/include/net/uip/uip-arch.h
@@ -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 */
+
diff --git a/nuttx/include/net/uip/uip-icmp.h b/nuttx/include/net/uip/uip-icmp.h
index 632653ab8..67d6941d3 100644
--- a/nuttx/include/net/uip/uip-icmp.h
+++ b/nuttx/include/net/uip/uip-icmp.h
@@ -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 */
diff --git a/nuttx/include/net/uip/uip-lib.h b/nuttx/include/net/uip/uip-lib.h
index 307a6b277..ce81dca67 100644
--- a/nuttx/include/net/uip/uip-lib.h
+++ b/nuttx/include/net/uip/uip-lib.h
@@ -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 */
diff --git a/nuttx/include/nuttx/clock.h b/nuttx/include/nuttx/clock.h
index b57b8e4f8..6d4d20dd4 100644
--- a/nuttx/include/nuttx/clock.h
+++ b/nuttx/include/nuttx/clock.h
@@ -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
****************************************************************************/