autosec-devel Mailing List for Automated Security Tools (Page 4)
Brought to you by:
red0x
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(30) |
Aug
(53) |
Sep
(4) |
Oct
(39) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
(1) |
Apr
(31) |
May
(15) |
Jun
(1) |
Jul
(1) |
Aug
(7) |
Sep
(42) |
Oct
(37) |
Nov
(39) |
Dec
(15) |
2004 |
Jan
(10) |
Feb
(17) |
Mar
(2) |
Apr
(56) |
May
(22) |
Jun
(17) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
2007 |
Jan
(2) |
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <no...@so...> - 2004-04-08 23:42:42
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000042 ======================================================================= Reporter: red0x Handler: red0x ======================================================================= Project: sonar Bug ID: 0000042 Category: Feature Requests Reproducibility: N/A Severity: feature Priority: normal Status: closed ======================================================================= Date Submitted: 10-14-03 14:09 PDT Last Modified: 04-08-04 16:42 PDT ======================================================================= Summary: XML output plugin Description: Ability to output scan results in standard XML ======================================================================= ----------------------------------------------------------------------- red0x - 11-17-03 14:27 PST ----------------------------------------------------------------------- XML output added in 1.2.1 ----------------------------------------------------------------------- red0x - 04-08-04 16:42 PDT ----------------------------------------------------------------------- damn heisenbugs. finally closing this bug. |
From: red0x <re...@us...> - 2004-04-08 23:41:30
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8400/plugins Modified Files: log_xml.c log_file.c Log Message: Tracked down a heisenbug or two... Index: log_xml.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/log_xml.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** log_xml.c 8 Apr 2004 19:11:02 -0000 1.10 --- log_xml.c 8 Apr 2004 23:28:16 -0000 1.11 *************** *** 72,76 **** pthis.ready = false; pthis.version = 6; /* set API version 6 */ - pthis.selected = false; pthis.plugin_char = 'X'; --- 72,75 ---- *************** *** 159,165 **** // check to see if my_file points to prev allocated data? ! my_file = (char *)Malloc(filename_len); ! memset(my_file, 0, filename_len); ! strncpy(my_file, c_data, filename_len); #ifdef DEBUG printf("fopen(\"%s\", \"%s\");\n", my_file, append_or_overwrite); --- 158,162 ---- // check to see if my_file points to prev allocated data? ! my_file = strndup(c_data, filename_len); #ifdef DEBUG printf("fopen(\"%s\", \"%s\");\n", my_file, append_or_overwrite); *************** *** 167,171 **** my_fp = fopen(my_file, append_or_overwrite); free(append_or_overwrite); ! if(!my_fp) { *(pthis.err) = PLUGIN_NOFILE; --- 164,168 ---- my_fp = fopen(my_file, append_or_overwrite); free(append_or_overwrite); ! if(my_fp == NULL) { *(pthis.err) = PLUGIN_NOFILE; Index: log_file.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/log_file.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** log_file.c 8 Apr 2004 19:11:02 -0000 1.25 --- log_file.c 8 Apr 2004 23:28:17 -0000 1.26 *************** *** 158,164 **** // check to see if my_file points to prev allocated data? ! my_file = (char *)Malloc(filename_len); ! memset(my_file, 0, filename_len); ! strncpy(my_file, c_data, filename_len); #ifdef DEBUG printf("fopen(\"%s\", \"%s\");\n", my_file, append_or_overwrite); --- 158,162 ---- // check to see if my_file points to prev allocated data? ! my_file = strndup(c_data, filename_len); #ifdef DEBUG printf("fopen(\"%s\", \"%s\");\n", my_file, append_or_overwrite); |
From: <no...@so...> - 2004-04-08 23:17:23
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000044 ======================================================================= Reporter: red0x Handler: pharkas ======================================================================= Project: sonar Bug ID: 0000044 Category: Other Reproducibility: N/A Severity: tweak Priority: normal Status: closed ======================================================================= Date Submitted: 02-05-04 19:36 PST Last Modified: 04-08-04 16:17 PDT ======================================================================= Summary: Duplicate options structures are clutter Description: The two structures, sonarContext and pluginContext are clutter. I would like to get rid of them, and make one options structure, that holds the values for all the global options (ie, options in the main sonar engine usage). ======================================================================= ----------------------------------------------------------------------- pharkas - 02-28-04 04:50 PST ----------------------------------------------------------------------- Fixed, but minimally tested |
From: <no...@so...> - 2004-04-08 23:13:37
|
The following bug has been RESOLVED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000043 ======================================================================= Reporter: red0x Handler: red0x ======================================================================= Project: sonar Bug ID: 0000043 Category: Bugs Reproducibility: always Severity: feature Priority: normal Status: resolved Resolution: fixed ======================================================================= Date Submitted: 12-05-03 14:26 PST Last Modified: 04-08-04 16:13 PDT ======================================================================= Summary: Parallel scanning broken Description: Scanning with two different types in parallel is broken. ======================================================================= ----------------------------------------------------------------------- red0x - 02-02-04 18:04 PST ----------------------------------------------------------------------- CVS code seems to address this pretty well, however, the ACK scan (rfc793.c) still breaks the parallelism of our scanning. ----------------------------------------------------------------------- red0x - 02-28-04 04:44 PST ----------------------------------------------------------------------- I'm going to wait until the options structure is updated to address this issue. I am leaving the bug assigned to me, but open. ----------------------------------------------------------------------- red0x - 04-08-04 16:13 PDT ----------------------------------------------------------------------- CVS fix. Should work for 1.2.2. |
From: red0x <re...@us...> - 2004-04-08 23:09:57
|
Update of /cvsroot/autosec/sonar/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2081/doc Modified Files: Makefile.am Makefile.in Log Message: Modified makefiles to install plugin manual Index: Makefile.in =================================================================== RCS file: /cvsroot/autosec/sonar/doc/Makefile.in,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile.in 8 Apr 2004 22:38:41 -0000 1.17 --- Makefile.in 8 Apr 2004 22:56:44 -0000 1.18 *************** *** 289,293 **** -rm -f Makefile.in ! install-data-local: html @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) --- 289,293 ---- -rm -f Makefile.in ! install-data-local: html sonar_plugin_man.pdf @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) *************** *** 298,301 **** --- 298,302 ---- cp -rf $$d$$p $(DESTDIR)$(pkgdatadir); \ done + cp -f sonar_plugin_man.pdf $(DESTDIR)$(pkgdatadir) uninstall-local: *************** *** 306,309 **** --- 307,311 ---- rm -rf $(DESTDIR)$(pkgdatadir)/$$d$$p; \ done + rm -f $(DESTDIR)$(pkgdatadir)/sonar_plugin_man.pdf html: Index: Makefile.am =================================================================== RCS file: /cvsroot/autosec/sonar/doc/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 8 Apr 2004 22:38:41 -0000 1.6 --- Makefile.am 8 Apr 2004 22:56:44 -0000 1.7 *************** *** 22,26 **** -rm -f Makefile.in ! install-data-local: html @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) --- 22,26 ---- -rm -f Makefile.in ! install-data-local: html sonar_plugin_man.pdf @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) *************** *** 31,34 **** --- 31,35 ---- cp -rf $$d$$p $(DESTDIR)$(pkgdatadir); \ done + cp -f sonar_plugin_man.pdf $(DESTDIR)$(pkgdatadir) uninstall-local: *************** *** 39,42 **** --- 40,44 ---- rm -rf $(DESTDIR)$(pkgdatadir)/$$d$$p; \ done + rm -f $(DESTDIR)$(pkgdatadir)/sonar_plugin_man.pdf html: |
From: red0x <re...@us...> - 2004-04-08 22:51:55
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30382 Modified Files: Makefile.am Makefile.in Log Message: Modified makefiles to autogenerate the plugin_manual when you make docs Index: Makefile.in =================================================================== RCS file: /cvsroot/autosec/sonar/Makefile.in,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Makefile.in 2 Feb 2004 09:33:27 -0000 1.30 --- Makefile.in 8 Apr 2004 22:38:41 -0000 1.31 *************** *** 109,118 **** AUX_DIST_EXTRA = ! EXTRA_DIST = bootstrap doc/sonar.1 CONTRIB - #CONTRIB doc/Makefile.in doc/docConf.in \ - # admin/config.sub admin/config.guess admin/install-sh admin/missing \ - # admin/mkinstalldirs plugins/network_icmp.c plugins/rfc793.c plugins/rfc793.h plugins/bare.c plugins/bare.h plugins/passive.c plugins/passive.h plugins/log_file.c #plugins/log_file.h plugins/network_icmp.h plugins/Makefile.am plugins/Makefile.in \ - # doc/sonar.1 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \ stamp-h.in $(AUX_DIST) --- 109,122 ---- AUX_DIST_EXTRA = ! EXTRA_DIST = bootstrap doc/sonar.1 CONTRIB doc/sonar_plugin_man.tex \ ! doc/example/bare-1.c doc/example/bare-1.h \ ! doc/example/sonar_inp_list-1.c doc/example/sonar_inp_list-1.h \ ! doc/example/sonar_inp_list-2.c doc/example/sonar_inp_list-2.h \ ! doc/example/sonar_inp_list-3.c doc/example/sonar_inp_list-4.c \ ! doc/example/sonar_inp_list-5.c doc/example/sonar_inp_list-6.c \ ! doc/example/sonar_inp_list-7.c doc/example/sonar_inp_list.c \ ! doc/example/sonar_inp_list.h ! MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \ stamp-h.in $(AUX_DIST) *************** *** 327,331 **** $(am__remove_distdir) mkdir $(distdir) ! $(mkinstalldirs) $(distdir)/doc @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ --- 331,335 ---- $(am__remove_distdir) mkdir $(distdir) ! $(mkinstalldirs) $(distdir)/doc $(distdir)/doc/example @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ Index: Makefile.am =================================================================== RCS file: /cvsroot/autosec/sonar/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile.am 2 Feb 2004 09:33:27 -0000 1.15 --- Makefile.am 8 Apr 2004 22:38:40 -0000 1.16 *************** *** 16,24 **** AUX_DIST_EXTRA = ! EXTRA_DIST = bootstrap doc/sonar.1 CONTRIB ! #CONTRIB doc/Makefile.in doc/docConf.in \ ! # admin/config.sub admin/config.guess admin/install-sh admin/missing \ ! # admin/mkinstalldirs plugins/network_icmp.c plugins/rfc793.c plugins/rfc793.h plugins/bare.c plugins/bare.h plugins/passive.c plugins/passive.h plugins/log_file.c #plugins/log_file.h plugins/network_icmp.h plugins/Makefile.am plugins/Makefile.in \ ! # doc/sonar.1 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \ --- 16,27 ---- AUX_DIST_EXTRA = ! EXTRA_DIST = bootstrap doc/sonar.1 CONTRIB doc/sonar_plugin_man.tex \ ! doc/example/bare-1.c doc/example/bare-1.h \ ! doc/example/sonar_inp_list-1.c doc/example/sonar_inp_list-1.h \ ! doc/example/sonar_inp_list-2.c doc/example/sonar_inp_list-2.h \ ! doc/example/sonar_inp_list-3.c doc/example/sonar_inp_list-4.c \ ! doc/example/sonar_inp_list-5.c doc/example/sonar_inp_list-6.c \ ! doc/example/sonar_inp_list-7.c doc/example/sonar_inp_list.c \ ! doc/example/sonar_inp_list.h MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \ |
From: red0x <re...@us...> - 2004-04-08 22:51:54
|
Update of /cvsroot/autosec/sonar/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30382/doc Modified Files: Makefile.am Makefile.in Log Message: Modified makefiles to autogenerate the plugin_manual when you make docs Index: Makefile.in =================================================================== RCS file: /cvsroot/autosec/sonar/doc/Makefile.in,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile.in 6 Dec 2003 00:13:25 -0000 1.16 --- Makefile.in 8 Apr 2004 22:38:41 -0000 1.17 *************** *** 96,99 **** --- 96,100 ---- man1_MANS = sonar.1 DOCSUBDIRS = html + EXTRA_DIST = sonar_plugin_man.tex subdir = doc mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs *************** *** 269,273 **** uninstall-info-am uninstall-local uninstall-man uninstall-man1 ! debug: all --- 270,274 ---- uninstall-info-am uninstall-local uninstall-man uninstall-man1 ! sonar_plugin_man.pdf: sonar_plugin_man.tex debug: all *************** *** 278,281 **** --- 279,283 ---- -rm -rf html latex -rm docConf Makefile sonar.1 + -rm sonar_plugin_man.pdf sonar_plugin_man.log sonar_plugin_man.aux sonar_plugin_man.toc clean-generic: *************** *** 310,314 **** $(DOXYGEN) docConf ! all-am: html # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- 312,319 ---- $(DOXYGEN) docConf ! sonar_plugin_man.pdf: sonar_plugin_man.tex ! if [ -x `which pdflatex` ]; then `which pdflatex` $(top_srcdir)/doc/sonar_plugin_man.tex > /dev/null; fi ! ! all-am: html sonar_plugin_man.pdf # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Index: Makefile.am =================================================================== RCS file: /cvsroot/autosec/sonar/doc/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 6 Dec 2003 00:13:19 -0000 1.5 --- Makefile.am 8 Apr 2004 22:38:41 -0000 1.6 *************** *** 1,7 **** man1_MANS = sonar.1 DOCSUBDIRS = html ! debug: all ! install-debug: install --- 1,7 ---- man1_MANS = sonar.1 DOCSUBDIRS = html ! sonar_plugin_man.pdf: sonar_plugin_man.tex debug: all ! EXTRA_DIST = sonar_plugin_man.tex install-debug: install *************** *** 12,15 **** --- 12,16 ---- -rm -rf html latex -rm docConf Makefile sonar.1 + -rm sonar_plugin_man.pdf sonar_plugin_man.log sonar_plugin_man.aux sonar_plugin_man.toc clean-generic: *************** *** 44,46 **** $(DOXYGEN) docConf ! all-am: html --- 45,50 ---- $(DOXYGEN) docConf ! sonar_plugin_man.pdf: sonar_plugin_man.tex ! if [ -x `which pdflatex` ]; then `which pdflatex` $(top_srcdir)/doc/sonar_plugin_man.tex > /dev/null; fi ! ! all-am: html sonar_plugin_man.pdf |
From: red0x <re...@us...> - 2004-04-08 22:50:01
|
Update of /cvsroot/autosec/sonar/doc/example In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30009/doc/example Modified Files: sonar_inp_list-1.c sonar_inp_list-4.c sonar_inp_list.c Log Message: Errata fix Index: sonar_inp_list-1.c =================================================================== RCS file: /cvsroot/autosec/sonar/doc/example/sonar_inp_list-1.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sonar_inp_list-1.c 8 Apr 2004 21:54:59 -0000 1.1 --- sonar_inp_list-1.c 8 Apr 2004 22:36:33 -0000 1.2 *************** *** 22,26 **** */ ! #include "include/iplist.h" #include <sonar/plugin.h> #include <assert.h> // for assert(3) --- 22,26 ---- */ ! #include "sonar_inp_list.h" #include <sonar/plugin.h> #include <assert.h> // for assert(3) *************** *** 72,79 **** // This is how we get accessed from sonar. ! // for 'R', we are used like this: 'sonar -iR' ! plugin_context.plugin_char = 'R'; ! plugin_context.shortname = "random"; // short name ! plugin_context.longname = "Random Input Plugin"; // description // provide pointers to corresponding functions. --- 72,79 ---- // This is how we get accessed from sonar. ! // for 'L', we are used like this: 'sonar -iL' ! plugin_context.plugin_char = 'L'; ! plugin_context.shortname = "list"; // short name ! plugin_context.longname = "IP List Input Plugin"; // description // provide pointers to corresponding functions. Index: sonar_inp_list-4.c =================================================================== RCS file: /cvsroot/autosec/sonar/doc/example/sonar_inp_list-4.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sonar_inp_list-4.c 8 Apr 2004 21:54:59 -0000 1.1 --- sonar_inp_list-4.c 8 Apr 2004 22:36:33 -0000 1.2 *************** *** 12,16 **** if(hostname[0] == '#') continue; ! hostname[BUFSIZE] = '\0'; return PLUGIN_OK; } --- 12,16 ---- if(hostname[0] == '#') continue; ! hostname[strlen(hostname)-1] = '\0'; return PLUGIN_OK; } Index: sonar_inp_list.c =================================================================== RCS file: /cvsroot/autosec/sonar/doc/example/sonar_inp_list.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sonar_inp_list.c 8 Apr 2004 21:54:59 -0000 1.1 --- sonar_inp_list.c 8 Apr 2004 22:36:33 -0000 1.2 *************** *** 22,26 **** */ ! #include "include/iplist.h" #include <sonar/plugin.h> #include <assert.h> // for assert(3) --- 22,26 ---- */ ! #include "sonar_inp_list.h" #include <sonar/plugin.h> #include <assert.h> // for assert(3) *************** *** 72,79 **** // This is how we get accessed from sonar. ! // for 'R', we are used like this: 'sonar -iR' ! plugin_context.plugin_char = 'R'; ! plugin_context.shortname = "random"; // short name ! plugin_context.longname = "Random Input Plugin"; // description // provide pointers to corresponding functions. --- 72,79 ---- // This is how we get accessed from sonar. ! // for 'L', we are used like this: 'sonar -iL' ! plugin_context.plugin_char = 'L'; ! plugin_context.shortname = "list"; // short name ! plugin_context.longname = "IP List Input Plugin"; // description // provide pointers to corresponding functions. *************** *** 165,169 **** if(hostname[0] == '#') continue; ! hostname[BUFSIZE] = '\0'; return PLUGIN_OK; } --- 165,169 ---- if(hostname[0] == '#') continue; ! hostname[strlen(hostname)-1] = '\0'; return PLUGIN_OK; } |
From: red0x <re...@us...> - 2004-04-08 22:10:45
|
Update of /cvsroot/autosec/sonar/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22286 Added Files: sonar_plugin_man.tex Log Message: Added the plugin developer's manual --- NEW FILE: sonar_plugin_man.tex --- \documentclass[a4paper,10pt]{report} \usepackage{verbatim} % Title Page \title{Sonar Plugin Manual \\ 1.2.2} \author{Automated Security Tools} \begin{document} \maketitle \begin{abstract} This document exists to help you on your way to programming plugins for the \emph{sonar} network reconnaissance software. It will cover how to use the functions provided by sonar, what functions to provide, and how they must behave. Anyone interested in the debugging, developing, or understanding of sonar plugins should read this document. This paper will walk you through the development of a fully functional input plugin. Part I of the document gives the API specification, and part II walks through the development of a sample input plugin. \end{abstract} \tableofcontents \part{Plugin API Specification} \chapter{Plugin Functions} Depending on what type of plugin you are writing, you must specify certain required functions and fill them in. Input, Output, and Networking plugins have different requirements that we will outline below. Because of the structure of sonar's plugin API, you need not name your functions are they are named below, and in fact, I encourage you to choose a more descriptive name for your functions. However, you must provide a function that will perform the main task of the functions. Each plugin is assumed to return PLUGIN\_OK on success if it has an \emph{int} return type. \section{Input Plugins} \subsection{plugin\_open} \begin{verbatim} static int plugin_open(void *cmdline, int len); \end{verbatim} plugin\_open performs the following functions: \\ \begin{enumerate} \item Returns PLUGIN\_NOFILE on file not found errors. \item Marks your plugin as \emph{ready} if everything it is ready to begin giving input. \item If your plugin needs to open files or sockets, do that here. \item If everything preceeded without errors, return the size of the buffer you will be returning in plugin\_next. This step is crucially important. \item If you encountered errors, set \emph{errno} appropriately, and return PLUGIN\_ERROR \end{enumerate} \subsection{plugin\_next} \begin{verbatim} static int plugin_next(char *hostname); \end{verbatim} plugin\_next performs the following functions: \\ \begin{enumerate} \item Returns the next ip-address as a string pointed to by \emph{hostname}. \item Once the last hostname or ip-address has been returned, it should return PLUGIN\_EOF to signal that no more hostnames will follow. \item Any subsequent calls must result in the same error. \end{enumerate} \subsection{plugin\_close} \begin{verbatim} static int plugin_close(void); \end{verbatim} plugin\_close performs the following functions: \\ \begin{enumerate} \item Close any files or sockets opened in plugin\_open. \item Return the plugin to the state it was before plugin\_open was called. \item After this, a subsequent call to plugin\_open should \emph{not} return an error. \item Returns PLUGIN\_OK on success. \end{enumerate} \section{Output Plugins} \subsection{plugin\_output} \begin{verbatim} static int plugin_output(char *msg, va_list *ap); \end{verbatim} plugin\_output performs the following functions: \\ \begin{enumerate} \item Returns PLUGIN\_NOPEN if plugin is not marked as ready and selected. \item Returns PLUGIN\_NOFILE if the required output medium is not opened. It may provide some way to re-open it and mark it's errno accordingly. \item Print the msg and va-list using \emph{vfprintf(3)}. \end{enumerate} \subsection{plugin\_results} \begin{verbatim} static int plugin_results(target_t *result, unsigned int num); \end{verbatim} plugin\_results performs the following functions: \\ \begin{enumerate} \item Iterate over the linked list of results in \emph{result}. Assume there are \emph{num} entries, while still ensuring not to dereference \emph{NULL}. \item Output the contents of the target\_t structure in a way that makes sense for your output plugin. \item Ensure that each hostnames's port status, stats, and comments are printed out. \end{enumerate} \section{Network Plugins} \subsection{plugin\_sweep} \begin{verbatim} static int plugin_sweep(target_t *targets); \end{verbatim} plugin\_sweep performs the following functions: \begin{enumerate} \item Assume targets is a circularly linked list, and iterate over all the targets, performing the scan that your plugin provides. \item Return appropriate error codes in the plugin's \emph{errno} and/or by returning that value where appropriate. \item Return PLUGIN\_OK on success. \end{enumerate} \section{All Plugins} \subsection{plugin\_init} \begin{verbatim} void *plugin_init(void *in_data); \end{verbatim} Although you have freedom when naming other functions, a function named \emph{plugin\_init} \textbf{must} be defined in your plugin. This function will be called from sonar to load your plugin. If you plugin named it something else, it would not get loaded. \\ plugin\_init performs the following functions: \begin{enumerate} \item Obtain the \emph{sonar\_t} structure from the \emph{in\_data} pointer. \item Fill in a \emph{plugin\_t} structure with the relivant values and functions pointers for your plugin type. (See the plugin\_init guide below.) \item Set the plugin's \emph{errno} to \emph{PLUGIN\_LOADED} \end{enumerate} \subsubsection{Unnecessary function pointers} \paragraph{Input Plugins} Input plugins can leave the following function pointers in \emph{plugin\_t} defined to NULL: \begin{enumerate} \item plugin\_output \item plugin\_sweep \item plugin\_results \end{enumerate} \paragraph{Output Plugins} Output plugins can leave the following function pointers in \emph{plugin\_t} defined to NULL: \begin{enumerate} \item plugin\_next \item plugin\_sweep \end{enumerate} \paragraph{Network Plugins} Network plugins can leave the following function pointers in \emph{plugin\_t} defined to NULL: \begin{enumerate} \item plugin\_next \item plugin\_output \item plugin\_results \end{enumerate} \subsection{plugin\_destroy} \begin{verbatim} static int plugin_destroy(void); \end{verbatim} plugin\_destroy performs the following functions: \begin{enumerate} \item Fill the \emph{plugin\_t} structure with \emph{NULL} pointers for functions, and \emph{0} for variables. \item Set the plugin's \emph{errno} to \emph{PLUGIN\_UNLOADED} \item Perform any plugin specific file closing, memery freeing, etc. \end{enumerate} \subsection{plugin\_usage} \begin{verbatim} static void plugin_usage(void); \end{verbatim} plugin\_usage performs the following functions: \begin{enumerate} \item Print the usage using the \emph{output} function pointer stored in the plugin's \emph{sonar\_t} structure. \end{enumerate} \subsection{plugin\_status} \begin{verbatim} static void plugin_status(void); \end{verbatim} plugin\_status performs the following functions: \begin{enumerate} \item Print any relivant status information using the \emph{output} function as above. \end{enumerate} \subsection{plugin\_last\_error} \begin{verbatim} static int plugin_last_error(void); \end{verbatim} plugin\_last\_error performs the following functions: \begin{enumerate} \item Simply return the plugin's \emph{errno} value. \end{enumerate} \section{Guidlines to writing plugin\_init} In order to write a plugin\_init that functions the way it should, aim to remember these points: \begin{enumerate} \item Check that the \emph{in\_data argument} you are passed is not NULL. \item Check that the plugin api held in \emph{sonar\_t->api} is the correct number for your plugin. \item Set the appropriate plugin type in \emph{plugin\_t->type} and mark your plugin as \emph{not ready}. \item Set the appropriate function pointers. \item Set the appropriate identifying information as well. \item Finally, set the plugin's \emph{errno} to \emph{PLUGIN\_LOADED}. \end{enumerate} Beyond that, what you do with your plugin\_init function is up to you. \part{Writing Plugins: A Walkthrough} \chapter{Examples} For examples of working plugins, see the appropriate sources. \section{Sonar core plugins} For examples of sonar plugins, download the sonar core source code and look at the source code in the \emph{plugins} directory. These plugins are all fully functional, even though they may diviate a little from standard practice. They must use different style includes, because they must be built before the sonar header files are installed on the system. \section{Sonar plugins built separately} The autosec project provides a few example plugins that build outside of the source tree, and therefore are good starting places for your projects. They have two separate plugins available at the time of this writing. One is an extremely bare bones output plugin, and another is a working list input plugin, like the one we are going to develop in this paper. They are available in the Downloads section of \textbf{\emph{http://autosec.sf.net}} \section{Third Party plugins} Send me an email at \emph{red0x}@\emph{users.sourceforge.net} to let me know if you begin development of a third party plugin. Plugins need not be GPL'd, but any plugin that is not GPL'd cannot be distributed bundled with sonar, because it is GPL'd. Let me know if you have or have seen any third party plugins floating around. \chapter{Design Considerations} \section{Plugin Type} The first design decision you must make is what type of plugin do you want to create? The easiest types to make are input or output plugins. Networking plugins are harder, because they must handle all sorts of network communications. In this document, I will walk you through the creation of an input plugin that takes its input from a text file, one ip-address or hostname per line. \section{Purpose} Once you know your target plugin type, deciding your plugins purpose should be easy. For our input plugin, we will use it to parse a text file full of IP addresses and hostnames as targets. \section{Bare Bones} The next step, after you have written all this down, is the bare bones plugins source files. We will create \emph{bare.h} and \emph{bare.c} here. To begin, create a bare header file that looks something like this: \subsection{bare-1.h} \verbatiminput{example/bare-1.h} And create a bare bones \emph{bare.c} that looks like this: \subsection{bare-1.c} \verbatiminput{example/bare-1.c} These source files will be used as the bare bones to all your plugin development needs. \chapter{Source Code Development} Once you know your plugins intended functionality, it should be pretty easy to create a plugin to do what you want it to do. \section{bare.h modifications} \emph{bare.h} will, unfortunately, not cut it without modification for all your plugin needs. Since you, or anyone, may write plugins in C++ if desired, you must ensure that your \textbf{\emph{plugin\_init}} function is linked as a C function only, so we will create the needed additions to bare.h, and rename it to \textbf{sonar\_inp\_list.h} now: \subsection{sonar\_inp\_list-1.h} \verbatiminput{example/sonar_inp_list-1.h} \section{Header files} What all must be declared in the header file for your plugin? As a general rule of thumb, any structures local to your plugin, and datatypes that you will use frequently should go into the header file. You may, or may not, wrap the type declarations in the \emph{extern "C"} section, as you see fit. However, you \textbf{must} provide a \textbf{plugin\_init} function exactly as shown here: \begin{verbatim*} void *plugin_init(void *in_data); \end{verbatim*} Along with this definition, you should also include any other definitions and needed header files here. Our sonar\_inp\_list.h now looks like this: \subsection{sonar\_inp\_list-2.h} \verbatiminput{example/sonar_inp_list-2.h} \subsection{Notes} From here on, we will only show changes made to this file by showing what we add. You \textbf{must} include \textbf{\emph{sonar/plugin.h}} in your plugin's header file to access needed types and structures. \section{Source files} You may break your plugin into as many source files as you see fit. If your plugin is simple, and doesn't warrant too much modularization, that is fine. If it is complex, and needs lots of modularization, feel free. \subsection{Bare Bones} Your plugin must contain one function named \emph{plugin\_init} that will take a pointer to a \emph{sonar\_t} structure as an argument, and return a pointer to a \emph{plugin\_t} structure that is correctly filled in. Explanations on filling in this structure will follow. Other things your plugin must contain, are the required methods for each type of plugin. \subsection{plugin\_init} Your \emph{plugin\_init} function must initialize a \emph{plugin\_t} structure and return it. That is the only thing it \textbf{must} do, you may provide other functionality here. Do not print output in this function, please, instead, return one of the new error codes in \textbf{plugin.h} . An example of how to fill this structure in follows: \verbatiminput{example/sonar_inp_list-1.c} \subsubsection{File Managment} Since this plugin is an input plugin, we will need a file descriptor for the file we will read from. Add the following to the global declarations in your plugin: \begin{verbatim} static FILE *fp; \end{verbatim} And add the following line to the end of the \emph{plugin\_init} function: \begin{verbatim} fp = NULL; \end{verbatim} \subsection{plugin\_destroy} The next logical step in our development is to create a \emph{plugin\_destroy} function to cleanup when our plugin is done. We can add the following function to our plugin: \verbatiminput{example/sonar_inp_list-2.c} \subsection{plugin\_open} We need some way to get the filename from the user, and open our file before the plugin tries to read data, so we must develop our \emph{plugin\_open} function. My \emph{plugin\_open} checks for the file name on the command line. In order to get the argument to the plugin, you would run sonar like this: \begin{verbatim} bash# sonar -iL,<filename> ... \end{verbatim} Next, we must return the buffer size that sonar should expect to read from us. The finished function looks like this: \verbatiminput{example/sonar_inp_list-3.c} \subsection{plugin\_next} Now, we need some way to read our data, and return it to sonar. So, we will write \emph{plugin\_next} next. This function does the real important job of an input plugin. This function will read from the input file, and return the data to sonar. Since sonar will keep calling this function until it gets a \emph{PLUGIN\_EOF} or \emph{PLUGIN\_ERROR}, you must support such functionality accordingly. A \emph{while} loop performs this task nicely: \verbatiminput{example/sonar_inp_list-4.c} \subsection{plugin\_close} \emph{plugin\_close} is a relatively easy write. All we have to do is close our file, and set ourselves as not-ready. \verbatiminput{example/sonar_inp_list-5.c} \subsection{plugin\_usage and plugin\_status} Since both these functions are relatively easy writes, and perform similar user interaction, they will be written together. The \emph{plugin\_usage} function needs to accurately report to the user how to use your plugin. The \emph{plugin\_status} function needs to output the status of your plugin, being terse, while still reporting needed information. These functions are written as follows: \verbatiminput{example/sonar_inp_list-6.c} \subsection{plugin\_last\_error} This function only needs to return the plugin's \emph{errno}, like so: \verbatiminput{example/sonar_inp_list-7.c} \section{Finished} Now, you are finished writing a fully functional input plugin. The source to said plugin has been bundled with this guide so you may follow along. If your copy of the guide does not include the sonar\_inp\_list source, logon to http://autosec.sf.net and download a copy. \end{document} |
From: red0x <re...@us...> - 2004-04-08 22:08:12
|
Update of /cvsroot/autosec/sonar/doc/example In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21760 Added Files: bare-1.c bare-1.h sonar_inp_list-1.c sonar_inp_list-1.h sonar_inp_list-2.c sonar_inp_list-2.h sonar_inp_list-3.c sonar_inp_list-4.c sonar_inp_list-5.c sonar_inp_list-6.c sonar_inp_list-7.c sonar_inp_list.c sonar_inp_list.h Log Message: Step by step example files for plugin developers --- NEW FILE: sonar_inp_list.h --- /*************************************************************************** * sonar_inp_list.h * IP List Input Plugin Header * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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. */ #ifndef _SONAR_INP_LIST_H #define _SONAR_INP_LIST_H // You need to include this for plugin_t and sonar_t #include <sonar/plugin.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include <stdarg.h> #include <stdlib.h> /// Buffer size to return to sonar #define BUFSIZE 256 #ifdef __cplusplus extern "C" { #endif void *plugin_init(void *in_data); #ifdef __cplusplus } #endif #endif /* _SONAR_INP_LIST_H */ --- NEW FILE: sonar_inp_list-4.c --- static int plugin_next(char *hostname) { /* don't need to do this, sonar does it */ /* hostname = malloc(); */ if(!hostname) return PLUGIN_ERROR; memset(hostname, 0, BUFSIZE); while(fgets(hostname, BUFSIZE - 1, fp) != NULL) { /* support for comments */ if(hostname[0] == '#') continue; hostname[BUFSIZE] = '\0'; return PLUGIN_OK; } return PLUGIN_EOF; } --- NEW FILE: sonar_inp_list-1.c --- /*************************************************************************** * sonar_inp_list.c * IP List Input Plugin Source * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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 "include/iplist.h" #include <sonar/plugin.h> #include <assert.h> // for assert(3) /// Plugin's plugin_t structure, filled in by plugin_init static plugin_t plugin_context; /// Sonar's sonar_t structure, filled in by sonar, passed to this plugin static sonar_t *sonar_context; /// last error code is stored in the errno. static uint16_t my_errno; // notice everything is declared static. static int plugin_destroy(void); static int plugin_open(void *c_data, int i_data); static int plugin_close(void); static int plugin_next(char *hostname); static void plugin_usage(void); static void plugin_status(void); static int plugin_last_error(void); static FILE *fp; void * plugin_init(void *in_data) { assert(in_data != NULL); // this is assumed sonar_context = (sonar_t *) in_data; // check to see that sonar will provide you with the correct API version if(sonar_context->api < 6) { fprintf(stderr, "Plugin API must be 6 or higher, update sonar or downgrade this plugin\n"); } // this is an input plugin only // if it were input AND output, you could OR // the two together: INPUT_PLUGIN | OUTPUT_PLUGIN plugin_context.type = INPUT_PLUGIN; plugin_context.err = &my_errno; plugin_context.ready = false; // we are not ready // // we should not do this: sonar selects plugins. // plugin_context.selected = false; // plugin_context.version = 6; /* set that we expect to be used by plugin * API version 6 */ // This is how we get accessed from sonar. // for 'R', we are used like this: 'sonar -iR' plugin_context.plugin_char = 'R'; plugin_context.shortname = "random"; // short name plugin_context.longname = "Random Input Plugin"; // description // provide pointers to corresponding functions. plugin_context.plugin_init = &plugin_init; plugin_context.plugin_destroy = &plugin_destroy; // // this function should soon disappear // plugin_context.plugin_args = &plugin_args; // plugin_context.plugin_open = &plugin_open; plugin_context.plugin_close = &plugin_close; plugin_context.plugin_next = &plugin_next; // these are not needed for input plugins plugin_context.plugin_sweep = NULL; plugin_context.plugin_output = NULL; plugin_context.plugin_results = NULL; // these are needed for all plugins. plugin_context.plugin_usage = &plugin_usage; plugin_context.plugin_status = &plugin_status; plugin_context.plugin_last_error = &plugin_last_error; // set the errno to PLUGIN_LOADED. my_errno = PLUGIN_LOADED; // do any local initialization here. return &plugin_context; } --- NEW FILE: sonar_inp_list-5.c --- static int plugin_close(void) { /* close anything you opened */ plugin_context.selected = false; plugin_context.ready = false; if(fp) fclose(fp); return PLUGIN_OK; } --- NEW FILE: sonar_inp_list-1.h --- /*************************************************************************** * sonar_inp_list.h * IP List Input Plugin Header * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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. */ #ifndef _SONAR_INP_LIST_H #define _SONAR_INP_LIST_H #ifdef __cplusplus extern "C" { #endif void *plugin_init(void *in_data); #ifdef __cplusplus } #endif #endif /* _SONAR_INP_LIST_H */ --- NEW FILE: sonar_inp_list.c --- /*************************************************************************** * sonar_inp_list.c * IP List Input Plugin Source * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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 "include/iplist.h" #include <sonar/plugin.h> #include <assert.h> // for assert(3) /// Plugin's plugin_t structure, filled in by plugin_init static plugin_t plugin_context; /// Sonar's sonar_t structure, filled in by sonar, passed to this plugin static sonar_t *sonar_context; /// last error code is stored in the errno. static uint16_t my_errno; // notice everything is declared static. static int plugin_destroy(void); static int plugin_open(void *c_data, int i_data); static int plugin_close(void); static int plugin_next(char *hostname); static void plugin_usage(void); static void plugin_status(void); static int plugin_last_error(void); static FILE *fp; void * plugin_init(void *in_data) { assert(in_data != NULL); // this is assumed sonar_context = (sonar_t *) in_data; // check to see that sonar will provide you with the correct API version if(sonar_context->api < 6) { fprintf(stderr, "Plugin API must be 6 or higher, update sonar or downgrade this plugin\n"); } // this is an input plugin only // if it were input AND output, you could OR // the two together: INPUT_PLUGIN | OUTPUT_PLUGIN plugin_context.type = INPUT_PLUGIN; plugin_context.err = &my_errno; plugin_context.ready = false; // we are not ready // // we should not do this: sonar selects plugins. // plugin_context.selected = false; // plugin_context.version = 6; /* set that we expect to be used by plugin * API version 6 */ // This is how we get accessed from sonar. // for 'R', we are used like this: 'sonar -iR' plugin_context.plugin_char = 'R'; plugin_context.shortname = "random"; // short name plugin_context.longname = "Random Input Plugin"; // description // provide pointers to corresponding functions. plugin_context.plugin_init = &plugin_init; plugin_context.plugin_destroy = &plugin_destroy; // // this function should soon disappear // plugin_context.plugin_args = &plugin_args; // plugin_context.plugin_open = &plugin_open; plugin_context.plugin_close = &plugin_close; plugin_context.plugin_next = &plugin_next; // these are not needed for input plugins plugin_context.plugin_sweep = NULL; plugin_context.plugin_output = NULL; plugin_context.plugin_results = NULL; // these are needed for all plugins. plugin_context.plugin_usage = &plugin_usage; plugin_context.plugin_status = &plugin_status; plugin_context.plugin_last_error = &plugin_last_error; // set the errno to PLUGIN_LOADED. my_errno = PLUGIN_LOADED; // do any local initialization here. return &plugin_context; } /* this is our "destructor" that destroys anything we created */ static int plugin_destroy(void) { /* kill everything in an orderly fashion */ sonar_context = NULL; plugin_context.type = 0; plugin_context.err = NULL; plugin_context.ready = false; plugin_context.selected = false; plugin_context.plugin_init = NULL; plugin_context.plugin_destroy = NULL; plugin_context.plugin_open = NULL; plugin_context.plugin_close = NULL; plugin_context.plugin_next = NULL; plugin_context.plugin_sweep = NULL; plugin_context.plugin_output = NULL; plugin_context.plugin_results = NULL; plugin_context.plugin_usage = NULL; plugin_context.plugin_status = NULL; plugin_context.plugin_last_error = NULL; my_errno = PLUGIN_UNLOADED; if(fp) fclose(fp); fp = NULL; return PLUGIN_UNLOADED; } static int plugin_open(void *c_data, int i_data) { char *optarg = (char *) c_data; plugin_context.selected = true; if(c_data == NULL || i_data == 0) { return PLUGIN_NOFILE; } fp = fopen(optarg, "r"); if(!fp) return PLUGIN_NOFILE; /* report the error */ /* let sonar know you are ready */ plugin_context.ready = true; return BUFSIZE; /* return size of buffer sonar will need */ } static int plugin_next(char *hostname) { /* don't need to do this, sonar does it */ /* hostname = malloc(); */ if(!hostname) return PLUGIN_ERROR; memset(hostname, 0, BUFSIZE); while(fgets(hostname, BUFSIZE - 1, fp) != NULL) { /* support for comments */ if(hostname[0] == '#') continue; hostname[BUFSIZE] = '\0'; return PLUGIN_OK; } return PLUGIN_EOF; } static int plugin_close(void) { /* close anything you opened */ plugin_context.selected = false; plugin_context.ready = false; if(fp) fclose(fp); return PLUGIN_OK; } static void plugin_usage(void) { /* output a few simple usage snippets here, and exit(-1); */ assert(sonar_context != NULL); assert(sonar_context->output != NULL); sonar_context->output("\n iplist input plugin\n"); sonar_context->output(" Usage: -iL,<filename>\n"); /* do not exit so other plugins may print their usage too! */ /* exit(-1); */ } static void plugin_status(void) { /* if you are ready, and selected, output a quick status info here */ assert(sonar_context != NULL); assert(sonar_context->output != NULL); if(plugin_context.ready && plugin_context.selected) sonar_context->output("iplist input loaded::\n"); } static int plugin_last_error(void) { /* return your last error, since my_errno is a uint16_t and the return * type of this function is a int32_t, you could get creative with return * * * * * values and masking ;) */ return my_errno; } --- NEW FILE: sonar_inp_list-2.c --- /* this is our "destructor" that destroys anything we created */ static int plugin_destroy(void) { /* kill everything in an orderly fashion */ sonar_context = NULL; plugin_context.type = 0; plugin_context.err = NULL; plugin_context.ready = false; plugin_context.selected = false; plugin_context.plugin_init = NULL; plugin_context.plugin_destroy = NULL; plugin_context.plugin_open = NULL; plugin_context.plugin_close = NULL; plugin_context.plugin_next = NULL; plugin_context.plugin_sweep = NULL; plugin_context.plugin_output = NULL; plugin_context.plugin_results = NULL; plugin_context.plugin_usage = NULL; plugin_context.plugin_status = NULL; plugin_context.plugin_last_error = NULL; my_errno = PLUGIN_UNLOADED; if(fp) fclose(fp); fp = NULL; return PLUGIN_UNLOADED; } --- NEW FILE: bare-1.h --- /*************************************************************************** * bare.h * Bare Bones Plugin Header * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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. */ #ifndef _BARE_H #define _BARE_H #endif /* _BARE_H */ --- NEW FILE: sonar_inp_list-6.c --- static void plugin_usage(void) { /* output a few simple usage snippets here, and exit(-1); */ assert(sonar_context != NULL); assert(sonar_context->output != NULL); sonar_context->output("\n iplist input plugin\n"); sonar_context->output(" Usage: -iL,<filename>\n"); /* do not exit so other plugins may print their usage too! */ /* exit(-1); */ } static void plugin_status(void) { /* if you are ready, and selected, output a quick status info here */ assert(sonar_context != NULL); assert(sonar_context->output != NULL); if(plugin_context.ready && plugin_context.selected) sonar_context->output("iplist input loaded::\n"); } --- NEW FILE: sonar_inp_list-3.c --- static int plugin_open(void *c_data, int i_data) { char *optarg = (char *) c_data; plugin_context.selected = true; if(c_data == NULL || i_data == 0) { return PLUGIN_NOFILE; } fp = fopen(optarg, "r"); if(!fp) return PLUGIN_NOFILE; /* report the error */ /* let sonar know you are ready */ plugin_context.ready = true; return BUFSIZE; /* return size of buffer sonar will need */ } --- NEW FILE: sonar_inp_list-7.c --- static int plugin_last_error(void) { /* return your last error, since my_errno is a uint16_t and the return * type of this function is a int32_t, you could get creative with return * * * * * values and masking ;) */ return my_errno; } --- NEW FILE: sonar_inp_list-2.h --- /*************************************************************************** * sonar_inp_list.h * IP List Input Plugin Header * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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. */ #ifndef _SONAR_INP_LIST_H #define _SONAR_INP_LIST_H // You need to include this for plugin_t and sonar_t #include <sonar/plugin.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include <stdarg.h> #include <stdlib.h> /// Buffer size to return to sonar #define BUFSIZE 256 #ifdef __cplusplus extern "C" { #endif void *plugin_init(void *in_data); #ifdef __cplusplus } #endif #endif /* _SONAR_INP_LIST_H */ --- NEW FILE: bare-1.c --- /*************************************************************************** * bare.c * Bare Bones Plugin Source * Wed Mar 31 19:37:16 2004 * Copyright 2004 red0x * re...@us... ****************************************************************************/ /* * 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 Library 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. */ |
From: red0x <re...@us...> - 2004-04-08 22:04:53
|
Update of /cvsroot/autosec/sonar/doc/example In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21032/example Log Message: Directory /cvsroot/autosec/sonar/doc/example added to the repository |
From: red0x <re...@us...> - 2004-04-08 22:03:06
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20743 Modified Files: .indent.pro Log Message: More style changes... woohoo Index: .indent.pro =================================================================== RCS file: /cvsroot/autosec/sonar/.indent.pro,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .indent.pro 8 Apr 2004 21:11:47 -0000 1.3 --- .indent.pro 8 Apr 2004 21:49:54 -0000 1.4 *************** *** 1 **** ! -i4 -sc -bli0 -bl0 -cbi0 -ss --- 1 ---- ! -i4 -sc -bli0 -bl -cbi0 -ss -fca -npcs -nsai -nsaf -nsaw -nut |
From: red0x <re...@us...> - 2004-04-08 21:56:07
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19429/src Modified Files: plugin.h Log Message: Slight documentation update Index: plugin.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** plugin.h 8 Apr 2004 19:11:03 -0000 1.40 --- plugin.h 8 Apr 2004 21:42:50 -0000 1.41 *************** *** 388,392 **** \subsection pother Other Questions If you have any questions about how to do anything else with plugins, see ! \link bare.c bare.c \endlink , \link log_file.h log_file.h \endlink , and \link plugin.h plugin.h \endlink . If you want to make a very bare plugin that only does a few things, just provide all the functions and have each return --- 388,392 ---- \subsection pother Other Questions If you have any questions about how to do anything else with plugins, see ! the plugin manual , \link log_file.h log_file.h \endlink , and \link plugin.h plugin.h \endlink . If you want to make a very bare plugin that only does a few things, just provide all the functions and have each return *************** *** 439,446 **** \section apichanges Changes as of 1.5 ! As of API version 1.5, I have made some options global to all plugins (like the TTL) ! See \ref sonarContext and \ref pluginContext . Also, \c plugin_network_command_handler has ! been removed. All targets are handled by sonar, so your network plugins will not have to ! handle name resolving. As a result, the pointer to the name resolving function has been removed. */ --- 439,445 ---- \section apichanges Changes as of 1.5 ! As of API version 1.5, I have made some options global to all plugins ! See \ref sonar_options_s. Also, \c plugin_args has ! been removed. All options specific to your plugin will be passed to \c plugin_open. */ |
From: red0x <re...@us...> - 2004-04-08 21:24:59
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13944/src Modified Files: plugin.c Log Message: Removed plugin_args function calls. plugin_args, and the old way of passing options, has *finally* been removed. Index: plugin.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** plugin.c 8 Apr 2004 19:11:03 -0000 1.31 --- plugin.c 8 Apr 2004 21:11:48 -0000 1.32 *************** *** 305,312 **** log_write(LOG_DBUG, " %p (ok)\n", plug); ! /* only support from version 4 on up */ if(plug->version > API_VER || ! plug->version < 4) { log_write(LOG_CONSOLE | --- 305,312 ---- log_write(LOG_DBUG, " %p (ok)\n", plug); ! /* only support from version 6 on up */ if(plug->version > API_VER || ! plug->version < 6) { log_write(LOG_CONSOLE | *************** *** 616,619 **** --- 616,620 ---- in->iCount=1; in->bRandom=0; + in->bBroadcast=0; } |
From: red0x <re...@us...> - 2004-04-08 21:24:59
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13944 Modified Files: .indent.pro Log Message: Removed plugin_args function calls. plugin_args, and the old way of passing options, has *finally* been removed. Index: .indent.pro =================================================================== RCS file: /cvsroot/autosec/sonar/.indent.pro,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .indent.pro 8 Apr 2004 19:44:02 -0000 1.2 --- .indent.pro 8 Apr 2004 21:11:47 -0000 1.3 *************** *** 1 **** ! -i8 -sc -bli0 -bl0 -cbi0 -ss --- 1 ---- ! -i4 -sc -bli0 -bl0 -cbi0 -ss |
From: red0x <re...@us...> - 2004-04-08 21:23:54
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13649/src Modified Files: target.c Log Message: Fixed defualt port return value in load_default_ports Index: target.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/target.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** target.c 30 Mar 2004 22:03:22 -0000 1.15 --- target.c 8 Apr 2004 21:10:41 -0000 1.16 *************** *** 33,51 **** #include "sonar.h" #include "mem.h" extern sonar_t mthis; - /* - #ifndef HAVE_STRNDUP - #define HAVE_STRNDUP - char* strndup(const char* src, size_t n) { - char* dst; - dst = malloc(n + 1); - strncpy(dst, src, n); - return dst; - } - #endif - */ - static const char rcsid[] = "\100$ autosec/sonar: $Id$"; --- 33,40 ---- #include "sonar.h" #include "mem.h" + #include "util.h" extern sonar_t mthis; static const char rcsid[] = "\100$ autosec/sonar: $Id$"; *************** *** 248,252 **** --- 237,244 ---- sa->sin_addr.s_addr = htonl(start); if(retval == 255 || retval == 256 || (start & 0x000000ff) == 0 || (start & 0x000000ff) == 255) + { target->broadcast = 1; + mthis.opts.bBroadcast = 1; + } return retval; } *************** *** 311,320 **** struct servent *se; assert(*target != NULL); while((se = getservent()) != NULL) { (*target)->ports[se->s_port] = PORT_SCAN; } endservent(); ! return SONAR_OK; } --- 303,314 ---- struct servent *se; assert(*target != NULL); + (*target)->num_ports = 0; while((se = getservent()) != NULL) { (*target)->ports[se->s_port] = PORT_SCAN; + (*target)->num_ports++; } endservent(); ! return (*target)->num_ports; } |
From: red0x <re...@us...> - 2004-04-08 21:22:59
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13392/src Modified Files: util.c util.h Log Message: Added a strndup replacement function Index: util.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/util.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** util.h 29 Jan 2004 23:43:52 -0000 1.23 --- util.h 8 Apr 2004 21:09:40 -0000 1.24 *************** *** 75,77 **** --- 75,82 ---- int sanity_check(int value, int min, int dir); + #ifndef HAVE_STRNDUP + char* strndup(const char* src, size_t n); + #endif + + #endif Index: util.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/util.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** util.c 28 Feb 2004 12:43:40 -0000 1.27 --- util.c 8 Apr 2004 21:09:40 -0000 1.28 *************** *** 464,468 **** if(value > min) value = min; ! return value; ! } --- 464,478 ---- if(value > min) value = min; ! return value; ! } ! ! #ifndef HAVE_STRNDUP ! #define HAVE_STRNDUP ! static const char blah[]="strndup_replaced!\0"; ! char* strndup(const char* src, size_t n) { ! char* dst; ! dst = malloc(n + 1); ! strncpy(dst, src, n); ! return dst; } + #endif |
From: red0x <re...@us...> - 2004-04-08 21:22:19
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13252/plugins Modified Files: network_icmp.c Log Message: Timing and verbosity fix Index: network_icmp.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/network_icmp.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** network_icmp.c 8 Apr 2004 19:11:02 -0000 1.43 --- network_icmp.c 8 Apr 2004 21:09:07 -0000 1.44 *************** *** 55,59 **** /// Timestamp Time zone static struct timezone tz; ! static unsigned int num_hosts; /// Plugin's plugin_t structure, built by plugin_init --- 55,59 ---- /// Timestamp Time zone static struct timezone tz; ! //static unsigned int num_hosts; /// Plugin's plugin_t structure, built by plugin_init *************** *** 129,133 **** ready = false; ! num_hosts = 0; my_type = ICMP_ECHO; my_code = 0; --- 129,133 ---- ready = false; ! //num_hosts = 0; my_type = ICMP_ECHO; my_code = 0; *************** *** 173,177 **** ready = false; - num_hosts = 0; mthis = NULL; return PLUGIN_UNLOADED; --- 173,176 ---- *************** *** 414,418 **** pthis.ready = true; seq_no = 1 + (int) (70.0 * rand() / (RAND_MAX + 1.0)); - num_hosts = mthis->num_targets; return PLUGIN_OK; } --- 413,416 ---- *************** *** 465,470 **** recd.socket = my_socket; - recd.hosts = num_hosts; - /* this is a broad cast address, not a range */ low_seq = recd.start = clock(); --- 463,466 ---- *************** *** 498,502 **** targets->entry, targets->extra_hosts); #endif ! if(mthis->opts.iVerbose > 0) err_msg("Increasing timeout, netmask detected\n"); } --- 494,498 ---- targets->entry, targets->extra_hosts); #endif ! if(mthis->opts.iVerbose > 1) err_msg("Increasing timeout, netmask detected\n"); } *************** *** 511,515 **** /* sleep after this host (allows more dest unreachables to come back) */ ! if(counter < num_hosts && mthis->opts.iHostDelay > 0) usleep(mthis->opts.iHostDelay * 1000); } --- 507,511 ---- /* sleep after this host (allows more dest unreachables to come back) */ ! if(counter < mthis->num_targets && mthis->opts.iHostDelay > 0) usleep(mthis->opts.iHostDelay * 1000); } *************** *** 810,816 **** rec->responses = 0; ! ! /*while((done == 0 || clock() <= rec->max) && rec->responses < rec->hosts)*/ ! while(done == 0 || ((clock() <= (rec->max * CLOCKS_PER_SEC * rec->hosts) + rec->start)) && rec->responses < rec->hosts) { tr.tv_sec = 0; --- 806,811 ---- rec->responses = 0; ! ! while(done == 0 || ((clock() <= (rec->max * CLOCKS_PER_SEC * rec->hosts) + rec->start) && rec->responses < rec->hosts)) { tr.tv_sec = 0; |
From: red0x <re...@us...> - 2004-04-08 21:21:42
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13059/plugins Modified Files: rfc793.c Log Message: ACK scan fix, timing update. Index: rfc793.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/rfc793.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** rfc793.c 8 Apr 2004 19:11:02 -0000 1.44 --- rfc793.c 8 Apr 2004 21:08:30 -0000 1.45 *************** *** 35,39 **** static int my_socket, err_socket; - static unsigned int num_hosts; static unsigned char done = 0; static plugin_t pthis; --- 35,38 ---- *************** *** 88,92 **** pthis.err = &my_errno; pthis.ready = true; ! pthis.version = 5; /* set API version 5 */ ready = false; --- 87,91 ---- pthis.err = &my_errno; pthis.ready = true; ! pthis.version = 6; /* set API version 5 */ ready = false; *************** *** 108,116 **** my_errno = PLUGIN_LOADED; - my_socket = -1; - num_hosts = 0; - return &pthis; } --- 107,112 ---- *************** *** 138,142 **** pthis.plugin_next = NULL; pthis.plugin_sweep = NULL; - pthis.plugin_sweep = NULL; pthis.plugin_output = NULL; pthis.plugin_results = NULL; --- 134,137 ---- *************** *** 150,156 **** } - - - static void rfc793_options_parse(void *arguments, int len) { --- 145,148 ---- *************** *** 158,161 **** --- 150,154 ---- int i,vallen; arg=(char*)arguments; + op.srcPrt = -1; while(arg) *************** *** 280,286 **** } - /*This will stay for later if(mthis->opts.bBroadcast) { l.l_onoff = 1; if(setsockopt(my_socket, SOL_SOCKET, SO_BROADCAST, --- 273,279 ---- } if(mthis->opts.bBroadcast) { + printf("setting broadcast\n"); l.l_onoff = 1; if(setsockopt(my_socket, SOL_SOCKET, SO_BROADCAST, *************** *** 293,297 **** } } - */ mthis->dropprivs(uid); --- 286,289 ---- *************** *** 301,305 **** ready = true; pthis.ready = true; - num_hosts = mthis->num_targets; return PLUGIN_OK; } --- 293,296 ---- *************** *** 318,326 **** assert(mthis->output != NULL); mthis->output("\n ACK Scan plugin: requires root priveleges\n"); ! mthis->output(" Usage: hostname:port/mask ...\n"); mthis->output(" If no port is specified, this will scan *all* ports\n"); mthis->output(" in /etc/services\n"); ! mthis->output(" Example: sonar -sA www.google.com:80/32\n"); ! exit(-1); } --- 309,319 ---- assert(mthis->output != NULL); mthis->output("\n ACK Scan plugin: requires root priveleges\n"); ! mthis->output(" Usage: -sA,[ttl=<num>,srcprt=<port>,prog=<cmdline>] hostname:port/mask\n"); ! mthis->output(" \tttl: set IP TTL\n"); ! mthis->output(" \tsrcprt: set TCP source port\n"); ! mthis->output(" \tprog: set command line to execute if host(s) is/are online\n"); mthis->output(" If no port is specified, this will scan *all* ports\n"); mthis->output(" in /etc/services\n"); ! mthis->output(" Example: sonar -sA,ttl=64,srcprt=53,prog=\"echo hi\" target.example.com:80/24\n"); } *************** *** 331,337 **** if(pthis.ready && ready) { ! mthis->output(" ACK Scan plugin ready::\n"); ! mthis->output(" TTL %d :: delay %d :: Source port %d ", op.ttl, ! mthis->opts.iPostDelay, op.srcPrt); } } --- 324,341 ---- if(pthis.ready && ready) { ! mthis->output("ACK Scan: %d host(s)::\n", mthis->num_targets); ! if(mthis->opts.iPostDelay == 0) ! mthis->output("\tno post-delay::\n"); ! else ! mthis->output("\tpost-delay %ds::\n", ! mthis->opts.iPostDelay); ! if(op.ttl != 0) ! mthis->output("\tTTL %d::\n", op.ttl); ! else ! mthis->output("\tdefault TTL::\n"); ! if(op.srcPrt != -1) ! mthis->output("\tSource port %d::\n", op.srcPrt); ! else ! mthis->output("\tRandom source port\n"); } } *************** *** 349,352 **** --- 353,357 ---- struct recv_t recd; int timeout; + unsigned int old_hosts = 0, ports = 0; assert(targets != NULL); *************** *** 361,365 **** timeout = mthis->opts.iTimeout; if(timeout <= 0) ! timeout = 5000; pthread_attr_init(&attr); --- 366,370 ---- timeout = mthis->opts.iTimeout; if(timeout <= 0) ! timeout = 5; //default timeout of 5 seconds pthread_attr_init(&attr); *************** *** 370,374 **** /* if we are broadcasting, increase the responses to collect */ /* and increase the timeout value */ ! recd.hosts = num_hosts; /* useful for later --- 375,379 ---- /* if we are broadcasting, increase the responses to collect */ /* and increase the timeout value */ ! recd.hosts = mthis->num_targets; /* useful for later *************** *** 379,390 **** recd.start = clock(); /* set the default timeout values */ ! recd.max = ! recd.start + (timeout * recd.hosts * CLOCKS_PER_SEC) / 1000; /* add time for a per host delay */ if(mthis->opts.iHostDelay > 0) ! recd.max += (mthis->opts.iHostDelay * recd.hosts * ! CLOCKS_PER_SEC) / 1000; ! /* add a default magic number to get some extra (late) responses */ ! recd.max += CLOCKS_PER_SEC / 1000; /* default is one half extra second */ /* start the receiving thread */ --- 384,391 ---- recd.start = clock(); /* set the default timeout values */ ! recd.max = timeout; /* add time for a per host delay */ if(mthis->opts.iHostDelay > 0) ! recd.max += mthis->opts.iHostDelay; /* start the receiving thread */ *************** *** 393,407 **** err_sys("could not create thread"); ! while(targets != NULL && counter < num_hosts) { ! if(targets->num_ports > 0) { ! recd.start = clock(); ! recd.max = recd.start + (timeout * targets->num_ports * ! CLOCKS_PER_SEC) / 1000; ! //recd.hosts++; // += (targets->num_ports - 1); ! recd.ports = targets->num_ports; ! targets->num_ports = 0; //--; } for(i = 0; i < 65536; i++) --- 394,410 ---- err_sys("could not create thread"); ! while(targets != NULL && counter < mthis->num_targets) { ! /* we have a broadcast target, without an ip-range */ ! if(targets->broadcast == 1 && targets->extra_hosts == 0) ! /* add to the timeout value */ ! recd.hosts += 255; ! if(targets->num_ports > 0 && ports == 0) { ! //recd.start = clock(); ! //recd.max = timeout;// * targets->num_ports; ! recd.ports = targets->num_ports; ! ports++; } for(i = 0; i < 65536; i++) *************** *** 411,424 **** { targets->ports[i] = PORT_SCANNING; ! if(targets->extra_hosts > 0) { - recd.start = clock(); - recd.max += (timeout * targets->extra_hosts * - CLOCKS_PER_SEC) / 1000; recd.hosts += targets->extra_hosts; ! targets->extra_hosts = 0; ! if(mthis->opts.iVerbose > 0) ! err_msg("Increasing timeout, netmask detected: %d", ! recd.max); } if(rfc793_send(targets) == PLUGIN_ERROR) --- 414,425 ---- { targets->ports[i] = PORT_SCANNING; ! //recd.ports++; ! if(targets->extra_hosts > 0 && old_hosts == 0) { recd.hosts += targets->extra_hosts; ! old_hosts++; ! //targets->extra_hosts = 0; ! if(mthis->opts.iVerbose > 1) ! err_msg("Increasing timeout, netmask detected\n"); } if(rfc793_send(targets) == PLUGIN_ERROR) *************** *** 429,436 **** /* sleep after this host (allows more dest unreachables to come * back) */ ! if(counter < num_hosts) usleep(mthis->opts.iHostDelay * 1000); } } targets = targets->next; } --- 430,440 ---- /* sleep after this host (allows more dest unreachables to come * back) */ ! if(counter < mthis->num_targets && mthis->opts.iHostDelay > 0) usleep(mthis->opts.iHostDelay * 1000); } } + old_hosts = 0; + ports = 0; + targets = targets->next; } *************** *** 465,468 **** --- 469,473 ---- int total_size = sizeof(struct tcphdr); int my_ports[65547]; + uint32_t addr, one=1; assert(target != NULL); *************** *** 502,506 **** nt.sport = htons(op.srcPrt); else ! nt.sport = htons(1+(int)(65535.0*rand()/(RAND_MAX+1.0))); switch (target->addrinfo->ai_family) --- 507,511 ---- nt.sport = htons(op.srcPrt); else ! nt.sport = htons(1+(int)(65535.0*rand()/(RAND_MAX+1.0))); switch (target->addrinfo->ai_family) *************** *** 509,513 **** sa = (struct sockaddr_in *) target->addrinfo->ai_addr; ia = sa->sin_addr; ! ia.s_addr = htonl(ntohl(ia.s_addr) + j); nt.dst = ia.s_addr; break; --- 514,537 ---- sa = (struct sockaddr_in *) target->addrinfo->ai_addr; ia = sa->sin_addr; ! addr = ntohl(ia.s_addr); ! if(j > 0) ! { ! addr++; ! ia.s_addr = htonl(addr); ! } ! sa->sin_addr = ia; ! /* broadcast address, set bcast mode */ ! if(((addr & 0x000000ff) == 0) || ((addr & 0x000000ff) == 255)) ! { ! if(one) ! { ! if(setsockopt(my_socket, SOL_SOCKET, SO_BROADCAST, ! (int *) &one, sizeof(int)) < 0) ! { ! err_ret("could not set broadcast mode"); ! } ! one = 0; ! } ! } nt.dst = ia.s_addr; break; *************** *** 527,531 **** } - add_tcphdr(packet, &nt, TH_ACK); // packet is ready to send --- 551,554 ---- *************** *** 548,552 **** free(packet); /* fresh copy of port list */ ! memcpy(target->ports, my_ports, 65537); } --- 571,575 ---- free(packet); /* fresh copy of port list */ ! memcpy(target->ports, my_ports, 65537 * sizeof(int)); } *************** *** 585,590 **** rec->responses = 0; ! while((done == 0 || clock() <= rec->max) ! && rec->responses < rec->hosts * rec->ports) { /* dont do anything up here, or we'll eat CPU */ --- 608,613 ---- rec->responses = 0; ! while(done == 0 || ! ((clock() <= (rec->max * CLOCKS_PER_SEC/100 * rec->hosts * rec->ports ) + rec->start) && rec->responses < rec->hosts * rec->ports)) { /* dont do anything up here, or we'll eat CPU */ *************** *** 592,596 **** tv.tv_sec = 0; my_host = NULL; ! FD_ZERO(&rfds); FD_SET(my_socket, &rfds); --- 615,619 ---- tv.tv_sec = 0; my_host = NULL; ! FD_ZERO(&rfds); FD_SET(my_socket, &rfds); *************** *** 619,623 **** tv.tv_sec = 0; tv.tv_usec = 0; - memset(buf, 0, MAX_PACKET); if(FD_ISSET(my_socket, &rfds)) --- 642,645 ---- *************** *** 703,717 **** num_res++; ! ! mthis->message ("%s[%s]:%d online & UNfiltered: range: %.2f ms " "ttl: %d size: %d\n", ! my_host->addrinfo->ai_canonname, ! inet_ntoa(from.sin_addr), ! ntohs(tcp->th_sport), triptime, ! iphdr->ip_ttl, ntohs(iphdr->ip_len)); /* print the packet if they want it */ ! if(mthis->opts.iVerbose > 1) ! print_packet(tcp); if(op.prog != NULL) --- 725,739 ---- num_res++; ! if(mthis->opts.iVerbose > 1) ! mthis->message ("%s[%s]:%d online & UNfiltered: range: %.2f ms " "ttl: %d size: %d\n", ! my_host->addrinfo->ai_canonname, ! inet_ntoa(from.sin_addr), ! ntohs(tcp->th_sport), triptime, ! iphdr->ip_ttl, ntohs(iphdr->ip_len)); /* print the packet if they want it */ ! if(mthis->opts.iVerbose > 3) ! print_packet(tcp); if(op.prog != NULL) *************** *** 829,833 **** num_res++; ! mthis->message ("%s[%s]:%d\tonline & filtered: range: " "%.2f ms ttl: %d size: %d\n", my_host->addrinfo->ai_canonname, --- 851,856 ---- num_res++; ! if(mthis->opts.iVerbose > 0) ! mthis->message ("%s[%s]:%d\tonline & filtered: range: " "%.2f ms ttl: %d size: %d\n", my_host->addrinfo->ai_canonname, *************** *** 852,856 **** default: assert(ai != NULL); ! if(mthis->opts.iVerbose > 1) mthis->message("%s[%s]: destination unreachable: %s\n", ai->ai_canonname, --- 875,879 ---- default: assert(ai != NULL); ! if(mthis->opts.iVerbose > 0) mthis->message("%s[%s]: destination unreachable: %s\n", ai->ai_canonname, *************** *** 871,875 **** if(result > 0) mthis->output("no response(s) from %d hosts\n", result); ! if(result < 0) mthis->output("subnet broadcast detected: extra response(s) from " "%d hosts\n", ~result + 1); --- 894,898 ---- if(result > 0) mthis->output("no response(s) from %d hosts\n", result); ! if(result < 0 && rec->ports == 1) mthis->output("subnet broadcast detected: extra response(s) from " "%d hosts\n", ~result + 1); *************** *** 884,887 **** --- 907,912 ---- unreach); } + if(mthis->opts.iVerbose <= 1 && unfilt && mthis->opts.iVerbose >0) + mthis->output("\tThe remaining %d ports that were in state \'unfiltered\' were\n\tnot printed, if you want to see them, use '-v2'\n", unfilt); return NULL; } |
From: red0x <re...@us...> - 2004-04-08 21:19:10
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12183 Modified Files: aclocal.m4 config.h.in config.sub configure configure.in ltmain.sh Log Message: Added a configure check for strndup Index: config.h.in =================================================================== RCS file: /cvsroot/autosec/sonar/config.h.in,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** config.h.in 31 Jan 2004 04:41:52 -0000 1.22 --- config.h.in 8 Apr 2004 21:05:53 -0000 1.23 *************** *** 107,110 **** --- 107,113 ---- #undef HAVE_STRING_H + /* Define to 1 if you have the `strndup' function. */ + #undef HAVE_STRNDUP + /* Define to 1 if you have the <syslog.h> header file. */ #undef HAVE_SYSLOG_H Index: configure =================================================================== RCS file: /cvsroot/autosec/sonar/configure,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** configure 6 Feb 2004 06:20:51 -0000 1.35 --- configure 8 Apr 2004 21:05:53 -0000 1.36 *************** *** 5893,5896 **** --- 5893,5920 ---- ;; + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then *************** *** 6687,6691 **** case "$host_cpu" in x86_64*) ! echo '#line 6689 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 --- 6711,6715 ---- case "$host_cpu" in x86_64*) ! echo '#line 6713 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 *************** *** 7435,7439 **** lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF ! #line 7437 "configure" #include "confdefs.h" --- 7459,7463 ---- lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF ! #line 7461 "configure" #include "confdefs.h" *************** *** 7533,7537 **** lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF ! #line 7535 "configure" #include "confdefs.h" --- 7557,7561 ---- lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF ! #line 7559 "configure" #include "confdefs.h" *************** *** 11430,11434 **** ! for ac_func in getcwd gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memmove memset select socket strchr strerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` --- 11454,11459 ---- ! ! for ac_func in getcwd gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memmove memset select socket strchr strerror strndup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` Index: configure.in =================================================================== RCS file: /cvsroot/autosec/sonar/configure.in,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configure.in 6 Feb 2004 06:20:50 -0000 1.32 --- configure.in 8 Apr 2004 21:05:54 -0000 1.33 *************** *** 72,76 **** AC_FUNC_STAT AC_FUNC_VPRINTF ! AC_CHECK_FUNCS([getcwd gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memmove memset select socket strchr strerror]) --- 72,76 ---- AC_FUNC_STAT AC_FUNC_VPRINTF ! AC_CHECK_FUNCS([getcwd gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memmove memset select socket strchr strerror strndup]) Index: aclocal.m4 =================================================================== RCS file: /cvsroot/autosec/sonar/aclocal.m4,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** aclocal.m4 24 Sep 2003 19:57:15 -0000 1.9 --- aclocal.m4 8 Apr 2004 21:05:53 -0000 1.10 *************** *** 2243,2246 **** --- 2243,2270 ---- ;; + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then Index: config.sub =================================================================== RCS file: /cvsroot/autosec/sonar/config.sub,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.sub 14 Oct 2003 23:38:59 -0000 1.1 --- config.sub 8 Apr 2004 21:05:53 -0000 1.2 *************** *** 368,371 **** --- 368,374 ---- os=-bsd ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl Index: ltmain.sh =================================================================== RCS file: /cvsroot/autosec/sonar/ltmain.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ltmain.sh 14 Oct 2003 23:38:59 -0000 1.1 --- ltmain.sh 8 Apr 2004 21:05:54 -0000 1.2 *************** *** 60,64 **** PACKAGE=libtool VERSION=1.4.3 ! TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)" default_mode= --- 60,64 ---- PACKAGE=libtool VERSION=1.4.3 ! TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)" default_mode= *************** *** 220,234 **** fi - # Mandrake: (gc) It's bad to link C++ code with GCC, so we need to use the compiler name if provided - if test "$mode" = link && test -n "$archive_cmds" && test -x "/usr/bin/perl"; then - case $nonopt in - *cc | *++ | gcc* | *-gcc* | egcs*) - archive_cmds=`echo $archive_cmds | perl -pe 's/^\S+\s+//'` - archive_cmds="$nonopt $archive_cmds" - archive_expsym_cmds=`echo $archive_expsym_cmds | perl -pe 's/^\S+\s+//'` - archive_expsym_cmds="$nonopt $archive_expsym_cmds" - esac - fi - # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being --- 220,223 ---- *************** *** 783,786 **** --- 772,776 ---- dllsearchpath= lib_search_path=`pwd` + inst_prefix_dir= avoid_version=no *************** *** 913,916 **** --- 903,911 ---- continue ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; release) release="-$arg" *************** *** 1014,1017 **** --- 1009,1017 ---- ;; + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L *************** *** 1215,1218 **** --- 1215,1223 ---- ;; + -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread ) + compiler_flags="$compiler_flags $arg" + continue + ;; + # Some other compiler flag. -* | +*) *************** *** 1394,1398 **** esac for pass in $passes; do ! if test $linkmode = prog; then # Determine which files to process case $pass in --- 1399,1403 ---- esac for pass in $passes; do ! if test "$linkmode" = prog; then # Determine which files to process case $pass in *************** *** 1411,1419 **** case $deplib in -l*) ! if test $linkmode = oldlib && test $linkmode = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi ! if test $pass = conv; then deplibs="$deplib $deplibs" continue --- 1416,1424 ---- case $deplib in -l*) ! if test "$linkmode" = oldlib && test "$linkmode" = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi ! if test "$pass" = conv; then deplibs="$deplib $deplibs" continue *************** *** 1435,1439 **** else deplibs="$deplib $deplibs" ! test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue --- 1440,1444 ---- else deplibs="$deplib $deplibs" ! test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue *************** *** 1444,1457 **** lib) deplibs="$deplib $deplibs" ! test $pass = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) ! if test $pass = conv; then deplibs="$deplib $deplibs" continue fi ! if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` --- 1449,1462 ---- lib) deplibs="$deplib $deplibs" ! test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) ! if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi ! if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` *************** *** 1468,1472 **** ;; # -L -R*) ! if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. --- 1473,1477 ---- ;; # -L -R*) ! if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. *************** *** 1481,1485 **** *.la) lib="$deplib" ;; *.$libext) ! if test $pass = conv; then deplibs="$deplib $deplibs" continue --- 1486,1490 ---- *.la) lib="$deplib" ;; *.$libext) ! if test "$pass" = conv; then deplibs="$deplib $deplibs" continue *************** *** 1504,1508 **** ;; prog) ! if test $pass != link; then deplibs="$deplib $deplibs" else --- 1509,1513 ---- ;; prog) ! if test "$pass" != link; then deplibs="$deplib $deplibs" else *************** *** 1515,1519 **** ;; # *.$libext *.lo | *.$objext) ! if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. --- 1520,1524 ---- ;; # *.$libext *.lo | *.$objext) ! if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. *************** *** 1531,1535 **** ;; esac # case $deplib ! if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 --- 1536,1540 ---- ;; esac # case $deplib ! if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 *************** *** 1565,1569 **** if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || ! { test $linkmode = oldlib && test $linkmode = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" --- 1570,1574 ---- if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || ! { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" *************** *** 1571,1575 **** fi ! if test $pass = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" --- 1576,1580 ---- fi ! if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" *************** *** 1592,1596 **** tmp_libs="$tmp_libs $deplib" done ! elif test $linkmode != prog && test $linkmode != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 --- 1597,1601 ---- tmp_libs="$tmp_libs $deplib" done ! elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 *************** *** 1610,1614 **** # This library was specified with -dlopen. ! if test $pass = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 --- 1615,1619 ---- # This library was specified with -dlopen. ! if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 *************** *** 1659,1663 **** # This library was specified with -dlpreopen. ! if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 --- 1664,1668 ---- # This library was specified with -dlpreopen. ! if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 *************** *** 1678,1682 **** if test -z "$libdir"; then # Link the convenience library ! if test $linkmode = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then --- 1683,1687 ---- if test -z "$libdir"; then # Link the convenience library ! if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then *************** *** 1689,1693 **** fi ! if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" --- 1694,1698 ---- fi ! if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" *************** *** 1705,1709 **** esac # Need to link against all dependency_libs? ! if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else --- 1710,1714 ---- esac # Need to link against all dependency_libs? ! if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else *************** *** 1728,1732 **** if test "$linkmode,$pass" = "prog,link" || ! { test $linkmode = lib && test $hardcode_into_libs = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time --- 1733,1737 ---- if test "$linkmode,$pass" = "prog,link" || ! { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time *************** *** 1750,1754 **** ;; esac ! if test $linkmode = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then --- 1755,1759 ---- ;; esac ! if test "$linkmode" = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then *************** *** 1834,1838 **** fi # test -n $old_archive_from_expsyms_cmds ! if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= --- 1839,1843 ---- fi # test -n $old_archive_from_expsyms_cmds ! if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= *************** *** 1883,1887 **** esac fi ! if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" --- 1888,1892 ---- esac fi ! if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" *************** *** 1900,1904 **** fi ! if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= --- 1905,1909 ---- fi ! if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= *************** *** 1908,1912 **** add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then ! add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then --- 1913,1926 ---- add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then ! # Try looking first in the location we're being installed to. ! add_dir= ! if test -n "$inst_prefix_dir"; then ! case "$libdir" in ! [\\/]*) ! add_dir="-L$inst_prefix_dir$libdir" ! ;; ! esac ! fi ! add_dir="$add_dir -L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then *************** *** 1918,1926 **** else # We cannot seem to hardcode it, guess we'll fake it. ! add_dir="-L$libdir" add="-l$name" fi ! if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" --- 1932,1949 ---- else # We cannot seem to hardcode it, guess we'll fake it. ! # Try looking first in the location we're being installed to. ! add_dir= ! if test -n "$inst_prefix_dir"; then ! case "$libdir" in ! [\\/]*) ! add_dir="-L$inst_prefix_dir$libdir" ! ;; ! esac ! fi ! add_dir="$add_dir -L$libdir" add="-l$name" fi ! if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" *************** *** 1930,1934 **** fi fi ! elif test $linkmode = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || --- 1953,1957 ---- fi fi ! elif test "$linkmode" = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || *************** *** 1990,1997 **** fi # link shared/static library? ! if test $linkmode = lib; then if test -n "$dependency_libs" && ! { test $hardcode_into_libs != yes || test $build_old_libs = yes || ! test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= --- 2013,2020 ---- fi # link shared/static library? ! if test "$linkmode" = lib; then if test -n "$dependency_libs" && ! { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || ! test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= *************** *** 2024,2028 **** done ! if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do --- 2047,2051 ---- done ! if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do *************** *** 2067,2071 **** fi # linkmode = lib done # for deplib in $libs ! if test $pass = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do --- 2090,2094 ---- fi # linkmode = lib done # for deplib in $libs ! if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do *************** *** 2073,2079 **** done fi ! if test $pass != dlopen; then ! test $pass != scan && dependency_libs="$newdependency_libs" ! if test $pass != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= --- 2096,2102 ---- done fi ! if test "$pass" != dlopen; then ! test "$pass" != scan && dependency_libs="$newdependency_libs" ! if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= *************** *** 2133,2137 **** fi done # for pass ! if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" --- 2156,2160 ---- fi done # for pass ! if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" *************** *** 2251,2255 **** # Check that each of the things are valid numbers. case $current in ! 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 --- 2274,2278 ---- # Check that each of the things are valid numbers. case $current in ! [0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 *************** *** 2260,2264 **** case $revision in ! 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 --- 2283,2287 ---- case $revision in ! [0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 *************** *** 2269,2273 **** case $age in ! 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 --- 2292,2296 ---- case $age in ! [0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 *************** *** 2445,2449 **** esac done ! if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi --- 2468,2472 ---- esac done ! if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi *************** *** 2488,2492 **** *) # Add libc to deplibs on all other systems if necessary. ! if test $build_libtool_need_lc = "yes"; then deplibs="$deplibs -lc" fi --- 2511,2515 ---- *) # Add libc to deplibs on all other systems if necessary. ! if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi *************** *** 2760,2764 **** echo "*** or is declared to -dlopen it." ! if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," --- 2783,2787 ---- echo "*** or is declared to -dlopen it." ! if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," *************** *** 2787,2791 **** # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then ! if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= --- 2810,2814 ---- # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then ! if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= *************** *** 3495,3499 **** fi ! if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` --- 3518,3522 ---- fi ! if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` *************** *** 3950,3954 **** done # Quote the link command for shipping. ! relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` --- 3973,3977 ---- done # Quote the link command for shipping. ! relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` *************** *** 4081,4085 **** # Directory that this library needs to be installed in: libdir='$install_libdir'" ! if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" --- 4104,4108 ---- # Directory that this library needs to be installed in: libdir='$install_libdir'" ! if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" *************** *** 4292,4295 **** --- 4315,4336 ---- if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit 1 + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` + fi + $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" *************** *** 4297,4301 **** else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ! continue fi fi --- 4338,4342 ---- else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ! exit 1 fi fi *************** *** 4460,4464 **** tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" ! tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else --- 4501,4509 ---- tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" ! tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` ! if test $? = 0 ; then : ! else ! tmpdir="$tmpdir/libtool-$$" ! fi if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else *************** *** 4801,4808 **** fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` ! test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates ! if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; --- 4846,4853 ---- fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` ! test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates ! if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *************** *** 4836,4842 **** done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" ! test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ! if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. --- 4881,4887 ---- done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" ! test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ! if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. *************** *** 4882,4886 **** *) # Do a test to see if this is a libtool program. ! if test $mode = clean && (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= --- 4927,4931 ---- *) # Do a test to see if this is a libtool program. ! if test "$mode" = clean && (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= |
From: red0x <re...@us...> - 2004-04-08 21:19:09
|
Update of /cvsroot/autosec/sonar/libltdl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12183/libltdl Modified Files: acinclude.m4 Log Message: Added a configure check for strndup Index: acinclude.m4 =================================================================== RCS file: /cvsroot/autosec/sonar/libltdl/acinclude.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** acinclude.m4 14 Oct 2003 23:32:09 -0000 1.1 --- acinclude.m4 8 Apr 2004 21:05:54 -0000 1.2 *************** *** 101,104 **** --- 101,118 ---- ;; + *-*-linux*) + # Test if the compiler is 64bit + echo 'int i;' > conftest.$ac_ext + lt_cv_cc_64bit_output=no + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *"ELF 64"*) + lt_cv_cc_64bit_output=yes + ;; + esac + fi + rm -rf conftest* + ;; + *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. *************** *** 1404,1407 **** --- 1418,1445 ---- ;; + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then *************** *** 1949,1954 **** version_type=none dynamic_linker="$host_os ld.so" ! sys_lib_dlsearch_path_spec="/lib /usr/lib" ! sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in --- 1987,1992 ---- version_type=none dynamic_linker="$host_os ld.so" ! sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib" ! sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib /usr/X11R6/lib" case $host_os in *************** *** 2184,2187 **** --- 2222,2232 ---- hardcode_into_libs=yes + case $host_cpu:$lt_cv_cc_64bit_output in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" + sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" + ;; + esac + # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the *************** *** 3426,3430 **** linux-gnu*) case $host_cpu in ! alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*) lt_cv_deplibs_check_method=pass_all ;; *) --- 3471,3475 ---- linux-gnu*) case $host_cpu in ! alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*) lt_cv_deplibs_check_method=pass_all ;; *) |
From: red0x <re...@us...> - 2004-04-08 19:57:14
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26277 Modified Files: .indent.pro Log Message: Changed to Kangleipak style Index: .indent.pro =================================================================== RCS file: /cvsroot/autosec/sonar/.indent.pro,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .indent.pro 7 Jun 2002 17:53:51 -0000 1.1 --- .indent.pro 8 Apr 2004 19:44:02 -0000 1.2 *************** *** 1 **** ! -bl -cdw -i8 -lp -nbfda -nce -nprs -nsaf -nsai -nsaw -nss -nut -ts8 -bli0 -npcs -cli8 -npsl --- 1 ---- ! -i8 -sc -bli0 -bl0 -cbi0 -ss |
From: red0x <re...@us...> - 2004-04-08 19:24:19
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18810/plugins Modified Files: inp_rand.c log_file.c log_xml.c network_icmp.c rfc793.c Log Message: Removed old, manky plugin options parsing routines Index: inp_rand.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/inp_rand.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** inp_rand.c 2 Mar 2004 02:32:55 -0000 1.9 --- inp_rand.c 8 Apr 2004 19:11:02 -0000 1.10 *************** *** 39,43 **** static int plugin_destroy(void); static int plugin_open(void *c_data, int i_data); - static int plugin_args(char opt, char *optarg); static int plugin_close(void); static int plugin_next(char *hostname); --- 39,42 ---- *************** *** 74,78 **** pthis.plugin_init = &plugin_init; pthis.plugin_destroy = &plugin_destroy; - pthis.plugin_args = &plugin_args; pthis.plugin_open = &plugin_open; pthis.plugin_close = &plugin_close; --- 73,76 ---- *************** *** 109,114 **** pthis.plugin_next = NULL; pthis.plugin_sweep = NULL; - pthis.plugin_args = NULL; - pthis.plugin_sweep = NULL; pthis.plugin_output = NULL; pthis.plugin_results = NULL; --- 107,110 ---- *************** *** 138,146 **** } - static int plugin_args(char opt, char *optarg) - { - return PLUGIN_INVALIDO; - } - static int plugin_close(void) { --- 134,137 ---- Index: network_icmp.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/network_icmp.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** network_icmp.c 31 Mar 2004 08:53:47 -0000 1.42 --- network_icmp.c 8 Apr 2004 19:11:02 -0000 1.43 *************** *** 65,69 **** static int icmp_end(void); - static int icmp_args(char opt, char *optarg); static int icmp_leadin(void *c_data, int i_data); static int icmp_close(void); --- 65,68 ---- *************** *** 122,126 **** pthis.plugin_next = NULL; pthis.plugin_sweep = &icmp_sweep; - pthis.plugin_args = &icmp_args; pthis.plugin_sweep = &icmp_sweep; pthis.plugin_output = NULL; --- 121,124 ---- *************** *** 168,173 **** pthis.plugin_next = NULL; pthis.plugin_sweep = NULL; - pthis.plugin_args = NULL; - pthis.plugin_sweep = NULL; pthis.plugin_output = NULL; pthis.plugin_results = NULL; --- 166,169 ---- *************** *** 182,197 **** } - - /** @fn icmp_args(char opt, char *optarg) - * Plugin Argument handler - * @param opt Option char as passed from getopt - * @param optarg Option argument as passed from getopt - * @return PLUGIN_OK if that argument was handled, PLUGIN_ERROR otherwise - */ - static int icmp_args(char opt, char *optarg) - { - return PLUGIN_INVALIDO; - } - static void icmp_arg_parse(char *sArgs, int arglen) { --- 178,181 ---- Index: log_file.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/log_file.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** log_file.c 31 Mar 2004 08:53:46 -0000 1.24 --- log_file.c 8 Apr 2004 19:11:02 -0000 1.25 *************** *** 37,41 **** static int plugin_destroy(void); - static int plugin_args(char opt, char *optarg); static int plugin_open(void *c_data, int i_data); static int plugin_close(void); --- 37,40 ---- *************** *** 81,85 **** pthis.plugin_init = &plugin_init; pthis.plugin_destroy = &plugin_destroy; - pthis.plugin_args = &plugin_args; pthis.plugin_open = &plugin_open; pthis.plugin_close = &plugin_close; --- 80,83 ---- *************** *** 112,117 **** pthis.plugin_next = NULL; pthis.plugin_sweep = NULL; - pthis.plugin_args = NULL; - pthis.plugin_sweep = NULL; pthis.plugin_output = NULL; pthis.plugin_results = NULL; --- 110,113 ---- *************** *** 126,135 **** } - static int plugin_args(char opt, char *optarg) - { - - return PLUGIN_INVALIDO; - } - static int plugin_open(void *c_data, int i_data) { --- 122,125 ---- Index: rfc793.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/rfc793.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** rfc793.c 8 Apr 2004 08:29:41 -0000 1.43 --- rfc793.c 8 Apr 2004 19:11:02 -0000 1.44 *************** *** 82,87 **** /* this is assumed */ mthis = (sonar_t *) in_data; ! if(mthis->api < 5) ! err_quit("Plugin API must be 5 or higher, update sonar"); pthis.type = NETWORK_PLUGIN; --- 82,87 ---- /* this is assumed */ mthis = (sonar_t *) in_data; ! if(mthis->api < 6) ! err_quit("Plugin API must be 6 or higher, update sonar"); pthis.type = NETWORK_PLUGIN; *************** *** 97,101 **** pthis.plugin_init = &plugin_init; pthis.plugin_destroy = &plugin_destroy; - pthis.plugin_args = NULL; pthis.plugin_open = &plugin_open; pthis.plugin_close = &plugin_close; --- 97,100 ---- *************** *** 139,143 **** pthis.plugin_next = NULL; pthis.plugin_sweep = NULL; - pthis.plugin_args = NULL; pthis.plugin_sweep = NULL; pthis.plugin_output = NULL; --- 138,141 ---- Index: log_xml.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/log_xml.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** log_xml.c 2 Mar 2004 02:34:35 -0000 1.9 --- log_xml.c 8 Apr 2004 19:11:02 -0000 1.10 *************** *** 40,44 **** static int plugin_destroy(void); - static int plugin_args(char opt, char *optarg); static int plugin_open(void *c_data, int i_data); static int plugin_close(void); --- 40,43 ---- *************** *** 81,85 **** pthis.plugin_init = &plugin_init; pthis.plugin_destroy = &plugin_destroy; - pthis.plugin_args = &plugin_args; pthis.plugin_open = &plugin_open; pthis.plugin_close = &plugin_close; --- 80,83 ---- *************** *** 113,118 **** pthis.plugin_next = NULL; pthis.plugin_sweep = NULL; - pthis.plugin_args = NULL; - pthis.plugin_sweep = NULL; pthis.plugin_output = NULL; pthis.plugin_results = NULL; --- 111,114 ---- *************** *** 127,135 **** } - static int plugin_args(char opt, char *optarg) - { - return PLUGIN_INVALIDO; - } - static int plugin_open(void *c_data, int i_data) { --- 123,126 ---- |
From: red0x <re...@us...> - 2004-04-08 19:24:19
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18810/src Modified Files: plugin.c plugin.h sonar.c Log Message: Removed old, manky plugin options parsing routines Index: plugin.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** plugin.h 31 Mar 2004 20:49:08 -0000 1.39 --- plugin.h 8 Apr 2004 19:11:03 -0000 1.40 *************** *** 196,202 **** int (*plugin_destroy) (void); - /// Argument handler XXX: soon to be removed - int (*plugin_args) (char opt, char *optarg); - /// Open the input/output/network source int (*plugin_open) (void *c_data, int i_data); --- 196,199 ---- Index: plugin.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** plugin.c 31 Mar 2004 08:53:47 -0000 1.30 --- plugin.c 8 Apr 2004 19:11:03 -0000 1.31 *************** *** 570,624 **** /** - * @fn plugin_command_handler(char opt, char *optarg) - * Call each plugin's plugin_args function to see if it handles this option - * @param opt Option char as passed from getopt - * @param optarg Option argument as passed from getopt - * @return SONAR_ERROR if no plugins handled the argument\n - * SONAR_OK if someone handled it - */ - int plugin_command_handler(char opt, char *optarg) - { - //go through the plugins, and see if this option is handled, first network - // plugins, then input, then output - // else, return SONAR_ERROR - unsigned int plug = 0; - int error = PLUGIN_ERROR; - for(plug = 0; plug < num_inp; plug++) - { - int myerror; - assert(input_list[plug].plug != NULL); - assert(input_list[plug].plug->plugin_args != NULL); - if((myerror = - input_list[plug].plug->plugin_args(opt, - optarg)) != - PLUGIN_ERROR && error == PLUGIN_ERROR) - error = myerror; - } - for(plug = 0; plug < num_out; plug++) - { - int myerror; - assert(output_list[plug].plug != NULL); - assert(output_list[plug].plug->plugin_args != NULL); - if((myerror = - output_list[plug].plug->plugin_args(opt, - optarg)) != - PLUGIN_ERROR && error == PLUGIN_ERROR) - error = myerror; - } - for(plug = 0; plug < num_net; plug++) - { - int myerror; - assert(network_list[plug].plug != NULL); - assert(network_list[plug].plug->plugin_args != NULL); - if((myerror = - network_list[plug].plug->plugin_args(opt, - optarg)) != - PLUGIN_ERROR && error == PLUGIN_ERROR) - error = myerror; - } - return error; - } - - /** * @fn plugin_message_hook(char *msg, va_list *ap) * Call each output plugin's output function if its ready --- 570,573 ---- Index: sonar.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** sonar.c 31 Mar 2004 11:48:52 -0000 1.41 --- sonar.c 8 Apr 2004 19:11:03 -0000 1.42 *************** *** 316,330 **** } break; - case 'p': - plugin = (char *) optarg; - log_write(LOG_CONSOLE, "Passing arguments this way is soon " - "to be deprecated\n"); - log_write(LOG_DBUG, "plugin_command_handler(%c, %s);\n", - *plugin, (char *) (plugin + 1)); - - if(plugin_command_handler(*plugin,(char *) (plugin + 1)) - == SONAR_ERROR) - sonar_usage("Argument not handled by plugin(s)"); - break; case 'v': if(optarg != NULL) --- 316,319 ---- |
From: Jacob F. <ph...@us...> - 2004-04-08 08:42:55
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19487 Modified Files: rfc793.c Log Message: Fixed parameters up a bit and style nazi Index: rfc793.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/rfc793.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** rfc793.c 2 Apr 2004 08:46:50 -0000 1.42 --- rfc793.c 8 Apr 2004 08:29:41 -0000 1.43 *************** *** 75,118 **** void *plugin_init(void *in_data) { ! assert(in_data != NULL); ! /* useless reference, to avoid a warning */ ! if(rcsid); ! /* this is assumed */ ! mthis = (sonar_t *) in_data; ! if(mthis->api < 5) [...1907 lines suppressed...] ! case ICMP_UNREACH_HOST_PRECEDENCE: ! return "host precedence violation"; ! case ICMP_UNREACH_PRECEDENCE_CUTOFF: ! return "precedence cutoff"; ! } ! return "unknown"; } static RETSIGTYPE sig_handler(int i) { ! switch(i) ! { ! case SIGSEGV: ! err_msg("oops! ACK scan seg faulted.\n"); ! abort(); ! break; } /* just close the thread and be done with it */ ! pthread_exit(NULL); } |