Skip to content

Commit

Permalink
events: pretty printer for QUIC
Browse files Browse the repository at this point in the history
But there isn't much to print.. Version, and SNI.
  • Loading branch information
jasonish committed Jun 28, 2024
1 parent 5550fc2 commit 119530c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions webapp/src/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,12 @@ export function formatEventDescription(event: Event): string {
case "smb": {
const smb = event._source.smb;
return `${smb?.command} - ${smb?.status} (${smb?.dialect})`;
return "";
}
case "ssh": {
const ssh = event._source.ssh;
return `${ssh?.client?.software_version || "Unknown"}/${
ssh?.client?.proto_version || "Unknown"
} => ${ssh?.server?.software_version || "Unknown"}/${
ssh?.server?.proto_version || "Unknown"
}`;
return `${ssh?.client?.software_version || "Unknown"}/${ssh?.client?.proto_version || "Unknown"
} => ${ssh?.server?.software_version || "Unknown"}/${ssh?.server?.proto_version || "Unknown"
}`;
}
case "stats": {
const stats = event._source.stats!;
Expand All @@ -215,6 +212,17 @@ export function formatEventDescription(event: Event): string {
}
return parts.join(" ");
}
case "quic": {
let quic = event._source.quic;
let parts = [];
if (quic.version) {
parts.push(`Version ${quic.version}`);
}
if (quic.sni) {
parts.push(`SNI ${quic.sni}`);
}
return parts.join("; ");
}
default: {
const event_type = event._source.event_type;
if (event_type && event._source[event_type]) {
Expand Down

0 comments on commit 119530c

Please sign in to comment.