ipnetwork icon indicating copy to clipboard operation
ipnetwork copied to clipboard

Feature Request: ipnetwork.Inverse

Open rgreasley opened this issue 4 years ago • 1 comments

Hello,

Would it be possible to implement an "ipnetwork.Inverse" to get the inverse netmask? Let's say the netmask is 255.255.255.0, the inverse would be 0.0.0.255.

Thanks.

rgreasley avatar Aug 22 '20 15:08 rgreasley

Proposed: Add the following property to IPNetwork.cs

    /// <summary>
    /// Netmask Inverse
    /// example: _netmask == 255.255.255.0 returns the inverse 0.0.0.255
    /// </summary>
    public IPAddress NetmaskInverse
    {
      get
      {
        return IPNetwork.ToIPAddress(~this._netmask, this._family);
      }
    }

ajstadlin avatar Apr 17 '22 02:04 ajstadlin

Implemented as WildcardMask in 2.6.437+ https://en.wikipedia.org/wiki/Wildcard_mask

lduchosal avatar Aug 11 '22 14:08 lduchosal