Removed
Link Here
|
1 |
#!/bin/sh |
2 |
# |
3 |
|
4 |
# PROVIDE: sancp |
5 |
# REQUIRE: DAEMON |
6 |
# BEFORE: LOGIN |
7 |
# KEYWORD: shutdown |
8 |
|
9 |
# Add the following lines to /etc/rc.conf to enable sancp: |
10 |
# sancp_enable (bool): Set to YES to enable sancp |
11 |
# Default: NO |
12 |
# sancp_flags (str): Extra flags passed to sancp |
13 |
# Default: -D |
14 |
# sancp_conf (str): Sancp configuration file |
15 |
# Default: %%PREFIX%%/etc/sancp.conf |
16 |
# sancp_interface (str): Default: none - MUST BE SET |
17 |
# |
18 |
# Command Line Options: (cmdline) |
19 |
# --------------------- |
20 |
# |
21 |
# -? or -h this help screen |
22 |
# -c <filename> specify the configuration/rules filename |
23 |
# -d <directory> specify the directory for output files |
24 |
# -i <device> set the network device to listen on (default: 'any') |
25 |
# -g <gid> set a group identity |
26 |
# -u <uid> set a user identity |
27 |
# -r <pcapfile> pcap file to read (overrides -i) |
28 |
# -B "<bpf expression>" set a bpf expression (alternative to -F <filename>) |
29 |
# -D (daemon) forks, prints msgs to syslog only and overrides -C option |
30 |
# -K (console) enable additional printing of 'realtimes' to stdout (suppressed by option -D) |
31 |
# -F <bpf filename> file containing a bpf filter expression, overrides (alternative to -B) |
32 |
# -H --human-readable write IP addresses in dotted notation and TCPflag fields in hex |
33 |
# -R Set default for realtime to 'pass' (default is 'log') disables realtime, but rules can override |
34 |
# -S Set default for stats to 'pass' (default is 'log') disables stats, but rules can override |
35 |
# -P Set default for pcap to 'pass' (default is 'log') disables pcap, but rules can override |
36 |
# -I or --enable_icmp_mixed record 'code' and 'type' fields for ICMP |
37 |
# to the fields 's_port' and 'd_port'. |
38 |
# note: affects how related icmp packets are correlated |
39 |
# -V display version |
40 |
# --shift (debug) force interpretation of packet starting at byte[2] |
41 |
# normally performed when reading from the 'any' interface |
42 |
# --strip-80211 strip 802.1Q headers from 802.1Q packets; used to |
43 |
# decode 802.1Q encapsulated packets - affects -A option, |
44 |
# --log-facility <facility> where facility can be 'LOCAL1' - 'LOCAL7' |
45 |
# The default log facility used by SANCP is LOG_DAEMON |
46 |
# |
47 |
# Debug mode for pcap data logging |
48 |
# -A records ALL traffic frames to a pcap file named 'debug_pcap_raw' |
49 |
# (despite rules). Packets are logged here prior to decoding or handling. |
50 |
# Use -F or -B option to restrict what is collectedi. |
51 |
# Pcap data logged using this option is affected by the --strip-80211 cmdline option |
52 |
# The configuration file equivalent to this is 'default debug_pcap_raw enable' |
53 |
|
54 |
. /etc/rc.subr |
55 |
|
56 |
name="sancp" |
57 |
rcvar=`set_rcvar` |
58 |
|
59 |
command="%%PREFIX%%/bin/sancp" |
60 |
|
61 |
start_precmd=start_precmd |
62 |
|
63 |
start_precmd() |
64 |
{ |
65 |
if [ -z "${sancp_interface}" ]; then |
66 |
err 1 "sancp_interface must set." |
67 |
fi |
68 |
} |
69 |
|
70 |
# set some defaults |
71 |
load_rc_config $name |
72 |
|
73 |
: ${sancp_enable="NO"} |
74 |
: ${sancp_flags="-D"} |
75 |
: ${sancp_conf="%%PREFIX%%/etc/sancp.conf"} |
76 |
: ${sancp_interface=""} |
77 |
|
78 |
command_args="${sancp_flags} -c ${sancp_conf} -i ${sancp_interface}" |
79 |
|
80 |
run_rc_command "$1" |