Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
func_md5.c File Reference

MD5 digest related dialplan functions. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
Include dependency graph for func_md5.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int load_module (void)
 
static int md5 (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "MD5 digest 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct ast_custom_function md5_function
 

Detailed Description

MD5 digest related dialplan functions.

Author
Olle E. Johansson oej@e.nosp@m.dvin.nosp@m.a.net
Russell Bryant russe.nosp@m.lb@c.nosp@m.lemso.nosp@m.n.ed.nosp@m.u

Definition in file func_md5.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 82 of file func_md5.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 82 of file func_md5.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 82 of file func_md5.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 77 of file func_md5.c.

References ast_custom_function_register.

78 {
80 }
static struct ast_custom_function md5_function
Definition: func_md5.c:66
#define ast_custom_function_register(acf)
Register a custom function.
Definition: pbx.h:1508

◆ md5()

static int md5 ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
)
static

Definition at line 52 of file func_md5.c.

References ast_log, ast_md5_hash(), ast_strlen_zero, and LOG_WARNING.

54 {
55  if (ast_strlen_zero(data)) {
56  ast_log(LOG_WARNING, "Syntax: MD5(<data>) - missing argument!\n");
57  return -1;
58  }
59 
60  ast_md5_hash(buf, data);
61  buf[32] = '\0';
62 
63  return 0;
64 }
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define LOG_WARNING
Definition: logger.h:274
#define ast_strlen_zero(foo)
Definition: strings.h:52
#define ast_log
Definition: astobj2.c:42
void ast_md5_hash(char *output, const char *input)
Produces MD5 hash based on input string.
Definition: main/utils.c:248

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 72 of file func_md5.c.

References ast_custom_function_unregister().

73 {
75 }
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
static struct ast_custom_function md5_function
Definition: func_md5.c:66

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "MD5 digest 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
static

Definition at line 82 of file func_md5.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 82 of file func_md5.c.

◆ md5_function

struct ast_custom_function md5_function
static
Initial value:
= {
.name = "MD5",
.read = md5,
.read_max = 33,
}
static int md5(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Definition: func_md5.c:52

Definition at line 66 of file func_md5.c.