> On Nov. 24, 2014, 5:55 p.m., Jie Yu wrote: > > I would sugguest using static functions to create IPAddress instances. > > Also, you may wanna mimic the interfaces provided by Python ipaddress module > > https://docs.python.org/3/library/ipaddress.html > > > > IPAddress addr = IPAddress::IPv4Address("0.1.1.1"); > > IPAddress addr = IPAddress::IPv4Address(...); // in_addr version > > IPAddress addr = IPAddress::IPv6Address(...); // in6_addr version > > ... > > > > IPNetwork network = IPNetwork::IPv4Network("1.1.1.1/8"); > > IPNetwork network = IPNetwork::IPv4Network(ipv4Addr, prefix); > > IPNetwork network = IPNetwork::IPv6Network("2001:db8::0/96"); > > ... > > > > It might be good to separate "IPAddress" and "IPNetwork" concepts. > > Dominic Hamon wrote: > Would we use the address/network separation? looking through the > callsites I don't think we would.
I would imagine that some of the routing library and tc filter functions will use IPNetwork and Node will use IPAddress. - Jie ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28387/#review62806 ----------------------------------------------------------- On Nov. 24, 2014, 5:49 a.m., Evelina Dumitrescu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28387/ > ----------------------------------------------------------- > > (Updated Nov. 24, 2014, 5:49 a.m.) > > > Review request for mesos and Dominic Hamon. > > > Bugs: MESOS-1919 > https://issues.apache.org/jira/browse/MESOS-1919 > > > Repository: mesos-git > > > Description > ------- > > Create an IP address abstraction such that every callsite does not need to > check the family and get the right address. > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/include/Makefile.am > 00a4edd0bcde3f92630fb173aeb4fff8e9139f77 > 3rdparty/libprocess/3rdparty/stout/include/stout/ipaddress.hpp PRE-CREATION > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp > a992bd9f7caf3abcc2c5e14519ca7e3ac045bb4b > 3rdparty/libprocess/3rdparty/stout/tests/net_tests.cpp > 425132e5d7c3770be4a5a39feea5a2f22179b871 > > Diff: https://reviews.apache.org/r/28387/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Evelina Dumitrescu > >
