]> git.proxmox.com Git - mirror_frr.git/blob - lib/base64.h
Merge pull request #10580 from leonshaw/fix/link-ns
[mirror_frr.git] / lib / base64.h
1 /*
2 * This is part of the libb64 project, and has been placed in the public domain.
3 * For details, see http://sourceforge.net/projects/libb64
4 */
5
6 #ifndef _BASE64_H_
7 #define _BASE64_H_
8
9 enum base64_encodestep {
10 step_A, step_B, step_C
11 };
12
13 struct base64_encodestate {
14 enum base64_encodestep step;
15 char result;
16 int stepcount;
17 };
18
19 void base64_init_encodestate(struct base64_encodestate *state_in);
20
21 char base64_encode_value(char value_in);
22
23 int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,
24 struct base64_encodestate *state_in);
25
26 int base64_encode_blockend(char *code_out, struct base64_encodestate *state_in);
27
28
29 enum base64_decodestep {
30 step_a, step_b, step_c, step_d
31 };
32
33 struct base64_decodestate {
34 enum base64_decodestep step;
35 char plainchar;
36 };
37
38 void base64_init_decodestate(struct base64_decodestate *state_in);
39
40 signed char base64_decode_value(signed char value_in);
41
42 int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,
43 struct base64_decodestate *state_in);
44
45 #endif /* _BASE64_H_ */