summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2020-09-30 16:57:30 +0200
committerXavier Simonart <xavier.simonart@intel.com>2020-10-19 08:50:26 +0000
commitcd690215adb97aee66d355d9bb64a78a55e1defc (patch)
treedc923a9206051793443270b1d8460ce4f325d037 /VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua
parentf9b0da859a9f2a6556f0437d5cff42a0648dcab2 (diff)
Support dataplane subnet mask & latency histogram
There is a new parameter in the config_file: dataplane_subnet_mask. This parameter is added to the dataplane IP addresses and is needed by the Linux stack to deal with some protocols (e.g. ARP). If not present, the default value of 24 will be used. In the end, this will make sure that IP addresses in the rapid.env file will have this mask, e.g. /24 If you use other tools than createrapid.py to create the rapid.env file, make sure to add the mask. This commit also introduces a change when exiting: we only copy the prox.log files from the different prox instances in case we expect a new prox.log file to be created in these instances. When using a valid format.yaml file, the tool will now also send the latency distribution data (histogram) to the URL. The tool is now also checking the value of bucket_size_exp: it needs to be 11 or more. Change-Id: I633cdc64ef687fdb6625be1e7482a5a371f83e93 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua b/VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua
index 237c385b..1b4c657b 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua
@@ -21,6 +21,22 @@ function convertIPToHex(ip)
return "IP ADDRESS ERROR"
end
+ local chunks = {ip:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)(\/%d+)$")}
+ if #chunks == 5 then
+ for i,v in ipairs(chunks) do
+ if i < 5 then
+ if tonumber(v) > 255 then
+ print ("IPV4 ADDRESS ERROR: ", ip)
+ return "IPV4 ADDRESS ERROR"
+ end
+ address_chunks[#address_chunks + 1] = string.format ("%02x", v)
+ end
+ end
+ result = table.concat(address_chunks, " ")
+ print ("Hex IPV4: ", result)
+ return result
+ end
+
local chunks = {ip:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)$")}
if #chunks == 4 then
for i,v in ipairs(chunks) do