aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/buffer.h
diff options
context:
space:
mode:
authorJames Yonan2016-03-03 01:19:00 -0700
committerGert Doering2016-04-04 21:20:03 +0200
commit0a6a80156ee60705f7856100da7a2a61f018e2a0 (patch)
tree9a679f8496f72ef3740915a227eca55cadbd100b /src/openvpn/buffer.h
parentbbde0a766c69f573746461415c6f5cd289272fff (diff)
downloadopenvpn-0a6a80156ee60705f7856100da7a2a61f018e2a0.zip
openvpn-0a6a80156ee60705f7856100da7a2a61f018e2a0.tar.gz
Added flags parameter to format_hex_ex.
We add the flags parameter without changing the signature of the function by repurposing the space_break parameter into space_break_flags where the lower 8 bits are used for the previous space_break parameter and the higher bits are used for flag values. Added new flag FHE_CAPS that formats the generated hex string in upper case. Signed-off-by: James Yonan <james@openvpn.net> Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: <1456993146-63968-4-git-send-email-james@openvpn.net> URL: http://article.gmane.org/gmane.network.openvpn.devel/11275 Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/buffer.h')
-rw-r--r--src/openvpn/buffer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h
index 24f52aa..8070439 100644
--- a/src/openvpn/buffer.h
+++ b/src/openvpn/buffer.h
@@ -403,9 +403,11 @@ bool buf_parse (struct buffer *buf, const int delim, char *line, const int size)
/*
* Hex dump -- Output a binary buffer to a hex string and return it.
*/
+#define FHE_SPACE_BREAK_MASK 0xFF /* space_break parameter in lower 8 bits */
+#define FHE_CAPS 0x100 /* output hex in caps */
char *
format_hex_ex (const uint8_t *data, int size, int maxoutput,
- int space_break, const char* separator,
+ unsigned int space_break_flags, const char* separator,
struct gc_arena *gc);
static inline char *