|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "base64 encode/decode dialplan functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_custom_function | base64_decode_function |
|
static struct ast_custom_function | base64_encode_function |
|
Use the base64 as functions.
Definition in file func_base64.c.
static int base64_helper |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
data, |
|
|
char * |
buf, |
|
|
struct ast_str ** |
str, |
|
|
ssize_t |
len |
|
) |
| |
|
static |
Definition at line 75 of file func_base64.c.
77{
80 return -1;
81 }
82
83 if (cmd[7] == 'E') {
86 } else {
88
89
90 size_t bytes_needed_to_encode_data = ((strlen(data) * 4 / 3 + 3) & ~3) + 1;
92 }
95 }
96 } else {
97 int decoded_len;
100
101
102 buf[decoded_len <= (
len - 1) ? decoded_len :
len - 1] =
'\0';
103 } else {
106 }
109
110
111
113 else
114
116
118 }
119 }
120
121 return 0;
122}
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_make_space(buf, new_len)
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
int ast_base64decode(unsigned char *dst, const char *src, int max)
Decode data from base64.
int ast_base64encode(char *dst, const unsigned char *src, int srclen, int max)
Encode data in base64.
References ast_base64decode(), ast_base64encode(), ast_log, ast_str_buffer(), ast_str_make_space, ast_str_size(), ast_str_strlen(), ast_str_update(), ast_strlen_zero(), buf, len(), LOG_WARNING, and str.
Referenced by base64_buf_helper(), and base64_str_helper().