Skip to content

Commit

Permalink
conversion to ip
Browse files Browse the repository at this point in the history
  • Loading branch information
mgheorghe committed Nov 22, 2023
1 parent ffa2e03 commit fbd3368
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dpugen/dashgen/dash_route_rule_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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): {
Expand Down

0 comments on commit fbd3368

Please sign in to comment.