[ip6] rename methods fully initializing an Ip6::Address/Prefix (#13169)

This commit renames several methods in `Ip6::Address`,
`Ip6::InterfaceIdentifier`, `Ip6::Prefix`, and `Ip4::Address` that
fully initialize the object from `Set...()` to `Init...()`.

This creates a clear semantic distinction in the API:
- `Init...()`: Fully (re-)initializing the object.
- `Set...()`: Modifies a specific property or a sub-component of
   the object (e.g., `SetPrefix()`,  `SetLocator()`,
   `SetSubnetId()`).

Some examples of renames include:
- `SetFromExtAddress()` -> `InitFromExtAddress()`
- `SetToLocator()` -> `InitAsLocator()`
- `SetToLinkLocalAddress()` -> `InitAsLinkLocalAddress()`
- `SetToRoutingLocator()` -> `InitAsRoutingLocator()`
- `SetToAnycastLocator()` -> `InitAsAnycastLocator()`
- `SetToIp4Mapped()` -> `InitAsIp4Mapped()`

All calls to these methods across the codebase have been updated
to reflect the new names.
This commit is contained in:
Abtin Keshavarzian
2026-05-28 20:52:05 -07:00
committed by GitHub
parent e1b34bc5bc
commit 2a2d4be953
52 changed files with 154 additions and 148 deletions
+1 -1
View File
@@ -4997,7 +4997,7 @@ void TestDhcp6Pd(void)
prefix = PrefixFromString("2001:db8:cafe:0::", 64);
shortPrefix.Set(prefix.GetBytes(), 48);
shortPrefix.InitFrom(prefix.GetBytes(), 48);
ReportPdPrefixesAsRa({Pio(shortPrefix, kValidLitime, kPreferredLifetime)});
sExpectedRios.Add(prefix);