Class MsftNetIpAddress

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.network.MsftNetIpAddress

@ShallowImmutable public class MsftNetIpAddress extends Object
Immutable representation of IPv4 and IPv6 address configuration for a Network Adapter on a Windows system.

Fields correspond to properties retrieved from the MSFT_NetIPAddress class in the root/StandardCimv2 namespace.

Together, with MsftDnsClientServerAddress, this class aims to be a replacement for Win32NetworkAdapterConfiguration

Usage example

MsftNetIpAddress address = MsftNetIpAddress.builder()
    .interfaceIndex(1)
    .addressFamily(0)
    .ipv4Address("192.168.0.210")
    .ipv6Address("fe80::abed:1234:5678:9abc")
    .build();

// Create a modified copy
MsftNetIpAddress updated = address.toBuilder()
    .ipv4Address("192.168.0.255")
    .build();

See MsftNetAdapter, for network adapter information.

See MsftDnsClientServerAddress, for information regarding the connected DNS servers of a network adapter.

See MsftNetConnectionProfile, for information regarding the current profile of a network adapter.

Since:
3.0.0
See Also:
  • Field Details

    • interfaceIndex

      @SerializedName("InterfaceIndex") @Nullable @Nullable Long interfaceIndex
      Index of the network interface associated with this IP configuration.
    • interfaceAlias

      @SerializedName("InterfaceAlias") @Nullable @Nullable String interfaceAlias
      User-friendly name of the network interface.
    • addressFamily

      @SerializedName("AddressFamily") @Nullable @Nullable Long addressFamily
      Address family of the IP address.
      • 2 - IPv4
      • 23 - IPv6
    • ipAddress

      @SerializedName("IPAddress") @Nullable @Nullable String ipAddress
      The IP address assigned to the interface (can be IPv4 or IPv6 or both).
    • ipv4Address

      @SerializedName("IPv4Address") @Nullable @Nullable String ipv4Address
      The IPv4 address assigned to the interface, if applicable.
    • ipv6Address

      @SerializedName("IPv6Address") @Nullable @Nullable String ipv6Address
      The IPv6 address assigned to the interface, if applicable.
    • type

      @SerializedName("Type") @Nullable @Nullable Integer type
      Type of IP address.
      • 1 - Unicast
      • 2 - Anycast
    • prefixOrigin

      @SerializedName("PrefixOrigin") @Nullable @Nullable Long prefixOrigin
      Source of the prefix for this IP Address.
      • 0 - Other
      • 1 - Manual
      • 2 - WellKnown
      • 3 - DHCP
      • 4 - RouterAdvertisement
    • suffixOrigin

      @SerializedName("SuffixOrigin") @Nullable @Nullable Long suffixOrigin
      Source of the suffix for the IP address.
      • 0 - Other
      • 1 - Manual
      • 2 - WellKnown
      • 3 - DHCP
      • 4 - Link
      • 5 - Random
    • prefixLength

      @SerializedName("PrefixLength") @Nullable @Nullable Long prefixLength
      Length of the network prefix, in bits.
    • preferredLifetime

      @SerializedName("PreferredLifetime") @Nullable @Nullable MsftNetIpAddress.Datetime preferredLifetime
      Lifetime during which the address is preferred for use. The default value is infinite.
    • validLifeTime

      @SerializedName("ValidLifetime") @Nullable @Nullable MsftNetIpAddress.Datetime validLifeTime
      Total lifetime during which the address is valid. The default value is infinite.
  • Constructor Details

    • MsftNetIpAddress

      public MsftNetIpAddress()
  • Method Details

    • toString

      @NotNull public @NotNull String toString()
      Prints the entity in a JSON pretty-print format
      Overrides:
      toString in class Object
      Returns:
      the String value of the object in JSON pretty-print format