Back to home page

Enduro/X

 
 

    


0001 /**
0002  * @brief Main header for NDRXD command processor
0003  *
0004  * @file cmd_processor.h
0005  */
0006 /* -----------------------------------------------------------------------------
0007  * Enduro/X Middleware Platform for Distributed Transaction Processing
0008  * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009  * Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0010  * This software is released under one of the following licenses:
0011  * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0012  * See LICENSE file for full text.
0013  * -----------------------------------------------------------------------------
0014  * AGPL license:
0015  *
0016  * This program is free software; you can redistribute it and/or modify it under
0017  * the terms of the GNU Affero General Public License, version 3 as published
0018  * by the Free Software Foundation;
0019  *
0020  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022  * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0023  * for more details.
0024  *
0025  * You should have received a copy of the GNU Affero General Public License along 
0026  * with this program; if not, write to the Free Software Foundation, Inc.,
0027  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0028  *
0029  * -----------------------------------------------------------------------------
0030  * A commercial use license is available from Mavimax, Ltd
0031  * contact@mavimax.com
0032  * -----------------------------------------------------------------------------
0033  */
0034 
0035 #ifndef CMD_PROCESSOR_H
0036 #define CMD_PROCESSOR_H
0037 
0038 #ifdef  __cplusplus
0039 extern "C" {
0040 #endif
0041 
0042 /*---------------------------Includes-----------------------------------*/
0043 #include <ndrxdcmn.h>
0044 #include <ndrxd.h>
0045 /*---------------------------Externs------------------------------------*/
0046 extern command_state_t G_command_state;
0047 /*---------------------------Macros-------------------------------------*/
0048 /*---------------------------Enums--------------------------------------*/
0049 /*---------------------------Typedefs-----------------------------------*/
0050 typedef struct
0051 {
0052     void *mod_param1;       /**< Generic pointer    */
0053     int  param2;            /**< Generic param 2    */
0054     void *mod_param3;       /**< Generic pointer 3  */
0055     long param4;            /**< long param 4       */
0056 } mod_param_t;
0057 
0058 /**
0059  * With additional text field
0060  */
0061 typedef struct
0062 {
0063     void *mod_param1;       /**< Generic pointer    */
0064     int  param2;            /**< Generic param 2    */
0065     void *mod_param3;       /**< Generic pointer 3  */
0066     long param4;            /**< long param 4       */
0067     char param5[128];       /**< add text field     */
0068 } mod_param5_t;
0069 
0070 /*---------------------------Globals------------------------------------*/
0071 /*---------------------------Statics------------------------------------*/
0072 /*---------------------------Prototypes---------------------------------*/
0073 extern int cmd_processor_init(void);
0074 /* Handler to command processr */
0075 extern command_call_t * G_last_interactive_call;
0076 
0077 /* Command listing */
0078 extern int simple_command_reply(command_call_t * call,
0079                         int status, long flags,
0080                         mod_param_t *mod_params,
0081                         void (*p_mod)(command_reply_t *reply, size_t *send_size,
0082                         mod_param_t *mod_params),
0083                         long userfld1, int error_code, char *error_msg);
0084 
0085 extern int app_shutdown(command_startstop_t *call,
0086         /* have some progress feedback */
0087         void (*p_shutdown_progress)(command_call_t *call, pm_node_t *pm, int calltype),
0088         long *p_processes_shutdown);
0089 
0090 extern int app_sreload(command_startstop_t *call,
0091         void (*p_startup_progress)(command_startstop_t *call, pm_node_t *pm, int calltype),
0092         void (*p_shutdown_progress)(command_call_t *call, pm_node_t *pm, int calltype),
0093         long *p_processes_started);
0094 extern int do_respawn_check(void);
0095 extern int srv_send_ping (pm_node_t *p_pm);
0096 extern int start_process(command_startstop_t *cmd_call, pm_node_t *p_pm,
0097             void (*p_startup_progress)(command_startstop_t *call, pm_node_t *p_pm, int calltype),
0098             long *p_processes_started,
0099             int do_wait,
0100             int *abort, int *sg_snapshoot, int is_respawn);
0101 
0102 /* cmd_config.c: */
0103 extern int cmd_config_load(command_call_t * call, char *data, size_t len, int context);
0104 
0105 /* cmd_reload.c: */
0106 extern int cmd_reload(command_call_t * call, char *data, size_t len, int context);
0107 extern int cmd_testcfg (command_call_t * call, char *data, size_t len, int context);
0108 
0109 /* cmd_startstop.c: */
0110 extern int cmd_start (command_call_t * call, char *data, size_t len, int context);
0111 extern int cmd_stop (command_call_t * call, char *data, size_t len, int context);
0112 extern int cmd_sreload (command_call_t * call, char *data, size_t len, int context);
0113 extern int cmd_sreloadi (command_call_t * call, char *data, size_t len, int context);
0114 extern int cmd_notify (command_call_t * call, char *data, size_t len, int context);
0115 extern int cmd_abort (command_call_t * call, char *data, size_t len, int context);
0116 
0117 /* cmd_srvinfo: */
0118 extern int cmd_srvinfo (command_call_t * call, char *data, size_t len, int context);
0119 
0120 /* cmd_psc.c: */
0121 extern int cmd_psc (command_call_t * call, char *data, size_t len, int context);
0122 
0123 /* cmd_at.c: */
0124 extern int cmd_at (command_call_t * call, char *data, size_t len, int context);
0125 
0126 /* cmd_ppm.c: */
0127 extern int cmd_ppm (command_call_t * call, char *data, size_t len, int context);
0128 
0129 /* cmd_shm_psrv.c */
0130 extern int cmd_shm_psrv (command_call_t * call, char *data, size_t len, int context);
0131 
0132 /* cmd_shm_psvc.c */
0133 extern int cmd_shm_psvc (command_call_t * call, char *data, size_t len, int context);
0134 
0135 /* cmd_bridge.c: */
0136 extern int cmd_brcon (command_call_t * call, char *data, size_t len, int context);
0137 extern int cmd_brdiscon (command_call_t * call, char *data, size_t len, int context);
0138 extern int cmd_brrefresh (command_call_t * call, char *data, size_t len, int context);
0139 extern int cmd_getbrs (command_call_t * call, char *data, size_t len, int context);
0140 
0141 /* cmd_ping.c: */
0142 extern int cmd_srvpingrsp (command_call_t * call, char *data, size_t len, int context);
0143 
0144 /* cmd_pq.c: */
0145 extern int cmd_pq (command_call_t * call, char *data, size_t len, int context);
0146 
0147 /* cmd_env.c: */
0148 extern int cmd_pe (command_call_t * call, char *data, size_t len, int context);
0149 extern int cmd_set (command_call_t * call, char *data, size_t len, int context);
0150 extern int cmd_unset (command_call_t * call, char *data, size_t len, int context);
0151 
0152 /* cmd_appconfig.c */
0153 extern int cmd_appconfig (command_call_t * call, char *data, size_t len, 
0154         int context);
0155 
0156 /* cmd_dping.c */
0157 extern int cmd_dping (command_call_t * call, char *data, size_t len, 
0158         int context);
0159 
0160 extern int cmd_dsleep (command_call_t * call, char *data, size_t len, 
0161         int context);
0162 
0163 extern int cmd_blist (command_call_t * call, char *data, size_t len, 
0164         int context);
0165 
0166 #ifdef  __cplusplus
0167 }
0168 #endif
0169 
0170 #endif  /* CMD_PROCESSOR_H */
0171 
0172 /* vim: set ts=4 sw=4 et smartindent: */