[Oisf-devel] suricata on solaris?
Victor Julien
victor at inliniac.net
Tue May 25 19:56:22 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It seems that Solaris handles setting CPU affinity differently. I'd try
putting the contents of the SetCPUAffinity in #ifndef OS_SUNOS, put the
closing #endif before the "return 0;" line.
Cheers,
Victor
Luis wrote:
> got a little bit farther that time..
>
> now it the error is as follows (sigh)..
>
>
> bash-3.00$ make
> make all-recursive
> Making all in libhtp
> make all-recursive
> Making all in htp
> Making all in test
> Making all in src
> gcc -DHAVE_CONFIG_H -I. -I.. -I../libhtp -I/opt/PP2K/include
> -I/opt/PP2K/include -I/opt/PP2K/include -I/opt/PP2K/include
> -mcpu=ultrasparc -W -Wall -fno-strict-aliasing -Wno-unused-parameter
> -DOS_SOLARIS -DHAVE_LIBNET11 -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD
> -DHAVE_NET_ETHERNET_H -DLIBPCAP_VERSION_MAJOR=1 -MT tm-threads.o -MD
> -MP -MF .deps/tm-threads.Tpo -c -o tm-threads.o tm-threads.c
> tm-threads.c: In function `SetCPUAffinity':
> tm-threads.c:657: error: `cpu_set_t' undeclared (first use in this function)
> tm-threads.c:657: error: (Each undeclared identifier is reported only once
> tm-threads.c:657: error: for each function it appears in.)
> tm-threads.c:657: error: syntax error before "cs"
> tm-threads.c:659: warning: implicit declaration of function `CPU_ZERO'
> tm-threads.c:659: error: `cs' undeclared (first use in this function)
> tm-threads.c:660: warning: implicit declaration of function `CPU_SET'
> tm-threads.c:672: error: too few arguments to function `processor_bind'
> *** Error code 1
> make: Fatal error: Command failed for target `tm-threads.o'
> Current working directory
> /export/home/lcatacor/src/suricata/suricata-0.9.0/src
> *** Error code 1
> The following command caused the error:
> fail= failcom='exit 1'; \
> for f in x $MAKEFLAGS; do \
> case $f in \
> *=* | --[!k]*);; \
> *k*) failcom='fail=yes';; \
> esac; \
> done; \
> dot_seen=no; \
> target=`echo all-recursive | sed s/-recursive//`; \
> list='libhtp src'; for subdir in $list; do \
> echo "Making $target in $subdir"; \
> if test "$subdir" = "."; then \
> dot_seen=yes; \
> local_target="$target-am"; \
> else \
> local_target="$target"; \
> fi; \
> (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \
> || eval $failcom; \
> done; \
> if test "$dot_seen" = "no"; then \
> make "$target-am" || exit 1; \
> fi; test -z "$fail"
> make: Fatal error: Command failed for target `all-recursive'
> Current working directory /export/home/lcatacor/src/suricata/suricata-0.9.0
> *** Error code 1
> make: Fatal error: Command failed for target `all'
>
>
> Luis
>
>
> On Tue, May 25, 2010 at 8:51 AM, Will Metcalf <william.metcalf at gmail.com
> <mailto:william.metcalf at gmail.com>> wrote:
>
> in src/threads.h change the macro around to look like this. See if it
> works after that.
>
> Regards,
>
> Will
>
> /*
> * OS specific macro's for setting the thread name. "top" can display
> * this name.
> */
> #ifndef PR_SET_NAME /*PR_SET_NAME */
> #define SCSetThreadName(n)
> #elif OS_FREEBSD /* FreeBSD */
> /** \todo Add implementation for FreeBSD */
> #define SCSetThreadName(n)
> #elif OS_WIN32 /* Windows */
> /** \todo Add implementation for Windows */
> #define SCSetThreadName(n)
> #elif OS_DARWIN /* Mac OS X */
> /** \todo Add implementation for MacOS */
> #define SCSetThreadName(n)
> #elif OS_SOLARIS
> #define SCSetThreadName(n)
> #else /* Linux */
>
>
> On Mon, May 24, 2010 at 10:48 AM, Luis <luis.mlists at gmail.com
> <mailto:luis.mlists at gmail.com>> wrote:
> > Hi:
> >
> > Thanks for answering..
> >
> > made the modifications to configure.in <http://configure.in>, and
> the mentioned source files..
> > (using DOS_SOLARIS)
> >
> >
> > however, I'm running into the following now..
> >
> > bash-3.00$ make
> > make all-recursive
> > Making all in libhtp
> > make all-recursive
> > Making all in htp
> > Making all in test
> > Making all in src
> > gcc -DHAVE_CONFIG_H -I. -I.. -I../libhtp -I/opt/PP2K/include
> > -I/opt/PP2K/include -I/opt/PP2K/include -I/opt/PP2K/include
> > -mcpu=ultrasparc -W -Wall -fno-strict-aliasing -Wno-unused-parameter
> > -DOS_SOLARIS -DHAVE_LIBNET11 -D_BSD_SOURCE -D__BSD_SOURCE
> -D__FAVOR_BSD
> > -DHAVE_NET_ETHERNET_H -DLIBPCAP_VERSION_MAJOR=1 -MT flow.o -MD
> -MP -MF
> > .deps/flow.Tpo -c -o flow.o flow.c
> > flow.c: In function `FlowManagerThread':
> > flow.c:666: error: `THREAD_NAME_LEN' undeclared (first use in this
> function)
> > flow.c:666: error: (Each undeclared identifier is reported only once
> > flow.c:666: error: for each function it appears in.)
> > flow.c:666: warning: implicit declaration of function `prctl'
> > flow.c:666: error: `PR_SET_NAME' undeclared (first use in this
> function)
> > flow.c:666: warning: unused variable `tname'
> > *** Error code 1
> > make: Fatal error: Command failed for target `flow.o'
> > Current working directory
> > /export/home/lcatacor/src/suricata/suricata-0.9.0/src
> > *** Error code 1
> > The following command caused the error:
> > fail= failcom='exit 1'; \
> > for f in x $MAKEFLAGS; do \
> > case $f in \
> > *=* | --[!k]*);; \
> > *k*) failcom='fail=yes';; \
> > esac; \
> > done; \
> > dot_seen=no; \
> > target=`echo all-recursive | sed s/-recursive//`; \
> > list='libhtp src'; for subdir in $list; do \
> > echo "Making $target in $subdir"; \
> > if test "$subdir" = "."; then \
> > dot_seen=yes; \
> > local_target="$target-am"; \
> > else \
> > local_target="$target"; \
> > fi; \
> > (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \
> > || eval $failcom; \
> > done; \
> > if test "$dot_seen" = "no"; then \
> > make "$target-am" || exit 1; \
> > fi; test -z "$fail"
> > make: Fatal error: Command failed for target `all-recursive'
> > Current working directory
> /export/home/lcatacor/src/suricata/suricata-0.9.0
> > *** Error code 1
> > make: Fatal error: Command failed for target `all'
> >
> >
> >
> >
> > did I miss something?
> >
> >
> > Thanks
> >
> >
> > Luis
> >
> >
> >
> >
> > On Sat, May 22, 2010 at 5:28 AM, Victor Julien
> <victor at inliniac.net <mailto:victor at inliniac.net>> wrote:
> >>
> Thank you Yoa-Min. One remark: in recent Suricata libnet is no longer
> required.
>
> Cheers,
> Victor
>
> Yao-Min Chen wrote:
>> The following info is dated back in Feb. So perhaps it is
>> outdated. The
>> work was based on Solaris 10, but should also work with
>> OpenSolaris.
>> Feel free to let me know any question.
>
>
>> LIBNET
>
>> * Suricata requires libnet-1.1.x.so
>> <http://libnet-1.1.x.so>; the package available at
>> www.sunfreeware.com <http://www.sunfreeware.com> has
>> libnet.a only.
>> * Instead, download libnet tarball from www.sunfreeware.com
>> <http://www.sunfreeware.com>
>> * /usr/sfw/bin/gtar xzf libnet-1.1.2.1.tar.gz
>> * Get the patch files from D.Mehra's OpenSolaris package
>> and build
>
>> wget
>
>> http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/libnet_link_dlpi.c.patch
>> <http://cr.opensolaris.org/%7Edmehra/libnet/raw_files/new/usr/src/lib/libnet/libnet_link_dlpi.c.patch>
>> wget
>
>> http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.am.patch
>> <http://cr.opensolaris.org/%7Edmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.am.patch>
>> wget
>
>> http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.in.patch
>> <http://cr.opensolaris.org/%7Edmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.in.patch>
>> patch -b -d src libnet_link_dlpi.c < libnet_link_dlpi.c.patch
>> patch -b -d src Makefile.am < makefile.am.patch
>> patch -b -p1 -d src Makefile.in < makefile.in.patch
>
>> export CFLAGS="-g -fPIC"
>> export PATH=/opt/gccfss/bin:$PATH
>> ./configure
>> gmake
>> gmake install
>
>
>> Modify configure.in <http://configure.in> and configure
>> to add a new OS label SUNOS
>
>> case "$host" in
>> *-*-*freebsd*)
>> CFLAGS="${CFLAGS} -DOS_FREEBSD"
>> CPPFLAGS="${CPPFLAGS} -I/usr/local/include
>> -I/usr/local/include/libnet11"
>> LDFLAGS="${LDFLAGS} -L/usr/local/lib
>> -L/usr/local/lib/libnet11"
>> ;;
>> *darwin*|*Darwin*)
>> CFLAGS="${CFLAGS} -DOS_DARWIN"
>> CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
>> LDFLAGS="${LDFLAGS} -L/opt/local/lib"
>> ;;
>> *SunOS*)
>> CFLAGS="${CFLAGS} -DOS_SUNOS"
>> CPPLAGS="${CPPFLAGS} -I/usr/sfw/include"
>> LDFLAGS="${LDFLAGS} -L/usr/sfw/lib"
>> ;;
>> *-*-linux*)
>> #for now do nothing
>> ;;
>> *)
>
>
>> Modify src
>
>> * cd ./src
>> * source-pcap-file.c: replace u_int8_t with uint8_t as
>> u_int8_t is
>> only defined in linux kernel header file, not POSIX standard
>> * util-debug.c: #define LOG_AUTHPRIV to LOG_AUTH and LOG_FTP to
>> LOG_DAEMON since there is neither LOG_AUTHPRIV nor LOG_FTP in
>> Solaris
>> * stream-tcp.c: same as previous item, replace u_int8_t
>> with uint8_t
>> as u_int8_t
>> * suricata-common.h: include <strings.h> to pick up
>> definition of
>> index()
>> * tm-threads.c: replace syscall(SYS_gettid) with
>> pthread_self();
>> replace sched_setaffinity() with processor_bind()
>> * util-debug.c: replace syscall(SYS_gettid) with pthread_self()
>> * util-debug-filters.c: replace syscall(SYS_gettid) with
>> pthread_self()
>> * stream-tcp-reassemble.h: replace u_int8_t with uint8_t
>> * util-daemon.c: include <signal.h>
>
>
>
>> On 05/21/10 09:35 AM, Will Metcalf wrote:
>>> We don't currently have any Solaris boxes setup for testing,
>> probably
>>> something we should look into ;-). Yao-Min, can you offer Lui any
>>> assistance?
>>>
>>> Regards,
>>>
>>> Will
>>>
>>> On Fri, May 21, 2010 at 11:29 AM, Lui Cat
>> <luis.mlists at gmail.com <mailto:luis.mlists at gmail.com>>
>>> wrote:
>>>
>>>> hello there;
>>>>
>>>> don't know if this is the right forum to ask this question,
>> but I was
>>>> wondering if anyone has attempted to compile suricata on solaris
>>>> (sparc or
>>>> x86)..
>>>> ?
>>>>
>>>> I'm currently stuck at the following:
>>>>
>>>> bash-3.00$ make
>>>> make all-recursive
>>>> Making all in libhtp
>>>> make all-recursive
>>>> Making all in htp
>>>> Making all in test
>>>> Making all in src
>>>> gcc -DHAVE_CONFIG_H -I. -I.. -I../libhtp -I/opt/PP2K/include
>>>> -I/opt/PP2K/include -I/opt/PP2K/include -I/opt/PP2K/include
>>>> -mcpu=ultrasparc -W -Wall -fno-strict-aliasing
>> -Wno-unused-parameter
>>>> -DOS_SOLARIS -DHAVE_LIBNET11 -D_BSD_SOURCE -D__BSD_SOURCE
>>>> -D__FAVOR_BSD
>>>> -DHAVE_NET_ETHERNET_H -DLIBPCAP_VERSION_MAJOR=1 -MT
>>>> source-pcap-file.o -MD
>>>> -MP -MF .deps/source-pcap-file.Tpo -c -o source-pcap-file.o
>>>> source-pcap-file.c
>>>> source-pcap-file.c:51: error: syntax error before "u_int8_t"
>>>> source-pcap-file.c: In function `ReceivePcapFileThreadInit':
>>>> source-pcap-file.c:208: warning: assignment from incompatible
>> pointer
>>>> type
>>>> source-pcap-file.c:211: warning: assignment from incompatible
>> pointer
>>>> type
>>>> source-pcap-file.c:214: warning: assignment from incompatible
>> pointer
>>>> type
>>>> source-pcap-file.c:217: warning: assignment from incompatible
>> pointer
>>>> type
>>>> *** Error code 1
>>>> make: Fatal error: Command failed for target `source-pcap-file.o'
>>>> Current working directory
>>>> /export/home/lcatacor/src/suricata/suricata-0.9.0/src
>>>> *** Error code 1
>>>> The following command caused the error:
>>>> fail= failcom='exit 1'; \
>>>> for f in x $MAKEFLAGS; do \
>>>> case $f in \
>>>> *=* | --[!k]*);; \
>>>> *k*) failcom='fail=yes';; \
>>>> esac; \
>>>> done; \
>>>> dot_seen=no; \
>>>> target=`echo all-recursive | sed s/-recursive//`; \
>>>> list='libhtp src'; for subdir in $list; do \
>>>> echo "Making $target in $subdir"; \
>>>> if test "$subdir" = "."; then \
>>>> dot_seen=yes; \
>>>> local_target="$target-am"; \
>>>> else \
>>>> local_target="$target"; \
>>>> fi; \
>>>> (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make
>> $local_target) \
>>>> || eval $failcom; \
>>>> done; \
>>>> if test "$dot_seen" = "no"; then \
>>>> make "$target-am" || exit 1; \
>>>> fi; test -z "$fail"
>>>> make: Fatal error: Command failed for target `all-recursive'
>>>> Current working directory
>>>> /export/home/lcatacor/src/suricata/suricata-0.9.0
>>>> *** Error code 1
>>>> make: Fatal error: Command failed for target `all'
>>>>
>>>>
>>>>
>>>> To get this far, had to change the configure script to add a
>> *solaris*
>>>> section to include a -DOS_SOLARIS and change the
>> src/util-byte.h file
>>>> to
>>>> include sys/byteorder.h
>>>>
>>>>
>>>> Any help would be appreciated
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Luis
>>>>
>>>>
>>>> _______________________________________________
>>>> Oisf-devel mailing list
>>>> Oisf-devel at openinfosecfoundation.org
>> <mailto:Oisf-devel at openinfosecfoundation.org>
>>>>
>> http://lists.openinfosecfoundation.org/mailman/listinfo/oisf-devel
>>>>
>>>>
>>>>
>
>
>
>> ------------------------------------------------------------------------
>
>> _______________________________________________
>> Oisf-devel mailing list
>> Oisf-devel at openinfosecfoundation.org
>> <mailto:Oisf-devel at openinfosecfoundation.org>
>> http://lists.openinfosecfoundation.org/mailman/listinfo/oisf-devel
>
>
> >
> >
- --
- ---------------------------------------------
Victor Julien
http://www.inliniac.net/
PGP: http://www.inliniac.net/victorjulien.asc
- ---------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkv8K2YACgkQiSMBBAuniMdVpACeN7N3H8a6pYXRuwY0r8OuutDO
x3gAnAq+oyBlND9dPgQTLa6TlGeBZIrs
=bO2j
-----END PGP SIGNATURE-----
More information about the Oisf-devel
mailing list