Implemented checker as described in internal-docs/notes4coding/checker_design.md

This commit is contained in:
DaZuo0122
2026-01-15 19:07:26 +08:00
commit c1c36cdf56
19 changed files with 2172 additions and 0 deletions

16
docs/examples/modbus.json Normal file
View File

@@ -0,0 +1,16 @@
{
"functions": [
{
"function": 3,
"name": "read_holding_registers",
"request": [
{"name":"starting_address","type":"u16"},
{"name":"quantity","type":"u16"}
],
"response": [
{"name":"byte_count","type":"u8"},
{"name":"registers","type":"bytes","length_from":"byte_count"}
]
}
]
}

31
docs/examples/report.json Normal file
View File

@@ -0,0 +1,31 @@
{
"summary": {
"total_packets": 1,
"total_findings": 1,
"fatal": 0,
"error": 1,
"warn": 0,
"info": 0
},
"findings": [
{
"pcap_index": 0,
"event_id": 1,
"severity": "error",
"code": "expected_field_mismatch",
"message": "Field mismatch for quantity",
"flow": {
"src_ip": "10.0.0.10",
"src_port": 51012,
"dst_ip": "10.0.0.20",
"dst_port": 502
},
"observed": {
"field": "quantity",
"observed": 1,
"expected": 2
},
"expected": null
}
]
}

View File

@@ -0,0 +1 @@
{"trace_id":"example-trace","event_id":1,"pcap_index":0,"ts_ns":1736451234567890000,"direction":"c2s","flow":{"src_ip":"10.0.0.10","src_port":51012,"dst_ip":"10.0.0.20","dst_port":502},"expected":{"modbus":{"transaction_id":513,"unit_id":1,"function_code":3},"fields":{"starting_address":0,"quantity":2}}}