diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-09-10 23:16:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-09-10 23:16:00 +0000 |
commit | fe3b7d73edd4e41389f9b3ff3cd9d07892ae3e56 (patch) | |
tree | d5da1055f781a8a7c6c54eaaeb30a476867caa4a /util.c | |
parent | d121dc07f1601c58994bdd4acd6ee33ef845e0e8 (diff) | |
download | wireshark-fe3b7d73edd4e41389f9b3ff3cd9d07892ae3e56.tar.gz wireshark-fe3b7d73edd4e41389f9b3ff3cd9d07892ae3e56.tar.bz2 wireshark-fe3b7d73edd4e41389f9b3ff3cd9d07892ae3e56.zip |
Move the base-64 routines to "epan/base64.c".
svn path=/trunk/; revision=11960
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 33 |
1 files changed, 0 insertions, 33 deletions
@@ -254,39 +254,6 @@ compute_timestamp_diff(gint *diffsec, gint *diffusec, } } -/* Decode a base64 string in-place - simple and slow algorithm. - Return length of result. Taken from rproxy/librsync/base64.c by - Andrew Tridgell. */ - -size_t epan_base64_decode(char *s) -{ - static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - int bit_offset, byte_offset, idx, i, n; - unsigned char *d = (unsigned char *)s; - char *p; - - n=i=0; - - while (*s && (p=strchr(b64, *s))) { - idx = (int)(p - b64); - byte_offset = (i*6)/8; - bit_offset = (i*6)%8; - d[byte_offset] &= ~((1<<(8-bit_offset))-1); - if (bit_offset < 3) { - d[byte_offset] |= (idx << (2-bit_offset)); - n = byte_offset+1; - } else { - d[byte_offset] |= (idx >> (bit_offset-2)); - d[byte_offset+1] = 0; - d[byte_offset+1] |= (idx << (8-(bit_offset-2))) & 0xFF; - n = byte_offset+2; - } - s++; i++; - } - - return n; -} - /* Try to figure out if we're remotely connected, e.g. via ssh or Terminal Server, and create a capture filter that matches aspects of the connection. We match the following environment variables: |