Issue: 6954
This commit adds the linktype name to the output stream. The name is
determined from the pcap utility function pcap_datalink_val_to_name
"properties": {
"linktype": {
"type": "integer"
+ },
+ "linktype_name": {
+ "type": "string",
+ "description": "the descriptive name of the linktype"
}
},
"additionalProperties": false
return;
}
if (!jb_set_uint(js, "linktype", p->datalink)) {
+ jb_close(js);
return;
}
+
+ const char *dl_name = DatalinkValueToName(p->datalink);
+
+ // Intentionally ignore the return value from jb_set_string and proceed
+ // so the jb object is closed
+ (void)jb_set_string(js, "linktype_name", dl_name == NULL ? "n/a" : dl_name);
+
jb_close(js);
}