From fbbc602d9efd9f88ce35b09c02f1226881c32bfb Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Fri, 14 Apr 2017 11:57:47 +0200 Subject: Bugfixing for IRATI prototype and QEMU testbed --- rumba/prototypes/irati_templates.py | 313 +++++++++++++++++++----------------- 1 file changed, 162 insertions(+), 151 deletions(-) (limited to 'rumba/prototypes/irati_templates.py') diff --git a/rumba/prototypes/irati_templates.py b/rumba/prototypes/irati_templates.py index 0f3ef05..b8d9788 100644 --- a/rumba/prototypes/irati_templates.py +++ b/rumba/prototypes/irati_templates.py @@ -35,189 +35,197 @@ da_map_base = { # Template for a normal DIF configuration file -normal_dif_base = { - "difType" : "normal-ipc", - "dataTransferConstants" : { - "addressLength" : 2, - "cepIdLength" : 2, - "lengthLength" : 2, - "portIdLength" : 2, - "qosIdLength" : 2, - "rateLength" : 4, - "frameLength" : 4, - "sequenceNumberLength" : 4, - "ctrlSequenceNumberLength" : 4, - "maxPduSize" : 10000, - "maxPduLifetime" : 60000 +normal_dif_base = { + "difType": "normal-ipc", + "dataTransferConstants": { + "addressLength": 2, + "cepIdLength": 2, + "lengthLength": 2, + "portIdLength": 2, + "qosIdLength": 2, + "rateLength": 4, + "frameLength": 4, + "sequenceNumberLength": 4, + "ctrlSequenceNumberLength": 4, + "maxPduSize": 10000, + "maxPduLifetime": 60000 }, - "qosCubes" : [ { - "name" : "unreliablewithflowcontrol", - "id" : 1, - "partialDelivery" : False, - "orderedDelivery" : True, - "efcpPolicies" : { - "dtpPolicySet" : { - "name" : "default", - "version" : "0" + "qosCubes": [ + { + "name": "unreliablewithflowcontrol", + "id": 1, + "partialDelivery": False, + "orderedDelivery": True, + "efcpPolicies": { + "dtpPolicySet": { + "name": "default", + "version": "0" }, - "initialATimer" : 0, - "dtcpPresent" : True, - "dtcpConfiguration" : { - "dtcpPolicySet" : { - "name" : "default", - "version" : "0" + "initialATimer": 0, + "dtcpPresent": True, + "dtcpConfiguration": { + "dtcpPolicySet": { + "name": "default", + "version": "0" }, - "rtxControl" : False, - "flowControl" : True, - "flowControlConfig" : { - "rateBased" : False, - "windowBased" : True, - "windowBasedConfig" : { - "maxClosedWindowQueueLength" : 10, - "initialCredit" : 200 + "rtxControl": False, + "flowControl": True, + "flowControlConfig": { + "rateBased": False, + "windowBased": True, + "windowBasedConfig": { + "maxClosedWindowQueueLength": 10, + "initialCredit": 200 } } } } }, { - "name" : "reliablewithflowcontrol", - "id" : 2, - "partialDelivery" : False, - "orderedDelivery" : True, + "name": "reliablewithflowcontrol", + "id": 2, + "partialDelivery": False, + "orderedDelivery": True, "maxAllowableGap": 0, - "efcpPolicies" : { - "dtpPolicySet" : { - "name" : "default", - "version" : "0" + "efcpPolicies": { + "dtpPolicySet": { + "name": "default", + "version": "0" }, - "initialATimer" : 0, - "dtcpPresent" : True, - "dtcpConfiguration" : { - "dtcpPolicySet" : { - "name" : "default", - "version" : "0" + "initialATimer": 0, + "dtcpPresent": True, + "dtcpConfiguration": { + "dtcpPolicySet": { + "name": "default", + "version": "0" }, - "rtxControl" : True, - "rtxControlConfig" : { - "dataRxmsNmax" : 5, - "initialRtxTime" : 1000 + "rtxControl": True, + "rtxControlConfig": { + "dataRxmsNmax": 5, + "initialRtxTime": 1000 }, - "flowControl" : True, - "flowControlConfig" : { - "rateBased" : False, - "windowBased" : True, - "windowBasedConfig" : { - "maxClosedWindowQueueLength" : 10, - "initialCredit" : 200 + "flowControl": True, + "flowControlConfig": { + "rateBased": False, + "windowBased": True, + "windowBasedConfig": { + "maxClosedWindowQueueLength": 10, + "initialCredit": 200 } } } } - } ], + } + ], "knownIPCProcessAddresses": [], - "addressPrefixes" : [ { - "addressPrefix" : 0, - "organization" : "N.Bourbaki" + "addressPrefixes": [ + { + "addressPrefix": 0, + "organization": "N.Bourbaki" }, { - "addressPrefix" : 16, - "organization" : "IRATI" - } ], - - "rmtConfiguration" : { - "pffConfiguration" : { - "policySet" : { - "name" : "default", - "version" : "0" + "addressPrefix": 16, + "organization": "IRATI" + } + ], + + "rmtConfiguration": { + "pffConfiguration": { + "policySet": { + "name": "default", + "version": "0" } }, - "policySet" : { - "name" : "default", - "version" : "1" + "policySet": { + "name": "default", + "version": "1" } }, - "enrollmentTaskConfiguration" : { - "policySet" : { - "name" : "default", - "version" : "1", - "parameters" : [ { - "name" : "enrollTimeoutInMs", - "value" : "10000" - }, { - "name" : "watchdogPeriodInMs", - "value" : "30000" - }, { - "name" : "declaredDeadIntervalInMs", - "value" : "120000" - }, { - "name" : "neighborsEnrollerPeriodInMs", - "value" : "0" - }, { - "name" : "maxEnrollmentRetries", - "value" : "0" - } ] + "enrollmentTaskConfiguration": { + "policySet": { + "name": "default", + "version": "1", + "parameters": [ + { + "name": "enrollTimeoutInMs", + "value": "10000" + }, { + "name": "watchdogPeriodInMs", + "value": "30000" + }, { + "name": "declaredDeadIntervalInMs", + "value": "120000" + }, { + "name": "neighborsEnrollerPeriodInMs", + "value": "0" + }, { + "name": "maxEnrollmentRetries", + "value": "0" + } + ] } - }, + }, - "flowAllocatorConfiguration" : { - "policySet" : { - "name" : "default", - "version" : "1" + "flowAllocatorConfiguration": { + "policySet": { + "name": "default", + "version": "1" } }, - "namespaceManagerConfiguration" : { - "policySet" : { - "name" : "default", - "version" : "1" + "namespaceManagerConfiguration": { + "policySet": { + "name": "default", + "version": "1" } }, - "securityManagerConfiguration" : { - "policySet" : { - "name" : "default", - "version" : "1" + "securityManagerConfiguration": { + "policySet": { + "name": "default", + "version": "1" } }, - "resourceAllocatorConfiguration" : { - "pduftgConfiguration" : { - "policySet" : { - "name" : "default", - "version" : "0" + "resourceAllocatorConfiguration": { + "pduftgConfiguration": { + "policySet": { + "name": "default", + "version": "0" } } }, - "routingConfiguration" : { - "policySet" : { - "name" : "link-state", - "version" : "1", - "parameters" : [ { - "name" : "objectMaximumAge", - "value" : "10000" - },{ - "name" : "waitUntilReadCDAP", - "value" : "5001" - },{ - "name" : "waitUntilError", - "value" : "5001" - },{ - "name" : "waitUntilPDUFTComputation", - "value" : "103" - },{ - "name" : "waitUntilFSODBPropagation", - "value" : "101" - },{ - "name" : "waitUntilAgeIncrement", - "value" : "997" - },{ - "name" : "routingAlgorithm", - "value" : "Dijkstra" - }] + "routingConfiguration": { + "policySet": { + "name": "link-state", + "version": "1", + "parameters": [ + { + "name": "objectMaximumAge", + "value": "10000" + }, { + "name": "waitUntilReadCDAP", + "value": "5001" + }, { + "name": "waitUntilError", + "value": "5001" + }, { + "name": "waitUntilPDUFTComputation", + "value": "103" + }, { + "name": "waitUntilFSODBPropagation", + "value": "101" + }, { + "name": "waitUntilAgeIncrement", + "value": "997" + }, { + "name": "routingAlgorithm", + "value": "Dijkstra" + } + ] } } } @@ -237,10 +245,12 @@ def ps_set(d, k, v, parms): d[k]["parameters"][i]["value"] = value break else: - d[k]["parameters"].append({ 'name': name, 'value': value }) + d[k]["parameters"].append({'name': name, 'value': value}) elif len(parms) > 0: - d[k]["parameters"] = [ { 'name': p.split('=')[0], 'value': p.split('=')[1]} for p in parms ] + d[k]["parameters"] = [ + {'name': p.split('=')[0], 'value': p.split('=')[1]} + for p in parms] d[k]["name"] = v @@ -252,7 +262,8 @@ def dtp_ps_set(d, v, parms): def dtcp_ps_set(d, v, parms): for i in range(len(d["qosCubes"])): - ps_set(d["qosCubes"][i]["efcpPolicies"]["dtcpConfiguration"], "dtcpPolicySet", v, parms) + ps_set(d["qosCubes"][i]["efcpPolicies"]["dtcpConfiguration"], + "dtcpPolicySet", v, parms) policy_translator = { @@ -267,7 +278,8 @@ policy_translator = { d["namespaceManagerConfiguration"], "policySet", v, p), 'security-manager': lambda d, v, p: ps_set( d["securityManagerConfiguration"], "policySet", v, p), - 'routing': lambda d, v, p: ps_set(d["routingConfiguration"], "policySet", v, p), + 'routing': lambda d, v, p: ps_set( + d["routingConfiguration"], "policySet", v, p), 'resource-allocator.pduftg': lambda d, v, p: ps_set( d["resourceAllocatorConfiguration"], "policySet", v, p), 'efcp.*.dtcp': None, @@ -308,7 +320,7 @@ def translate_security_path(d, path, ps, parms): ps_set(d["default"], tr[component], ps, parms) - else: # profile is the name of a DIF + else: # profile is the name of a DIF if "specific" not in d: d["specific"] = [] j = -1 @@ -317,14 +329,14 @@ def translate_security_path(d, path, ps, parms): j = i break - if j == -1: # We need to create an entry for the new DIF - d["specific"].append({"underlyingDIF" : profile + ".DIF"}) + if j == -1: # We need to create an entry for the new DIF + d["specific"].append({"underlyingDIF": profile + ".DIF"}) ps_set(d["specific"][j], tr[component], ps, parms) def translate_policy(difconf, path, ps, parms): - if path =='efcp.*.dtcp': + if path == 'efcp.*.dtcp': dtcp_ps_set(difconf, ps, parms) elif path == 'efcp.*.dtp': @@ -335,4 +347,3 @@ def translate_policy(difconf, path, ps, parms): else: policy_translator[path](difconf, ps, parms) - -- cgit v1.2.3