diff --git a/dpugen/dashgen/dash_route_rule_table.py b/dpugen/dashgen/dash_route_rule_table.py index 6405b2c..1a1d62e 100644 --- a/dpugen/dashgen/dash_route_rule_table.py +++ b/dpugen/dashgen/dash_route_rule_table.py @@ -3,7 +3,11 @@ import os import sys -from dpugen.confbase import ConfBase +from dpugen.confbase import ( + ConfBase, + socket_inet_ntoa, + struct_pack +) from dpugen.confutils import common_main @@ -16,11 +20,11 @@ def __init__(self, params={}): def items(self): print(' Generating %s ...' % os.path.basename(__file__), file=sys.stderr) p = self.params - cp = self.cooked_params + ip_int = self.cooked_params for eni_index, eni in enumerate(range(p.ENI_START, p.ENI_START + p.ENI_COUNT * p.ENI_STEP, p.ENI_STEP)): r_vni_id = eni + p.ENI_L2R_STEP - vtep_remote = cp.PAR + eni_index * cp.IP_STEP1 + vtep_remote = socket_inet_ntoa(struct_pack('>L', ip_int.PAR + eni_index * ip_int.IP_STEP1)) self.num_yields += 1 yield { 'DASH_ROUTE_RULE_TABLE:eni-%d:%d:%s/32' % (eni, r_vni_id, vtep_remote): {