Skip to content

Add validators for iec_size, fq_codel_size, int, job_mode, reboot_parameter, unit_mounts_for #450

@SJrX

Description

@SJrX

Goal

Batch 4 of 5.

Targets

Function Usages C source Approach
config_parse_iec_size(0) 4 shared/conf-parser.c:974 parse_size(rvalue, 1024, ...) — IEC byte, same shape as tbf_size
config_parse_fq_codel_size(QDISC_KIND_FQ_CODEL) 4 network/tc/fq-codel.c:267 parse_size(rvalue, 1024, ...) — same IEC byte shape
config_parse_int(0) 4 shared/conf-parser.c:959 (DEFINE_PARSER(int, ..., safe_atoi)) signed int (32-bit range)
config_parse_job_mode(0) 4 load-fragment.c:144 (DEFINE_CONFIG_PARSE_ENUM(... job_mode ...)) Enum from job_mode_table
config_parse_reboot_parameter(0) 4 load-fragment.c:353reboot_parameter_is_valid ASCII printable, length ≤ 255, specifier-aware
config_parse_unit_mounts_for(0) 4 load-fragment.c:3111 Whitespace-separated absolute paths (specifier-aware)

Skipped

  • config_parse_string(0) (4 uses) — C parser accepts any string with ltype=0 (no STRING_SAFE/STRING_ASCII flags); a validator here would be functionally equivalent to NullOptionValue and just game the burn-down without helping users.
  • config_parse_hw_addrs(0) (4 uses) — multi-format MAC parser (xx:yy:zz:aa:bb:cc, xxyy.zzaa.bbcc, xx-yy-zz-aa-bb-cc, IPv4, IPv6, infiniband). Doable but the regex would be sprawling; defer to batch 5 if useful.
  • config_parse_socket_listen(SOCKET_SOCKET) (4 uses) — abstract / IPv4 / IPv6 / Unix path / FD variants, defer.
  • config_parse_dhcp_option_tlv(0) (4 uses) — DHCP option TLV byte syntax, defer.
  • config_parse_unit_condition_string(CONDITION_VERSION) (8 uses) — operator version or named-version comparisons, defer (would need specialized grammar per condition variant).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions