Commit 42fe9f9
committed
categories: add mmap .ndb backend for custom category lists
Introduce a compiled .ndb backend (mmap) for external custom category
matching, with LEGACY / NDB_ONLY / HYBRID modes, while keeping the
existing -G / Aho-Corasick list path unchanged.
Adds ndpi_load_category_ndb_file() / ndpi_unload_category_ndb(),
ndpiReader --category-ndb and --category-ndb-reload-interval, a
polling-based hot-reload helper, offline builder ndpi_gen_categories_bin,
shared hostname normalization (generator + runtime), and on-disk layout
in ndpi_categories_bin.h (domains plus IPv4/IPv6 prefix entries).
The generator writes the database atomically (temporary file + fsync +
rename) so ndpiReader can reload a new valid file without restart.1 parent ea3586e commit 42fe9f9
21 files changed
Lines changed: 3252 additions & 35 deletions
File tree
- doc
- example
- fuzz
- src
- include
- lib
- tests/unit
- windows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
| 415 | + | |
| 416 | + | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
| |||
427 | 433 | | |
428 | 434 | | |
429 | 435 | | |
| 436 | + | |
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
| |||
619 | 626 | | |
620 | 627 | | |
621 | 628 | | |
| 629 | + | |
622 | 630 | | |
623 | 631 | | |
624 | 632 | | |
| |||
0 commit comments