Author: Mark
Date: Sun May 22 06:58:20 2005
New Revision: 172
Modified:
branches/3.0/ChangeLog
branches/3.0/opsb.c
branches/3.0/opsb.h
branches/3.0/opsb_help.c
Log:
simplify command path and remove redundant help text
Modified: branches/3.0/ChangeLog
==============================================================================
--- branches/3.0/ChangeLog (original)
+++ branches/3.0/ChangeLog Sun May 22 06:58:20 2005
@@ -1,6 +1,7 @@
Open Proxy Scanning Bot Module for NeoStats Changelog.
==============================================================================
3.0.a3-dev - Mark (M) & Fish (F)
+ - Simplify command path. (M)
- Fix event and command return values. (M)
- Clean up config.h entries. (M)
- Fix Win32 CRT calls. (M)
Modified: branches/3.0/opsb.c
==============================================================================
--- branches/3.0/opsb.c (original)
+++ branches/3.0/opsb.c Sun May 22 06:58:20 2005
@@ -32,6 +32,9 @@
int startscan(scaninfo *scandata);
void save_ports();
static int unconf(void);
+int opsb_cmd_list (CmdParams* cmdparams);
+int opsb_cmd_add (CmdParams* cmdparams);
+int opsb_cmd_del (CmdParams* cmdparams);
Bot *opsb_bot;
@@ -141,7 +144,7 @@
return NS_SUCCESS;
}
-int opsb_cmd_ports_list (CmdParams* cmdparams)
+int opsb_cmd_list (CmdParams* cmdparams)
{
port_list *pl;
int i;
@@ -161,14 +164,11 @@
return NS_SUCCESS;
}
-int opsb_cmd_ports_add (CmdParams* cmdparams)
+int opsb_cmd_add (CmdParams* cmdparams)
{
port_list *pl;
lnode_t *lnode;
- if (cmdparams->ac < 3) {
- return NS_ERR_SYNTAX_ERROR;
- }
if (list_isfull(opsb.ports)) {
irc_prefmsg (opsb_bot, cmdparams->source, "Error, Ports list is full");
return NS_SUCCESS;
@@ -204,15 +204,12 @@
return NS_SUCCESS;
}
-int opsb_cmd_ports_del (CmdParams* cmdparams)
+int opsb_cmd_del (CmdParams* cmdparams)
{
port_list *pl;
int i;
lnode_t *lnode;
- if (cmdparams->ac < 1) {
- return NS_ERR_SYNTAX_ERROR;
- }
if (atoi(cmdparams->av[1]) != 0) {
lnode = list_first(opsb.ports);
i = 1;
@@ -242,18 +239,6 @@
return NS_SUCCESS;
}
-int opsb_cmd_ports (CmdParams* cmdparams)
-{
- if (!ircstrcasecmp (cmdparams->av[0], "LIST")) {
- return opsb_cmd_ports_list (cmdparams);
- } else if (!ircstrcasecmp (cmdparams->av[0], "ADD")) {
- return opsb_cmd_ports_add (cmdparams);
- } else if (!ircstrcasecmp (cmdparams->av[0], "DEL")) {
- return opsb_cmd_ports_del (cmdparams);
- }
- return NS_ERR_SYNTAX_ERROR;
-}
-
int do_set_cb (CmdParams* cmdparams, SET_REASON reason)
{
if( reason == SET_CHANGE )
@@ -277,11 +262,13 @@
static bot_cmd opsb_commands[]=
{
- {"STATUS", opsb_cmd_status, 0, NS_ULEVEL_OPER, opsb_help_status, opsb_help_status_oneline},
- {"REMOVE", opsb_cmd_remove, 1, NS_ULEVEL_OPER, opsb_help_remove, opsb_help_remove_oneline},
- {"CHECK", opsb_cmd_check, 1, NS_ULEVEL_OPER, opsb_help_check, opsb_help_check_oneline},
- {"PORTS", opsb_cmd_ports, 1, NS_ULEVEL_ADMIN, opsb_help_ports, opsb_help_ports_oneline},
- {NULL, NULL, 0, 0, NULL, NULL}
+ {"STATUS", opsb_cmd_status, 0, NS_ULEVEL_OPER, opsb_help_status, opsb_help_status_oneline},
+ {"REMOVE", opsb_cmd_remove, 1, NS_ULEVEL_OPER, opsb_help_remove, opsb_help_remove_oneline},
+ {"CHECK", opsb_cmd_check, 1, NS_ULEVEL_OPER, opsb_help_check, opsb_help_check_oneline},
+ {"ADD", opsb_cmd_add, 3, NS_ULEVEL_ADMIN, opsb_help_add, opsb_help_add_oneline},
+ {"DEL", opsb_cmd_del, 1, NS_ULEVEL_ADMIN, opsb_help_del, opsb_help_del_oneline},
+ {"LIST", opsb_cmd_list, 0, NS_ULEVEL_ADMIN, opsb_help_list, opsb_help_list_oneline},
+ {NULL, NULL, 0, 0, NULL, NULL}
};
static bot_setting opsb_settings[]=
Modified: branches/3.0/opsb.h
==============================================================================
--- branches/3.0/opsb.h (original)
+++ branches/3.0/opsb.h Sun May 22 06:58:20 2005
@@ -137,18 +137,20 @@
extern const char *opsb_help_check[];
extern const char *opsb_help_status[];
extern const char *opsb_help_remove[];
-extern const char *opsb_help_ports[];
+extern const char *opsb_help_add[];
+extern const char *opsb_help_del[];
+extern const char *opsb_help_list[];
extern const char opsb_help_status_oneline[];
extern const char opsb_help_remove_oneline[];
extern const char opsb_help_check_oneline[];
-extern const char opsb_help_ports_oneline[];
-extern const char opsb_help_set_oneline[];
+extern const char opsb_help_add_oneline[];
+extern const char opsb_help_del_oneline[];
+extern const char opsb_help_list_oneline[];
extern const char *opsb_help_set_akill [];
extern const char *opsb_help_set_targetip [];
extern const char *opsb_help_set_targetport [];
-extern const char *opsb_help_set_opmdomain [];
extern const char *opsb_help_set_maxbytes [];
extern const char *opsb_help_set_timeout [];
extern const char *opsb_help_set_openstring [];
Modified: branches/3.0/opsb_help.c
==============================================================================
--- branches/3.0/opsb_help.c (original)
+++ branches/3.0/opsb_help.c Sun May 22 06:58:20 2005
@@ -26,8 +26,9 @@
const char opsb_help_status_oneline[] = "View opsb state information";
const char opsb_help_remove_oneline[] = "Remove an akill set by opsb";
const char opsb_help_check_oneline[] = "Scan a selected user";
-const char opsb_help_ports_oneline[] = "Allows you to customize the ports scanned";
-const char opsb_help_set_oneline[] = "Change opsb configuration options";
+const char opsb_help_add_oneline[] = "Add a port to scanning";
+const char opsb_help_del_oneline[] = "Delete a port from scanning";
+const char opsb_help_list_oneline[] = "List protocols and ports scanned";
const char *opsb_about[] = {
"\2Open Proxy Scanning Bot Information\2",
@@ -78,14 +79,6 @@
NULL
};
-const char *opsb_help_set_opmdomain [] = {
- "\2OPMDOMAIN <DOMAIN>\2",
- "Domain used for blacklists.",
- "This setting should not be changed unless you know the",
- "effects in full",
- NULL
-};
-
const char *opsb_help_set_maxbytes [] = {
"\2MAXBYTES <MAX>\2",
"Maximum number of bytes we receive from a proxy before disconnecting",
@@ -148,21 +141,10 @@
NULL
};
-const char *opsb_help_ports[] = {
- "Syntax: \2PORTS <LIST>\2",
- " \2PORTS <ADD> <type> <port>\2",
- " \2PORTS <DEL> <index>\2",
- "",
- "This command lets you view or manipulate the ports",
- "and proxy types scanned when users connect to your",
- "IRC network. By Default, OPSB scans some default Ports",
- "but you may wish to update this list with some additional",
- "protocols and ports custom to your network"
- "",
- "\2LIST\2 will list the current ports and protocols scanned",
- "and a ID number for use in removing entries.",
+const char *opsb_help_add[] = {
+ "Syntax: \2ADD <type> <port>\2",
"",
- "\2ADD\2 will add an entry of <type> running on port <port>",
+ "Add an entry of <type> running on port <port>",
"to the port list.",
"<type> can be either:",
" HTTP",
@@ -173,10 +155,22 @@
" ROUTER",
"and port can be any valid port number. The new port is scanned",
"straight away",
+ NULL
+};
+
+const char *opsb_help_del[] = {
+ "Syntax: \2DEL <index>\2",
"",
- "\2DEL\2 will delete entry <index> from the list of",
- "ports. Requires a Restart of OPSB to become effective. Alternatively",
- "Reloading the OPSB module will make this effective",
+ "Delete entry <index> from the list of ports. ",
+ "Requires a restart of OPSB to become effective.",
+ NULL
+};
+
+const char *opsb_help_list[] = {
+ "Syntax: \2LIST\2",
+ "",
+ "List the current ports and protocols scanned",
+ "and a ID number for use in removing entries.",
NULL
};
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.