diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-16 22:31:07 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-16 22:31:07 +0000 |
commit | 004220fb63d9c49f5ba389a7d80d0bbde14ba11f (patch) | |
tree | 21410e677f84ba94ab90afc1dab7c4866c9596cc /wsutil/bitswap.c | |
parent | 0e029166ba5f894893c06fba315e1a7340eef156 (diff) | |
download | wireshark-004220fb63d9c49f5ba389a7d80d0bbde14ba11f.tar.gz wireshark-004220fb63d9c49f5ba389a7d80d0bbde14ba11f.tar.bz2 wireshark-004220fb63d9c49f5ba389a7d80d0bbde14ba11f.zip |
Exporting/importing variables cause problems, so create function to do bitswaping.
svn path=/trunk/; revision=53374
Diffstat (limited to 'wsutil/bitswap.c')
-rw-r--r-- | wsutil/bitswap.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wsutil/bitswap.c b/wsutil/bitswap.c index 8e0fa657b7..ec387c5c8b 100644 --- a/wsutil/bitswap.c +++ b/wsutil/bitswap.c @@ -30,7 +30,7 @@ #include "bitswap.h" /* "swaptab[i]" is the value of "i" with the bits reversed. */ -WS_DLL_PUBLIC_DEF const guint8 swaptab[256] = +static const guint8 swaptab[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, @@ -65,3 +65,11 @@ WS_DLL_PUBLIC_DEF const guint8 swaptab[256] = 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, }; + +void bit_swap_buf_inplace(guint8 *buf, size_t len) +{ + size_t i; + + for (i = 0; i < len; i++) + buf[i] = swaptab[buf[i]]; +} |