base/bif/zeekygen.bif.zeek

GLOBAL

Functions for querying script, package, or variable documentation.

Namespace

GLOBAL

Summary

Functions

get_identifier_comments: function

Retrieve the Zeekygen-style comments (##) associated with an identifier (e.g.

get_identifier_declaring_script: function

Retrieve the declaring script associated with an identifier (e.g.

get_package_readme: function

Retrieve the contents of a Zeek script package’s README file.

get_record_field_comments: function

Retrieve the Zeekygen-style comments (##) associated with a record field.

get_record_field_declaring_script: function

Retrieve the declaring script associated with a record field.

get_script_comments: function

Retrieve the Zeekygen-style summary comments (##!) associated with a Zeek script.

Detailed Interface

Functions

get_identifier_comments
Type

function (name: string) : string

Retrieve the Zeekygen-style comments (##) associated with an identifier (e.g. a variable or type).

Parameters

name – a script-level identifier for which to retrieve comments.

Returns

comments associated with name. If name is not a known script-level identifier, an empty string is returned.

get_identifier_declaring_script
Type

function (name: string) : string

Retrieve the declaring script associated with an identifier (e.g. a variable or type).

Parameters

name – a script-level identifier

Returns

declaring script associated with name. If name is not a known script-level identifier, an empty string is returned.

See also: get_record_field_declaring_script

get_package_readme
Type

function (name: string) : string

Retrieve the contents of a Zeek script package’s README file.

Parameters

name – the name of a Zeek script package. It must be a relative path to where it is located within a particular component of ZEEKPATH.

Returns

contents of the package’s README file. If name is not a known package, an empty string is returned.

get_record_field_comments
Type

function (name: string) : string

Retrieve the Zeekygen-style comments (##) associated with a record field.

Parameters

name – the name of a script-level record type and a field within it formatted like a typical record field access: “<record_type>$<field>”.

Returns

comments associated with the record field. If name does not point to a known script-level record type or a known field within a record type, an empty string is returned.

get_record_field_declaring_script
Type

function (name: string) : string

Retrieve the declaring script associated with a record field.

The declaring script for a field is different from the declaring script of the record type itself when fields were added via redef.

Parameters

name – the name of a script-level record type and a field within it formatted like a typical record field access: “<record_type>$<field>”.

Returns

the declaring script associated with the record field. If name does not point to a known script-level record type or a known field within a record type, an empty string is returned.

See also: get_identifier_declaring_script

get_script_comments
Type

function (name: string) : string

Retrieve the Zeekygen-style summary comments (##!) associated with a Zeek script.

Parameters

name – the name of a Zeek script. It must be a relative path to where it is located within a particular component of ZEEKPATH and use the same file name extension/suffix as the actual file (e.g. “.zeek”).

Returns

summary comments associated with script with name. If name is not a known script, an empty string is returned.