mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Rename Zeexygen to Zeekygen
This commit is contained in:
parent
f2f06d66c0
commit
84ca12fdb4
78 changed files with 444 additions and 440 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
|||
|
||||
2.6-262 | 2019-05-02 21:39:01 -0700
|
||||
|
||||
* Rename Zeexygen to Zeekygen (Jon Siwek, Corelight)
|
||||
|
||||
2.6-261 | 2019-05-02 20:49:23 -0700
|
||||
|
||||
* Remove previously deprecated policy/protocols/smb/__load__ (Jon Siwek, Corelight)
|
||||
|
|
4
NEWS
4
NEWS
|
@ -180,10 +180,10 @@ Changed Functionality
|
|||
and aren't counted as true gaps.
|
||||
|
||||
- The Broxygen component, which is used to generate our Doxygen-like
|
||||
scripting API documentation has been renamed to Zeexygen. This likely has
|
||||
scripting API documentation has been renamed to Zeekygen. This likely has
|
||||
no breaking or visible changes for most users, except in the case one
|
||||
used it to generate their own documentation via the ``--broxygen`` flag,
|
||||
which is now named ``--zeexygen``. Besides that, the various documentation
|
||||
which is now named ``--zeekygen``. Besides that, the various documentation
|
||||
in scripts has also been updated to replace Sphinx cross-referencing roles
|
||||
and directives like ":bro:see:" with ":zeek:zee:".
|
||||
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.6-261
|
||||
2.6-262
|
||||
|
|
2
doc
2
doc
|
@ -1 +1 @@
|
|||
Subproject commit f897256ad219b644b99a14873473e0276cf430f6
|
||||
Subproject commit 8aa690e20d19f79805d7f680e454e4ea10231add
|
|
@ -99,7 +99,7 @@ Record process status in file
|
|||
\fB\-W\fR,\ \-\-watchdog
|
||||
activate watchdog timer
|
||||
.TP
|
||||
\fB\-X\fR,\ \-\-zeexygen <cfgfile>
|
||||
\fB\-X\fR,\ \-\-zeekygen <cfgfile>
|
||||
generate documentation based on config file
|
||||
.TP
|
||||
\fB\-\-pseudo\-realtime[=\fR<speedup>]
|
||||
|
@ -150,7 +150,7 @@ ASCII log file extension
|
|||
Output file for script execution statistics
|
||||
.TP
|
||||
.B BRO_DISABLE_BROXYGEN
|
||||
Disable Zeexygen (Broxygen) documentation support
|
||||
Disable Zeekygen (Broxygen) documentation support
|
||||
.SH AUTHOR
|
||||
.B bro
|
||||
was written by The Bro Project <info@bro.org>.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
This package is loaded during the process which automatically generates
|
||||
reference documentation for all Zeek scripts (i.e. "Zeexygen"). Its only
|
||||
reference documentation for all Zeek scripts (i.e. "Zeekygen"). Its only
|
||||
purpose is to provide an easy way to load all known Zeek scripts plus any
|
||||
extra scripts needed or used by the documentation process.
|
|
@ -1,4 +1,4 @@
|
|||
##! This is an example script that demonstrates Zeexygen-style
|
||||
##! This is an example script that demonstrates Zeekygen-style
|
||||
##! documentation. It generally will make most sense when viewing
|
||||
##! the script's raw source code and comparing to the HTML-rendered
|
||||
##! version.
|
||||
|
@ -13,12 +13,12 @@
|
|||
##! There's also a custom role to reference any identifier node in
|
||||
##! the Zeek Sphinx domain that's good for "see alsos", e.g.
|
||||
##!
|
||||
##! See also: :zeek:see:`ZeexygenExample::a_var`,
|
||||
##! :zeek:see:`ZeexygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
##! See also: :zeek:see:`ZeekygenExample::a_var`,
|
||||
##! :zeek:see:`ZeekygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
##!
|
||||
##! And a custom directive does the equivalent references:
|
||||
##!
|
||||
##! .. zeek:see:: ZeexygenExample::a_var ZeexygenExample::ONE SSH::Info
|
||||
##! .. zeek:see:: ZeekygenExample::a_var ZeekygenExample::ONE SSH::Info
|
||||
|
||||
# Comments that use a single pound sign (#) are not significant to
|
||||
# a script's auto-generated documentation, but ones that use a
|
||||
|
@ -30,7 +30,7 @@
|
|||
# variable declarations to associate with the last-declared identifier.
|
||||
#
|
||||
# Generally, the auto-doc comments (##) are associated with the
|
||||
# next declaration/identifier found in the script, but Zeexygen
|
||||
# next declaration/identifier found in the script, but Zeekygen
|
||||
# will track/render identifiers regardless of whether they have any
|
||||
# of these special comments associated with them.
|
||||
#
|
||||
|
@ -49,19 +49,19 @@
|
|||
|
||||
# "module" statements are self-documenting, don't use any ``##`` style
|
||||
# comments with them.
|
||||
module ZeexygenExample;
|
||||
module ZeekygenExample;
|
||||
|
||||
# Redefinitions of "Notice::Type" are self-documenting, but
|
||||
# more information can be supplied in two different ways.
|
||||
redef enum Notice::Type += {
|
||||
## Any number of this type of comment
|
||||
## will document "Zeexygen_One".
|
||||
Zeexygen_One,
|
||||
Zeexygen_Two, ##< Any number of this type of comment
|
||||
##< will document "ZEEXYGEN_TWO".
|
||||
Zeexygen_Three,
|
||||
## will document "Zeekygen_One".
|
||||
Zeekygen_One,
|
||||
Zeekygen_Two, ##< Any number of this type of comment
|
||||
##< will document "ZEEKYGEN_TWO".
|
||||
Zeekygen_Three,
|
||||
## Omitting comments is fine, and so is mixing ``##`` and ``##<``, but
|
||||
Zeexygen_Four, ##< it's probably best to use only one style consistently.
|
||||
Zeekygen_Four, ##< it's probably best to use only one style consistently.
|
||||
};
|
||||
|
||||
# All redefs are automatically tracked. Comments of the "##" form can be use
|
||||
|
@ -110,7 +110,7 @@ export {
|
|||
type ComplexRecord: record {
|
||||
field1: count; ##< Counts something.
|
||||
field2: bool; ##< Toggles something.
|
||||
field3: SimpleRecord; ##< Zeexygen automatically tracks types
|
||||
field3: SimpleRecord; ##< Zeekygen automatically tracks types
|
||||
##< and cross-references are automatically
|
||||
##< inserted in to generated docs.
|
||||
msg: string &default="blah"; ##< Attributes are self-documenting.
|
||||
|
@ -163,9 +163,9 @@ export {
|
|||
## Summarize "an_event" here.
|
||||
## Give more details about "an_event" here.
|
||||
##
|
||||
## ZeexygenExample::a_function should not be confused as a parameter
|
||||
## ZeekygenExample::a_function should not be confused as a parameter
|
||||
## in the generated docs, but it also doesn't generate a cross-reference
|
||||
## link. Use the see role instead: :zeek:see:`ZeexygenExample::a_function`.
|
||||
## link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
||||
##
|
||||
## name: Describe the argument here.
|
||||
global an_event: event(name: string);
|
|
@ -143,7 +143,7 @@ set(bro_PLUGIN_LIBS CACHE INTERNAL "plugin libraries" FORCE)
|
|||
|
||||
add_subdirectory(analyzer)
|
||||
add_subdirectory(broker)
|
||||
add_subdirectory(zeexygen)
|
||||
add_subdirectory(zeekygen)
|
||||
add_subdirectory(file_analysis)
|
||||
add_subdirectory(input)
|
||||
add_subdirectory(iosource)
|
||||
|
|
|
@ -18,7 +18,7 @@ DebugLogger::Stream DebugLogger::streams[NUM_DBGS] = {
|
|||
{ "dpd", 0, false }, { "tm", 0, false },
|
||||
{ "logging", 0, false }, {"input", 0, false },
|
||||
{ "threading", 0, false }, { "file_analysis", 0, false },
|
||||
{ "plugins", 0, false }, { "zeexygen", 0, false },
|
||||
{ "plugins", 0, false }, { "zeekygen", 0, false },
|
||||
{ "pktio", 0, false }, { "broker", 0, false },
|
||||
{ "scripts", 0, false}
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ enum DebugStream {
|
|||
DBG_THREADING, // Threading system
|
||||
DBG_FILE_ANALYSIS, // File analysis
|
||||
DBG_PLUGINS, // Plugin system
|
||||
DBG_ZEEXYGEN, // Zeexygen
|
||||
DBG_ZEEKYGEN, // Zeekygen
|
||||
DBG_PKTIO, // Packet sources and dumpers.
|
||||
DBG_BROKER, // Broker communication
|
||||
DBG_SCRIPTS, // Script initialization
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "PersistenceSerializer.h"
|
||||
#include "Scope.h"
|
||||
#include "Traverse.h"
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
|
||||
ID::ID(const char* arg_name, IDScope arg_scope, bool arg_is_export)
|
||||
{
|
||||
|
@ -680,7 +680,7 @@ void ID::DescribeReSTShort(ODesc* d) const
|
|||
if ( is_type )
|
||||
d->Add(type_name(t));
|
||||
else
|
||||
d->Add(zeexygen_mgr->GetEnumTypeName(Name()).c_str());
|
||||
d->Add(zeekygen_mgr->GetEnumTypeName(Name()).c_str());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
22
src/Type.cc
22
src/Type.cc
|
@ -8,8 +8,8 @@
|
|||
#include "Scope.h"
|
||||
#include "Serializer.h"
|
||||
#include "Reporter.h"
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeexygen/utils.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
#include "zeekygen/utils.h"
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
@ -1197,8 +1197,8 @@ void RecordType::DescribeFieldsReST(ODesc* d, bool func_args) const
|
|||
if ( func_args )
|
||||
continue;
|
||||
|
||||
using zeexygen::IdentifierInfo;
|
||||
IdentifierInfo* doc = zeexygen_mgr->GetIdentifierInfo(GetName());
|
||||
using zeekygen::IdentifierInfo;
|
||||
IdentifierInfo* doc = zeekygen_mgr->GetIdentifierInfo(GetName());
|
||||
|
||||
if ( ! doc )
|
||||
{
|
||||
|
@ -1217,7 +1217,7 @@ void RecordType::DescribeFieldsReST(ODesc* d, bool func_args) const
|
|||
field_from_script != type_from_script )
|
||||
{
|
||||
d->PushIndent();
|
||||
d->Add(zeexygen::redef_indication(field_from_script).c_str());
|
||||
d->Add(zeekygen::redef_indication(field_from_script).c_str());
|
||||
d->PopIndent();
|
||||
}
|
||||
|
||||
|
@ -1237,7 +1237,7 @@ void RecordType::DescribeFieldsReST(ODesc* d, bool func_args) const
|
|||
{
|
||||
string s = cmnts[i];
|
||||
|
||||
if ( zeexygen::prettify_params(s) )
|
||||
if ( zeekygen::prettify_params(s) )
|
||||
d->NL();
|
||||
|
||||
d->Add(s.c_str());
|
||||
|
@ -1505,7 +1505,7 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
|
|||
if ( deprecated )
|
||||
id->MakeDeprecated();
|
||||
|
||||
zeexygen_mgr->Identifier(id);
|
||||
zeekygen_mgr->Identifier(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1618,8 +1618,8 @@ void EnumType::DescribeReST(ODesc* d, bool roles_only) const
|
|||
else
|
||||
d->Add(fmt(".. zeek:enum:: %s %s", it->second.c_str(), GetName().c_str()));
|
||||
|
||||
using zeexygen::IdentifierInfo;
|
||||
IdentifierInfo* doc = zeexygen_mgr->GetIdentifierInfo(it->second);
|
||||
using zeekygen::IdentifierInfo;
|
||||
IdentifierInfo* doc = zeekygen_mgr->GetIdentifierInfo(it->second);
|
||||
|
||||
if ( ! doc )
|
||||
{
|
||||
|
@ -1634,7 +1634,7 @@ void EnumType::DescribeReST(ODesc* d, bool roles_only) const
|
|||
if ( doc->GetDeclaringScript() )
|
||||
enum_from_script = doc->GetDeclaringScript()->Name();
|
||||
|
||||
IdentifierInfo* type_doc = zeexygen_mgr->GetIdentifierInfo(GetName());
|
||||
IdentifierInfo* type_doc = zeekygen_mgr->GetIdentifierInfo(GetName());
|
||||
|
||||
if ( type_doc && type_doc->GetDeclaringScript() )
|
||||
type_from_script = type_doc->GetDeclaringScript()->Name();
|
||||
|
@ -1644,7 +1644,7 @@ void EnumType::DescribeReST(ODesc* d, bool roles_only) const
|
|||
{
|
||||
d->NL();
|
||||
d->PushIndent();
|
||||
d->Add(zeexygen::redef_indication(enum_from_script).c_str());
|
||||
d->Add(zeekygen::redef_indication(enum_from_script).c_str());
|
||||
d->PopIndent();
|
||||
}
|
||||
|
||||
|
|
24
src/main.cc
24
src/main.cc
|
@ -55,7 +55,7 @@ extern "C" {
|
|||
#include "analyzer/Tag.h"
|
||||
#include "plugin/Manager.h"
|
||||
#include "file_analysis/Manager.h"
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
#include "iosource/Manager.h"
|
||||
#include "broker/Manager.h"
|
||||
|
||||
|
@ -91,7 +91,7 @@ input::Manager* input_mgr = 0;
|
|||
plugin::Manager* plugin_mgr = 0;
|
||||
analyzer::Manager* analyzer_mgr = 0;
|
||||
file_analysis::Manager* file_mgr = 0;
|
||||
zeexygen::Manager* zeexygen_mgr = 0;
|
||||
zeekygen::Manager* zeekygen_mgr = 0;
|
||||
iosource::Manager* iosource_mgr = 0;
|
||||
bro_broker::Manager* broker_mgr = 0;
|
||||
|
||||
|
@ -193,7 +193,7 @@ void usage(int code = 1)
|
|||
fprintf(stderr, " -T|--re-level <level> | set 'RE_level' for rules\n");
|
||||
fprintf(stderr, " -U|--status-file <file> | Record process status in file\n");
|
||||
fprintf(stderr, " -W|--watchdog | activate watchdog timer\n");
|
||||
fprintf(stderr, " -X|--zeexygen <cfgfile> | generate documentation based on config file\n");
|
||||
fprintf(stderr, " -X|--zeekygen <cfgfile> | generate documentation based on config file\n");
|
||||
|
||||
#ifdef USE_PERFTOOLS_DEBUG
|
||||
fprintf(stderr, " -m|--mem-leaks | show leaks [perftools]\n");
|
||||
|
@ -213,7 +213,7 @@ void usage(int code = 1)
|
|||
fprintf(stderr, " $BRO_SEED_FILE | file to load seeds from (not set)\n");
|
||||
fprintf(stderr, " $BRO_LOG_SUFFIX | ASCII log file extension (.%s)\n", logging::writer::Ascii::LogExt().c_str());
|
||||
fprintf(stderr, " $BRO_PROFILER_FILE | Output file for script execution statistics (not set)\n");
|
||||
fprintf(stderr, " $BRO_DISABLE_BROXYGEN | Disable Zeexygen documentation support (%s)\n", getenv("BRO_DISABLE_BROXYGEN") ? "set" : "not set");
|
||||
fprintf(stderr, " $BRO_DISABLE_BROXYGEN | Disable Zeekygen documentation support (%s)\n", getenv("BRO_DISABLE_BROXYGEN") ? "set" : "not set");
|
||||
fprintf(stderr, " $ZEEK_DNS_RESOLVER | IPv4/IPv6 address of DNS resolver to use (%s)\n", getenv("ZEEK_DNS_RESOLVER") ? getenv("ZEEK_DNS_RESOLVER") : "not set, will use first IPv4 address from /etc/resolv.conf");
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
|
@ -369,7 +369,7 @@ void terminate_bro()
|
|||
|
||||
plugin_mgr->FinishPlugins();
|
||||
|
||||
delete zeexygen_mgr;
|
||||
delete zeekygen_mgr;
|
||||
delete timer_mgr;
|
||||
delete persistence_serializer;
|
||||
delete event_serializer;
|
||||
|
@ -469,7 +469,7 @@ int main(int argc, char** argv)
|
|||
{"filter", required_argument, 0, 'f'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"iface", required_argument, 0, 'i'},
|
||||
{"zeexygen", required_argument, 0, 'X'},
|
||||
{"zeekygen", required_argument, 0, 'X'},
|
||||
{"prefix", required_argument, 0, 'p'},
|
||||
{"readfile", required_argument, 0, 'r'},
|
||||
{"rulefile", required_argument, 0, 's'},
|
||||
|
@ -521,7 +521,7 @@ int main(int argc, char** argv)
|
|||
if ( p )
|
||||
add_to_name_list(p, ':', prefixes);
|
||||
|
||||
string zeexygen_config;
|
||||
string zeekygen_config;
|
||||
|
||||
#ifdef USE_IDMEF
|
||||
string libidmef_dtd_path = "idmef-message.dtd";
|
||||
|
@ -674,7 +674,7 @@ int main(int argc, char** argv)
|
|||
break;
|
||||
|
||||
case 'X':
|
||||
zeexygen_config = optarg;
|
||||
zeekygen_config = optarg;
|
||||
break;
|
||||
|
||||
#ifdef USE_PERFTOOLS_DEBUG
|
||||
|
@ -756,7 +756,7 @@ int main(int argc, char** argv)
|
|||
timer_mgr = new PQ_TimerMgr("<GLOBAL>");
|
||||
// timer_mgr = new CQ_TimerMgr();
|
||||
|
||||
zeexygen_mgr = new zeexygen::Manager(zeexygen_config, bro_argv[0]);
|
||||
zeekygen_mgr = new zeekygen::Manager(zeekygen_config, bro_argv[0]);
|
||||
|
||||
add_essential_input_file("base/init-bare.zeek");
|
||||
add_essential_input_file("base/init-frameworks-and-bifs.zeek");
|
||||
|
@ -807,7 +807,7 @@ int main(int argc, char** argv)
|
|||
plugin_mgr->InitPreScript();
|
||||
analyzer_mgr->InitPreScript();
|
||||
file_mgr->InitPreScript();
|
||||
zeexygen_mgr->InitPreScript();
|
||||
zeekygen_mgr->InitPreScript();
|
||||
|
||||
bool missing_plugin = false;
|
||||
|
||||
|
@ -876,7 +876,7 @@ int main(int argc, char** argv)
|
|||
exit(1);
|
||||
|
||||
plugin_mgr->InitPostScript();
|
||||
zeexygen_mgr->InitPostScript();
|
||||
zeekygen_mgr->InitPostScript();
|
||||
broker_mgr->InitPostScript();
|
||||
|
||||
if ( print_plugins )
|
||||
|
@ -906,7 +906,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
reporter->InitOptions();
|
||||
zeexygen_mgr->GenerateDocs();
|
||||
zeekygen_mgr->GenerateDocs();
|
||||
|
||||
if ( user_pcap_filter )
|
||||
{
|
||||
|
|
26
src/parse.y
26
src/parse.y
|
@ -88,7 +88,7 @@
|
|||
#include "Scope.h"
|
||||
#include "Reporter.h"
|
||||
#include "Brofiler.h"
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
@ -1039,7 +1039,7 @@ type_decl:
|
|||
$$ = new TypeDecl($3, $1, $4, (in_record > 0));
|
||||
|
||||
if ( in_record > 0 && cur_decl_type_id )
|
||||
zeexygen_mgr->RecordField(cur_decl_type_id, $$, ::filename);
|
||||
zeekygen_mgr->RecordField(cur_decl_type_id, $$, ::filename);
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -1073,7 +1073,7 @@ decl:
|
|||
TOK_MODULE TOK_ID ';'
|
||||
{
|
||||
current_module = $2;
|
||||
zeexygen_mgr->ModuleUsage(::filename, current_module);
|
||||
zeekygen_mgr->ModuleUsage(::filename, current_module);
|
||||
}
|
||||
|
||||
| TOK_EXPORT '{' { is_export = true; } decl_list '}'
|
||||
|
@ -1082,36 +1082,36 @@ decl:
|
|||
| TOK_GLOBAL def_global_id opt_type init_class opt_init opt_attr ';'
|
||||
{
|
||||
add_global($2, $3, $4, $5, $6, VAR_REGULAR);
|
||||
zeexygen_mgr->Identifier($2);
|
||||
zeekygen_mgr->Identifier($2);
|
||||
}
|
||||
|
||||
| TOK_OPTION def_global_id opt_type init_class opt_init opt_attr ';'
|
||||
{
|
||||
add_global($2, $3, $4, $5, $6, VAR_OPTION);
|
||||
zeexygen_mgr->Identifier($2);
|
||||
zeekygen_mgr->Identifier($2);
|
||||
}
|
||||
|
||||
| TOK_CONST def_global_id opt_type init_class opt_init opt_attr ';'
|
||||
{
|
||||
add_global($2, $3, $4, $5, $6, VAR_CONST);
|
||||
zeexygen_mgr->Identifier($2);
|
||||
zeekygen_mgr->Identifier($2);
|
||||
}
|
||||
|
||||
| TOK_REDEF global_id opt_type init_class opt_init opt_attr ';'
|
||||
{
|
||||
add_global($2, $3, $4, $5, $6, VAR_REDEF);
|
||||
zeexygen_mgr->Redef($2, ::filename);
|
||||
zeekygen_mgr->Redef($2, ::filename);
|
||||
}
|
||||
|
||||
| TOK_REDEF TOK_ENUM global_id TOK_ADD_TO '{'
|
||||
{ parser_redef_enum($3); zeexygen_mgr->Redef($3, ::filename); }
|
||||
{ parser_redef_enum($3); zeekygen_mgr->Redef($3, ::filename); }
|
||||
enum_body '}' ';'
|
||||
{
|
||||
// Zeexygen already grabbed new enum IDs as the type created them.
|
||||
// Zeekygen already grabbed new enum IDs as the type created them.
|
||||
}
|
||||
|
||||
| TOK_REDEF TOK_RECORD global_id
|
||||
{ cur_decl_type_id = $3; zeexygen_mgr->Redef($3, ::filename); }
|
||||
{ cur_decl_type_id = $3; zeekygen_mgr->Redef($3, ::filename); }
|
||||
TOK_ADD_TO '{'
|
||||
{ ++in_record; }
|
||||
type_decl_list
|
||||
|
@ -1127,12 +1127,12 @@ decl:
|
|||
}
|
||||
|
||||
| TOK_TYPE global_id ':'
|
||||
{ cur_decl_type_id = $2; zeexygen_mgr->StartType($2); }
|
||||
{ cur_decl_type_id = $2; zeekygen_mgr->StartType($2); }
|
||||
type opt_attr ';'
|
||||
{
|
||||
cur_decl_type_id = 0;
|
||||
add_type($2, $5, $6);
|
||||
zeexygen_mgr->Identifier($2);
|
||||
zeekygen_mgr->Identifier($2);
|
||||
}
|
||||
|
||||
| func_hdr func_body
|
||||
|
@ -1167,7 +1167,7 @@ func_hdr:
|
|||
begin_func($2, current_module.c_str(),
|
||||
FUNC_FLAVOR_FUNCTION, 0, $3, $4);
|
||||
$$ = $3;
|
||||
zeexygen_mgr->Identifier($2);
|
||||
zeekygen_mgr->Identifier($2);
|
||||
}
|
||||
| TOK_EVENT event_id func_params opt_attr
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "Var.h"
|
||||
#include "Val.h"
|
||||
#include "Reporter.h"
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
|
||||
namespace plugin {
|
||||
|
||||
|
@ -134,7 +134,7 @@ ComponentManager<T, C>::ComponentManager(const string& arg_module, const string&
|
|||
tag_enum_type = new EnumType(module + "::" + local_id);
|
||||
::ID* id = install_ID(local_id.c_str(), module.c_str(), true, true);
|
||||
add_type(id, tag_enum_type, 0);
|
||||
zeexygen_mgr->Identifier(id);
|
||||
zeekygen_mgr->Identifier(id);
|
||||
}
|
||||
|
||||
template <class T, class C>
|
||||
|
|
12
src/scan.l
12
src/scan.l
|
@ -29,7 +29,7 @@
|
|||
#include "Traverse.h"
|
||||
|
||||
#include "analyzer/Analyzer.h"
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
|
||||
#include "plugin/Manager.h"
|
||||
|
||||
|
@ -162,19 +162,19 @@ ESCSEQ (\\([^\n]|[0-7]+|x[[:xdigit:]]+))
|
|||
%%
|
||||
|
||||
##!.* {
|
||||
zeexygen_mgr->SummaryComment(::filename, yytext + 3);
|
||||
zeekygen_mgr->SummaryComment(::filename, yytext + 3);
|
||||
}
|
||||
|
||||
##<.* {
|
||||
string hint(cur_enum_type && last_id_tok ?
|
||||
make_full_var_name(current_module.c_str(), last_id_tok) : "");
|
||||
|
||||
zeexygen_mgr->PostComment(yytext + 3, hint);
|
||||
zeekygen_mgr->PostComment(yytext + 3, hint);
|
||||
}
|
||||
|
||||
##.* {
|
||||
if ( yytext[2] != '#' )
|
||||
zeexygen_mgr->PreComment(yytext + 2);
|
||||
zeekygen_mgr->PreComment(yytext + 2);
|
||||
}
|
||||
|
||||
#{OWS}@no-test.* return TOK_NO_TEST;
|
||||
|
@ -375,7 +375,7 @@ when return TOK_WHEN;
|
|||
string loader = ::filename; // load_files may change ::filename, save copy
|
||||
string loading = find_relative_script_file(new_file);
|
||||
(void) load_files(new_file);
|
||||
zeexygen_mgr->ScriptDependency(loader, loading);
|
||||
zeekygen_mgr->ScriptDependency(loader, loading);
|
||||
}
|
||||
|
||||
@load-sigs{WS}{FILE} {
|
||||
|
@ -719,7 +719,7 @@ static int load_files(const char* orig_file)
|
|||
else
|
||||
file_stack.append(new FileInfo);
|
||||
|
||||
zeexygen_mgr->Script(file_path);
|
||||
zeekygen_mgr->Script(file_path);
|
||||
|
||||
DBG_LOG(DBG_SCRIPTS, "Loading %s", file_path.c_str());
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ include_directories(BEFORE
|
|||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set(zeexygen_SRCS
|
||||
set(zeekygen_SRCS
|
||||
Manager.cc
|
||||
Info.h
|
||||
PackageInfo.cc
|
||||
|
@ -19,7 +19,7 @@ set(zeexygen_SRCS
|
|||
utils.cc
|
||||
)
|
||||
|
||||
bif_target(zeexygen.bif)
|
||||
bro_add_subdir_library(zeexygen ${zeexygen_SRCS})
|
||||
bif_target(zeekygen.bif)
|
||||
bro_add_subdir_library(zeekygen ${zeekygen_SRCS})
|
||||
|
||||
add_dependencies(bro_zeexygen generate_outputs)
|
||||
add_dependencies(bro_zeekygen generate_outputs)
|
|
@ -11,7 +11,7 @@
|
|||
#include <algorithm>
|
||||
#include <errno.h>
|
||||
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
using namespace std;
|
||||
|
||||
static TargetFactory create_target_factory()
|
||||
|
@ -37,7 +37,7 @@ Config::Config(const string& arg_file, const string& delim)
|
|||
ifstream f(file.c_str());
|
||||
|
||||
if ( ! f.is_open() )
|
||||
reporter->FatalError("failed to open Zeexygen config file '%s': %s",
|
||||
reporter->FatalError("failed to open Zeekygen config file '%s': %s",
|
||||
file.c_str(), strerror(errno));
|
||||
|
||||
string line;
|
||||
|
@ -59,20 +59,20 @@ Config::Config(const string& arg_file, const string& delim)
|
|||
continue;
|
||||
|
||||
if ( tokens.size() != 3 )
|
||||
reporter->FatalError("malformed Zeexygen target in %s:%u: %s",
|
||||
reporter->FatalError("malformed Zeekygen target in %s:%u: %s",
|
||||
file.c_str(), line_number, line.c_str());
|
||||
|
||||
Target* target = target_factory.Create(tokens[0], tokens[2], tokens[1]);
|
||||
|
||||
if ( ! target )
|
||||
reporter->FatalError("unknown Zeexygen target type: %s",
|
||||
reporter->FatalError("unknown Zeekygen target type: %s",
|
||||
tokens[0].c_str());
|
||||
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
if ( f.bad() )
|
||||
reporter->InternalError("error reading Zeexygen config file '%s': %s",
|
||||
reporter->InternalError("error reading Zeekygen config file '%s': %s",
|
||||
file.c_str(), strerror(errno));
|
||||
}
|
||||
|
||||
|
@ -99,5 +99,5 @@ time_t Config::GetModificationTime() const
|
|||
if ( file.empty() )
|
||||
return 0;
|
||||
|
||||
return zeexygen::get_mtime(file);
|
||||
return zeekygen::get_mtime(file);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_CONFIGURATION_H
|
||||
#define ZEEXYGEN_CONFIGURATION_H
|
||||
#ifndef ZEEKYGEN_CONFIGURATION_H
|
||||
#define ZEEKYGEN_CONFIGURATION_H
|
||||
|
||||
#include "Info.h"
|
||||
#include "Target.h"
|
||||
|
@ -9,7 +9,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Manages the generation of reStructuredText documents corresponding to
|
||||
|
@ -22,8 +22,8 @@ class Config {
|
|||
public:
|
||||
|
||||
/**
|
||||
* Read a Zeexygen configuration file, parsing all targets in it.
|
||||
* @param file The file containing a list of Zeexygen targets. If it's
|
||||
* Read a Zeekygen configuration file, parsing all targets in it.
|
||||
* @param file The file containing a list of Zeekygen targets. If it's
|
||||
* an empty string most methods are a no-op.
|
||||
* @param delim The delimiter between target fields.
|
||||
*/
|
||||
|
@ -41,7 +41,7 @@ public:
|
|||
void FindDependencies(const std::vector<Info*>& infos);
|
||||
|
||||
/**
|
||||
* Build each Zeexygen target (i.e. write out the reST documents to disk).
|
||||
* Build each Zeekygen target (i.e. write out the reST documents to disk).
|
||||
*/
|
||||
void GenerateDocs() const;
|
||||
|
||||
|
@ -58,6 +58,6 @@ private:
|
|||
TargetFactory target_factory;
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -7,7 +7,7 @@
|
|||
#include "Val.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
|
||||
IdentifierInfo::IdentifierInfo(ID* arg_id, ScriptInfo* script)
|
||||
: Info(),
|
||||
|
@ -128,7 +128,7 @@ string IdentifierInfo::DoReStructuredText(bool roles_only) const
|
|||
{
|
||||
string s = comments[i];
|
||||
|
||||
if ( zeexygen::prettify_params(s) )
|
||||
if ( zeekygen::prettify_params(s) )
|
||||
d.NL();
|
||||
|
||||
d.Add(s.c_str());
|
|
@ -1,7 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_IDENTIFIERINFO_H
|
||||
#define ZEEXYGEN_IDENTIFIERINFO_H
|
||||
#ifndef ZEEKYGEN_IDENTIFIERINFO_H
|
||||
#define ZEEKYGEN_IDENTIFIERINFO_H
|
||||
|
||||
#include "Info.h"
|
||||
#include "ScriptInfo.h"
|
||||
|
@ -14,7 +14,7 @@
|
|||
#include <list>
|
||||
#include <map>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
class ScriptInfo;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
* Add a comment associated with the identifier. If the identifier is a
|
||||
* record type and it's in the middle of parsing fields, the comment is
|
||||
* associated with the last field that was parsed.
|
||||
* @param comment A string extracted from Zeexygen-style comment.
|
||||
* @param comment A string extracted from Zeekygen-style comment.
|
||||
*/
|
||||
void AddComment(const std::string& comment)
|
||||
{ last_field_seen ? last_field_seen->comments.push_back(comment)
|
||||
|
@ -102,13 +102,13 @@ public:
|
|||
std::string GetDeclaringScriptForField(const std::string& field) const;
|
||||
|
||||
/**
|
||||
* @return All Zeexygen comments associated with the identifier.
|
||||
* @return All Zeekygen comments associated with the identifier.
|
||||
*/
|
||||
std::vector<std::string> GetComments() const;
|
||||
|
||||
/**
|
||||
* @param field A record field name.
|
||||
* @return All Zeexygen comments associated with the record field.
|
||||
* @return All Zeekygen comments associated with the record field.
|
||||
*/
|
||||
std::vector<std::string> GetFieldComments(const std::string& field) const;
|
||||
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
struct Redefinition {
|
||||
std::string from_script; /**< Name of script doing the redef. */
|
||||
std::string new_val_desc; /**< Description of new value bound to ID. */
|
||||
std::vector<std::string> comments; /**< Zeexygen comments on redef. */
|
||||
std::vector<std::string> comments; /**< Zeekygen comments on redef. */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -159,6 +159,6 @@ private:
|
|||
ScriptInfo* declaring_script;
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -1,15 +1,15 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_INFO_H
|
||||
#define ZEEXYGEN_INFO_H
|
||||
#ifndef ZEEKYGEN_INFO_H
|
||||
#define ZEEKYGEN_INFO_H
|
||||
|
||||
#include <string>
|
||||
#include <ctime>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Abstract base class for any thing that Zeexygen can document.
|
||||
* Abstract base class for any thing that Zeekygen can document.
|
||||
*/
|
||||
class Info {
|
||||
|
||||
|
@ -68,6 +68,6 @@ private:
|
|||
{ }
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -7,7 +7,7 @@
|
|||
#include <utility>
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
using namespace std;
|
||||
|
||||
static void DbgAndWarn(const char* msg)
|
||||
|
@ -19,7 +19,7 @@ static void DbgAndWarn(const char* msg)
|
|||
return;
|
||||
|
||||
reporter->Warning("%s", msg);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "%s", msg);
|
||||
DBG_LOG(DBG_ZEEKYGEN, "%s", msg);
|
||||
}
|
||||
|
||||
static void WarnMissingScript(const char* type, const ID* id,
|
||||
|
@ -28,7 +28,7 @@ static void WarnMissingScript(const char* type, const ID* id,
|
|||
if ( script == "<command line>" )
|
||||
return;
|
||||
|
||||
DbgAndWarn(fmt("Can't generate Zeexygen doumentation for %s %s, "
|
||||
DbgAndWarn(fmt("Can't generate Zeekygen doumentation for %s %s, "
|
||||
"lookup of %s failed",
|
||||
type, id->Name(), script.c_str()));
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ Manager::Manager(const string& arg_config, const string& bro_command)
|
|||
// a PATH component that starts with a tilde (such as "~/bin"). A simple
|
||||
// workaround is to just run bro with a relative or absolute path.
|
||||
if ( path_to_bro.empty() || stat(path_to_bro.c_str(), &s) < 0 )
|
||||
reporter->InternalError("Zeexygen can't get mtime of bro binary %s (try again by specifying the absolute or relative path to Bro): %s",
|
||||
reporter->InternalError("Zeekygen can't get mtime of bro binary %s (try again by specifying the absolute or relative path to Bro): %s",
|
||||
path_to_bro.c_str(), strerror(errno));
|
||||
|
||||
bro_mtime = s.st_mtime;
|
||||
|
@ -129,7 +129,7 @@ void Manager::Script(const string& path)
|
|||
|
||||
if ( scripts.GetInfo(name) )
|
||||
{
|
||||
DbgAndWarn(fmt("Duplicate Zeexygen script documentation: %s",
|
||||
DbgAndWarn(fmt("Duplicate Zeekygen script documentation: %s",
|
||||
name.c_str()));
|
||||
return;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ void Manager::Script(const string& path)
|
|||
ScriptInfo* info = new ScriptInfo(name, path);
|
||||
scripts.map[name] = info;
|
||||
all_info.push_back(info);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Made ScriptInfo %s", name.c_str());
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Made ScriptInfo %s", name.c_str());
|
||||
|
||||
if ( ! info->IsPkgLoader() )
|
||||
return;
|
||||
|
@ -146,7 +146,7 @@ void Manager::Script(const string& path)
|
|||
|
||||
if ( packages.GetInfo(name) )
|
||||
{
|
||||
DbgAndWarn(fmt("Duplicate Zeexygen package documentation: %s",
|
||||
DbgAndWarn(fmt("Duplicate Zeekygen package documentation: %s",
|
||||
name.c_str()));
|
||||
return;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ void Manager::Script(const string& path)
|
|||
PackageInfo* pkginfo = new PackageInfo(name);
|
||||
packages.map[name] = pkginfo;
|
||||
all_info.push_back(pkginfo);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Made PackageInfo %s", name.c_str());
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Made PackageInfo %s", name.c_str());
|
||||
}
|
||||
|
||||
void Manager::ScriptDependency(const string& path, const string& dep)
|
||||
|
@ -164,7 +164,7 @@ void Manager::ScriptDependency(const string& path, const string& dep)
|
|||
|
||||
if ( dep.empty() )
|
||||
{
|
||||
DbgAndWarn(fmt("Empty Zeexygen script doc dependency: %s",
|
||||
DbgAndWarn(fmt("Empty Zeekygen script doc dependency: %s",
|
||||
path.c_str()));
|
||||
return;
|
||||
}
|
||||
|
@ -175,17 +175,17 @@ void Manager::ScriptDependency(const string& path, const string& dep)
|
|||
|
||||
if ( ! script_info )
|
||||
{
|
||||
DbgAndWarn(fmt("Failed to add Zeexygen script doc dependency %s "
|
||||
DbgAndWarn(fmt("Failed to add Zeekygen script doc dependency %s "
|
||||
"for %s", depname.c_str(), name.c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
script_info->AddDependency(depname);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Added script dependency %s for %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Added script dependency %s for %s",
|
||||
depname.c_str(), name.c_str());
|
||||
|
||||
for ( size_t i = 0; i < comment_buffer.size(); ++i )
|
||||
DbgAndWarn(fmt("Discarded extraneous Zeexygen comment: %s",
|
||||
DbgAndWarn(fmt("Discarded extraneous Zeekygen comment: %s",
|
||||
comment_buffer[i].c_str()));
|
||||
}
|
||||
|
||||
|
@ -199,13 +199,13 @@ void Manager::ModuleUsage(const string& path, const string& module)
|
|||
|
||||
if ( ! script_info )
|
||||
{
|
||||
DbgAndWarn(fmt("Failed to add Zeexygen module usage %s in %s",
|
||||
DbgAndWarn(fmt("Failed to add Zeekygen module usage %s in %s",
|
||||
module.c_str(), name.c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
script_info->AddModule(module);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Added module usage %s in %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Added module usage %s in %s",
|
||||
module.c_str(), name.c_str());
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ void Manager::StartType(ID* id)
|
|||
|
||||
if ( id->GetLocationInfo() == &no_location )
|
||||
{
|
||||
DbgAndWarn(fmt("Can't generate zeexygen doumentation for %s, "
|
||||
DbgAndWarn(fmt("Can't generate zeekygen doumentation for %s, "
|
||||
"no location available", id->Name()));
|
||||
return;
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ void Manager::StartType(ID* id)
|
|||
}
|
||||
|
||||
incomplete_type = CreateIdentifierInfo(id, script_info);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Made IdentifierInfo (incomplete) %s, in %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Made IdentifierInfo (incomplete) %s, in %s",
|
||||
id->Name(), script.c_str());
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ void Manager::Identifier(ID* id)
|
|||
{
|
||||
if ( incomplete_type->Name() == id->Name() )
|
||||
{
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Finished document for type %s", id->Name());
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Finished document for type %s", id->Name());
|
||||
incomplete_type->CompletedTypeDecl();
|
||||
incomplete_type = 0;
|
||||
return;
|
||||
|
@ -309,7 +309,7 @@ void Manager::Identifier(ID* id)
|
|||
{
|
||||
// Internally-created identifier (e.g. file/proto analyzer enum tags).
|
||||
// Handled specially since they don't have a script location.
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Made internal IdentifierInfo %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Made internal IdentifierInfo %s",
|
||||
id->Name());
|
||||
CreateIdentifierInfo(id, 0);
|
||||
return;
|
||||
|
@ -325,7 +325,7 @@ void Manager::Identifier(ID* id)
|
|||
}
|
||||
|
||||
CreateIdentifierInfo(id, script_info);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Made IdentifierInfo %s, in script %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Made IdentifierInfo %s, in script %s",
|
||||
id->Name(), script.c_str());
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ void Manager::RecordField(const ID* id, const TypeDecl* field,
|
|||
|
||||
if ( ! idd )
|
||||
{
|
||||
DbgAndWarn(fmt("Can't generate zeexygen doumentation for "
|
||||
DbgAndWarn(fmt("Can't generate zeekygen doumentation for "
|
||||
"record field %s, unknown record: %s",
|
||||
field->id, id->Name()));
|
||||
return;
|
||||
|
@ -348,7 +348,7 @@ void Manager::RecordField(const ID* id, const TypeDecl* field,
|
|||
string script = NormalizeScriptPath(path);
|
||||
idd->AddRecordField(field, script, comment_buffer);
|
||||
comment_buffer.clear();
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Document record field %s, identifier %s, script %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Document record field %s, identifier %s, script %s",
|
||||
field->id, id->Name(), script.c_str());
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ void Manager::Redef(const ID* id, const string& path)
|
|||
|
||||
if ( ! id_info )
|
||||
{
|
||||
DbgAndWarn(fmt("Can't generate zeexygen doumentation for "
|
||||
DbgAndWarn(fmt("Can't generate zeekygen doumentation for "
|
||||
"redef of %s, identifier lookup failed",
|
||||
id->Name()));
|
||||
return;
|
||||
|
@ -384,7 +384,7 @@ void Manager::Redef(const ID* id, const string& path)
|
|||
script_info->AddRedef(id_info);
|
||||
comment_buffer.clear();
|
||||
last_identifier_seen = id_info;
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Added redef of %s from %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Added redef of %s from %s",
|
||||
id->Name(), from_script.c_str());
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ void Manager::PostComment(const string& comment, const string& id_hint)
|
|||
if ( last_identifier_seen )
|
||||
last_identifier_seen->AddComment(RemoveLeadingSpace(comment));
|
||||
else
|
||||
DbgAndWarn(fmt("Discarded unassociated Zeexygen comment %s",
|
||||
DbgAndWarn(fmt("Discarded unassociated Zeekygen comment %s",
|
||||
comment.c_str()));
|
||||
|
||||
return;
|
|
@ -1,7 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_MANAGER_H
|
||||
#define ZEEXYGEN_MANAGER_H
|
||||
#ifndef ZEEKYGEN_MANAGER_H
|
||||
#define ZEEKYGEN_MANAGER_H
|
||||
|
||||
#include "Configuration.h"
|
||||
#include "Info.h"
|
||||
|
@ -21,7 +21,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Map of info objects. Just a wrapper around std::map to improve code
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
|
||||
/**
|
||||
* Ctor.
|
||||
* @param config Path to a Zeexygen config file if documentation is to be
|
||||
* @param config Path to a Zeekygen config file if documentation is to be
|
||||
* written to disk.
|
||||
* @param bro_command The command used to invoke the bro process.
|
||||
* It's used when checking for out-of-date targets. If the bro binary is
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
void InitPostScript();
|
||||
|
||||
/**
|
||||
* Builds all Zeexygen targets specified by config file and write out
|
||||
* Builds all Zeekygen targets specified by config file and write out
|
||||
* documentation to disk.
|
||||
*/
|
||||
void GenerateDocs() const;
|
||||
|
@ -140,24 +140,24 @@ public:
|
|||
void Redef(const ID* id, const std::string& path);
|
||||
|
||||
/**
|
||||
* Register Zeexygen script summary content.
|
||||
* Register Zeekygen script summary content.
|
||||
* @param path Absolute path to a Bro script.
|
||||
* @param comment Zeexygen-style summary comment ("##!") to associate with
|
||||
* @param comment Zeekygen-style summary comment ("##!") to associate with
|
||||
* script given by \a path.
|
||||
*/
|
||||
void SummaryComment(const std::string& path, const std::string& comment);
|
||||
|
||||
/**
|
||||
* Register a Zeexygen comment ("##") for an upcoming identifier (i.e.
|
||||
* Register a Zeekygen comment ("##") for an upcoming identifier (i.e.
|
||||
* this content is buffered and consumed by next identifier/field
|
||||
* declaration.
|
||||
* @param comment Content of the Zeexygen comment.
|
||||
* @param comment Content of the Zeekygen comment.
|
||||
*/
|
||||
void PreComment(const std::string& comment);
|
||||
|
||||
/**
|
||||
* Register a Zeexygen comment ("##<") for the last identifier seen.
|
||||
* @param comment Content of the Zeexygen comment.
|
||||
* Register a Zeekygen comment ("##<") for the last identifier seen.
|
||||
* @param comment Content of the Zeekygen comment.
|
||||
* @param identifier_hint Expected name of identifier with which to
|
||||
* associate \a comment.
|
||||
*/
|
||||
|
@ -197,11 +197,11 @@ public:
|
|||
{ return packages.GetInfo(name); }
|
||||
|
||||
/**
|
||||
* Check if a Zeexygen target is up-to-date.
|
||||
* @param target_file output file of a Zeexygen target.
|
||||
* Check if a Zeekygen target is up-to-date.
|
||||
* @param target_file output file of a Zeekygen target.
|
||||
* @param dependencies all dependencies of the target.
|
||||
* @return true if modification time of \a target_file is newer than
|
||||
* modification time of Bro binary, Zeexygen config file, and all
|
||||
* modification time of Bro binary, Zeekygen config file, and all
|
||||
* dependencies, else false.
|
||||
*/
|
||||
template <class T>
|
||||
|
@ -241,7 +241,7 @@ bool Manager::IsUpToDate(const string& target_file,
|
|||
// Doesn't exist.
|
||||
return false;
|
||||
|
||||
reporter->InternalError("Zeexygen failed to stat target file '%s': %s",
|
||||
reporter->InternalError("Zeekygen failed to stat target file '%s': %s",
|
||||
target_file.c_str(), strerror(errno));
|
||||
}
|
||||
|
||||
|
@ -258,8 +258,8 @@ bool Manager::IsUpToDate(const string& target_file,
|
|||
return true;
|
||||
}
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
extern zeexygen::Manager* zeexygen_mgr;
|
||||
extern zeekygen::Manager* zeekygen_mgr;
|
||||
|
||||
#endif
|
|
@ -9,7 +9,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
|
||||
PackageInfo::PackageInfo(const string& arg_name)
|
||||
: Info(),
|
||||
|
@ -23,7 +23,7 @@ PackageInfo::PackageInfo(const string& arg_name)
|
|||
ifstream f(readme_file.c_str());
|
||||
|
||||
if ( ! f.is_open() )
|
||||
reporter->InternalWarning("Zeexygen failed to open '%s': %s",
|
||||
reporter->InternalWarning("Zeekygen failed to open '%s': %s",
|
||||
readme_file.c_str(), strerror(errno));
|
||||
|
||||
string line;
|
||||
|
@ -32,7 +32,7 @@ PackageInfo::PackageInfo(const string& arg_name)
|
|||
readme.push_back(line);
|
||||
|
||||
if ( f.bad() )
|
||||
reporter->InternalWarning("Zeexygen error reading '%s': %s",
|
||||
reporter->InternalWarning("Zeekygen error reading '%s': %s",
|
||||
readme_file.c_str(), strerror(errno));
|
||||
}
|
||||
|
||||
|
@ -54,5 +54,5 @@ time_t PackageInfo::DoGetModificationTime() const
|
|||
if ( readme_file.empty() )
|
||||
return 0;
|
||||
|
||||
return zeexygen::get_mtime(readme_file);
|
||||
return zeekygen::get_mtime(readme_file);
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_PACKAGEINFO_H
|
||||
#define ZEEXYGEN_PACKAGEINFO_H
|
||||
#ifndef ZEEKYGEN_PACKAGEINFO_H
|
||||
#define ZEEKYGEN_PACKAGEINFO_H
|
||||
|
||||
#include "Info.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Information about a Bro script package.
|
||||
|
@ -45,6 +45,6 @@ private:
|
|||
std::vector<std::string> readme;
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -5,7 +5,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
|
||||
ReStructuredTextTable::ReStructuredTextTable(size_t arg_num_cols)
|
||||
: num_cols(arg_num_cols), rows(), longest_row_in_column()
|
|
@ -1,12 +1,12 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_RESTTABLE_H
|
||||
#define ZEEXYGEN_RESTTABLE_H
|
||||
#ifndef ZEEKYGEN_RESTTABLE_H
|
||||
#define ZEEKYGEN_RESTTABLE_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* A reST table with arbitrary number of columns.
|
||||
|
@ -48,6 +48,6 @@ private:
|
|||
std::vector<size_t> longest_row_in_column;
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -10,7 +10,7 @@
|
|||
#include "Desc.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
|
||||
bool IdInfoComp::operator ()(const IdentifierInfo* lhs,
|
||||
const IdentifierInfo* rhs) const
|
||||
|
@ -24,11 +24,11 @@ static vector<string> summary_comment(const vector<string>& cmnts)
|
|||
|
||||
for ( size_t i = 0; i < cmnts.size(); ++i )
|
||||
{
|
||||
size_t end = zeexygen::end_of_first_sentence(cmnts[i]);
|
||||
size_t end = zeekygen::end_of_first_sentence(cmnts[i]);
|
||||
|
||||
if ( end == string::npos )
|
||||
{
|
||||
if ( zeexygen::is_all_whitespace(cmnts[i]) )
|
||||
if ( zeekygen::is_all_whitespace(cmnts[i]) )
|
||||
break;
|
||||
|
||||
rval.push_back(cmnts[i]);
|
||||
|
@ -86,7 +86,7 @@ static string make_summary(const string& heading, char underline, char border,
|
|||
add_summary_rows(d, summary_comment((*it)->GetComments()), &table);
|
||||
}
|
||||
|
||||
return zeexygen::make_heading(heading, underline) + table.AsString(border)
|
||||
return zeekygen::make_heading(heading, underline) + table.AsString(border)
|
||||
+ "\n";
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ static string make_redef_summary(const string& heading, char underline,
|
|||
add_summary_rows(d, summary_comment(iit->comments), &table);
|
||||
}
|
||||
|
||||
return zeexygen::make_heading(heading, underline) + table.AsString(border)
|
||||
return zeekygen::make_heading(heading, underline) + table.AsString(border)
|
||||
+ "\n";
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ static string make_details(const string& heading, char underline,
|
|||
if ( id_list.empty() )
|
||||
return "";
|
||||
|
||||
string rval = zeexygen::make_heading(heading, underline);
|
||||
string rval = zeekygen::make_heading(heading, underline);
|
||||
|
||||
for ( id_info_list::const_iterator it = id_list.begin();
|
||||
it != id_list.end(); ++it )
|
||||
|
@ -143,7 +143,7 @@ static string make_redef_details(const string& heading, char underline,
|
|||
if ( id_set.empty() )
|
||||
return "";
|
||||
|
||||
string rval = zeexygen::make_heading(heading, underline);
|
||||
string rval = zeekygen::make_heading(heading, underline);
|
||||
|
||||
for ( id_info_set::const_iterator it = id_set.begin();
|
||||
it != id_set.end(); ++it )
|
||||
|
@ -178,13 +178,13 @@ void ScriptInfo::DoInitPostScript()
|
|||
IdentifierInfo* info = it->second;
|
||||
ID* id = info->GetID();
|
||||
|
||||
if ( ! zeexygen::is_public_api(id) )
|
||||
if ( ! zeekygen::is_public_api(id) )
|
||||
continue;
|
||||
|
||||
if ( id->AsType() )
|
||||
{
|
||||
types.push_back(info);
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a type",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a type",
|
||||
id->Name(), name.c_str());
|
||||
continue;
|
||||
}
|
||||
|
@ -193,17 +193,17 @@ void ScriptInfo::DoInitPostScript()
|
|||
{
|
||||
switch ( id->Type()->AsFuncType()->Flavor() ) {
|
||||
case FUNC_FLAVOR_HOOK:
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a hook",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a hook",
|
||||
id->Name(), name.c_str());
|
||||
hooks.push_back(info);
|
||||
break;
|
||||
case FUNC_FLAVOR_EVENT:
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a event",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a event",
|
||||
id->Name(), name.c_str());
|
||||
events.push_back(info);
|
||||
break;
|
||||
case FUNC_FLAVOR_FUNCTION:
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a function",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a function",
|
||||
id->Name(), name.c_str());
|
||||
functions.push_back(info);
|
||||
break;
|
||||
|
@ -219,13 +219,13 @@ void ScriptInfo::DoInitPostScript()
|
|||
{
|
||||
if ( id->FindAttr(ATTR_REDEF) )
|
||||
{
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a redef_option",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a redef_option",
|
||||
id->Name(), name.c_str());
|
||||
redef_options.push_back(info);
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a constant",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a constant",
|
||||
id->Name(), name.c_str());
|
||||
constants.push_back(info);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void ScriptInfo::DoInitPostScript()
|
|||
}
|
||||
else if ( id->IsOption() )
|
||||
{
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as an runtime option",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as an runtime option",
|
||||
id->Name(), name.c_str());
|
||||
options.push_back(info);
|
||||
|
||||
|
@ -246,7 +246,7 @@ void ScriptInfo::DoInitPostScript()
|
|||
// documentation.
|
||||
continue;
|
||||
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Filter id '%s' in '%s' as a state variable",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Filter id '%s' in '%s' as a state variable",
|
||||
id->Name(), name.c_str());
|
||||
state_vars.push_back(info);
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ string ScriptInfo::DoReStructuredText(bool roles_only) const
|
|||
string rval;
|
||||
|
||||
rval += ":tocdepth: 3\n\n";
|
||||
rval += zeexygen::make_heading(name, '=');
|
||||
rval += zeekygen::make_heading(name, '=');
|
||||
|
||||
for ( string_set::const_iterator it = module_usages.begin();
|
||||
it != module_usages.end(); ++it )
|
||||
|
@ -329,7 +329,7 @@ string ScriptInfo::DoReStructuredText(bool roles_only) const
|
|||
|
||||
//rval += fmt(":Source File: :download:`/scripts/%s`\n", name.c_str());
|
||||
rval += "\n";
|
||||
rval += zeexygen::make_heading("Summary", '~');
|
||||
rval += zeekygen::make_heading("Summary", '~');
|
||||
rval += make_summary("Runtime Options", '#', '=', options);
|
||||
rval += make_summary("Redefinable Options", '#', '=', redef_options);
|
||||
rval += make_summary("Constants", '#', '=', constants);
|
||||
|
@ -340,7 +340,7 @@ string ScriptInfo::DoReStructuredText(bool roles_only) const
|
|||
rval += make_summary("Hooks", '#', '=', hooks);
|
||||
rval += make_summary("Functions", '#', '=', functions);
|
||||
rval += "\n";
|
||||
rval += zeexygen::make_heading("Detailed Interface", '~');
|
||||
rval += zeekygen::make_heading("Detailed Interface", '~');
|
||||
rval += make_details("Runtime Options", '#', options);
|
||||
rval += make_details("Redefinable Options", '#', redef_options);
|
||||
rval += make_details("Constants", '#', constants);
|
||||
|
@ -356,25 +356,25 @@ string ScriptInfo::DoReStructuredText(bool roles_only) const
|
|||
|
||||
time_t ScriptInfo::DoGetModificationTime() const
|
||||
{
|
||||
time_t most_recent = zeexygen::get_mtime(path);
|
||||
time_t most_recent = zeekygen::get_mtime(path);
|
||||
|
||||
for ( string_set::const_iterator it = dependencies.begin();
|
||||
it != dependencies.end(); ++it )
|
||||
{
|
||||
Info* info = zeexygen_mgr->GetScriptInfo(*it);
|
||||
Info* info = zeekygen_mgr->GetScriptInfo(*it);
|
||||
|
||||
if ( ! info )
|
||||
{
|
||||
for (const string& ext : script_extensions)
|
||||
{
|
||||
string pkg_name = *it + "/__load__" + ext;
|
||||
info = zeexygen_mgr->GetScriptInfo(pkg_name);
|
||||
info = zeekygen_mgr->GetScriptInfo(pkg_name);
|
||||
if ( info )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! info )
|
||||
reporter->InternalWarning("Zeexygen failed to get mtime of %s",
|
||||
reporter->InternalWarning("Zeekygen failed to get mtime of %s",
|
||||
it->c_str());
|
||||
continue;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_SCRIPTINFO_H
|
||||
#define ZEEXYGEN_SCRIPTINFO_H
|
||||
#ifndef ZEEKYGEN_SCRIPTINFO_H
|
||||
#define ZEEKYGEN_SCRIPTINFO_H
|
||||
|
||||
#include "Info.h"
|
||||
#include "IdentifierInfo.h"
|
||||
|
@ -12,7 +12,7 @@
|
|||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
class IdentifierInfo;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
|||
ScriptInfo(const std::string& name, const std::string& path);
|
||||
|
||||
/**
|
||||
* Associate a Zeexygen summary comment ("##!") with the script.
|
||||
* Associate a Zeekygen summary comment ("##!") with the script.
|
||||
* @param comment String extracted from the comment.
|
||||
*/
|
||||
void AddComment(const std::string& comment)
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
{ return is_pkg_loader; }
|
||||
|
||||
/**
|
||||
* @return All the scripts Zeexygen summary comments.
|
||||
* @return All the scripts Zeekygen summary comments.
|
||||
*/
|
||||
std::vector<std::string> GetComments() const;
|
||||
|
||||
|
@ -119,6 +119,6 @@ private:
|
|||
id_info_set redefs;
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -16,7 +16,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
|
||||
static void write_plugin_section_heading(FILE* f, const plugin::Plugin* p)
|
||||
{
|
||||
|
@ -123,13 +123,13 @@ static void write_plugin_bif_items(FILE* f, const plugin::Plugin* p,
|
|||
|
||||
for ( it = bifitems.begin(); it != bifitems.end(); ++it )
|
||||
{
|
||||
zeexygen::IdentifierInfo* doc = zeexygen_mgr->GetIdentifierInfo(
|
||||
zeekygen::IdentifierInfo* doc = zeekygen_mgr->GetIdentifierInfo(
|
||||
it->GetID());
|
||||
|
||||
if ( doc )
|
||||
fprintf(f, "%s\n\n", doc->ReStructuredText().c_str());
|
||||
else
|
||||
reporter->InternalWarning("Zeexygen ID lookup failed: %s\n",
|
||||
reporter->InternalWarning("Zeekygen ID lookup failed: %s\n",
|
||||
it->GetID().c_str());
|
||||
}
|
||||
}
|
||||
|
@ -138,10 +138,10 @@ static void WriteAnalyzerTagDefn(FILE* f, const string& module)
|
|||
{
|
||||
string tag_id = module + "::Tag";
|
||||
|
||||
zeexygen::IdentifierInfo* doc = zeexygen_mgr->GetIdentifierInfo(tag_id);
|
||||
zeekygen::IdentifierInfo* doc = zeekygen_mgr->GetIdentifierInfo(tag_id);
|
||||
|
||||
if ( ! doc )
|
||||
reporter->InternalError("Zeexygen failed analyzer tag lookup: %s",
|
||||
reporter->InternalError("Zeekygen failed analyzer tag lookup: %s",
|
||||
tag_id.c_str());
|
||||
|
||||
fprintf(f, "%s\n", doc->ReStructuredText().c_str());
|
||||
|
@ -177,7 +177,7 @@ static vector<T*> filter_matches(const vector<Info*>& from, Target* t)
|
|||
|
||||
if ( t->MatchesPattern(d) )
|
||||
{
|
||||
DBG_LOG(DBG_ZEEXYGEN, "'%s' matched pattern for target '%s'",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "'%s' matched pattern for target '%s'",
|
||||
d->Name().c_str(), t->Name().c_str());
|
||||
rval.push_back(d);
|
||||
}
|
||||
|
@ -194,14 +194,14 @@ TargetFile::TargetFile(const string& arg_name)
|
|||
string dir = SafeDirname(name).result;
|
||||
|
||||
if ( ! ensure_intermediate_dirs(dir.c_str()) )
|
||||
reporter->FatalError("Zeexygen failed to make dir %s",
|
||||
reporter->FatalError("Zeekygen failed to make dir %s",
|
||||
dir.c_str());
|
||||
}
|
||||
|
||||
f = fopen(name.c_str(), "w");
|
||||
|
||||
if ( ! f )
|
||||
reporter->FatalError("Zeexygen failed to open '%s' for writing: %s",
|
||||
reporter->FatalError("Zeekygen failed to open '%s' for writing: %s",
|
||||
name.c_str(), strerror(errno));
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ TargetFile::~TargetFile()
|
|||
if ( f )
|
||||
fclose(f);
|
||||
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Wrote out-of-date target '%s'", name.c_str());
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Wrote out-of-date target '%s'", name.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -245,11 +245,11 @@ void AnalyzerTarget::DoFindDependencies(const std::vector<Info *>& infos)
|
|||
|
||||
void AnalyzerTarget::DoGenerate() const
|
||||
{
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), vector<Info*>()) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), vector<Info*>()) )
|
||||
return;
|
||||
|
||||
if ( Pattern() != "*" )
|
||||
reporter->InternalWarning("Zeexygen only implements analyzer target"
|
||||
reporter->InternalWarning("Zeekygen only implements analyzer target"
|
||||
" pattern '*'");
|
||||
|
||||
TargetFile file(Name());
|
||||
|
@ -313,7 +313,7 @@ void PackageTarget::DoFindDependencies(const vector<Info*>& infos)
|
|||
pkg_deps = filter_matches<PackageInfo>(infos, this);
|
||||
|
||||
if ( pkg_deps.empty() )
|
||||
reporter->FatalError("No match for Zeexygen target '%s' pattern '%s'",
|
||||
reporter->FatalError("No match for Zeekygen target '%s' pattern '%s'",
|
||||
Name().c_str(), Pattern().c_str());
|
||||
|
||||
for ( size_t i = 0; i < infos.size(); ++i )
|
||||
|
@ -329,7 +329,7 @@ void PackageTarget::DoFindDependencies(const vector<Info*>& infos)
|
|||
pkg_deps[j]->Name().size()))
|
||||
continue;
|
||||
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Script %s associated with package %s",
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Script %s associated with package %s",
|
||||
script->Name().c_str(), pkg_deps[j]->Name().c_str());
|
||||
pkg_manifest[pkg_deps[j]].push_back(script);
|
||||
script_deps.push_back(script);
|
||||
|
@ -339,8 +339,8 @@ void PackageTarget::DoFindDependencies(const vector<Info*>& infos)
|
|||
|
||||
void PackageTarget::DoGenerate() const
|
||||
{
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), script_deps) &&
|
||||
zeexygen_mgr->IsUpToDate(Name(), pkg_deps) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), script_deps) &&
|
||||
zeekygen_mgr->IsUpToDate(Name(), pkg_deps) )
|
||||
return;
|
||||
|
||||
TargetFile file(Name());
|
||||
|
@ -382,13 +382,13 @@ void PackageIndexTarget::DoFindDependencies(const vector<Info*>& infos)
|
|||
pkg_deps = filter_matches<PackageInfo>(infos, this);
|
||||
|
||||
if ( pkg_deps.empty() )
|
||||
reporter->FatalError("No match for Zeexygen target '%s' pattern '%s'",
|
||||
reporter->FatalError("No match for Zeekygen target '%s' pattern '%s'",
|
||||
Name().c_str(), Pattern().c_str());
|
||||
}
|
||||
|
||||
void PackageIndexTarget::DoGenerate() const
|
||||
{
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), pkg_deps) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), pkg_deps) )
|
||||
return;
|
||||
|
||||
TargetFile file(Name());
|
||||
|
@ -402,7 +402,7 @@ void ScriptTarget::DoFindDependencies(const vector<Info*>& infos)
|
|||
script_deps = filter_matches<ScriptInfo>(infos, this);
|
||||
|
||||
if ( script_deps.empty() )
|
||||
reporter->FatalError("No match for Zeexygen target '%s' pattern '%s'",
|
||||
reporter->FatalError("No match for Zeekygen target '%s' pattern '%s'",
|
||||
Name().c_str(), Pattern().c_str());
|
||||
|
||||
if ( ! IsDir() )
|
||||
|
@ -483,7 +483,7 @@ void ScriptTarget::DoGenerate() const
|
|||
vector<ScriptInfo*> dep;
|
||||
dep.push_back(script_deps[i]);
|
||||
|
||||
if ( zeexygen_mgr->IsUpToDate(target_filename, dep) )
|
||||
if ( zeekygen_mgr->IsUpToDate(target_filename, dep) )
|
||||
continue;
|
||||
|
||||
TargetFile file(target_filename);
|
||||
|
@ -508,7 +508,7 @@ void ScriptTarget::DoGenerate() const
|
|||
reporter->Warning("Failed to unlink %s: %s", f.c_str(),
|
||||
strerror(errno));
|
||||
|
||||
DBG_LOG(DBG_ZEEXYGEN, "Delete stale script file %s", f.c_str());
|
||||
DBG_LOG(DBG_ZEEKYGEN, "Delete stale script file %s", f.c_str());
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -516,7 +516,7 @@ void ScriptTarget::DoGenerate() const
|
|||
|
||||
// Target is a single file, all matching scripts get written there.
|
||||
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), script_deps) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), script_deps) )
|
||||
return;
|
||||
|
||||
TargetFile file(Name());
|
||||
|
@ -527,7 +527,7 @@ void ScriptTarget::DoGenerate() const
|
|||
|
||||
void ScriptSummaryTarget::DoGenerate() const
|
||||
{
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), script_deps) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), script_deps) )
|
||||
return;
|
||||
|
||||
TargetFile file(Name());
|
||||
|
@ -552,7 +552,7 @@ void ScriptSummaryTarget::DoGenerate() const
|
|||
|
||||
void ScriptIndexTarget::DoGenerate() const
|
||||
{
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), script_deps) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), script_deps) )
|
||||
return;
|
||||
|
||||
TargetFile file(Name());
|
||||
|
@ -577,13 +577,13 @@ void IdentifierTarget::DoFindDependencies(const vector<Info*>& infos)
|
|||
id_deps = filter_matches<IdentifierInfo>(infos, this);
|
||||
|
||||
if ( id_deps.empty() )
|
||||
reporter->FatalError("No match for Zeexygen target '%s' pattern '%s'",
|
||||
reporter->FatalError("No match for Zeekygen target '%s' pattern '%s'",
|
||||
Name().c_str(), Pattern().c_str());
|
||||
}
|
||||
|
||||
void IdentifierTarget::DoGenerate() const
|
||||
{
|
||||
if ( zeexygen_mgr->IsUpToDate(Name(), id_deps) )
|
||||
if ( zeekygen_mgr->IsUpToDate(Name(), id_deps) )
|
||||
return;
|
||||
|
||||
TargetFile file(Name());
|
|
@ -1,7 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_TARGET_H
|
||||
#define ZEEXYGEN_TARGET_H
|
||||
#ifndef ZEEKYGEN_TARGET_H
|
||||
#define ZEEKYGEN_TARGET_H
|
||||
|
||||
#include "Info.h"
|
||||
#include "PackageInfo.h"
|
||||
|
@ -13,7 +13,7 @@
|
|||
#include <vector>
|
||||
#include <cstdio>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Helper class to create files in arbitrary file paths and automatically
|
||||
|
@ -39,7 +39,7 @@ struct TargetFile {
|
|||
};
|
||||
|
||||
/**
|
||||
* A Zeexygen target abstract base class. A target is generally any portion of
|
||||
* A Zeekygen target abstract base class. A target is generally any portion of
|
||||
* documentation that Bro can build. It's identified by a type (e.g. script,
|
||||
* identifier, package), a pattern (e.g. "example.zeek", "HTTP::Info"), and
|
||||
* a path to an output file.
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
|
||||
/**
|
||||
* Register a new target type.
|
||||
* @param type_name The target type name as it will appear in Zeexygen
|
||||
* @param type_name The target type name as it will appear in Zeekygen
|
||||
* config files.
|
||||
*/
|
||||
template<class T>
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
/**
|
||||
* Instantiate a target.
|
||||
* @param type_name The target type name as it appears in Zeexygen config
|
||||
* @param type_name The target type name as it appears in Zeekygen config
|
||||
* files.
|
||||
* @param name The output file name of the target.
|
||||
* @param pattern The dependency pattern of the target.
|
||||
|
@ -384,6 +384,6 @@ private:
|
|||
std::vector<IdentifierInfo*> id_deps;
|
||||
};
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -7,10 +7,10 @@
|
|||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
using namespace std;
|
||||
|
||||
bool zeexygen::prettify_params(string& s)
|
||||
bool zeekygen::prettify_params(string& s)
|
||||
{
|
||||
size_t identifier_start_pos = 0;
|
||||
bool in_identifier = false;
|
||||
|
@ -76,29 +76,29 @@ bool zeexygen::prettify_params(string& s)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool zeexygen::is_public_api(const ID* id)
|
||||
bool zeekygen::is_public_api(const ID* id)
|
||||
{
|
||||
return (id->Scope() == SCOPE_GLOBAL) ||
|
||||
(id->Scope() == SCOPE_MODULE && id->IsExport());
|
||||
}
|
||||
|
||||
time_t zeexygen::get_mtime(const string& filename)
|
||||
time_t zeekygen::get_mtime(const string& filename)
|
||||
{
|
||||
struct stat s;
|
||||
|
||||
if ( stat(filename.c_str(), &s) < 0 )
|
||||
reporter->InternalError("Zeexygen failed to stat file '%s': %s",
|
||||
reporter->InternalError("Zeekygen failed to stat file '%s': %s",
|
||||
filename.c_str(), strerror(errno));
|
||||
|
||||
return s.st_mtime;
|
||||
}
|
||||
|
||||
string zeexygen::make_heading(const string& heading, char underline)
|
||||
string zeekygen::make_heading(const string& heading, char underline)
|
||||
{
|
||||
return heading + "\n" + string(heading.size(), underline) + "\n";
|
||||
}
|
||||
|
||||
size_t zeexygen::end_of_first_sentence(const string& s)
|
||||
size_t zeekygen::end_of_first_sentence(const string& s)
|
||||
{
|
||||
size_t rval = 0;
|
||||
|
||||
|
@ -119,7 +119,7 @@ size_t zeexygen::end_of_first_sentence(const string& s)
|
|||
return rval;
|
||||
}
|
||||
|
||||
bool zeexygen::is_all_whitespace(const string& s)
|
||||
bool zeekygen::is_all_whitespace(const string& s)
|
||||
{
|
||||
for ( size_t i = 0; i < s.size(); ++i )
|
||||
if ( ! isspace(s[i]) )
|
||||
|
@ -128,7 +128,7 @@ bool zeexygen::is_all_whitespace(const string& s)
|
|||
return true;
|
||||
}
|
||||
|
||||
string zeexygen::redef_indication(const string& from_script)
|
||||
string zeekygen::redef_indication(const string& from_script)
|
||||
{
|
||||
return fmt("(present if :doc:`/scripts/%s` is loaded)",
|
||||
from_script.c_str());
|
|
@ -1,18 +1,18 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEXYGEN_UTILS_H
|
||||
#define ZEEXYGEN_UTILS_H
|
||||
#ifndef ZEEKYGEN_UTILS_H
|
||||
#define ZEEKYGEN_UTILS_H
|
||||
|
||||
#include "ID.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace zeexygen {
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Transform content of a Zeexygen comment which may contain function
|
||||
* Transform content of a Zeekygen comment which may contain function
|
||||
* parameter or return value documentation to a prettier reST format.
|
||||
* @param s Content from a Zeexygen comment to transform. "id: ..." and
|
||||
* @param s Content from a Zeekygen comment to transform. "id: ..." and
|
||||
* "Returns: ..." change to ":id: ..." and ":returns: ...".
|
||||
* @return Whether any content in \a s was transformed.
|
||||
*/
|
||||
|
@ -62,6 +62,6 @@ bool is_all_whitespace(const std::string& s);
|
|||
*/
|
||||
std::string redef_indication(const std::string& from_script);
|
||||
|
||||
} // namespace zeexygen
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
|
@ -3,7 +3,7 @@
|
|||
##! Functions for querying script, package, or variable documentation.
|
||||
|
||||
%%{
|
||||
#include "zeexygen/Manager.h"
|
||||
#include "zeekygen/Manager.h"
|
||||
#include "util.h"
|
||||
|
||||
static StringVal* comments_to_val(const vector<string>& comments)
|
||||
|
@ -12,7 +12,7 @@ static StringVal* comments_to_val(const vector<string>& comments)
|
|||
}
|
||||
%%}
|
||||
|
||||
## Retrieve the Zeexygen-style comments (``##``) associated with an identifier
|
||||
## Retrieve the Zeekygen-style comments (``##``) associated with an identifier
|
||||
## (e.g. a variable or type).
|
||||
##
|
||||
## name: a script-level identifier for which to retrieve comments.
|
||||
|
@ -21,8 +21,8 @@ static StringVal* comments_to_val(const vector<string>& comments)
|
|||
## identifier, an empty string is returned.
|
||||
function get_identifier_comments%(name: string%): string
|
||||
%{
|
||||
using namespace zeexygen;
|
||||
IdentifierInfo* d = zeexygen_mgr->GetIdentifierInfo(name->CheckString());
|
||||
using namespace zeekygen;
|
||||
IdentifierInfo* d = zeekygen_mgr->GetIdentifierInfo(name->CheckString());
|
||||
|
||||
if ( ! d )
|
||||
return val_mgr->GetEmptyString();
|
||||
|
@ -30,7 +30,7 @@ function get_identifier_comments%(name: string%): string
|
|||
return comments_to_val(d->GetComments());
|
||||
%}
|
||||
|
||||
## Retrieve the Zeexygen-style summary comments (``##!``) associated with
|
||||
## Retrieve the Zeekygen-style summary comments (``##!``) associated with
|
||||
## a Bro script.
|
||||
##
|
||||
## name: the name of a Bro script. It must be a relative path to where
|
||||
|
@ -41,8 +41,8 @@ function get_identifier_comments%(name: string%): string
|
|||
## *name* is not a known script, an empty string is returned.
|
||||
function get_script_comments%(name: string%): string
|
||||
%{
|
||||
using namespace zeexygen;
|
||||
ScriptInfo* d = zeexygen_mgr->GetScriptInfo(name->CheckString());
|
||||
using namespace zeekygen;
|
||||
ScriptInfo* d = zeekygen_mgr->GetScriptInfo(name->CheckString());
|
||||
|
||||
if ( ! d )
|
||||
return val_mgr->GetEmptyString();
|
||||
|
@ -59,8 +59,8 @@ function get_script_comments%(name: string%): string
|
|||
## package, an empty string is returned.
|
||||
function get_package_readme%(name: string%): string
|
||||
%{
|
||||
using namespace zeexygen;
|
||||
PackageInfo* d = zeexygen_mgr->GetPackageInfo(name->CheckString());
|
||||
using namespace zeekygen;
|
||||
PackageInfo* d = zeekygen_mgr->GetPackageInfo(name->CheckString());
|
||||
|
||||
if ( ! d )
|
||||
return val_mgr->GetEmptyString();
|
||||
|
@ -68,7 +68,7 @@ function get_package_readme%(name: string%): string
|
|||
return comments_to_val(d->GetReadme());
|
||||
%}
|
||||
|
||||
## Retrieve the Zeexygen-style comments (``##``) associated with a record field.
|
||||
## Retrieve the Zeekygen-style comments (``##``) associated with a record field.
|
||||
##
|
||||
## name: the name of a record type and a field within it formatted like
|
||||
## a typical record field access: "<record_type>$<field>".
|
||||
|
@ -78,7 +78,7 @@ function get_package_readme%(name: string%): string
|
|||
## type, an empty string is returned.
|
||||
function get_record_field_comments%(name: string%): string
|
||||
%{
|
||||
using namespace zeexygen;
|
||||
using namespace zeekygen;
|
||||
string accessor = name->CheckString();
|
||||
size_t i = accessor.find('$');
|
||||
|
||||
|
@ -87,7 +87,7 @@ function get_record_field_comments%(name: string%): string
|
|||
|
||||
string id = accessor.substr(0, i);
|
||||
|
||||
IdentifierInfo* d = zeexygen_mgr->GetIdentifierInfo(id);
|
||||
IdentifierInfo* d = zeekygen_mgr->GetIdentifierInfo(id);
|
||||
|
||||
if ( ! d )
|
||||
return val_mgr->GetEmptyString();
|
|
@ -275,7 +275,7 @@
|
|||
0.000000 MetaHookPost LoadFile(./average) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./bloom-filter.bif.bro) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./bro.bif.bro) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./zeexygen.bif.bro) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./zeekygen.bif.bro) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./cardinality-counter.bif.bro) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./const.bif.bro) -> -1
|
||||
0.000000 MetaHookPost LoadFile(./consts) -> -1
|
||||
|
@ -855,7 +855,7 @@
|
|||
0.000000 MetaHookPre LoadFile(./average)
|
||||
0.000000 MetaHookPre LoadFile(./bloom-filter.bif.bro)
|
||||
0.000000 MetaHookPre LoadFile(./bro.bif.bro)
|
||||
0.000000 MetaHookPre LoadFile(./zeexygen.bif.bro)
|
||||
0.000000 MetaHookPre LoadFile(./zeekygen.bif.bro)
|
||||
0.000000 MetaHookPre LoadFile(./cardinality-counter.bif.bro)
|
||||
0.000000 MetaHookPre LoadFile(./const.bif.bro)
|
||||
0.000000 MetaHookPre LoadFile(./consts)
|
||||
|
@ -1435,7 +1435,7 @@
|
|||
0.000000 | HookLoadFile ./average.bro/bro
|
||||
0.000000 | HookLoadFile ./bloom-filter.bif.bro/bro
|
||||
0.000000 | HookLoadFile ./bro.bif.bro/bro
|
||||
0.000000 | HookLoadFile ./zeexygen.bif.bro/bro
|
||||
0.000000 | HookLoadFile ./zeekygen.bif.bro/bro
|
||||
0.000000 | HookLoadFile ./cardinality-counter.bif.bro/bro
|
||||
0.000000 | HookLoadFile ./const.bif.bro/bro
|
||||
0.000000 | HookLoadFile ./consts.bif.bro/bro
|
||||
|
|
|
@ -55,7 +55,7 @@ scripts/base/init-frameworks-and-bifs.zeek
|
|||
scripts/base/utils/patterns.zeek
|
||||
scripts/base/frameworks/files/magic/__load__.zeek
|
||||
build/scripts/base/bif/__load__.zeek
|
||||
build/scripts/base/bif/zeexygen.bif.zeek
|
||||
build/scripts/base/bif/zeekygen.bif.zeek
|
||||
build/scripts/base/bif/pcap.bif.zeek
|
||||
build/scripts/base/bif/bloom-filter.bif.zeek
|
||||
build/scripts/base/bif/cardinality-counter.bif.zeek
|
||||
|
|
|
@ -55,7 +55,7 @@ scripts/base/init-frameworks-and-bifs.zeek
|
|||
scripts/base/utils/patterns.zeek
|
||||
scripts/base/frameworks/files/magic/__load__.zeek
|
||||
build/scripts/base/bif/__load__.zeek
|
||||
build/scripts/base/bif/zeexygen.bif.zeek
|
||||
build/scripts/base/bif/zeekygen.bif.zeek
|
||||
build/scripts/base/bif/pcap.bif.zeek
|
||||
build/scripts/base/bif/bloom-filter.bif.zeek
|
||||
build/scripts/base/bif/cardinality-counter.bif.zeek
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
:tocdepth: 3
|
||||
|
||||
zeexygen/example.zeek
|
||||
zeekygen/example.zeek
|
||||
=====================
|
||||
.. zeek:namespace:: ZeexygenExample
|
||||
.. zeek:namespace:: ZeekygenExample
|
||||
|
||||
This is an example script that demonstrates Zeexygen-style
|
||||
This is an example script that demonstrates Zeekygen-style
|
||||
documentation. It generally will make most sense when viewing
|
||||
the script's raw source code and comparing to the HTML-rendered
|
||||
version.
|
||||
|
@ -19,14 +19,14 @@ purpose. They are transferred directly in to the generated
|
|||
There's also a custom role to reference any identifier node in
|
||||
the Zeek Sphinx domain that's good for "see alsos", e.g.
|
||||
|
||||
See also: :zeek:see:`ZeexygenExample::a_var`,
|
||||
:zeek:see:`ZeexygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
See also: :zeek:see:`ZeekygenExample::a_var`,
|
||||
:zeek:see:`ZeekygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
|
||||
And a custom directive does the equivalent references:
|
||||
|
||||
.. zeek:see:: ZeexygenExample::a_var ZeexygenExample::ONE SSH::Info
|
||||
.. zeek:see:: ZeekygenExample::a_var ZeekygenExample::ONE SSH::Info
|
||||
|
||||
:Namespace: ZeexygenExample
|
||||
:Namespace: ZeekygenExample
|
||||
:Imports: :doc:`base/frameworks/notice </scripts/base/frameworks/notice/index>`, :doc:`base/protocols/http </scripts/base/protocols/http/index>`, :doc:`policy/frameworks/software/vulnerable.zeek </scripts/policy/frameworks/software/vulnerable.zeek>`
|
||||
|
||||
Summary
|
||||
|
@ -34,25 +34,25 @@ Summary
|
|||
Redefinable Options
|
||||
###################
|
||||
======================================================================================= =======================================================
|
||||
:zeek:id:`ZeexygenExample::an_option`: :zeek:type:`set` :zeek:attr:`&redef` Add documentation for "an_option" here.
|
||||
:zeek:id:`ZeexygenExample::option_with_init`: :zeek:type:`interval` :zeek:attr:`&redef` Default initialization will be generated automatically.
|
||||
:zeek:id:`ZeekygenExample::an_option`: :zeek:type:`set` :zeek:attr:`&redef` Add documentation for "an_option" here.
|
||||
:zeek:id:`ZeekygenExample::option_with_init`: :zeek:type:`interval` :zeek:attr:`&redef` Default initialization will be generated automatically.
|
||||
======================================================================================= =======================================================
|
||||
|
||||
State Variables
|
||||
###############
|
||||
========================================================================== ========================================================================
|
||||
:zeek:id:`ZeexygenExample::a_var`: :zeek:type:`bool` Put some documentation for "a_var" here.
|
||||
:zeek:id:`ZeexygenExample::summary_test`: :zeek:type:`string` The first sentence for a particular identifier's summary text ends here.
|
||||
:zeek:id:`ZeexygenExample::var_without_explicit_type`: :zeek:type:`string` Types are inferred, that information is self-documenting.
|
||||
:zeek:id:`ZeekygenExample::a_var`: :zeek:type:`bool` Put some documentation for "a_var" here.
|
||||
:zeek:id:`ZeekygenExample::summary_test`: :zeek:type:`string` The first sentence for a particular identifier's summary text ends here.
|
||||
:zeek:id:`ZeekygenExample::var_without_explicit_type`: :zeek:type:`string` Types are inferred, that information is self-documenting.
|
||||
========================================================================== ========================================================================
|
||||
|
||||
Types
|
||||
#####
|
||||
==================================================================================== ===========================================================
|
||||
:zeek:type:`ZeexygenExample::ComplexRecord`: :zeek:type:`record` :zeek:attr:`&redef` General documentation for a type "ComplexRecord" goes here.
|
||||
:zeek:type:`ZeexygenExample::Info`: :zeek:type:`record` An example record to be used with a logging stream.
|
||||
:zeek:type:`ZeexygenExample::SimpleEnum`: :zeek:type:`enum` Documentation for the "SimpleEnum" type goes here.
|
||||
:zeek:type:`ZeexygenExample::SimpleRecord`: :zeek:type:`record` General documentation for a type "SimpleRecord" goes here.
|
||||
:zeek:type:`ZeekygenExample::ComplexRecord`: :zeek:type:`record` :zeek:attr:`&redef` General documentation for a type "ComplexRecord" goes here.
|
||||
:zeek:type:`ZeekygenExample::Info`: :zeek:type:`record` An example record to be used with a logging stream.
|
||||
:zeek:type:`ZeekygenExample::SimpleEnum`: :zeek:type:`enum` Documentation for the "SimpleEnum" type goes here.
|
||||
:zeek:type:`ZeekygenExample::SimpleRecord`: :zeek:type:`record` General documentation for a type "SimpleRecord" goes here.
|
||||
==================================================================================== ===========================================================
|
||||
|
||||
Redefinitions
|
||||
|
@ -60,21 +60,21 @@ Redefinitions
|
|||
=============================================================== ====================================================================
|
||||
:zeek:type:`Log::ID`: :zeek:type:`enum`
|
||||
:zeek:type:`Notice::Type`: :zeek:type:`enum`
|
||||
:zeek:type:`ZeexygenExample::SimpleEnum`: :zeek:type:`enum` Document the "SimpleEnum" redef here with any special info regarding
|
||||
:zeek:type:`ZeekygenExample::SimpleEnum`: :zeek:type:`enum` Document the "SimpleEnum" redef here with any special info regarding
|
||||
the *redef* itself.
|
||||
:zeek:type:`ZeexygenExample::SimpleRecord`: :zeek:type:`record` Document the record extension *redef* itself here.
|
||||
:zeek:type:`ZeekygenExample::SimpleRecord`: :zeek:type:`record` Document the record extension *redef* itself here.
|
||||
=============================================================== ====================================================================
|
||||
|
||||
Events
|
||||
######
|
||||
======================================================== ==========================
|
||||
:zeek:id:`ZeexygenExample::an_event`: :zeek:type:`event` Summarize "an_event" here.
|
||||
:zeek:id:`ZeekygenExample::an_event`: :zeek:type:`event` Summarize "an_event" here.
|
||||
======================================================== ==========================
|
||||
|
||||
Functions
|
||||
#########
|
||||
============================================================= =======================================
|
||||
:zeek:id:`ZeexygenExample::a_function`: :zeek:type:`function` Summarize purpose of "a_function" here.
|
||||
:zeek:id:`ZeekygenExample::a_function`: :zeek:type:`function` Summarize purpose of "a_function" here.
|
||||
============================================================= =======================================
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ Detailed Interface
|
|||
~~~~~~~~~~~~~~~~~~
|
||||
Redefinable Options
|
||||
###################
|
||||
.. zeek:id:: ZeexygenExample::an_option
|
||||
.. zeek:id:: ZeekygenExample::an_option
|
||||
|
||||
:Type: :zeek:type:`set` [:zeek:type:`addr`, :zeek:type:`addr`, :zeek:type:`string`]
|
||||
:Attributes: :zeek:attr:`&redef`
|
||||
|
@ -91,7 +91,7 @@ Redefinable Options
|
|||
Add documentation for "an_option" here.
|
||||
The type/attribute information is all generated automatically.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::option_with_init
|
||||
.. zeek:id:: ZeekygenExample::option_with_init
|
||||
|
||||
:Type: :zeek:type:`interval`
|
||||
:Attributes: :zeek:attr:`&redef`
|
||||
|
@ -102,7 +102,7 @@ Redefinable Options
|
|||
|
||||
State Variables
|
||||
###############
|
||||
.. zeek:id:: ZeexygenExample::a_var
|
||||
.. zeek:id:: ZeekygenExample::a_var
|
||||
|
||||
:Type: :zeek:type:`bool`
|
||||
|
||||
|
@ -110,7 +110,7 @@ State Variables
|
|||
isn't a function/event/hook is classified as a "state variable"
|
||||
in the generated docs.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::summary_test
|
||||
.. zeek:id:: ZeekygenExample::summary_test
|
||||
|
||||
:Type: :zeek:type:`string`
|
||||
|
||||
|
@ -118,7 +118,7 @@ State Variables
|
|||
And this second sentence doesn't show in the short description provided
|
||||
by the table of all identifiers declared by this script.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::var_without_explicit_type
|
||||
.. zeek:id:: ZeekygenExample::var_without_explicit_type
|
||||
|
||||
:Type: :zeek:type:`string`
|
||||
:Default: ``"this works"``
|
||||
|
@ -127,7 +127,7 @@ State Variables
|
|||
|
||||
Types
|
||||
#####
|
||||
.. zeek:type:: ZeexygenExample::ComplexRecord
|
||||
.. zeek:type:: ZeekygenExample::ComplexRecord
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
|
@ -137,8 +137,8 @@ Types
|
|||
field2: :zeek:type:`bool`
|
||||
Toggles something.
|
||||
|
||||
field3: :zeek:type:`ZeexygenExample::SimpleRecord`
|
||||
Zeexygen automatically tracks types
|
||||
field3: :zeek:type:`ZeekygenExample::SimpleRecord`
|
||||
Zeekygen automatically tracks types
|
||||
and cross-references are automatically
|
||||
inserted in to generated docs.
|
||||
|
||||
|
@ -148,7 +148,7 @@ Types
|
|||
|
||||
General documentation for a type "ComplexRecord" goes here.
|
||||
|
||||
.. zeek:type:: ZeexygenExample::Info
|
||||
.. zeek:type:: ZeekygenExample::Info
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
|
@ -164,33 +164,33 @@ Types
|
|||
fields plus the extensions and the scripts which contributed to it
|
||||
(provided they are also @load'ed).
|
||||
|
||||
.. zeek:type:: ZeexygenExample::SimpleEnum
|
||||
.. zeek:type:: ZeekygenExample::SimpleEnum
|
||||
|
||||
:Type: :zeek:type:`enum`
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::ONE ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::ONE ZeekygenExample::SimpleEnum
|
||||
|
||||
Documentation for particular enum values is added like this.
|
||||
And can also span multiple lines.
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::TWO ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::TWO ZeekygenExample::SimpleEnum
|
||||
|
||||
Or this style is valid to document the preceding enum value.
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::THREE ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::THREE ZeekygenExample::SimpleEnum
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::FOUR ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::FOUR ZeekygenExample::SimpleEnum
|
||||
|
||||
And some documentation for "FOUR".
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::FIVE ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::FIVE ZeekygenExample::SimpleEnum
|
||||
|
||||
Also "FIVE".
|
||||
|
||||
Documentation for the "SimpleEnum" type goes here.
|
||||
It can span multiple lines.
|
||||
|
||||
.. zeek:type:: ZeexygenExample::SimpleRecord
|
||||
.. zeek:type:: ZeekygenExample::SimpleRecord
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
|
@ -210,23 +210,23 @@ Types
|
|||
|
||||
Events
|
||||
######
|
||||
.. zeek:id:: ZeexygenExample::an_event
|
||||
.. zeek:id:: ZeekygenExample::an_event
|
||||
|
||||
:Type: :zeek:type:`event` (name: :zeek:type:`string`)
|
||||
|
||||
Summarize "an_event" here.
|
||||
Give more details about "an_event" here.
|
||||
|
||||
ZeexygenExample::a_function should not be confused as a parameter
|
||||
ZeekygenExample::a_function should not be confused as a parameter
|
||||
in the generated docs, but it also doesn't generate a cross-reference
|
||||
link. Use the see role instead: :zeek:see:`ZeexygenExample::a_function`.
|
||||
link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
||||
|
||||
|
||||
:name: Describe the argument here.
|
||||
|
||||
Functions
|
||||
#########
|
||||
.. zeek:id:: ZeexygenExample::a_function
|
||||
.. zeek:id:: ZeekygenExample::a_function
|
||||
|
||||
:Type: :zeek:type:`function` (tag: :zeek:type:`string`, msg: :zeek:type:`string`) : :zeek:type:`string`
|
||||
|
|
@ -1,91 +1,91 @@
|
|||
.. zeek:id:: ZeexygenExample::Zeexygen_One
|
||||
.. zeek:id:: ZeekygenExample::Zeekygen_One
|
||||
|
||||
:Type: :zeek:type:`Notice::Type`
|
||||
|
||||
Any number of this type of comment
|
||||
will document "Zeexygen_One".
|
||||
will document "Zeekygen_One".
|
||||
|
||||
.. zeek:id:: ZeexygenExample::Zeexygen_Two
|
||||
.. zeek:id:: ZeekygenExample::Zeekygen_Two
|
||||
|
||||
:Type: :zeek:type:`Notice::Type`
|
||||
|
||||
Any number of this type of comment
|
||||
will document "ZEEXYGEN_TWO".
|
||||
will document "ZEEKYGEN_TWO".
|
||||
|
||||
.. zeek:id:: ZeexygenExample::Zeexygen_Three
|
||||
.. zeek:id:: ZeekygenExample::Zeekygen_Three
|
||||
|
||||
:Type: :zeek:type:`Notice::Type`
|
||||
|
||||
|
||||
.. zeek:id:: ZeexygenExample::Zeexygen_Four
|
||||
.. zeek:id:: ZeekygenExample::Zeekygen_Four
|
||||
|
||||
:Type: :zeek:type:`Notice::Type`
|
||||
|
||||
Omitting comments is fine, and so is mixing ``##`` and ``##<``, but
|
||||
it's probably best to use only one style consistently.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::LOG
|
||||
.. zeek:id:: ZeekygenExample::LOG
|
||||
|
||||
:Type: :zeek:type:`Log::ID`
|
||||
|
||||
|
||||
.. zeek:type:: ZeexygenExample::SimpleEnum
|
||||
.. zeek:type:: ZeekygenExample::SimpleEnum
|
||||
|
||||
:Type: :zeek:type:`enum`
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::ONE ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::ONE ZeekygenExample::SimpleEnum
|
||||
|
||||
Documentation for particular enum values is added like this.
|
||||
And can also span multiple lines.
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::TWO ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::TWO ZeekygenExample::SimpleEnum
|
||||
|
||||
Or this style is valid to document the preceding enum value.
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::THREE ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::THREE ZeekygenExample::SimpleEnum
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::FOUR ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::FOUR ZeekygenExample::SimpleEnum
|
||||
|
||||
And some documentation for "FOUR".
|
||||
|
||||
.. zeek:enum:: ZeexygenExample::FIVE ZeexygenExample::SimpleEnum
|
||||
.. zeek:enum:: ZeekygenExample::FIVE ZeekygenExample::SimpleEnum
|
||||
|
||||
Also "FIVE".
|
||||
|
||||
Documentation for the "SimpleEnum" type goes here.
|
||||
It can span multiple lines.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::ONE
|
||||
.. zeek:id:: ZeekygenExample::ONE
|
||||
|
||||
:Type: :zeek:type:`ZeexygenExample::SimpleEnum`
|
||||
:Type: :zeek:type:`ZeekygenExample::SimpleEnum`
|
||||
|
||||
Documentation for particular enum values is added like this.
|
||||
And can also span multiple lines.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::TWO
|
||||
.. zeek:id:: ZeekygenExample::TWO
|
||||
|
||||
:Type: :zeek:type:`ZeexygenExample::SimpleEnum`
|
||||
:Type: :zeek:type:`ZeekygenExample::SimpleEnum`
|
||||
|
||||
Or this style is valid to document the preceding enum value.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::THREE
|
||||
.. zeek:id:: ZeekygenExample::THREE
|
||||
|
||||
:Type: :zeek:type:`ZeexygenExample::SimpleEnum`
|
||||
:Type: :zeek:type:`ZeekygenExample::SimpleEnum`
|
||||
|
||||
|
||||
.. zeek:id:: ZeexygenExample::FOUR
|
||||
.. zeek:id:: ZeekygenExample::FOUR
|
||||
|
||||
:Type: :zeek:type:`ZeexygenExample::SimpleEnum`
|
||||
:Type: :zeek:type:`ZeekygenExample::SimpleEnum`
|
||||
|
||||
And some documentation for "FOUR".
|
||||
|
||||
.. zeek:id:: ZeexygenExample::FIVE
|
||||
.. zeek:id:: ZeekygenExample::FIVE
|
||||
|
||||
:Type: :zeek:type:`ZeexygenExample::SimpleEnum`
|
||||
:Type: :zeek:type:`ZeekygenExample::SimpleEnum`
|
||||
|
||||
Also "FIVE".
|
||||
|
||||
.. zeek:type:: ZeexygenExample::SimpleRecord
|
||||
.. zeek:type:: ZeekygenExample::SimpleRecord
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
|||
The way fields can be documented is similar to what's already seen
|
||||
for enums.
|
||||
|
||||
.. zeek:type:: ZeexygenExample::ComplexRecord
|
||||
.. zeek:type:: ZeekygenExample::ComplexRecord
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
|
@ -113,8 +113,8 @@
|
|||
field2: :zeek:type:`bool`
|
||||
Toggles something.
|
||||
|
||||
field3: :zeek:type:`ZeexygenExample::SimpleRecord`
|
||||
Zeexygen automatically tracks types
|
||||
field3: :zeek:type:`ZeekygenExample::SimpleRecord`
|
||||
Zeekygen automatically tracks types
|
||||
and cross-references are automatically
|
||||
inserted in to generated docs.
|
||||
|
||||
|
@ -124,7 +124,7 @@
|
|||
|
||||
General documentation for a type "ComplexRecord" goes here.
|
||||
|
||||
.. zeek:type:: ZeexygenExample::Info
|
||||
.. zeek:type:: ZeekygenExample::Info
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
|
@ -140,7 +140,7 @@
|
|||
fields plus the extensions and the scripts which contributed to it
|
||||
(provided they are also @load'ed).
|
||||
|
||||
.. zeek:id:: ZeexygenExample::an_option
|
||||
.. zeek:id:: ZeekygenExample::an_option
|
||||
|
||||
:Type: :zeek:type:`set` [:zeek:type:`addr`, :zeek:type:`addr`, :zeek:type:`string`]
|
||||
:Attributes: :zeek:attr:`&redef`
|
||||
|
@ -149,7 +149,7 @@
|
|||
Add documentation for "an_option" here.
|
||||
The type/attribute information is all generated automatically.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::option_with_init
|
||||
.. zeek:id:: ZeekygenExample::option_with_init
|
||||
|
||||
:Type: :zeek:type:`interval`
|
||||
:Attributes: :zeek:attr:`&redef`
|
||||
|
@ -158,7 +158,7 @@
|
|||
Default initialization will be generated automatically.
|
||||
More docs can be added here.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::a_var
|
||||
.. zeek:id:: ZeekygenExample::a_var
|
||||
|
||||
:Type: :zeek:type:`bool`
|
||||
|
||||
|
@ -166,14 +166,14 @@
|
|||
isn't a function/event/hook is classified as a "state variable"
|
||||
in the generated docs.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::var_without_explicit_type
|
||||
.. zeek:id:: ZeekygenExample::var_without_explicit_type
|
||||
|
||||
:Type: :zeek:type:`string`
|
||||
:Default: ``"this works"``
|
||||
|
||||
Types are inferred, that information is self-documenting.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::summary_test
|
||||
.. zeek:id:: ZeekygenExample::summary_test
|
||||
|
||||
:Type: :zeek:type:`string`
|
||||
|
||||
|
@ -181,7 +181,7 @@
|
|||
And this second sentence doesn't show in the short description provided
|
||||
by the table of all identifiers declared by this script.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::a_function
|
||||
.. zeek:id:: ZeekygenExample::a_function
|
||||
|
||||
:Type: :zeek:type:`function` (tag: :zeek:type:`string`, msg: :zeek:type:`string`) : :zeek:type:`string`
|
||||
|
||||
|
@ -200,26 +200,26 @@
|
|||
|
||||
:returns: Describe the return type here.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::an_event
|
||||
.. zeek:id:: ZeekygenExample::an_event
|
||||
|
||||
:Type: :zeek:type:`event` (name: :zeek:type:`string`)
|
||||
|
||||
Summarize "an_event" here.
|
||||
Give more details about "an_event" here.
|
||||
|
||||
ZeexygenExample::a_function should not be confused as a parameter
|
||||
ZeekygenExample::a_function should not be confused as a parameter
|
||||
in the generated docs, but it also doesn't generate a cross-reference
|
||||
link. Use the see role instead: :zeek:see:`ZeexygenExample::a_function`.
|
||||
link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
||||
|
||||
|
||||
:name: Describe the argument here.
|
||||
|
||||
.. zeek:id:: ZeexygenExample::function_without_proto
|
||||
.. zeek:id:: ZeekygenExample::function_without_proto
|
||||
|
||||
:Type: :zeek:type:`function` (tag: :zeek:type:`string`) : :zeek:type:`string`
|
||||
|
||||
|
||||
.. zeek:type:: ZeexygenExample::PrivateRecord
|
||||
.. zeek:type:: ZeekygenExample::PrivateRecord
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
:orphan:
|
||||
|
||||
Package: zeexygen
|
||||
Package: zeekygen
|
||||
=================
|
||||
|
||||
This package is loaded during the process which automatically generates
|
||||
reference documentation for all Zeek scripts (i.e. "Zeexygen"). Its only
|
||||
reference documentation for all Zeek scripts (i.e. "Zeekygen"). Its only
|
||||
purpose is to provide an easy way to load all known Zeek scripts plus any
|
||||
extra scripts needed or used by the documentation process.
|
||||
|
||||
:doc:`/scripts/zeexygen/__load__.zeek`
|
||||
:doc:`/scripts/zeekygen/__load__.zeek`
|
||||
|
||||
|
||||
:doc:`/scripts/zeexygen/example.zeek`
|
||||
:doc:`/scripts/zeekygen/example.zeek`
|
||||
|
||||
This is an example script that demonstrates Zeexygen-style
|
||||
This is an example script that demonstrates Zeekygen-style
|
||||
documentation. It generally will make most sense when viewing
|
||||
the script's raw source code and comparing to the HTML-rendered
|
||||
version.
|
||||
|
@ -28,10 +28,10 @@ extra scripts needed or used by the documentation process.
|
|||
There's also a custom role to reference any identifier node in
|
||||
the Zeek Sphinx domain that's good for "see alsos", e.g.
|
||||
|
||||
See also: :zeek:see:`ZeexygenExample::a_var`,
|
||||
:zeek:see:`ZeexygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
See also: :zeek:see:`ZeekygenExample::a_var`,
|
||||
:zeek:see:`ZeekygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
|
||||
And a custom directive does the equivalent references:
|
||||
|
||||
.. zeek:see:: ZeexygenExample::a_var ZeexygenExample::ONE SSH::Info
|
||||
.. zeek:see:: ZeekygenExample::a_var ZeekygenExample::ONE SSH::Info
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
:doc:`zeexygen </scripts/zeexygen/index>`
|
||||
:doc:`zeekygen </scripts/zeekygen/index>`
|
||||
|
||||
This package is loaded during the process which automatically generates
|
||||
reference documentation for all Zeek scripts (i.e. "Zeexygen"). Its only
|
||||
reference documentation for all Zeek scripts (i.e. "Zeekygen"). Its only
|
||||
purpose is to provide an easy way to load all known Zeek scripts plus any
|
||||
extra scripts needed or used by the documentation process.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
zeekygen/__load__.zeek </scripts/zeekygen/__load__.zeek>
|
||||
zeekygen/example.zeek </scripts/zeekygen/example.zeek>
|
|
@ -1,5 +1,5 @@
|
|||
:doc:`/scripts/zeexygen/example.zeek`
|
||||
This is an example script that demonstrates Zeexygen-style
|
||||
:doc:`/scripts/zeekygen/example.zeek`
|
||||
This is an example script that demonstrates Zeekygen-style
|
||||
documentation. It generally will make most sense when viewing
|
||||
the script's raw source code and comparing to the HTML-rendered
|
||||
version.
|
||||
|
@ -14,10 +14,10 @@
|
|||
There's also a custom role to reference any identifier node in
|
||||
the Zeek Sphinx domain that's good for "see alsos", e.g.
|
||||
|
||||
See also: :zeek:see:`ZeexygenExample::a_var`,
|
||||
:zeek:see:`ZeexygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
See also: :zeek:see:`ZeekygenExample::a_var`,
|
||||
:zeek:see:`ZeekygenExample::ONE`, :zeek:see:`SSH::Info`
|
||||
|
||||
And a custom directive does the equivalent references:
|
||||
|
||||
.. zeek:see:: ZeexygenExample::a_var ZeexygenExample::ONE SSH::Info
|
||||
.. zeek:see:: ZeekygenExample::a_var ZeekygenExample::ONE SSH::Info
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
.. zeek:type:: ZeexygenTest::TypeAlias
|
||||
.. zeek:type:: ZeekygenTest::TypeAlias
|
||||
|
||||
:Type: :zeek:type:`bool`
|
||||
|
||||
This is just an alias for a builtin type ``bool``.
|
||||
|
||||
.. zeek:type:: ZeexygenTest::NotTypeAlias
|
||||
.. zeek:type:: ZeekygenTest::NotTypeAlias
|
||||
|
||||
:Type: :zeek:type:`bool`
|
||||
|
||||
This type should get its own comments, not associated w/ TypeAlias.
|
||||
|
||||
.. zeek:type:: ZeexygenTest::OtherTypeAlias
|
||||
.. zeek:type:: ZeekygenTest::OtherTypeAlias
|
||||
|
||||
:Type: :zeek:type:`bool`
|
||||
|
||||
|
@ -19,25 +19,25 @@
|
|||
one doesn't have to click through the full type alias chain to
|
||||
find out what the actual type is...
|
||||
|
||||
.. zeek:id:: ZeexygenTest::a
|
||||
.. zeek:id:: ZeekygenTest::a
|
||||
|
||||
:Type: :zeek:type:`ZeexygenTest::TypeAlias`
|
||||
:Type: :zeek:type:`ZeekygenTest::TypeAlias`
|
||||
|
||||
But this should reference a type of ``TypeAlias``.
|
||||
|
||||
.. zeek:id:: ZeexygenTest::b
|
||||
.. zeek:id:: ZeekygenTest::b
|
||||
|
||||
:Type: :zeek:type:`ZeexygenTest::OtherTypeAlias`
|
||||
:Type: :zeek:type:`ZeekygenTest::OtherTypeAlias`
|
||||
|
||||
And this should reference a type of ``OtherTypeAlias``.
|
||||
|
||||
.. zeek:type:: ZeexygenTest::MyRecord
|
||||
.. zeek:type:: ZeekygenTest::MyRecord
|
||||
|
||||
:Type: :zeek:type:`record`
|
||||
|
||||
f1: :zeek:type:`ZeexygenTest::TypeAlias`
|
||||
f1: :zeek:type:`ZeekygenTest::TypeAlias`
|
||||
|
||||
f2: :zeek:type:`ZeexygenTest::OtherTypeAlias`
|
||||
f2: :zeek:type:`ZeekygenTest::OtherTypeAlias`
|
||||
|
||||
f3: :zeek:type:`bool`
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
zeexygen/__load__.zeek </scripts/zeexygen/__load__.zeek>
|
||||
zeexygen/example.zeek </scripts/zeexygen/example.zeek>
|
|
@ -785,7 +785,7 @@
|
|||
0.000000 MetaHookPost LoadFile(0, .<...>/utils.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, .<...>/variance.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, .<...>/weird.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, .<...>/zeexygen.bif.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, .<...>/zeekygen.bif.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, <...>/__load__.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, <...>/__preload__.zeek) -> -1
|
||||
0.000000 MetaHookPost LoadFile(0, <...>/hooks.zeek) -> -1
|
||||
|
@ -1688,7 +1688,7 @@
|
|||
0.000000 MetaHookPre LoadFile(0, .<...>/utils.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, .<...>/variance.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, .<...>/weird.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, .<...>/zeexygen.bif.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, .<...>/zeekygen.bif.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, <...>/__load__.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, <...>/__preload__.zeek)
|
||||
0.000000 MetaHookPre LoadFile(0, <...>/hooks.zeek)
|
||||
|
@ -2599,7 +2599,7 @@
|
|||
0.000000 | HookLoadFile .<...>/variance.zeek
|
||||
0.000000 | HookLoadFile .<...>/video.sig
|
||||
0.000000 | HookLoadFile .<...>/weird.zeek
|
||||
0.000000 | HookLoadFile .<...>/zeexygen.bif.zeek
|
||||
0.000000 | HookLoadFile .<...>/zeekygen.bif.zeek
|
||||
0.000000 | HookLoadFile <...>/__load__.zeek
|
||||
0.000000 | HookLoadFile <...>/__preload__.zeek
|
||||
0.000000 | HookLoadFile <...>/hooks.zeek
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# This check piggy-backs on the test-all-policy.zeek test, assuming that every
|
||||
# loadable script is referenced there. The only additional check here is
|
||||
# that the zeexygen package should even load scripts that are commented
|
||||
# out in test-all-policy.zeek because the zeexygen package is only loaded
|
||||
# that the zeekygen package should even load scripts that are commented
|
||||
# out in test-all-policy.zeek because the zeekygen package is only loaded
|
||||
# when generated documentation and will terminate has soon as zeek_init
|
||||
# is handled, even if a script will e.g. put Zeek into listen mode or otherwise
|
||||
# cause it to not terminate after scripts are parsed.
|
||||
|
||||
# @TEST-EXEC: bash %INPUT $DIST/scripts/test-all-policy.zeek $DIST/scripts/zeexygen/__load__.zeek
|
||||
# @TEST-EXEC: bash %INPUT $DIST/scripts/test-all-policy.zeek $DIST/scripts/zeekygen/__load__.zeek
|
||||
|
||||
error_count=0
|
||||
|
||||
|
@ -22,10 +22,10 @@ if [ $# -ne 2 ]; then
|
|||
fi
|
||||
|
||||
all_loads=$(egrep "#[[:space:]]*@load.*" $1 | sed 's/#[[:space:]]*@load[[:space:]]*//g')
|
||||
zeexygen_loads=$(egrep "@load.*" $2 | sed 's/@load[[:space:]]*//g')
|
||||
zeekygen_loads=$(egrep "@load.*" $2 | sed 's/@load[[:space:]]*//g')
|
||||
|
||||
for f in $all_loads; do
|
||||
echo "$zeexygen_loads" | grep -q $f || error_msg "$f not loaded in zeexygen/__load__.zeek"
|
||||
echo "$zeekygen_loads" | grep -q $f || error_msg "$f not loaded in zeekygen/__load__.zeek"
|
||||
done
|
||||
|
||||
if [ $error_count -gt 0 ]; then
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# This script checks whether the reST docs generated by zeexygen are stale.
|
||||
# This script checks whether the reST docs generated by zeekygen are stale.
|
||||
# If this test fails when testing the master branch, then simply run:
|
||||
#
|
||||
# testing/scripts/gen-zeexygen-docs.sh
|
||||
# testing/scripts/update-zeekygen-docs.sh
|
||||
#
|
||||
# and then commit the changes.
|
||||
#
|
||||
# @TEST-EXEC: bash $SCRIPTS/gen-zeexygen-docs.sh ./doc
|
||||
# @TEST-EXEC: bash $SCRIPTS/update-zeekygen-docs.sh ./doc
|
||||
# @TEST-EXEC: bash %INPUT
|
||||
|
||||
if [ -n "$TRAVIS_PULL_REQUEST" ]; then
|
||||
|
@ -33,7 +33,7 @@ function check_diff
|
|||
echo "If this fails in the master branch or when merging to master," 1>&2
|
||||
echo "re-run the following command:" 1>&2
|
||||
echo "" 1>&2
|
||||
echo " $SCRIPTS/gen-zeexygen-docs.sh" 1>&2
|
||||
echo " $SCRIPTS/update-zeekygen-docs.sh" 1>&2
|
||||
echo "" 1>&2
|
||||
echo "Then commit/push the changes in the zeek-docs repo" 1>&2
|
||||
echo "(the doc/ directory in the zeek repo)." 1>&2
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff autogen-reST-enums.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
@TEST-START-FILE zeekygen.config
|
||||
identifier TestEnum* autogen-reST-enums.rst
|
||||
@TEST-END-FILE
|
||||
|
8
testing/btest/doc/zeekygen/example.zeek
Normal file
8
testing/btest/doc/zeekygen/example.zeek
Normal file
|
@ -0,0 +1,8 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff example.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
script zeekygen/example.zeek example.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeekygen/example
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff autogen-reST-func-params.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
@TEST-START-FILE zeekygen.config
|
||||
identifier test_func_params* autogen-reST-func-params.rst
|
||||
@TEST-END-FILE
|
||||
|
9
testing/btest/doc/zeekygen/identifier.zeek
Normal file
9
testing/btest/doc/zeekygen/identifier.zeek
Normal file
|
@ -0,0 +1,9 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
identifier ZeekygenExample::* test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
9
testing/btest/doc/zeekygen/package.zeek
Normal file
9
testing/btest/doc/zeekygen/package.zeek
Normal file
|
@ -0,0 +1,9 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
package zeekygen test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
9
testing/btest/doc/zeekygen/package_index.zeek
Normal file
9
testing/btest/doc/zeekygen/package_index.zeek
Normal file
|
@ -0,0 +1,9 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
package_index zeekygen test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff autogen-reST-records.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
@TEST-START-FILE zeekygen.config
|
||||
identifier TestRecord* autogen-reST-records.rst
|
||||
@TEST-END-FILE
|
||||
|
9
testing/btest/doc/zeekygen/script_index.zeek
Normal file
9
testing/btest/doc/zeekygen/script_index.zeek
Normal file
|
@ -0,0 +1,9 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
script_index zeekygen/* test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
9
testing/btest/doc/zeekygen/script_summary.zeek
Normal file
9
testing/btest/doc/zeekygen/script_summary.zeek
Normal file
|
@ -0,0 +1,9 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
script_summary zeekygen/example.zeek test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
|
@ -1,11 +1,11 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff autogen-reST-type-aliases.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
identifier ZeexygenTest::* autogen-reST-type-aliases.rst
|
||||
@TEST-START-FILE zeekygen.config
|
||||
identifier ZeekygenTest::* autogen-reST-type-aliases.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
module ZeexygenTest;
|
||||
module ZeekygenTest;
|
||||
|
||||
export {
|
||||
## This is just an alias for a builtin type ``bool``.
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff autogen-reST-vectors.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
@TEST-START-FILE zeekygen.config
|
||||
identifier test_vector* autogen-reST-vectors.rst
|
||||
@TEST-END-FILE
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -X zeexygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff example.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
script zeexygen/example.zeek example.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeexygen/example
|
|
@ -1,9 +0,0 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
identifier ZeexygenExample::* test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeexygen
|
|
@ -1,9 +0,0 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
package zeexygen test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeexygen
|
|
@ -1,9 +0,0 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
package_index zeexygen test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeexygen
|
|
@ -1,9 +0,0 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
script_index zeexygen/* test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeexygen
|
|
@ -1,9 +0,0 @@
|
|||
# @TEST-PORT: BROKER_PORT
|
||||
# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X zeexygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeexygen.config
|
||||
script_summary zeexygen/example.zeek test.rst
|
||||
@TEST-END-FILE
|
||||
|
||||
@load zeexygen
|
|
@ -11,9 +11,9 @@ unset BRO_DEFAULT_CONNECT_RETRY
|
|||
dir="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source_dir="$( cd $dir/../.. && pwd )"
|
||||
build_dir=$source_dir/build
|
||||
conf_file=$build_dir/zeexygen-test.conf
|
||||
conf_file=$build_dir/zeekygen-test.conf
|
||||
output_dir=$source_dir/doc
|
||||
zeek_error_file=$build_dir/zeexygen-test-stderr.txt
|
||||
zeek_error_file=$build_dir/zeekygen-test-stderr.txt
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
output_dir=$1
|
||||
|
@ -30,10 +30,10 @@ export BRO_SEED_FILE=$source_dir/testing/btest/random.seed
|
|||
|
||||
function run_zeek
|
||||
{
|
||||
ZEEK_ALLOW_INIT_ERRORS=1 bro -X $conf_file zeexygen >/dev/null 2>$zeek_error_file
|
||||
ZEEK_ALLOW_INIT_ERRORS=1 bro -X $conf_file zeekygen >/dev/null 2>$zeek_error_file
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed running zeek with zeexygen config file $conf_file"
|
||||
echo "Failed running zeek with zeekygen config file $conf_file"
|
||||
echo "See stderr in $zeek_error_file"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue