mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

Removed line numbers in the text because it was difficult to keep these up-to-date. Changed some wording and moved sample scripts before (rather than after) the descriptive text in order to keep it easy to understand.
19 lines
569 B
Text
19 lines
569 B
Text
event bro_init()
|
|
{
|
|
# Declaration of the table.
|
|
local ssl_services: table[string] of port;
|
|
|
|
# Initialize the table.
|
|
ssl_services = table(["SSH"] = 22/tcp, ["HTTPS"] = 443/tcp);
|
|
|
|
# Insert one key-yield pair into the table.
|
|
ssl_services["IMAPS"] = 993/tcp;
|
|
|
|
# Check if the key "SMTPS" is not in the table.
|
|
if ( "SMTPS" !in ssl_services )
|
|
ssl_services["SMTPS"] = 587/tcp;
|
|
|
|
# Iterate over each key in the table.
|
|
for ( k in ssl_services )
|
|
print fmt("Service Name: %s - Common Port: %s", k, ssl_services[k]);
|
|
}
|