mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Remove -z/--analysis option.
It was only used for one special case that is not commonly used by anyone.
This commit is contained in:
parent
30b40b214a
commit
b7ab6a5332
5 changed files with 1 additions and 114 deletions
|
@ -66,9 +66,6 @@ print version and exit
|
||||||
\fB\-x\fR,\ \-\-print\-state <file.bst>
|
\fB\-x\fR,\ \-\-print\-state <file.bst>
|
||||||
print contents of state file
|
print contents of state file
|
||||||
.TP
|
.TP
|
||||||
\fB\-z\fR,\ \-\-analyze <analysis>
|
|
||||||
run the specified policy file analysis
|
|
||||||
.TP
|
|
||||||
\fB\-C\fR,\ \-\-no\-checksums
|
\fB\-C\fR,\ \-\-no\-checksums
|
||||||
ignore checksums
|
ignore checksums
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -321,7 +321,6 @@ set(bro_SRCS
|
||||||
RuleAction.cc
|
RuleAction.cc
|
||||||
RuleCondition.cc
|
RuleCondition.cc
|
||||||
RuleMatcher.cc
|
RuleMatcher.cc
|
||||||
ScriptAnaly.cc
|
|
||||||
SmithWaterman.cc
|
SmithWaterman.cc
|
||||||
Scope.cc
|
Scope.cc
|
||||||
SerializationFormat.cc
|
SerializationFormat.cc
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
|
||||||
|
|
||||||
#include "Dict.h"
|
|
||||||
#include "Expr.h"
|
|
||||||
#include "Traverse.h"
|
|
||||||
#include "ScriptAnaly.h"
|
|
||||||
|
|
||||||
typedef const char cchar;
|
|
||||||
declare(PDict, cchar);
|
|
||||||
|
|
||||||
|
|
||||||
class FindNoteCallback : public TraversalCallback {
|
|
||||||
public:
|
|
||||||
FindNoteCallback() { note_expr = 0; }
|
|
||||||
|
|
||||||
virtual TraversalCode PreExpr(const Expr* e);
|
|
||||||
|
|
||||||
Expr* note_expr;
|
|
||||||
};
|
|
||||||
|
|
||||||
TraversalCode FindNoteCallback::PreExpr(const Expr* e)
|
|
||||||
{
|
|
||||||
if ( e->Tag() == EXPR_FIELD_ASSIGN )
|
|
||||||
{
|
|
||||||
const FieldAssignExpr* fae =
|
|
||||||
dynamic_cast<const FieldAssignExpr*>(e);
|
|
||||||
|
|
||||||
if ( ! streq(fae->FieldName(), "note") )
|
|
||||||
return TC_CONTINUE;
|
|
||||||
|
|
||||||
note_expr = fae->Op();
|
|
||||||
return TC_ABORTALL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TC_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class NoticeCallback : public TraversalCallback {
|
|
||||||
public:
|
|
||||||
virtual TraversalCode PreExpr(const Expr* e);
|
|
||||||
|
|
||||||
PDict(cchar) notices;
|
|
||||||
};
|
|
||||||
|
|
||||||
TraversalCode NoticeCallback::PreExpr(const Expr* e)
|
|
||||||
{
|
|
||||||
if ( e->Tag() != EXPR_CALL )
|
|
||||||
return TC_CONTINUE;
|
|
||||||
|
|
||||||
const CallExpr* ce = dynamic_cast<const CallExpr*>(e);
|
|
||||||
|
|
||||||
if ( ce->Func()->Tag() != EXPR_NAME ||
|
|
||||||
! streq(((NameExpr*) ce->Func())->Id()->Name(), "NOTICE") )
|
|
||||||
return TC_CONTINUE;
|
|
||||||
|
|
||||||
FindNoteCallback fnc;
|
|
||||||
ce->Traverse(&fnc);
|
|
||||||
if ( fnc.note_expr )
|
|
||||||
{
|
|
||||||
ODesc d;
|
|
||||||
fnc.note_expr->Describe(&d);
|
|
||||||
if ( ! notices.Lookup(d.Description()) )
|
|
||||||
{
|
|
||||||
const char* desc = strdup(d.Description());
|
|
||||||
notices.Insert(desc, desc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return TC_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void notice_analysis()
|
|
||||||
{
|
|
||||||
NoticeCallback cb;
|
|
||||||
traverse_all(&cb);
|
|
||||||
|
|
||||||
const cchar* notice = 0;
|
|
||||||
IterCookie* iter = cb.notices.InitForIteration();
|
|
||||||
|
|
||||||
while ( (notice = cb.notices.NextEntry(iter)) )
|
|
||||||
printf("Found NOTICE: %s\n", notice);
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
|
||||||
|
|
||||||
#ifndef scriptanaly_h
|
|
||||||
#define scriptanaly_h
|
|
||||||
|
|
||||||
void notice_analysis();
|
|
||||||
|
|
||||||
#endif
|
|
19
src/main.cc
19
src/main.cc
|
@ -25,7 +25,6 @@ extern "C" void OPENSSL_add_all_algorithms_conf(void);
|
||||||
|
|
||||||
#include "bsd-getopt-long.h"
|
#include "bsd-getopt-long.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "ScriptAnaly.h"
|
|
||||||
#include "DNS_Mgr.h"
|
#include "DNS_Mgr.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
|
@ -116,7 +115,6 @@ ProfileLogger* profiling_logger = 0;
|
||||||
ProfileLogger* segment_logger = 0;
|
ProfileLogger* segment_logger = 0;
|
||||||
SampleLogger* sample_logger = 0;
|
SampleLogger* sample_logger = 0;
|
||||||
int signal_val = 0;
|
int signal_val = 0;
|
||||||
int do_notice_analysis = 0;
|
|
||||||
extern char version[];
|
extern char version[];
|
||||||
char* command_line_policy = 0;
|
char* command_line_policy = 0;
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
|
@ -182,7 +180,6 @@ void usage()
|
||||||
fprintf(stderr, " -v|--version | print version and exit\n");
|
fprintf(stderr, " -v|--version | print version and exit\n");
|
||||||
fprintf(stderr, " -w|--writefile <writefile> | write to given tcpdump file\n");
|
fprintf(stderr, " -w|--writefile <writefile> | write to given tcpdump file\n");
|
||||||
fprintf(stderr, " -x|--print-state <file.bst> | print contents of state file\n");
|
fprintf(stderr, " -x|--print-state <file.bst> | print contents of state file\n");
|
||||||
fprintf(stderr, " -z|--analyze <analysis> | run the specified policy file analysis\n");
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, " -B|--debug <dbgstreams> | Enable debugging output for selected streams ('-B help' for help)\n");
|
fprintf(stderr, " -B|--debug <dbgstreams> | Enable debugging output for selected streams ('-B help' for help)\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -484,7 +481,6 @@ int main(int argc, char** argv)
|
||||||
{"writefile", required_argument, 0, 'w'},
|
{"writefile", required_argument, 0, 'w'},
|
||||||
{"version", no_argument, 0, 'v'},
|
{"version", no_argument, 0, 'v'},
|
||||||
{"print-state", required_argument, 0, 'x'},
|
{"print-state", required_argument, 0, 'x'},
|
||||||
{"analyze", required_argument, 0, 'z'},
|
|
||||||
{"no-checksums", no_argument, 0, 'C'},
|
{"no-checksums", no_argument, 0, 'C'},
|
||||||
{"force-dns", no_argument, 0, 'F'},
|
{"force-dns", no_argument, 0, 'F'},
|
||||||
{"load-seeds", required_argument, 0, 'G'},
|
{"load-seeds", required_argument, 0, 'G'},
|
||||||
|
@ -542,7 +538,7 @@ int main(int argc, char** argv)
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
|
|
||||||
char opts[256];
|
char opts[256];
|
||||||
safe_strncpy(opts, "B:e:f:G:H:I:i:n:p:R:r:s:T:t:U:w:x:X:z:CFNPQSWabdghv",
|
safe_strncpy(opts, "B:e:f:G:H:I:i:n:p:R:r:s:T:t:U:w:x:X:CFNPQSWabdghv",
|
||||||
sizeof(opts));
|
sizeof(opts));
|
||||||
|
|
||||||
#ifdef USE_PERFTOOLS_DEBUG
|
#ifdef USE_PERFTOOLS_DEBUG
|
||||||
|
@ -615,16 +611,6 @@ int main(int argc, char** argv)
|
||||||
bst_file = optarg;
|
bst_file = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'z':
|
|
||||||
if ( streq(optarg, "notice") )
|
|
||||||
do_notice_analysis = 1;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown analysis type: %s\n", optarg);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'B':
|
case 'B':
|
||||||
debug_streams = optarg;
|
debug_streams = optarg;
|
||||||
break;
|
break;
|
||||||
|
@ -1103,9 +1089,6 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
delete alive_handlers;
|
delete alive_handlers;
|
||||||
|
|
||||||
if ( do_notice_analysis )
|
|
||||||
notice_analysis();
|
|
||||||
|
|
||||||
if ( stmts )
|
if ( stmts )
|
||||||
{
|
{
|
||||||
stmt_flow_type flow;
|
stmt_flow_type flow;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue