2 * Copyright (c) 2006-2014 Erik Ekman <yarrick@kryo.se>,
3 * 2006-2009 Bjorn Andersson <flex@kryo.se>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 /* All-0, all-1, 01010101, 10101010: each 4 times to make sure the pattern
22 spreads across multiple encoded chars -> 16 bytes total.
23 Followed by 32 bytes from my /dev/random; should be enough.
25 #define DOWNCODECCHECK1 "\000\000\000\000\377\377\377\377\125\125\125\125\252\252\252\252\201\143\310\322\307\174\262\027\137\117\316\311\111\055\122\041\141\251\161\040\045\263\006\163\346\330\104\060\171\120\127\277"
26 #define DOWNCODECCHECK1_LEN 48
30 int (*encode) (char *, size_t *, const void *, size_t);
31 int (*decode) (void *, size_t *, const char *, size_t);
32 int (*places_dots) (void);
33 int (*eats_dots) (void);
34 int (*blocksize_raw)(void);
35 int (*blocksize_encoded)(void);
38 int build_hostname(char *, size_t, const char *, const size_t, const char *, struct encoder *, int);
39 int unpack_data(char *, size_t, char *, size_t, struct encoder *);
40 int inline_dotify(char *, size_t);
41 int inline_undotify(char *, size_t);
44 #endif /* _ENCODING_H_ */