OpenDNSSEC-enforcer  2.0.3
Macros | Typedefs | Functions
cmdhandler.c File Reference
#include "config.h"
#include <sys/un.h>
#include <errno.h>
#include <fcntl.h>
#include <ldns/ldns.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <pthread.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include "daemon/engine.h"
#include "clientpipe.h"
#include "scheduler/schedule.h"
#include "scheduler/task.h"
#include "file.h"
#include "log.h"
#include "status.h"
#include "duration.h"
#include "str.h"
#include "db/db_connection.h"
#include "policy/policy_resalt_cmd.h"
#include "policy/policy_list_cmd.h"
#include "daemon/help_cmd.h"
#include "daemon/time_leap_cmd.h"
#include "daemon/queue_cmd.h"
#include "daemon/verbosity_cmd.h"
#include "daemon/ctrl_cmd.h"
#include "enforcer/update_repositorylist_cmd.h"
#include "enforcer/repositorylist_cmd.h"
#include "enforcer/update_all_cmd.h"
#include "enforcer/update_conf_cmd.h"
#include "enforcer/enforce_cmd.h"
#include "policy/policy_import_cmd.h"
#include "policy/policy_export_cmd.h"
#include "policy/policy_purge_cmd.h"
#include "keystate/zone_list_cmd.h"
#include "keystate/zone_del_cmd.h"
#include "keystate/zone_add_cmd.h"
#include "keystate/keystate_ds_submit_cmd.h"
#include "keystate/keystate_ds_seen_cmd.h"
#include "keystate/keystate_ds_retract_cmd.h"
#include "keystate/keystate_ds_gone_cmd.h"
#include "keystate/keystate_export_cmd.h"
#include "keystate/keystate_import_cmd.h"
#include "keystate/keystate_list_cmd.h"
#include "keystate/key_purge_cmd.h"
#include "keystate/rollover_list_cmd.h"
#include "keystate/keystate_rollover_cmd.h"
#include "keystate/zonelist_import_cmd.h"
#include "keystate/zonelist_export_cmd.h"
#include "signconf/signconf_cmd.h"
#include "hsmkey/backup_hsmkeys_cmd.h"
#include "hsmkey/key_generate_cmd.h"
#include "daemon/cmdhandler.h"

Go to the source code of this file.

Macros

#define SE_CMDH_CMDLEN   7
 
#define MAX_CLIENT_CONN   8
 

Typedefs

typedef struct cmd_func_block *(* fbgetfunctype) (void)
 

Functions

void cmdhandler_get_usage (int sockfd)
 
struct cmd_func_blockget_funcblock (const char *cmd, ssize_t n)
 
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)
 

Macro Definition Documentation

◆ MAX_CLIENT_CONN

#define MAX_CLIENT_CONN   8

Definition at line 103 of file cmdhandler.c.

Referenced by cmdhandler_start().

◆ SE_CMDH_CMDLEN

#define SE_CMDH_CMDLEN   7

Command handler.

Definition at line 102 of file cmdhandler.c.

Typedef Documentation

◆ fbgetfunctype

typedef struct cmd_func_block*(* fbgetfunctype) (void)

Definition at line 107 of file cmdhandler.c.

Function Documentation

◆ cmdhandler_cleanup()

void cmdhandler_cleanup ( cmdhandler_type cmdhandler)

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.

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.

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.