[Snort-devel] Linking custom dynamic-preprocessor

Fuat Yosanto mbahe_suro at ...3099...
Wed Jul 21 21:36:17 EDT 2010


Thanks Steven, but I think, I have done that before.

These are what I have done last night:
I have modified some file

1. configure.in :
.............
AC_PROG_INSTALL
AC_CONFIG_FILES([ \
snort.pc \
Makefile \
.............
src/dynamic-preprocessors/Makefile   \
src/dynamic-preprocessors/ann/Makefile	\ <------ here
src/dynamic-preprocessors/libs/Makefile   \
src/dynamic-preprocessors/ftptelnet/Makefile   \
src/dynamic-preprocessors/smtp/Makefile   \
src/dynamic-preprocessors/ssh/Makefile   \
src/dynamic-preprocessors/dcerpc/Makefile   \
src/dynamic-preprocessors/dcerpc2/Makefile   \
src/dynamic-preprocessors/dns/Makefile   \
src/dynamic-preprocessors/ssl/Makefile   \
src/output-plugins/Makefile    \
.............
templates/Makefile \
src/win32/Makefile])
AC_OUTPUT
.............

2. src/generators.h : 
.............
/* Reserved for Marty's IP blacklisting patch
#define GENERATOR_SPP_IPLIST                        136 */

#define GENERATOR_SPP_SSLPP                         137

#define GENERATOR_SPP_ANN_PATTERN_GENERATOR	    230 <------ here

/*  This is where all the alert messages will be archived for each
    internal alerts */

#define ARPSPOOF_UNICAST_ARP_REQUEST_STR "(spp_arpspoof) Unicast ARP
request"
.............

3. src/preprocids.h
.............
#define PP_ARPSPOOF               15
#define PP_DCE2                   16

#define PP_ANN			  47 <------- here

// used externally
#define PP_ISAKMP                 17
#define PP_SKYPE                  18
.............

4. src/dynamic-preprocessors/Makefile.am
.............
INCLUDES = @INCLUDES@ 

if HAVE_DYNAMIC_PLUGINS
SUBDIRS = libs ann ftptelnet smtp ssh dcerpc dns ssl dcerpc2
endif		^----------------- here

clean-local:
	rm -rf include build
..............

Then, I have created src/dynamic-preprocessors/ann/Makefile.am 
(I've just modified from another dyn-preproc, please check if there are
somethings inappropriate, thx :D):
## $Id
AUTOMAKE_OPTIONS=foreign no-dependencies

INCLUDES = -I../include

libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor

lib_LTLIBRARIES = libsf_ann_ptgn_preproc.la

libsf_dns_preproc_la_LDFLAGS = -module

BUILT_SOURCES = \
sf_dynamic_preproc_lib.c

nodist_libsf_ann_ptgn_preproc_la_SOURCES = \
sf_dynamic_preproc_lib.c

libsf_ann_ptgn_preproc_la_SOURCES = \
spp_ann_pattern_generator.c \
sf_preproc_info.h

EXTRA_DIST = \
sf_ann_pattern_generator.dsp

sf_dynamic_preproc_lib.c: ../include/sf_dynamic_preproc_lib.c
	cp $? $@

all-local:
	$(MAKE) DESTDIR=`pwd`/../build install-libLTLIBRARIES

clean-local:
	rm -f sf_dynamic_preproc_lib.c


There are 2 sources in my dynamic-preprocessor dir
(src/dynamic-preprocessors/ann/)
1. spp_ann_pattern_generator.c :
...........
#include <sys/types.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include "preprocids.h"
#include "sf_snort_packet.h"
#include "sf_dynamic_preproc_lib.h"
#include "sf_dynamic_preprocessor.h"
#include "debug.h"

#define GENERATOR_SPP_ANN_PATTERN_GENERATOR	230

extern DynamicPreprocessorData _dpd;

static void ANNPatternGeneratorInit(char *);
static void ANNPatternGeneratorProcess(void *, void *);
...............
2. sf_preproc_info.h :
#ifndef SF_PREPROC_INFO_H_
#define SF_PREPROC_INFO_H_

#define MAJOR_VERSION   1
#define MINOR_VERSION   0
#define BUILD_VERSION   1
#define PREPROC_NAME    "ANN_Pattern_Generator_Preprocessor"

#define DYNAMIC_PREPROC_SETUP   ANNPatternGeneratorSetup
extern void ANNPatternGeneratorSetup(void);

#endif


This morning, I have tried running "./configure" again.
But still got no Makefile or Makefile.in generated in my
dynamic-preprocessor dir.
Did I missed something?
Sorry for my long messages, I just want to make it clear.




More information about the Snort-devel mailing list