diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-10-19 17:18:23 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-10-19 17:18:23 +0200 |
commit | 83e0c196b189513318093a6bf94f783c95e37b4f (patch) | |
tree | 1b9b7755098ba6b9b23e081255542a1c48095f3c | |
parent | 67fc4a906aa73700ce84edaceb7fee189ba3771f (diff) |
netsniff-ng: proto: Make raw hex/ascii print function globally available
Allow other dissectors to access the hex/ascii printing functions with a
raw uint8_t* instead of only through struct pkt_buff.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | proto.h | 2 | ||||
-rw-r--r-- | proto_none.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -26,7 +26,9 @@ struct protocol { }; extern void empty(struct pkt_buff *pkt); +extern void _hex(uint8_t *ptr, size_t len); extern void hex(struct pkt_buff *pkt); +extern void _ascii(uint8_t *ptr, size_t len); extern void ascii(struct pkt_buff *pkt); extern void hex_ascii(struct pkt_buff *pkt); diff --git a/proto_none.c b/proto_none.c index 0c0f62a..6b36962 100644 --- a/proto_none.c +++ b/proto_none.c @@ -14,7 +14,7 @@ void empty(struct pkt_buff *pkt __maybe_unused) {} -static void _hex(uint8_t *ptr, size_t len) +void _hex(uint8_t *ptr, size_t len) { if (!len) return; @@ -36,7 +36,7 @@ void hex(struct pkt_buff *pkt) tprintf("\n"); } -static void _ascii(uint8_t *ptr, size_t len) +void _ascii(uint8_t *ptr, size_t len) { if (!len) return; |