This repository has been archived on 2025-02-12. You can view files and clone it, but cannot push or open issues or pull requests.
NeoStats-opsb/opsb.h

128 lines
3.5 KiB
C
Raw Permalink Normal View History

2004-09-10 15:38:14 +00:00
/* NeoStats - IRC Statistical Services
2005-01-24 22:22:57 +00:00
** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
2004-09-10 15:38:14 +00:00
** http://www.neostats.net/
**
** 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
**
2002-08-31 09:28:34 +00:00
** NetStats CVS Identification
2003-09-22 15:14:02 +00:00
** $Id$
2002-08-31 09:28:34 +00:00
*/
#ifndef OPSB_H
#define OPSB_H
2005-05-22 22:03:31 +00:00
#include MODULECONFIG
2005-10-19 22:20:27 +00:00
/* these are some state flags */
#define DOING_SCAN 0x0008
#define GOTOPENPROXY 0x0010
#define FIN_SCAN 0x0080
2002-08-31 09:28:34 +00:00
/* max scans in the max concurrent scans at any one time */
#define MAX_SCANS 100
/* max queue is the max amount of scans that may be concurrent and queued. */
2005-10-19 22:04:37 +00:00
#define MAX_QUEUE ( MAX_SCANS * 100 )
/* max no of ports to scan */
#define MAX_PORTS 50
2002-08-31 09:28:34 +00:00
#define SCAN_SOCKET_COUNT 7
2005-10-19 22:20:27 +00:00
typedef struct port_list {
int type;
int port;
int numopen;
} port_list;
2004-08-01 23:05:50 +00:00
typedef struct scaninfo{
2002-08-31 09:28:34 +00:00
char who[MAXHOST];
int state;
char lookup[MAXHOST];
char server[MAXHOST];
2004-08-01 23:05:50 +00:00
struct in_addr ip;
Client *reqclient;
2002-08-31 09:28:34 +00:00
time_t started;
int doneban;
list_t *connections;
2004-08-01 23:05:50 +00:00
} scaninfo;
2002-08-31 09:28:34 +00:00
2005-10-19 22:20:27 +00:00
typedef struct opsbcfg {
2005-03-04 21:36:15 +00:00
char targetip[MAXHOST];
char openstring[BUFSIZE];
2002-08-31 09:28:34 +00:00
int targetport;
int maxbytes;
int timeout;
2005-10-19 22:16:31 +00:00
unsigned int socks;
2002-08-31 09:28:34 +00:00
int open;
int scanned;
2004-02-26 19:49:27 +00:00
char scanmsg[BUFSIZE];
2005-03-04 21:36:15 +00:00
int akilltime;
2002-08-31 09:28:34 +00:00
int confed;
int cachetime;
int cachesize;
2003-01-30 11:29:25 +00:00
int cachehits;
2005-03-04 21:36:15 +00:00
int doakill;
int doreport;
2004-02-26 19:49:27 +00:00
int verbose;
2005-03-07 23:27:30 +00:00
int exclusions;
list_t *ports;
2005-10-19 22:20:27 +00:00
} opsbcfg;
2002-08-31 09:28:34 +00:00
2005-10-19 22:20:27 +00:00
extern Bot *opsb_bot;
extern opsbcfg opsb;
/* this is the list of items to be queued */
extern list_t *opsbq;
/* this is the list of currently active scans */
extern list_t *opsbl;
/* this is a list of cached scans */
extern list_t *cache;
2002-08-31 09:28:34 +00:00
/* opsb.c */
2005-10-20 21:22:15 +00:00
int findscan( const void *key1, const void *key2 );
void checkqueue( void );
void addtocache( unsigned long ip );
2002-08-31 09:28:34 +00:00
/* proxy.c */
2005-10-19 22:04:37 +00:00
void start_proxy_scan( scaninfo *scandata );
int opsb_cmd_status( const CmdParams *cmdparams );
int init_scanengine( void );
char *type_of_proxy( int type );
int get_proxy_by_name( const char *name );
int load_ports( void );
2005-05-23 22:58:06 +00:00
void save_ports( void );
2003-10-29 12:11:16 +00:00
2004-02-26 19:49:27 +00:00
/* help text */
2004-08-01 23:05:50 +00:00
extern const char *opsb_about[];
2004-02-26 19:49:27 +00:00
extern const char *opsb_help_check[];
extern const char *opsb_help_status[];
extern const char *opsb_help_remove[];
extern const char *opsb_help_add[];
extern const char *opsb_help_del[];
extern const char *opsb_help_list[];
2004-02-26 19:49:27 +00:00
2005-03-04 21:36:15 +00:00
extern const char *opsb_help_set_akill [];
2004-02-26 19:49:27 +00:00
extern const char *opsb_help_set_targetip [];
extern const char *opsb_help_set_targetport [];
extern const char *opsb_help_set_maxbytes [];
extern const char *opsb_help_set_timeout [];
extern const char *opsb_help_set_openstring [];
extern const char *opsb_help_set_scanmsg [];
2005-03-04 21:36:15 +00:00
extern const char *opsb_help_set_akilltime [];
2004-02-26 19:49:27 +00:00
extern const char *opsb_help_set_cachetime [];
extern const char *opsb_help_set_verbose [];
2005-03-07 23:27:30 +00:00
extern const char *opsb_help_set_exclusions[];
extern const char *opsb_help_set_cachesize[];
extern const char *opsb_help_set_doreport[];
2002-08-31 09:28:34 +00:00
#endif /* OPSB_H */