OpenDNSSEC-enforcer  2.0.3
Data Structures | Macros | Typedefs | Functions
cmdhandler.h File Reference
#include <sys/un.h>
#include "scheduler/schedule.h"
#include "db/db_connection.h"

Go to the source code of this file.

Data Structures

struct  cmdhandler_struct
 
struct  cmd_func_block
 

Macros

#define ODS_SE_MAX_HANDLERS   5
 

Typedefs

typedef struct cmdhandler_struct cmdhandler_type
 

Functions

cmdhandler_typecmdhandler_create (const char *filename)
 
void cmdhandler_cleanup (cmdhandler_type *cmdhandler)
 
void cmdhandler_start (cmdhandler_type *cmdhandler)
 
void cmdhandler_stop (struct engine_struct *engine)
 
void cmdhandler_get_usage (int sockfd)
 
struct cmd_func_blockget_funcblock (const char *cmd, ssize_t n)
 

Macro Definition Documentation

◆ ODS_SE_MAX_HANDLERS

#define ODS_SE_MAX_HANDLERS   5

Command handler.

Definition at line 40 of file cmdhandler.h.

Typedef Documentation

◆ cmdhandler_type

Definition at line 45 of file cmdhandler.h.

Function Documentation

◆ cmdhandler_cleanup()

void cmdhandler_cleanup ( cmdhandler_type cmdhandler)

Cleanup command handler.

Parameters
[in]cmdhandlercommand handler

Cleanup command handler.

Definition at line 446 of file cmdhandler.c.

References cmdhandler_struct::listen_fd.

Referenced by engine_teardown().

◆ cmdhandler_create()

cmdhandler_type* cmdhandler_create ( const char *  filename)

Create command handler.

Parameters
[in]filenamesocket file name
Returns
cmdhandler_type* created command handler

Create command handler.

Definition at line 367 of file cmdhandler.c.

References ods_log_error().

◆ cmdhandler_get_usage()

void cmdhandler_get_usage ( int  sockfd)

Print usage of all known commands to file descriptor

Parameters
[in]sockfd,filedescriptor to print to.

Definition at line 163 of file cmdhandler.c.

◆ cmdhandler_start()

void cmdhandler_start ( cmdhandler_type cmdhandler)

Start command handler.

Parameters
[in]cmdhandler_type*command handler

Start command handler.

Definition at line 457 of file cmdhandler.c.

References cmdhandler_struct::engine, MAX_CLIENT_CONN, and ods_log_debug().

◆ cmdhandler_stop()

void cmdhandler_stop ( struct engine_struct engine)

Stop command handler.

Definition at line 594 of file cmdhandler.c.

References engine_struct::cmdhandler, cmdhandler_struct::need_to_exit, and ods_log_debug().

◆ get_funcblock()

struct cmd_func_block* get_funcblock ( const char *  cmd,
ssize_t  n 
)

Retrieve function block responsible for cmd

Loops over all known commands, first command to claim to be responsible will have its function block returned. If not claimed return NULL.

Parameters
[in]cmd,commandto look for
[in]n,lengthof cmd string.
Returns
function block or NULL

Definition at line 175 of file cmdhandler.c.