oping.h: Use `extern "C"' if `__cplusplus' is defined.
[liboping.git] / src / oping.h
index 5214947..b17e659 100644 (file)
@@ -4,8 +4,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; only version 2 of the License is
+ * applicable.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 #if HAVE_UNISTD_H
 # include <unistd.h>
 #endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 #if HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Type definitions
  */
@@ -48,10 +55,13 @@ typedef struct pingobj pingobj_t;
 #define PING_OPT_TIMEOUT 0x01
 #define PING_OPT_TTL     0x02
 #define PING_OPT_AF      0x04
+#define PING_OPT_DATA    0x08
+#define PING_OPT_SOURCE  0x10
 
 #define PING_DEF_TIMEOUT 1.0
 #define PING_DEF_TTL     255
 #define PING_DEF_AF      AF_UNSPEC
+#define PING_DEF_DATA    "Florian Forster <octo@verplant.org> http://verplant.org/"
 
 /*
  * Method definitions
@@ -75,6 +85,7 @@ pingobj_iter_t *ping_iterator_next (pingobj_iter_t *iter);
 #define PING_INFO_LATENCY  4
 #define PING_INFO_SEQUENCE 5
 #define PING_INFO_IDENT    6
+#define PING_INFO_DATA     7
 int ping_iterator_get_info (pingobj_iter_t *iter, int info,
                void *buffer, size_t *buffer_len);
 
@@ -83,4 +94,8 @@ const char *ping_get_error (pingobj_t *obj);
 void *ping_iterator_get_context (pingobj_iter_t *iter);
 void  ping_iterator_set_context (pingobj_iter_t *iter, void *context);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* OCTO_PING_H */