/* * Copyright (c) 2001, 2004 Niels Provos * All rights reserved. * * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include #include #include "ui.h" #include "parser.h" #ifdef HAVE_PYTHON #include "pyextend.h" #endif char *ui_file = UI_FIFO; #define PROMPT "honeydctl> " #define WHITESPACE " \t" char *strnsep(char **, char *); int ui_command_help(struct evbuffer *, char *); int ui_command_python(struct evbuffer *, char *); struct command { char *cmd; char *short_help; char *long_help; int (*func)(struct evbuffer *, char *); }; struct command commands[] = { { "help", "help\t\t outputs a command help\n", "help [command]\n", ui_command_help }, { "!", "!\t\t runs a Python command in the Honeyd environment\n", "! ", ui_command_python }, { "delete", "delete\t\t removes configured templates and ports\n", "delete \n", }, { "list", "list\t\t lists configured templates or subsystems\n", "list