Commit graph

603 commits

Author SHA1 Message Date
Jon Siwek
2490878656 Another revision for autodoc tracking of public vs private interfaces
A script's public API wasn't simply definable as identifiers
for which ID::IsGlobal() is true, e.g. an unexported identifier with
SCOPE_MODULE will still pass that test and (incorrectly) be considered
public API.

Also, generated reST now omits empty interface sections.
2011-03-24 14:04:30 -05:00
Don Appleman
c81f1889a5 Baseline for KNOWN-HOSTS tesT 2011-03-24 13:28:48 -05:00
Jon Siwek
2e88c5100c Revise autodoc tracking of public vs private script interfaces
A bro script's public interface is taken to mean any identifier declared
in the global scope that optionally is exported from some namespace/module.
Or more simply: ID::IsGlobal()
2011-03-24 12:32:32 -05:00
Don Appleman
638eb2f8eb Initial drop of known-hosts unit test, with tracefile and directory structure, as well as c ouple of files pulled from Robin's logging branch. 2011-03-24 11:27:21 -05:00
Jon Siwek
c2f0332b5f Removing lexical scanner recognition of "## Author:" comments.
This functionality is better done manually by the script writer
embedding reST into the script summary section (##! comments).
This allows flexibility in choosing between different methods
to convey the same information (e.g. ":Author: <author>" or
the ".. codeauthor:: <author>" directive that Sphinx
configurations can recognize).
2011-03-24 09:51:47 -05:00
Jon Siwek
8b79971e21 Fix auto-generated reST :doc: references to strip .bro file suffixes.
It's allowed for a script to "@load example.bro", but Sphinx doesn't want
that file extension for the purposes of generating cross-referencing links
to other documentation.
2011-03-23 16:59:41 -05:00
Jon Siwek
037a6906af Canonicalize "##" and "## " stylized comments, revise record/enum documentation tracking
The documentation framework now sees "##Text" and "## Text" as
equivalent documentation comments.  This prevents unintentional
indentation in the generated reST as a result of the later style, but
still allows embedded reST markup that relies on indentation of more
than two spaces to work as expected.

Comments associated with record fields and enums values are able
to span multiple "##"-stylized comments, allowing for more robust
reST markup to be embedded.

The documentation framework now tracks record fields through
a new CommentedTypeDecl subclass of TypeDecl that the parser constructs
in parallel with the real TypeDecl.
2011-03-23 16:08:18 -05:00
Jon Siwek
bbe7c98ab3 Major reformatting of auto-generated reST documentation.
Introduces reST directives and roles in a "bro" domain that Sphinx
will be taught to recognize.
2011-03-22 16:05:59 -05:00
Robin Sommer
05f2104fec Merge branch 'topic/robin/record-coercion' into topic/robin/logging-internals
* topic/robin/record-coercion:
  Fixing a bug with nested record ctors.
  Enabling automatic coercion from record type A to be B as long as A has all the types that B has.

Conflicts:
	src/Expr.cc
2011-03-21 17:24:30 -07:00
Robin Sommer
871eff9f90 Updating submodule(s). 2011-03-21 16:35:22 -07:00
Robin Sommer
12c9c947f8 Merge remote branch 'origin/topic/jsiwek/config-file-clobber-fixes'
* origin/topic/jsiwek/config-file-clobber-fixes:
  Changes to the way user-modifiable config files are installed.

Conflicts:
	aux/broccoli
	aux/broctl
2011-03-21 16:29:17 -07:00
Jon Siwek
384fa03c26 Revising notice, port analysis, packet filter, auto-generated documentation.
They're now all optional sections -- if a given bro script doesn't use the
functionality, then the documentation doesn't mention anything about it.
2011-03-21 15:08:39 -05:00
Jon Siwek
e0a77cb794 Auto-doc framework now handles multiple script authors more conveniently. 2011-03-21 14:03:11 -05:00
Jon Siwek
5fbcde7344 Teach Desc class how to (optionally) use spaces for indentation.
And (to be consistent with current conventions for reST documentation)
update places in the auto-documentation-generation framework
where tabs were used in the generated reST.
2011-03-21 13:49:53 -05:00
Jon Siwek
e491caeeb7 Add note to auto-generated reST about not editing it directly 2011-03-21 12:49:54 -05:00
Robin Sommer
7526058071 Fixing a bug with nested record ctors.
If a record field was initialized with another record ctor, there was
no record type coercion in place in case of a type mismatch.
2011-03-17 17:19:46 -07:00
Robin Sommer
d84d4b8a57 Moving uid from conn_id to connection, and making output determistic
if a hash seed is given.
2011-03-16 14:25:49 -07:00
Robin Sommer
881071cc99 Extending conn_id with a globally unique identifiers. 2011-03-15 20:42:56 -07:00
Jon Siwek
9e13d15f29 Tabifying BroDoc* sources to make consistent with general style. 2011-03-15 16:48:51 -05:00
Jon Siwek
dbf2b9996e Revising BroDoc*.h internal/api documentation. 2011-03-15 15:38:43 -05:00
Jon Siwek
f67c0892e5 Revise enum documentation autogeneration.
This adds a new subclass of EnumType, CommentedEnumType, and removes
any previous changes to EnumType that were done to support the
autodoc framework.

Dummy CommentedEnumType and ID's are constructed in parallel with the
real EnumType ID's during parsing and passed on to the autodoc framework.

This allows the generated documentation to track enum redefs, with
a special case being the "Notice" enum type.
2011-03-15 14:51:50 -05:00
Robin Sommer
8eb241fde7 Removing the EXPIRE_DFA_STATES code. 2011-03-14 18:55:40 -07:00
Robin Sommer
57fe369c4e Removing active mapping. 2011-03-14 18:31:17 -07:00
Robin Sommer
c92154994a Updating submodule(s). 2011-03-14 17:42:32 -07:00
Robin Sommer
88b41b6320 Merge remote branch 'origin/topic/jsiwek/cmake-compiler-check'
* origin/topic/jsiwek/cmake-compiler-check:
  Add explicit CMake check for compiler

Conflicts:
	aux/broccoli
	aux/broctl
2011-03-14 17:42:25 -07:00
Jon Siwek
b1dc5d3a1c Update to auto-generated documentation format.
Comments are now clearly marked.

Enums are now documented in order of their integral value, not
their identifier string.
2011-03-14 14:49:58 -05:00
Jon Siwek
f47c8e4d93 Changes to parser to allow enum type documentation comments.
"##" style comments before identifiers and "##<" style after identifiers
in the body of an enum type declaration will now show up in the
auto-generated reST documentation.
2011-03-14 14:13:52 -05:00
Jon Siwek
c4ca6f098c Changes to scanner and parser to allow record field comments.
The scanner can now be told to start/stop producing new token types that
assist in documenting record field types (and eventually enums also).

TOK_DOC:
    Produced on "##" style comments; documents the field that follows.

TOK_POST_DOC:
    Produced on "##<" style comments; documents the previous field.
2011-03-14 13:10:49 -05:00
Jon Siwek
4b0eb8127d Changes to add comments per enum or record type field. 2011-03-14 11:50:46 -05:00
Robin Sommer
b68d50d717 Updating submodule(s). 2011-03-11 18:41:45 -08:00
Robin Sommer
e1052b93b0 Test commit. 2011-03-11 18:39:14 -08:00
Robin Sommer
7d3ff49607 New submodule location. 2011-03-11 18:33:44 -08:00
Robin Sommer
0f854315e9 New test. 2011-03-10 18:18:58 -08:00
Robin Sommer
45ebfbb2b8 Bug fixes.
- Fixing a crash with an invalid pointer.

- Fixing a namespacing problem with is_ftp_data_conn() and check_relay_3().

- Fixing the do-we-have-an-event-handler-defined check.

Standard test-suite passes.

Seth, I think you can give it a try now ...
2011-03-10 18:18:01 -08:00
Jon Siwek
15fd5297a3 Fixes for declared type ID tracking & adding DescribeReST()'s
Changed BroType to track a char* instead of an ID* that represents
the declared type's identifier.  It was also necessary to serialize
this information or else it can be lost (e.g. FieldDecl's in RecordType
always seem to get serialized at some point).

DescribeReST() functions added to many classes to get the output
closer to being reST compatible; still needs tweaking for Sphinx
(reST->HTML) compatibility.
2011-03-10 16:22:45 -06:00
Robin Sommer
871561939b Updating baselines. 2011-03-09 19:42:24 -08:00
Robin Sommer
170a8bd403 Setting random number generator seed in btest.cfg. 2011-03-09 19:42:24 -08:00
Robin Sommer
d54c705898 Adding new environment variable BRO_SEED_FILE to set the seed file for
the random number generator.

This works like the corresponding command line option but is more
convinient when writing tests as it can be set in btest.cfg.
2011-03-09 19:42:24 -08:00
Robin Sommer
de227b8d88 When creating a new stream, we check now that all log field have
supported types.

Also not reporting a run-time error anymore when logging to a stream
that hasn't been created; just fail silently as this may happen due to
other earlier errors.
2011-03-09 19:42:24 -08:00
Robin Sommer
5beee9e45e Updating TODO.
Just one to go. :)
2011-03-09 18:08:17 -08:00
Robin Sommer
89e8ea7353 Enums are now logged with their ID names, not anymore with their
numerical values.
2011-03-09 18:06:50 -08:00
Robin Sommer
c6e3174bc8 The logging systems now supports fields of type set[<atomic_type>]. 2011-03-09 18:01:41 -08:00
Robin Sommer
52c54859b6 Bugfix: the header line was ending with a separator.
Test baselines needed adaption as well.
2011-03-09 16:55:29 -08:00
Robin Sommer
b69ecff3ee More options for the ASCII writer.
# The prefix for the header line if included.
	const header_prefix = "# " &redef;

	# The string to use for empty string fields.
	const empty_field = "" &redef;

	# The string to use for an unset optional field.
	const unset_field = "-" &redef;
2011-03-09 16:52:46 -08:00
Robin Sommer
cb9e0a5d5a If a field value contains the separator, that is now escape with hex
characters.
2011-03-09 16:26:11 -08:00
Jon Siwek
287a3a3cb8 Changes to parser to pass along identifiers to doc framework. 2011-03-09 15:47:58 -06:00
Jon Siwek
1310f2387c Changing BroDocObj wrapper class to wrap ID instead of BroObj. 2011-03-09 15:10:05 -06:00
Jon Siwek
1c962cbb89 Changes to make declared types track their identifier.
Only occurs when in documentation mode.
2011-03-09 14:53:22 -06:00
Jon Siwek
9282e0adff Add explicit CMake check for compiler 2011-03-09 11:48:00 -06:00
Robin Sommer
c6d20dbfdf Adding a few options to the ASCII writer.
module LogAscii;

export {
	# Output everything to stdout rather than into files. This is primarily
	# for testing purposes.
	const output_to_stdout = F &redef;

	# The separator between fields.
	const separator = "\t" &redef;

	# True to include a header line with column names.
	const include_header = T &redef;
}
2011-03-08 21:44:46 -08:00