From a5aadc11db1292f1752985d5bfc40ce492d625e6 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Mon, 12 Aug 2024 09:45:52 +0200 Subject: [PATCH] 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. --- src/spicy/spicyz/glue-compiler.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/spicy/spicyz/glue-compiler.cc b/src/spicy/spicyz/glue-compiler.cc index 9f992c6538..c34d7e1f6b 100644 --- a/src/spicy/spicyz/glue-compiler.cc +++ b/src/spicy/spicyz/glue-compiler.cc @@ -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);