void imap_quota_plugin_init(struct module *module) { command_register("GETQUOTAROOT", cmd_getquotaroot, 0); command_register("GETQUOTA", cmd_getquota, 0); command_register("SETQUOTA", cmd_setquota, 0); imap_quota_module = module; next_hook_client_created = imap_client_created_hook_set(imap_quota_client_created); }
void test_register(void) { struct external_command *ext_command = NULL; int author = 42, persistent = 0; char cmd_name[21]; int expected_command_index = 0; registered_commands_init(20); while ( expected_command_index < 60 ) { /*Verify that auto-growing the register works*/ (void)snprintf(cmd_name, 21, "ADD_HOST_COMMENT_%d", expected_command_index+1); ext_command = command_create(cmd_name, test__add_host_comment_handler, "This is a description for a command named ADD_HOST_COMMENT", NULL); command_argument_add(ext_command, "host", STRING, NULL, NULL); b_val = 0; command_argument_add(ext_command, "persistent", BOOL, &b_val, NULL); i_val = 42; command_argument_add(ext_command, "author", INTEGER, &i_val, NULL); s_val = "No comment"; command_argument_add(ext_command, "comment", STRING, s_val, NULL); ok(expected_command_index == command_register(ext_command, -1), "command registration is successful"); ok((NULL == command_argument_get_value(ext_command, "host")), "Host (null) default value saved properly"); ok(persistent == *(int *)command_argument_get_value(ext_command, "persistent"), "Persistent (bool) default value saved properly"); ok(author == *(int *)command_argument_get_value(ext_command, "author"), "Author (int) default value saved properly"); ok(!strcmp("No comment", command_argument_get_value(ext_command, "comment")), "Comment (str) default value saved properly"); ++expected_command_index; } registered_commands_deinit(); }
static __init void version_cmd_init(void) { if(command_register(&version_cmd)) LOG("Register command 'version'"); else LOG("Failed to register command 'version'"); }
static __init void go_cmd_init(void) { if(command_register(&go_cmd)) LOG("Register command 'go'"); else LOG("Failed to register command 'go'"); }
/*! * @brief Register a full list of commands with meterpreter. * @param commands The array of commands that are to be registered for the module/extension. */ void command_register_all(Command commands[]) { DWORD index; for (index = 0; commands[index].method; index++) command_register(&commands[index]); }
int test_load (void) { print ("Loaded test module - version %d.%d", test_info_s.major, test_info_s.minor); command_register ("test", 1, 0, 0, 0, test_command); return 0; }
void imap_xaps_plugin_init(struct module *module) { command_register("XAPPLEPUSHSERVICE", cmd_xapplepushservice, 0); imap_xaps_module = module; next_hook_client_created = imap_client_created_hook_set(xaps_client_created); }
void push_notify_registration_plugin_init (struct module *module) { command_register("XAPPLEPUSHSERVICE", cmd_x_apple_push_service, 0); push_notify_registration_module = module; next_hook_client_created = imap_client_created_hook_set(push_notify_registration_client_created); }
/* * Initialize the server extension */ DWORD __declspec(dllexport) InitServerExtension(Remote *remote) { DWORD index; hMetSrv = remote->hMetSrv; for (index = 0; customCommands[index].method; index++) command_register(&customCommands[index]); // initialize structures for the packet sniffer sdk hMgr = NULL; hErr = 0; memset(open_captures, 0, sizeof(open_captures)); // wipe the include/exclude ports empty memset(sniffer_includeports, 0, sizeof(sniffer_includeports)); memset(sniffer_excludeports, 0, sizeof(sniffer_excludeports)); sniffer_includeports[0] = -1; sniffer_excludeports[0] = -1; // get the address/port of the connected control socket peername4 = NULL; peername6 = NULL; peername_len = sizeof(peername); getpeername(remote->fd, &peername, &peername_len); if(peername.sa_family == PF_INET) peername4 = (struct sockaddr_in *)&peername; if(peername.sa_family == PF_INET6) peername6 = (struct sockaddr_in6 *)&peername; InitializeCriticalSection(&sniffercs); return hErr; }
static __init void cd_cmd_init(void) { if(command_register(&cd_cmd)) LOG("Register command 'cd'"); else LOG("Failed to register command 'cd'"); }
void register_commands() { command_register("help", help_info, COMMAND_NO_PRIV, command_handle_help); command_register("reset", reset_info, COMMAND_NO_PRIV, command_handle_reset); command_register("show version", show_version_info, COMMAND_NO_PRIV, command_handle_show_version); command_register("show state", show_state_info, COMMAND_NO_PRIV, command_handle_show_state); command_register("show conf", show_conf_info, COMMAND_NO_PRIV, command_handle_show_conf); command_register("show voltage", show_voltage_info, COMMAND_NO_PRIV, command_handle_show_voltage); command_register("set dsense", set_sense_info, COMMAND_NO_PRIV, command_handle_set_sense); command_register("set conf", set_conf_info, COMMAND_NO_PRIV, command_handle_set_conf); }
void Shell::init(UART *hal_uart) { _hal_uart = hal_uart; command_register("help", &_cmd_help); uart_prompt(); volatile int i = 1000000; while (i--); }
/* * Registers custom command handlers */ VOID register_dispatch_routines() { DWORD index; extension_list = list_create(); for( index=0 ; custom_commands[index].method ; index++ ) command_register( &custom_commands[index] ); }
/* * Registers custom command handlers */ VOID remote_register_core_dispatch_routines() { DWORD index; for (index = 0; custom_commands[index].method; index++) command_register(&custom_commands[index]); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { list_pools, 'A', "list-pools", "list loaded pool configurations", {"[--raw]"}, { {"help", 'h', 0, "show usage information"}, {"raw", 'r', 0, "dump raw response message"}, } }); }
/* * Initialize the server extension */ DWORD __declspec(dllexport) InitServerExtension(Remote *remote) { DWORD index; for (index = 0; customCommands[index].method; index++) command_register(&customCommands[index]); return ERROR_SUCCESS; }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { logcmd, 'T', "log", "trace logging output", {"[--raw|--pretty]"}, { {"help", 'h', 0, "show usage information"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { load_pools, 'a', "load-pools", "(re-)load pool configuration", {"[--raw|--pretty"}, { {"help", 'h', 0, "show usage information"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { stats, 'S', "stats", "show daemon stats information", {"[--raw|--pretty]"}, { {"help", 'h', 0, "show usage information"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, } }); }
/** * Initialise the I2C driver * * @param handle Which I2C bus (if more than one exists) * @param mode I2C device mode. Must be either I2C_MASTER or I2C_SLAVE * @param addr Own slave address * @param speed Bus speed in kbps * */ int i2c_init(int handle, int mode, uint8_t addr, uint16_t speed, int queue_len_tx, int queue_len_rx, i2c_callback_t callback) { /* Error checking */ if (handle >= pca9665_device_count) return E_NO_DEVICE; if (device[handle].is_initialised) return E_NO_ERR; if (queue_len_tx <= 0) return E_INVALID_PARAM; if (mode != I2C_MASTER) { driver_debug(DEBUG_I2C, "PCA9665 driver does not support slave mode operation\r\n"); return E_INVALID_PARAM; } if (i2c_lock == NULL) i2c_lock = xSemaphoreCreateMutex(); if (i2c_lock == NULL) return E_NO_BUFFER; /* TX Queue */ if (device[handle].tx.queue == NULL) { device[handle].tx.queue = xQueueCreate(queue_len_tx, sizeof(i2c_frame_t *)); } /* RX Queue */ if ((device[handle].rx.queue == NULL) && (queue_len_rx > 0)) { device[handle].rx.queue = xQueueCreate(queue_len_rx, sizeof(i2c_frame_t *)); } /* Callback */ if (callback != NULL) { device[handle].callback = callback; } /* Call board specific ISR initialization */ pca9665_isr_init(); /* Initialise device */ int result = pca9665_init(handle, device[handle].base, addr, speed); if (result == E_NO_ERR) { device[handle].is_initialised = 1; } else { driver_debug(DEBUG_I2C, "Failed to initialise PCA9665 driver\r\n"); } command_register(pca9554_commands); return result; }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { verify, 'v', "verify", "verify a certificate using the CA certificate", {"[--in file] [--ca file]"}, { {"help", 'h', 0, "show usage information"}, {"in", 'i', 1, "X.509 certificate to verify, default: stdin"}, {"cacert", 'c', 1, "CA certificate, default: verify self signed"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { gen, 'g', "gen", "generate a new private key", {"[--type rsa|ecdsa] [--size bits] [--outform der|pem|pgp]"}, { {"help", 'h', 0, "show usage information"}, {"type", 't', 1, "type of key, default: rsa"}, {"size", 's', 1, "keylength in bits, default: rsa 2048, ecdsa 384"}, {"outform", 'f', 1, "encoding of generated private key"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { dn, 'd', "dn", "extract the subject DN of an X.509 certificate", {"[--in file] [--format config|hex|base64|bin]"}, { {"help", 'h', 0, "show usage information"}, {"in", 'i', 1, "input file, default: stdin"}, {"format", 'f', 1, "output format, default: config"}, } }); }
int pi_rrd_init () { pi_rrd = plugin_register ("rrd"); /* *INDENT-OFF* */ command_register ("rrdcreate", &pi_rrd_handler_rrdcreate, CAP_CONFIG, _("Create an RRD file for statistics gathering")); command_register ("rrdlist", &pi_rrd_handler_rrdlist, CAP_CONFIG, _("Show the RRD file generated.")); command_register ("rrddelete", &pi_rrd_handler_rrddelete, CAP_CONFIG, _("Remove a RRD file.")); /* *INDENT-ON* */ plugin_request (NULL, PLUGIN_EVENT_LOAD, (plugin_event_handler_t *) pi_rrd_handle_load); plugin_request (NULL, PLUGIN_EVENT_SAVE, (plugin_event_handler_t *) pi_rrd_handle_save); config_register ("rrd.silent", CFG_ELEM_ULONG, &rrd_silent, _("If set, errors are not reported.")); rrdlist.next = &rrdlist; rrdlist.prev = &rrdlist; return 0; }
DWORD InitServerExtension(Remote *remote) #endif { DWORD index; #ifdef _WIN32 hMetSrv = remote->hMetSrv; #endif for (index = 0; customCommands[index].method; index++) command_register(&customCommands[index]); return ERROR_SUCCESS; }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { load_authorities, 'b', "load-authorities", "(re-)load authority configuration", {"[--raw|--pretty]"}, { {"help", 'h', 0, "show usage information"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, {"file", 'f', 1, "custom path to swanctl.conf"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { load_all, 'q', "load-all", "load credentials, pools and connections", {"[--raw|--pretty] [--clear] [--noprompt]"}, { {"help", 'h', 0, "show usage information"}, {"clear", 'c', 0, "clear previously loaded credentials"}, {"noprompt", 'n', 0, "do not prompt for passwords"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, } }); }
/** * Register install the command. */ static void __attribute__ ((constructor))reg_install() { command_register((command_t) { install, 'p', "install", "install a trap or shunt policy", {"--child <name> [--ike <name>] [--raw|--pretty]"}, { {"help", 'h', 0, "show usage information"}, {"child", 'c', 1, "CHILD_SA configuration to install"}, {"ike", 'i', 1, "name of the connection to which the child belongs"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { verify, 'v', "verify", "verify a certificate using the CA certificate", {"[--in file] [--cacert file] [--crl file]"}, { {"help", 'h', 0, "show usage information"}, {"in", 'i', 1, "X.509 certificate to verify, default: stdin"}, {"cacert", 'c', 1, "CA certificate for trustchain verification"}, {"crl", 'l', 1, "CRL for trustchain verification"}, {"online", 'o', 0, "enable online CRL/OCSP revocation checking"}, } }); }
/** * Register the command. */ static void __attribute__ ((constructor))reg() { command_register((command_t) { initiate, 'i', "initiate", "initiate a connection", {"--child <name> [--timeout <s>] [--raw|--pretty]"}, { {"help", 'h', 0, "show usage information"}, {"child", 'c', 1, "initate a CHILD_SA configuration"}, {"timeout", 't', 1, "timeout in seconds before detaching"}, {"raw", 'r', 0, "dump raw response message"}, {"pretty", 'P', 0, "dump raw response message in pretty print"}, {"loglevel", 'l', 1, "verbosity of redirected log"}, } }); }