Skip to content

Commit

Permalink
ipfix probe_ptree: warn on missing traffic class, throw error on miss…
Browse files Browse the repository at this point in the history
…ing exporter
  • Loading branch information
eugeneia committed Sep 15, 2022
1 parent 5bec85c commit 00d2337
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/program/ipfix/probe_ptree/probe_ptree.lua
Expand Up @@ -16,6 +16,11 @@ local probe_schema = 'snabb-snabbflow-v1'

local probe_cpuset = cpuset.new()

local function warn (msg, ...)
io.stderr:write("Warning: "..msg:format(...).."\n")
io.stderr:flush()
end

function setup_ipfix (conf)
-- yang.print_config_for_schema_by_name(probe_schema, conf, io.stdout)
return setup_workers(conf)
Expand Down Expand Up @@ -249,6 +254,7 @@ function setup_workers (config)
else
-- No traffic class configured for exporter, do not create
-- instances.
warn("No traffic class configured for exporter '%s'.", name)
break
end

Expand Down Expand Up @@ -305,6 +311,10 @@ function setup_workers (config)
}
for _, exporter in ipairs(class_order) do
local class = flow_director.class[exporter]
if not ipfix.exporter[exporter] then
error(("Exporter '%s' referenced in traffic class %d is not defined.")
:format(exporter, class.order))
end
table.insert(rss_config.classes, {
name = class_name(exporter, class),
filter = class.filter,
Expand Down

0 comments on commit 00d2337

Please sign in to comment.