> On 2010-11-17 18:24:38, Steve Reinhardt wrote: > > src/python/m5/util/convert.py, line 261 > > <http://reviews.m5sim.org/r/316/diff/1/?file=5208#file5208line261> > > > > Shouldn't this be "< 256"? (and "< 32" below too?) Didn't you just > > point out this same bug in some existing code here?
< 256 yes, < 32 no. The max byte value is 255, but the netmask can have 0 to 32 bits set I think, where 0 would be all possible IPs and 32 would be one specific IP. Let me know if that's not true. > On 2010-11-17 18:24:38, Steve Reinhardt wrote: > > src/python/m5/params.py, line 721 > > <http://reviews.m5sim.org/r/316/diff/1/?file=5207#file5207line721> > > > > All this kwargs stuff seems like overkill, and I'm not sure all the > > corner cases are handled sensibly (passing in args[0] as elseVal for both > > ip and netmask seems particularly suspect), but now that it's written I > > guess there's no point in deleting it. A comment that lists all the > > options for specifying a value would be helpful though. This is based off of the implementation of the Range param type, and lets you set the ip and port or ip and netmask explicitly. That's very handy when generating those values programmatically which is exactly how I've been using them. You're right that not all cases are covered. If kargs has neither ip nor netmask and one value args, that will end up in both ip and netmask. I'll look it over and see if some of the gaps can be covered easily. I was mimicking the Range type like I mentioned, but maybe that's not the best approach. - Gabe ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/316/#review489 ----------------------------------------------------------- On 2010-11-17 13:54:35, Gabe Black wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.m5sim.org/r/316/ > ----------------------------------------------------------- > > (Updated 2010-11-17 13:54:35) > > > Review request for Default. > > > Summary > ------- > > Params: Add parameter types for IP addresses in various forms. > > New parameter forms are: > IP address in the format "a.b.c.d" where a-d are from decimal 0 to 255. > IP address with netmask which is an IP followed by "/n" where n is a netmask > length in bits from decimal 0 to 32. These can also be specified as an > integral IP and netmask passed in separately. > IP address with port which is an IP followed by ":p" where p is a port index > from decimal 0 to 65535. These can also be specified as an integral IP and > port value passed in separately. > > > Diffs > ----- > > src/base/inet.hh 634d88f0dbd4 > src/base/inet.cc 634d88f0dbd4 > src/python/m5/params.py 634d88f0dbd4 > src/python/m5/util/convert.py 634d88f0dbd4 > src/python/swig/inet.i 634d88f0dbd4 > > Diff: http://reviews.m5sim.org/r/316/diff > > > Testing > ------- > > > Thanks, > > Gabe > >
_______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
