annotate base scripts with &is_used as needed

This commit is contained in:
Vern Paxson 2022-05-05 11:13:13 -07:00 committed by Tim Wojtulewicz
parent d9479c0502
commit 9b8ac44169
8 changed files with 18 additions and 17 deletions

View file

@ -459,8 +459,9 @@ function software_endpoint_name(id: conn_id, host: addr): string
return fmt("%s %s", host, (host == id$orig_h ? "client" : "server"));
}
# Convert a version into a string "a.b.c-x".
function software_fmt_version(v: Version): string
# Convert a version into a string "a.b.c-x". Marked "&is_used" because
# while the base scripts don't call it, the optional policy/ scripts do.
function software_fmt_version(v: Version): string &is_used
{
return fmt("%s%s%s%s%s",
v?$major ? fmt("%d", v$major) : "0",
@ -470,8 +471,8 @@ function software_fmt_version(v: Version): string
v?$addl ? fmt("-%s", v$addl) : "");
}
# Convert a software into a string "name a.b.cx".
function software_fmt(i: Info): string
# Convert a software into a string "name a.b.cx". Same as above re "&is_used".
function software_fmt(i: Info): string &is_used
{
return fmt("%s %s", i$name, software_fmt_version(i$version));
}