haproxy/reg-tests/converter
Manu Nicolas f4edcdf4de MINOR: sample: add a reverse_dom converter
In domain-based routing and policy rules, suffix matching on hostnames is
often easier to express as a prefix match on reversed labels. A dedicated
converter makes this convenient with existing fetches and matchers.

This also has a performance benefit for large maps. Prefix string matches use
the prefix-tree index (PAT_MATCH_BEG with pat_idx_tree_pfx), while end matches
use the string-list index (PAT_MATCH_END with pat_idx_list_str), so
reversed-label lookups can avoid linear suffix scans.

This patch adds "reverse_dom", a string converter that reverses domain labels,
ignores one optional trailing dot on input, and rejects empty labels. It
intentionally leaves trailing-dot handling to the caller so configurations can
choose between exact matches, subdomain-only matches, or an explicit dotted
form built with "concat(.)" for prefix lookups.

Examples:
  example.com      -> com.example
  mail.example.com -> com.example.mail

The documentation is updated and a reg-test covers the converter itself, the
explicit dotted form for "map_beg()", and the subdomain-only "-m beg" case.
2026-05-13 16:49:53 +02:00
..
add_item.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
aes_cbc.vtc REGTESTS: ssl: Add tests for new aes cbc converters 2026-01-15 10:56:27 +01:00
aes_gcm.vtc REGTESTS: converters: check USE_OPENSSL in aes_gcm.vtc 2025-10-31 12:43:00 +01:00
be2dec.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
be2hex.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
bytes.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
digest.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
field.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
fix.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
hmac.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
iif.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
json.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
json_query.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
le2dec.vtc MINOR: sample: Add le2dec (little endian to decimal) sample fetch 2025-08-05 13:47:53 +02:00
mqtt.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
param.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
reverse.vtc MINOR: sample: add a generic reverse converter 2026-05-13 16:45:25 +02:00
reverse_dom.map MINOR: sample: add a reverse_dom converter 2026-05-13 16:49:53 +02:00
reverse_dom.vtc MINOR: sample: add a reverse_dom converter 2026-05-13 16:49:53 +02:00
secure_memcmp.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
sha2.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
url_dec.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
url_enc.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
word.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00