- Increment PORTREVISION [1]

- Add LICENSE [1]
- Minor changes in files/{pkg-message.in, sancp.in} [1]
- Add stage support [1]
- Remove indefinite article from COMMENT
- Fix build with clang

PR:		ports/182445
Submitted by:	Paul Schmehl <pauls@utdallas.edu> (maintainer) [1]
Approved by:	wg/culot (mentors, implicit)
This commit is contained in:
Danilo Egea Gondolfo 2013-10-07 14:11:44 +00:00
parent 408e0e2ec3
commit 6cf7c9532f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=329707
5 changed files with 45 additions and 59 deletions

View File

@ -4,36 +4,45 @@
PORTNAME= sancp
PORTVERSION= 1.6.1
DISTVERSIONSUFFIX= -stable
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= security
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}-stable
MAINTAINER= pauls@utdallas.edu
COMMENT= A network connection profiler
COMMENT= Network connection profiler
LICENSE= QPLv1
LICENSE_NAME= Q PUBLIC LICENSE v1.0
LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= auto-accept
ALL_TARGET= bsd
USE_RC_SUBR= sancp
SUB_FILES= pkg-message
LOG_DIR= /var/log/sancp
PLIST_SUB+= LOG_DIR=${LOG_DIR}
USERS= sancp
GROUPS= sancp
PORTDOCS= CHANGES INSTALL ISSUES README \
SETUP fields.LIST LICENSE
OPTIONS_DEFINE= DOCS
NO_STAGE= yes
post-extract:
@cd ${WRKSRC} && ${MV} LICENSE docs/
PORTDOCS= CHANGES INSTALL ISSUES \
README SETUP fields.LIST
MAKE_ARGS= CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
LFLAGS="${LDFLAGS}"
post-patch:
@${REINPLACE_CMD} -e 's|gcc|$${CC}|g ; s|g++|$${CXX}|g' \
${WRKSRC}/Makefile
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/sancp ${PREFIX}/bin
@${INSTALL_DATA} ${WRKSRC}/etc/sancp/sancp.conf ${PREFIX}/etc/sancp.conf-dist
@${CP} -n ${PREFIX}/etc/sancp.conf-dist ${PREFIX}/etc/sancp.conf || ${TRUE}
.if !defined(NOPORTDOCS)
@${INSTALL} -d ${DOCSDIR}/
cd ${WRKSRC}/docs/ && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}
@${INSTALL_PROGRAM} ${WRKSRC}/sancp \
${STAGEDIR}${PREFIX}/bin
@${INSTALL_DATA} ${WRKSRC}/etc/sancp/sancp.conf \
${STAGEDIR}${PREFIX}/etc/sancp.conf.dist
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/docs/|} ${STAGEDIR}${DOCSDIR}
${INSTALL} -m 750 -d ${STAGEDIR}${LOG_DIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,15 @@
--- sancp.cc.orig 2013-10-04 17:55:19.000000000 +0000
+++ sancp.cc 2013-10-04 17:56:55.000000000 +0000
@@ -271,10 +271,10 @@
/*******************************************************************
* Function for C code to call C++ code (used by pcap_functions.c) *
*******************************************************************/
-
+
extern "C" void ProcessMyPacket(char *user, struct pcap_pkthdr * pkthdr, u_char * pkt)
{
- extern struct gvars gVars;
+ struct gvars gVars;
CBuffer *buffer;
struct cnx *new_cnx=0;
gVars.timeptr.tv_sec=pkthdr->ts.tv_sec;

View File

@ -20,9 +20,5 @@ sancp.conf has been altered (you used sancp for something else) a
new conf file, named sguil-sancp.conf-sample will be installed in the
%%PREFIX%%/etc directory. You should use that one for sguil.
All of the configuration options for sancp are documented in the
startup script in %%PREFIX%%/etc/rc.d (don't forget to specify interface
in /etc/rc.conf)
If you're running sguil, you probably want to use at least the following flags:
sancp_flags="-D -P -R -u sancp -g sancp -d /var/log/sancp"

View File

@ -16,41 +16,6 @@
# Default: %%PREFIX%%/etc/sancp.conf
# sancp_interface (str): Default: none - MUST BE SET
#
# Command Line Options: (cmdline)
# ---------------------
#
# -? or -h this help screen
# -c <filename> specify the configuration/rules filename
# -d <directory> specify the directory for output files
# -i <device> set the network device to listen on (default: 'any')
# -g <gid> set a group identity
# -u <uid> set a user identity
# -r <pcapfile> pcap file to read (overrides -i)
# -B "<bpf expression>" set a bpf expression (alternative to -F <filename>)
# -D (daemon) forks, prints msgs to syslog only and overrides -C option
# -K (console) enable additional printing of 'realtimes' to stdout (suppressed by option -D)
# -F <bpf filename> file containing a bpf filter expression, overrides (alternative to -B)
# -H --human-readable write IP addresses in dotted notation and TCPflag fields in hex
# -R Set default for realtime to 'pass' (default is 'log') disables realtime, but rules can override
# -S Set default for stats to 'pass' (default is 'log') disables stats, but rules can override
# -P Set default for pcap to 'pass' (default is 'log') disables pcap, but rules can override
# -I or --enable_icmp_mixed record 'code' and 'type' fields for ICMP
# to the fields 's_port' and 'd_port'.
# note: affects how related icmp packets are correlated
# -V display version
# --shift (debug) force interpretation of packet starting at byte[2]
# normally performed when reading from the 'any' interface
# --strip-80211 strip 802.1Q headers from 802.1Q packets; used to
# decode 802.1Q encapsulated packets - affects -A option,
# --log-facility <facility> where facility can be 'LOCAL1' - 'LOCAL7'
# The default log facility used by SANCP is LOG_DAEMON
#
# Debug mode for pcap data logging
# -A records ALL traffic frames to a pcap file named 'debug_pcap_raw'
# (despite rules). Packets are logged here prior to decoding or handling.
# Use -F or -B option to restrict what is collectedi.
# Pcap data logged using this option is affected by the --strip-80211 cmdline option
# The configuration file equivalent to this is 'default debug_pcap_raw enable'
. /etc/rc.subr

View File

@ -1,4 +1,5 @@
bin/sancp
@unexec if cmp -s %D/etc/sancp.conf %D/etc/sancp.conf-dist; then rm -f %D/etc/sancp.conf; fi
etc/sancp.conf-dist
@exec cp -n %D/%F %B/sancp.conf
@unexec if cmp -s %D/etc/sancp.conf %D/etc/sancp.conf.dist ; then rm -f %D/etc/sancp.conf ; fi
etc/sancp.conf.dist
@exec if [ ! -f %D/etc/sancp.conf ] ; then cp -p %D/%F %B/sancp.conf; fi
@dirrmtry /var/log/sancp