Changeset 289ff7e
- Timestamp:
- Mar 4, 2010 3:18:33 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- c119839
- Parents:
- 6280b1f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
r6280b1f r289ff7e 1256 1256 1257 1257 for idx, s in enumerate(subs): 1258 a = ips.allocate(len(s.interfaces)+2) 1258 net_size = len(s.interfaces)+2 1259 1260 a = ips.allocate(net_size) 1259 1261 if a : 1260 1262 base, num = a 1261 if num < len(s.interfaces) +2:1263 if num < net_size: 1262 1264 raise service_error(service_error.internal, 1263 1265 "Allocator returned wrong number of IPs??") … … 1265 1267 raise service_error(service_error.req, 1266 1268 "Cannot allocate IP addresses") 1269 mask = 2 1270 while 2 **mask < net_size: 1271 mask += 1 1272 1273 netmask = ((2**32-1) ^ (mask**2 -1)) 1274 print "%d %x" % (mask , netmask) 1267 1275 1268 1276 base += 1 … … 1271 1279 topdl.Attribute('ip4_address', 1272 1280 "%s" % ip_addr(base))) 1281 i.attribute.append( 1282 topdl.Attribute('ip4_netmask', 1283 "%s" % ip_addr(int(netmask)))) 1284 1273 1285 hname = i.element.name[0] 1274 1286 if ifs.has_key(hname):
Note: See TracChangeset
for help on using the changeset viewer.