BugZero updated this defect 58 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/22/2024
Smart Assurance - SMARTS
No affected releases provided.
No fixed releases provided.
How do you convert a hexadecimal string to an IP address in Smarts ASL?Trying to use the hexToIP method(operation) to convert a hexadecimal string to an IP address in ASL, but it seems to only work for the Availability Manager product.
Availability Manager is the only Smarts product that can use the hexToIP method(operation).
The following sample code shows how a hexadecimal string can be converted to an IP address in Smarts ASL://Break the hexadecimal string into two character pieces:my_input = "0A011903";START {input = my_input;ip : HEX_IP} do {print(ip);stop();}HEX_IP {o1 : READ_HEX_BYTEo2 : READ_HEX_BYTEo3 : READ_HEX_BYTEo4 : READ_HEX_BYTE} do {return o1 . "." . o2 . "." . o3 . "." . o4;}// To read only 2 hex chars, we need to use 2 '1 character' matchesREAD_HEX_BYTE {c : rep(char, 2)} do {h = MY_HEX(c);return h;}// We then essentially interpret those two characters as a hex string// (the integer equivalent is what gets saved)MY_HEX(x) {input = x;i : hex} do {return i;}OUTPUT:10.1.25.3