/* * 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 connection.c // Administration command handle and defined in cmdserver.c extern const char *admincommand_STOP; //= "STOP"; // stop daemon master & let child serving current media extern const char *admincommand_FORCESTOP; //= "FORCESTOP"; // stop daemon master and any child running extern const char *admincommand_RELOADCONFIG; //= "RELOAD_CONFIG"; // invoke a reload config to mediacenter extern const char *admincommand_STATUS; //= "STATUS"; // give back a status of daemon (in text,html, kml ?...) extern const char *admincommand_GET_TXT_CONFIG; //= "GET_TXT_CONFIG"; // give back a text edition of kissdx server config // 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_status = 100, adm_unknown = -9999, adm_err = -1 }; void handle_local_command(int sd_child); void setup_local_commandserver_socket(int * sd_loccmd); void handle_admincommand_stop(pid_t daemon_pid); // Send SIGTERM to MasterDaemon void handle_admincommand_forcestop(void); // Send SIGTERM to the process group of kissdx void handle_admincommand_reloadconfig (void); // 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() 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_*/