00001 00002 /*************************************************************************** 00003 * plugin_messages.h - Fawkes Plugin Messages 00004 * 00005 * Created: Wed Nov 22 17:24:16 2006 00006 * Copyright 2006 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __PLUGIN_NET_MESSAGES_H_ 00025 #define __PLUGIN_NET_MESSAGES_H_ 00026 00027 #include <netcomm/utils/dynamic_buffer.h> 00028 00029 namespace fawkes { 00030 00031 /** Plugin message type. */ 00032 typedef enum { 00033 MSG_PLUGIN_LOAD = 1, /**< request plugin load (plugin_load_msg_t) */ 00034 MSG_PLUGIN_LOADED = 2, /**< plugin loaded (plugin_loaded_msg_t) */ 00035 MSG_PLUGIN_LOAD_FAILED = 3, /**< plugin load failed (plugin_load_failed_msg_t) */ 00036 MSG_PLUGIN_UNLOAD = 4, /**< request plugin unload (plugin_unload_msg_t) */ 00037 MSG_PLUGIN_UNLOADED = 5, /**< plugin unloaded (plugin_unloaded_msg_t) */ 00038 MSG_PLUGIN_UNLOAD_FAILED = 6, /**< plugin unload failed (plugin_unload_failed_msg_t) */ 00039 MSG_PLUGIN_LIST_AVAIL = 7, /**< request list of available plugins */ 00040 MSG_PLUGIN_AVAIL_LIST = 8, /**< list of available plugins (plugin_list_msg_t) */ 00041 MSG_PLUGIN_AVAIL_LIST_FAILED = 9, /**< listing available plugins failed */ 00042 MSG_PLUGIN_LIST_LOADED = 10, /**< request lif of loaded plugins */ 00043 MSG_PLUGIN_LOADED_LIST = 11, /**< list of loaded plugins (plugin_list_msg_t) */ 00044 MSG_PLUGIN_LOADED_LIST_FAILED = 12, /**< listing loaded plugins failed */ 00045 MSG_PLUGIN_SUBSCRIBE_WATCH = 13, /**< Subscribe for watching load/unload events */ 00046 MSG_PLUGIN_UNSUBSCRIBE_WATCH = 14 /**< Unsubscribe from watching load/unload events */ 00047 } plugin_message_type_t; 00048 00049 00050 /** Maximum length of the plugin name field. */ 00051 #define PLUGIN_MSG_NAME_LENGTH 32 00052 00053 /** Load plugin message. 00054 * Message type Id is MSG_PLUGIN_LOAD. 00055 */ 00056 typedef struct { 00057 char name[PLUGIN_MSG_NAME_LENGTH]; /**< name of the plugin to load. */ 00058 } plugin_load_msg_t; 00059 00060 /** Unload plugin message. 00061 * Message type Id is MSG_PLUGIN_UNLOAD. 00062 */ 00063 typedef struct { 00064 char name[PLUGIN_MSG_NAME_LENGTH]; /**< name of te plugin to unload. */ 00065 } plugin_unload_msg_t; 00066 00067 /** Plugin loaded message. 00068 * Message type ID is MSG_PLUGIN_LOADED. 00069 */ 00070 typedef struct { 00071 char name[PLUGIN_MSG_NAME_LENGTH]; /**< name of the plugin that has been loaded */ 00072 } plugin_loaded_msg_t; 00073 00074 /** Plugin load failed. */ 00075 typedef struct { 00076 char name[PLUGIN_MSG_NAME_LENGTH]; /**< name of plugin that could not be unloaded */ 00077 } plugin_load_failed_msg_t; 00078 00079 /** Plugin unload failed. */ 00080 typedef struct { 00081 char name[PLUGIN_MSG_NAME_LENGTH]; /**< name of plugin that could not be unloaded */ 00082 } plugin_unload_failed_msg_t; 00083 00084 /** Plugin unloaded message. 00085 * Message type ID is MSG_PLUGIN_UNLOADED. 00086 */ 00087 typedef struct { 00088 char name[PLUGIN_MSG_NAME_LENGTH]; /**< name of the plugin that has been unloaded */ 00089 } plugin_unloaded_msg_t; 00090 00091 /** Plugin list message. 00092 * Message type ID is MSG_PLUGIN_LIST. 00093 */ 00094 typedef struct { 00095 dynamic_list_t plugin_list; /**< dynamically growing list of plugin names. */ 00096 } plugin_list_msg_t; 00097 00098 00099 } // end namespace fawkes 00100 00101 #endif