Make conn.log service field ordered

This changes service set in the connection record, and thus also the
conn.log service field to being ordered. Speficically, the order of the
entries in the service field will be the same order in which protocols
will be confirmed. This means that it now is possible to see which
protocols were layered over each other in which order by looking at the
respective conn.log entry.
This commit is contained in:
Johanna Amann 2025-01-23 12:12:23 +00:00
parent c72c1cba6f
commit ac7bbe6949
33 changed files with 44 additions and 40 deletions

View file

@ -224,8 +224,10 @@ const RecordValPtr& Connection::GetVal() {
conn_val->Assign(1, std::move(orig_endp));
conn_val->Assign(2, std::move(resp_endp));
// 3 and 4 are set below.
conn_val->Assign(5, make_intrusive<TableVal>(id::string_set)); // service
conn_val->Assign(6, val_mgr->EmptyString()); // history
// Do not assign to 5 (service). It is a non-optional set, which will be default-initialized
// using the script-level settings; this easily applies the &ordered attribute to it.
// conn_val->Assign(5, make_intrusive<TableVal>(id::ordered_string_set)); // service
conn_val->Assign(6, val_mgr->EmptyString()); // history
if ( ! uid )
uid.Set(zeek::detail::bits_per_uid);