aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-09-10 23:16:00 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-10 23:16:00 +0000
commitfe3b7d73edd4e41389f9b3ff3cd9d07892ae3e56 (patch)
treed5da1055f781a8a7c6c54eaaeb30a476867caa4a /util.c
parentd121dc07f1601c58994bdd4acd6ee33ef845e0e8 (diff)
Move the base-64 routines to "epan/base64.c".
svn path=/trunk/; revision=11960
Diffstat (limited to 'util.c')
-rw-r--r--util.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/util.c b/util.c
index 25766b2ae0..79dcf81e80 100644
--- a/util.c
+++ b/util.c
@@ -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: