Params: Add parameter types for IP addresses in various forms.
Review Request #316 - Created Nov. 17, 2010 and submitted
| Information | |
|---|---|
| Gabe Black | |
| gem5 | |
| Reviewers | |
| Default | |
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 or by "/e.f.g.h" where e-h are from decimal 0 to 255 and which is all 1 bits followed by all 0 bits when represented in binary. 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.
Posted (Nov. 17, 2010, 10:24 a.m.)
-
src/python/m5/params.py (Diff revision 1) -
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.
-
src/python/m5/util/convert.py (Diff revision 1) -
Shouldn't this be "< 256"? (and "< 32" below too?) Didn't you just point out this same bug in some existing code here?
Posted (Nov. 17, 2010, 11:11 a.m.)
-
src/base/inet.cc (Diff revision 1) -
This is somewhat backwards as cprintf can take an ostream. I'd make operator<< do the right thing with ccprintf and then have string() use it. Just like EthAddr.
-
src/python/m5/params.py (Diff revision 1) -
There are already checks in convert for this. Seems odd to do it here too.
-
src/python/m5/params.py (Diff revision 1) -
There are already checks in convert for this. Seems odd to have them in both places.
Posted (Nov. 20, 2010, 1:35 a.m.)
-
src/python/m5/util/convert.py (Diff revision 3) -
I net mask could also be specified like 10.3.4.5/255.255.0.0. Perhaps handling that case would be good too. Minimally, I think the /16 should be converted to the long form netmask and that should be passed around.
-
src/python/m5/util/convert.py (Diff revision 3) -
Why hex for max port here and decimal for max byte above?
Review request changed
Updated (Nov. 20, 2010, 3:40 p.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+352) |
Posted (Nov. 22, 2010, 2:43 a.m.)
-
src/base/inet.cc (Diff revision 5) -
I don't see how this works. after the first nibble, wont everything be 0?
