aboutsummaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index cfd971c2..402ece41 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1105,4 +1105,17 @@ char *strndup(const char *s, size_t n)
}
#endif /* ! HAVE_STRNDUP */
+/* Increment 64b integer in network byte order */
+void
+uint64_inc(unsigned char *counter)
+{
+ int i;
+
+ for (i = 7; i >= 0; i--) {
+ counter[i]++;
+ if (counter[i])
+ return;
+ }
+}
+
/** @} */