aboutsummaryrefslogtreecommitdiff
path: root/src/nat
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-13 21:18:49 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-13 21:18:49 +0200
commitfa198865e1af85f2868fceea03e64dc46ada9a1c (patch)
tree078abde14172c0d393159a2bd1eee38ce5cb4f77 /src/nat
parent98ac2b34f979cf10da24c984e690dabf7b34794b (diff)
downloadgnunet-fa198865e1af85f2868fceea03e64dc46ada9a1c.tar.gz
gnunet-fa198865e1af85f2868fceea03e64dc46ada9a1c.zip
add missing #define
Diffstat (limited to 'src/nat')
-rw-r--r--src/nat/gnunet-helper-nat-client.c11
-rw-r--r--src/nat/gnunet-helper-nat-server.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/src/nat/gnunet-helper-nat-client.c b/src/nat/gnunet-helper-nat-client.c
index 9768dd856..359e529b0 100644
--- a/src/nat/gnunet-helper-nat-client.c
+++ b/src/nat/gnunet-helper-nat-client.c
@@ -67,6 +67,17 @@
67#endif 67#endif
68 68
69/** 69/**
70 * Call memcpy() but check for @a n being 0 first. In the latter
71 * case, it is now safe to pass NULL for @a src or @a dst.
72 * Unlike traditional memcpy(), returns nothing.
73 *
74 * @param dst destination of the copy, may be NULL if @a n is zero
75 * @param src source of the copy, may be NULL if @a n is zero
76 * @param n number of bytes to copy
77 */
78#define GNUNET_memcpy(dst,src,n) do { if (0 != n) { (void) memcpy (dst,src,n); } } while (0)
79
80/**
70 * Must match IP given in the server. 81 * Must match IP given in the server.
71 */ 82 */
72#define DUMMY_IP "192.0.2.86" 83#define DUMMY_IP "192.0.2.86"
diff --git a/src/nat/gnunet-helper-nat-server.c b/src/nat/gnunet-helper-nat-server.c
index f35649152..b8f499b4d 100644
--- a/src/nat/gnunet-helper-nat-server.c
+++ b/src/nat/gnunet-helper-nat-server.c
@@ -71,6 +71,17 @@
71#endif 71#endif
72 72
73/** 73/**
74 * Call memcpy() but check for @a n being 0 first. In the latter
75 * case, it is now safe to pass NULL for @a src or @a dst.
76 * Unlike traditional memcpy(), returns nothing.
77 *
78 * @param dst destination of the copy, may be NULL if @a n is zero
79 * @param src source of the copy, may be NULL if @a n is zero
80 * @param n number of bytes to copy
81 */
82#define GNUNET_memcpy(dst,src,n) do { if (0 != n) { (void) memcpy (dst,src,n); } } while (0)
83
84/**
74 * Should we print some debug output? 85 * Should we print some debug output?
75 */ 86 */
76#define VERBOSE 0 87#define VERBOSE 0