コード例 #1
0
ファイル: ec_curses_plugins.c プロジェクト: 0x0mar/ettercap
static void curses_load_plugin(const char *path, char *file)
{
   int ret;

   DEBUG_MSG("curses_load_plugin %s/%s", path, file);

   /* load the plugin */
   ret = plugin_load_single(path, file);

   /* check the return code */
   switch (ret) {
      case ESUCCESS:
         curses_message("Plugin loaded successfully");
         break;
      case -EDUPLICATE:
         ui_error("plugin %s already loaded...", file);
         break;
      case -EVERSION:
         ui_error("plugin %s was compiled for a different ettercap version...", file);
         break;
      case -EINVALID:
      default:
         ui_error("Cannot load the plugin...\nthe file may be an invalid plugin\nor you don't have the permission to open it");
         break;
   }
}
コード例 #2
0
static void gtkui_load_plugin(char *full)
{
   char *path, *file;
   int ret;

   path = full;
   file = strrchr(full, '/');
   /* remove the last /
      split path and file
      increment file pointer to point to filenam */
   *file++ = 0;

   DEBUG_MSG("gtk_load_plugin %s/%s", path, file);

   /* load the plugin */
   ret = plugin_load_single(path, file);

   /* check the return code */
   switch (ret) {
      case ESUCCESS:
         gtkui_message("Plugin loaded successfully");
         break;
      case -EDUPLICATE:
         ui_error("plugin %s already loaded...", file);
         break;
      case -EVERSION:
         ui_error("plugin %s was compiled for a different ettercap version...", file);
         break;
      case -EINVALID:
      default:
         ui_error("Cannot load the plugin...\nthe file may be an invalid plugin\nor you don't have the permission to open it");
         break;
   }
}