Repository navigation
Conversation
sjrx-claude-sandbox
force-pushed
the
feat/validators-network-dhcp-misc
branch
from
October 24, 2026 14:41
a652191 to
a5c060c
Compare
Unit Test Results (grammar engine false)1 425 tests 1 425 ✅ 1m 6s ⏱️ Results for commit 4175a8b. ♻️ This comment has been updated with latest results. |
Unit Test Results (grammar engine true)1 425 tests 1 425 ✅ 52s ⏱️ Results for commit 4175a8b. ♻️ This comment has been updated with latest results. |
sjrx-claude-sandbox
force-pushed
the
feat/validators-network-dhcp-misc
branch
3 times, most recently
from
October 24, 2026 17:11
8c5ff95 to
6bb8773
Compare
…ings (network-dhcp-misc batch) Adds 33 grammar validators (36 registrations) for systemd-networkd .network settings that previously had no value validation: DHCPv4/DHCPv6/DHCP-server raw options, DUID type and raw data, uplink/outgoing interfaces, MUD URLs, Domains=/NTP=/DNSSECNegativeTrustAnchors=, RequiredForOnline=, and assorted enums. Each is modelled on the C parser at systemd 0f0682b773 and documented with man/parser/leaf/test links; shared pieces (safe_ato* numbers with 0b/0o/sign handling, case-insensitive booleans, C-escape words, DNS names, typed DHCP option payloads) live in BatchNetworkDhcpMiscCombinators.kt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…misc batch) - IgnoreCarrierLoss= / IPv6OnlyPreferredSec=: replace the shared TIME_VALUE with a structural PARSE_SEC_TIMESPAN that follows parse_time() exactly (1h30min, 55s500ms, .5s and 5s.5 were flagged). - DHCP raw options: after `ipv6address` take the whole coalesced colon run, then an address not starting with ':' (ipv6address::2001:db8::1 was flagged, ipv6address:::1 was accepted). - [DHCPv6] SendOption=/SendVendorOption= and UplinkInterface= now dispatch on key / section, as the C does, via KeyOrSectionDispatchingGrammarOptionValue. - Interface indexes are range- and octal-checked like parse_ifindex. - safe_ato numbers: allow whitespace after '/' or ':' and sign/whitespace after a 0b/0o prefix. - Note in KDoc that deprecated sections are not recognised by the plugin. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…names Several batch branches declared public helpers with the same name in the shared grammar package (SafeAtouTerminal, UINT32_LIMIT, safeAtou, SafeAtoNumberTerminal, BOOLEAN_ANY_CASE, COALESCED_COLONS). Each branch compiled alone but any two merged together would not. Prefix them per family so the batch PRs can merge in any order; consolidating them into Combinators.kt is left for a follow-up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Checked against systemd's real parsers built at 0f0682b773 (sd-check): - [DHCPServer] IPv6OnlyPreferredSec=: flag durations below 300s (MIN_V6ONLY_WAIT_USEC); systemd ignores them outside its test mode. - [Network] Domains=: flag localhost, localhost.localdomain and their subdomains (is_localhost), with or without the ~ prefix. - [DHCPServer] ServerAddress=: flag 127.0.0.0/8 and 169.254.0.0/16. - [DHCPv4]/[DHCPv6] UserClass=, VendorClass=: flag entries that unquote to the empty string. - NTP=/Domains=/DNSSECNegativeTrustAnchors=: a doubled backslash must start a valid dns_label_unescape escape (foo\\bar, foo\\256 refused). Adds NetworkDhcpMiscCheckedSpan (a span predicate over a structured sub-grammar) and networkDhcpMiscParseSecUsec for these checks, and tests with the exact values systemd accepts and rejects. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…c validators 242.x's BOOLEAN, BOOLEAN_FALSE and BOOLEAN_TRUE now ignore case, as parse_boolean() does, so the batch's own NETWORK_DHCP_MISC_BOOLEAN_ANY_CASE and BOOLEAN_FALSE_ANY_CASE copies are gone. DNSOverTLS=, LLMNR=/MulticastDNS= and EmitLLDP= (parse_boolean first, then a case-sensitive streq lookup) now use the explicit PreferValidAlternativeCombinator(names, BOOLEAN) form. Tests gain mixed-case booleans and mixed-case names that must stay invalid, checked against systemd's parsers at 0f0682b773. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ors (#563) Replace the batch's NetworkDhcpMiscSafeAtoNumberTerminal with the shared SafeAtoTerminal, written out at every call site with inclusive bounds: PVID=, [Link] Group=, SubnetId= (base 16), DUIDType=, ServerAddress= prefix, the SendOption= codes and enterprise id, and the uint8/16/32 option payloads. Drop the optional WhitespaceTerminal in front of those numbers; the terminal models C's whitespace exactly. RequestOptions= uses acceptsWhitespace = false, since each code is a whitespace-split word. IFNAME_OR_IFINDEX now asks SafeAtoTerminal.valueOf() for parse_ifindex() and spans the whole value. Verdict changes, all confirmed with systemd's parsers at 0f0682b773: - flagged: RequestOptions= 0b 1, 0o 7, 0b +1, 0b -0; a no-break space before a number after ':' or '/' - accepted: a leading \v (whole values and after ':' or '/'), 0b\v1, the strtoul wrap-around in DUIDType=, and UplinkInterface= / OutgoingInterface= 0b 1, 0o 7, \v5 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ship config_parse_dhcp_or_ra_route_table for NETWORK_CONFIG_SOURCE_DHCP4, DHCP6 and NDISC ([DHCPv4], [DHCPv6] and [IPv6AcceptRA] RouteTable=) with the shared ROUTE_TABLE_FROM_STRING grammar. The parser adds nothing to manager_get_route_table_from_string(): no empty special case and no extra bound. Possible networkd.conf names stay accepted. sd-check agrees on all three keys. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sjrx-claude-sandbox
force-pushed
the
feat/validators-network-dhcp-misc
branch
from
October 24, 2026 18:38
6bb8773 to
4175a8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.