achanda / ipnetwork

A library to work with CIDRs in rust
Apache License 2.0
121 stars 38 forks source link

Fix network handling. #118

Open Barre opened 4 years ago

Barre commented 4 years ago

Fixes:

Adds:

If there is no plans on breaking backwards compatibility, the ip() method should be re-introduced in my changes. Also, if ip is not kept, there would be no need for network() to compute the network address anymore as the arithmetic can be done in the constructor and the resulting ip stored in the struct, discarding the original IpAddr.

achanda commented 4 years ago

Sorry, it took me a while to reply, and thanks for the PR. I still have to figure out a good workflow of deprecating APIs and removing them eventually. Hence I am not a fan of changing the behaviour of ip right now.

Barre commented 4 years ago

@achanda I understand!

I'll update my PR with just the fix for is_subnet_of in the next few days then.

ctrlcctrlv commented 1 year ago

Probably superseded by #177.