Fri Jul 3 20:36:34 2009

Asterisk developer's documentation


app_segfault.c File Reference

#include <asterisk.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <asterisk/lock.h>
#include <asterisk/file.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/pbx.h>
#include <asterisk/module.h>

Include dependency graph for app_segfault.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
static void __unreg_module (void)
int load_module (void)
static int segfault_exec (struct ast_channel *chan, void *data)
int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .description = "Application for crashing Asterisk with a segmentation fault" , .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, }
static char * app = "Segfault"
static const struct
ast_module_info * 
ast_module_info = &__mod_info
static char * descrip = " Segfault(): Crash with a segfault. Never returns nufin.\n"
static char * synopsis = "This application will crash Asterisk with a segmentation fault."


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 57 of file app_segfault.c.

static void __unreg_module ( void   )  [static]

Definition at line 57 of file app_segfault.c.

int load_module ( void   ) 

Definition at line 52 of file app_segfault.c.

References app, ast_register_application(), descrip, segfault_exec(), and synopsis.

00053 {
00054    return ast_register_application(app, segfault_exec, synopsis, descrip);
00055 }

static int segfault_exec ( struct ast_channel *  chan,
void *  data 
) [static]

Definition at line 37 of file app_segfault.c.

References ast_module_user_add, and ast_module_user_remove.

Referenced by load_module().

00038 {
00039    struct ast_module_user *u;
00040    u = ast_module_user_add(chan);
00041    ((char *) 0)[0] = 0;
00042    ast_module_user_remove(u);
00043    return 0;
00044 }

int unload_module ( void   ) 

Definition at line 46 of file app_segfault.c.

References app, ast_module_user_hangup_all, and ast_unregister_application().

00047 {
00048    ast_module_user_hangup_all();
00049    return ast_unregister_application(app);
00050 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .description = "Application for crashing Asterisk with a segmentation fault" , .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, } [static]

Definition at line 57 of file app_segfault.c.

char* app = "Segfault" [static]

Definition at line 31 of file app_segfault.c.

Referenced by load_module(), and unload_module().

const struct ast_module_info* ast_module_info = &__mod_info [static]

Definition at line 57 of file app_segfault.c.

char* descrip = " Segfault(): Crash with a segfault. Never returns nufin.\n" [static]

Definition at line 35 of file app_segfault.c.

Referenced by load_module().

char* synopsis = "This application will crash Asterisk with a segmentation fault." [static]

Definition at line 33 of file app_segfault.c.

Referenced by load_module().


Generated on Fri Jul 3 20:36:35 2009 for Asterisk - the Open Source PBX by  doxygen 1.5.9