New plugin usage: Error: " value used but not set"

Hi

I have a SW module that worked using the older plugin module from 2.2.135 Bro and I recently merged it to Bro 2.3.397 and when I run my Bro script that uses it I get:

/usr/local/bro/share/bro/base/protocols/dns/telemetry_speed.bro, line 454: value used but not set (dns_telemetry_set_options)

dns_telemetry_set_options is a function contained in my module in a events.bif file. The file is compiled.

Any help in diagnosing this err would be appreciated .

I see the library plugin being created :

make[3]: Entering directory `/work/jpd/dyn/src/bro-fork2/bro/build’
[ 27%] Building CXX object src/analyzer/protocol/dns_telemetry/CMakeFiles/plugin-Bro-DNS_TELEMETRY.dir/DNS.cc.o
[ 27%] Building CXX object src/analyzer/protocol/dns_telemetry/CMakeFiles/plugin-Bro-DNS_TELEMETRY.dir/events.bif.cc.o
[ 27%] Building CXX object src/analyzer/protocol/dns_telemetry/CMakeFiles/plugin-Bro-DNS_TELEMETRY.dir/events.bif.init.cc.o
Linking CXX static library libplugin-Bro-DNS_TELEMETRY.a

If your plugin in the BRO_PLUGIN_PATH?

Also, if your Bro script is something that you would always want to load with your module, you can include it with the module and make it automatically load when Bro starts up. This lets you completely keep any evidence of your plugin out of Bro’s normal installation (I see you added your script to the base/ directory which you probably don’t want to do).

  .Seth

That directory is empty:

bro -h :

$BRO_PLUGIN_PATH | plugin search path (/usr/local/bro/lib/bro/plugins)

ls /usr/local/bro/lib/bro/plugins
ls: cannot access /usr/local/bro/lib/bro/plugins: No such file or directory

bro -N | grep DNS
opened ‘debug.log’ debugging output
Bro::DNS - DNS analyzer (built-in)
Bro::DNS_Telemetry - DNS analyzer Telemetry (built-in)

Oh, I’m sorry. I thought you were writing this as an external/dynamic plugin.

Have you tried looking at the output if you load the misc/loaded-scripts script? That should show a file named something like this getting loaded…

scripts/base/bif/plugins/Bro_DNS_TELEMETRY.events.bif.bro

  .Seth

No indication it gets loaded:

find /usr/local/bro | grep TELE
/usr/local/bro/share/bro/base/bif/plugins/Bro_DNS_TELEMETRY.events.bif.bro
root@dyn-x64-01:/work/jpd/dyn/src/bro-fork2/bro# export BRO_PLUGIN_PATH=/usr/local/bro/share/bro/base/bif/plugins

/usr/local/bro/bin/bro -i lo -i eth0 -i eth1 -b -C /usr/local/bro/share/bro/base/protocols/dns/telemetry_speed.bro

listening on lo, capture length 8192 bytes

listening on eth0, capture length 8192 bytes

listening on eth1, capture length 8192 bytes

1423232941.050872 error in /usr/local/bro/share/bro/base/protocols/dns/telemetry_speed.bro, line 454: value used but not set (dns_telemetry_set_options)
1423232941.050872 error in /usr/local/bro/share/bro/base/protocols/dns/telemetry_speed.bro, line 508: value used but not set (dns_telemetry_load_anchor_map)
1423232941.050872 error in /usr/local/bro/share/bro/base/protocols/dns/telemetry_speed.bro, line 524: value used but not set (dns_telemetry_get_metrics)

using -B plugins I see:

Registering component DNS_TELEMETRY (tag 13/0)

Does -NN show your function?

Robin

No . -NN only shows the Plugin Name:

Bro::DNS_Telemetry - DNS analyzer Telemetry (built-in)
[Analyzer] Contents_DNS_Telemetry (enabled)
[Analyzer] DNS_TELEMETRY (ANALYZER_DNS_TELEMETRY, enabled)

I turned on all -B options and gathered this from debug.log and what -NN shows

Made IdentifierInfo dns_telemetry_set_options, in script base/bif/plugins/Bro_DNS_TELEMETRY.events.bif.bro

Filter id ‘dns_telemetry_set_options’ in ‘base/bif/plugins/Bro_DNS_TELEMETRY.events.bif.bro’ as a function

deb.txt (11.6 KB)

My Pluggin - I am using the same InstantiateAnalyzer method as I did in 2.2.135:

class Plugin : public plugin::Plugin {
public:
plugin::Configuration Configure()
{
AddComponent(new ::analyzer::Component(“DNS_TELEMETRY”, ::analyzer::dns_telemetry::DNS_Telemetry_Analyzer::InstantiateAnalyzer));
AddComponent(new ::analyzer::Component(“Contents_DNS_Telemetry”, 0));

plugin::Configuration config;
config.name = “Bro::DNS_Telemetry”;
config.description = “DNS analyzer Telemetry”;
return config;
}