spicyz: Add back message about removed support for port / ports in evt

spicy-dhcp, spicy-http and spicy-dns all have this still in their .evt files,
so it seems popular. Be more helpful than "unexpected token" to users.
This commit is contained in:
Arne Welzel 2024-08-12 09:45:52 +02:00
parent 32cbe953ba
commit a5aadc11db

View file

@ -631,6 +631,13 @@ glue::ProtocolAnalyzer GlueCompiler::parseProtocolAnalyzer(const std::string& ch
}
}
else if ( looking_at(chunk, i, "ports") || looking_at(chunk, i, "port") ) {
throw ParseError(hilti::rt::fmt(
"Analyzer %s is using the removed 'port' or 'ports' keyword to register "
"well-known ports. Use Analyzer::register_for_ports() in the accompanying Zeek script instead.",
a.name));
}
else if ( looking_at(chunk, i, "replaces") ) {
eat_token(chunk, &i, "replaces");
a.replaces = extract_id(chunk, &i);