/* * kissdx - KiSS PC-Link Daemon eXtended (based on kissd) * * Copyright (C) * Portions Copyright (C) 2006 Vidar Tysse * Portions Copyright (C) 2007 Olivier Kahn * * Heavily based on kiss4lin, * Copyright (C) 2004 Jacob Kolding * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef CMCSERVER_H_ #define CMCSERVER_H_ // === Constant definition in cmdserver.c // Administration command handle and defined in cmdserver.c extern const char *ADMCMD_SET; //= "ADMCMD_SET"; // Client request : ADMCMD_SET|VERBOSE_LOG|WARNING\n extern const char *ADMCMD_GET; //= "ADMCMD_GET"; // Client request : ADMCMD_GET|VERBOSE_LOG|\n extern const char *ADMCMD_ACTION; //= "ADMCMD_ACTION"; // Client request : ADMCMD_ACTION|STOP|\n extern const char *ADMCMD_ACK; //= "ADMCMD_ACK"; // Server response: ADMCMD_ACK|STOP|OK\n extern const char *ADMCMD_SUCC; //= "OK"; extern const char *ADMCMD_FAIL; //= "ERR"; extern const char *ADMCMD_EOL; //= "EOL||"; // Keyword to request a connection close by partner extern const char *ADMCMD_STOP; //= "STOP"; // stop daemon master & let child serving current media extern const char *ADMCMD_FORCESTOP; //= "FORCESTOP"; // stop daemon master and any child running extern const char *ADMCMD_RELOADCONFIG; //= "RELOAD_CONFIG"; // invoke a reload config to mediacenter extern const char *ADMCMD_GETTXTCONFIG; //= "GET_TXT_CONFIG"; // give back a text edition of kissdx server config extern const char *ADMCMD_GETDICT; //= "GET_DICT"; // give back a text edition of kissdx server config extern const char *ADMCMD_STATUS; //= "STATUS"; // give back a status of daemon (in text,html, kml ?...) extern const char *ADMCMD_UNKNOWN; //= "UNKNOWN"; // Unknown admin command // List of administration request received enum admin_request_t { // return value of parse_admmin_command function adm_stop = 10, adm_forcestop = 20, adm_reloadconfig= 30, adm_gettxtconfig= 50, adm_getdict = 60, adm_status = 100, adm_set = 200, adm_get = 300, adm_unknown = -9999, adm_err = -1, adm_experimental = 8888 }; void handle_local_command(int sd_child); void setup_local_commandserver_socket(int * sd_loccmd); void handle_admincommand_stop(pid_t daemon_pid,int sd_client); // Send SIGTERM to MasterDaemon void handle_admincommand_forcestop(int sd_client); // Send SIGTERM to the process group of kissdx void handle_admincommand_reloadconfig (int sd_client); // Parse config... (Chg port of AdmCmd not supported) void handle_admincommand_gettxtconfig (int sd_client); // Send in txt, a variant of config.c:show_current_config_Verbose() void handle_admincommand_getdict (int sd_client); // Send dictionnary of admcmd supported void send_admincommand_ack (int sd_client, char *ack_type, char *admcmd, char *msg); void handle_admincommand_get_config_value (int sd_client, char *cfg_option, char *cfg_param); enum admin_request_t parse_admcmd_request(int sd_admcmd, char *opt_admcmd, int opt_admcmd_size); // Parse AdmCmd and response which 'enum admin_request_t' #endif /*CMCSERVER_H_*/