MAC create with
Create MAC with extracts first 12 hexadecimal characters from input string and normalizes them as an MAC address. It is not necessary to have continuous sequence of characters. Non hexadecimal characters therefore are skipped.
Therefore retyping can be used on any representations of mac addresses.
Block accepts as an input any string value (on right side) and returns internal data type representing MAC address.
In case value can’t be retyped to mac address there is returned type with default address of 000000000000.
XML representation of empty mac_create block:
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="mac_create"/>
</xml>
XML representation of mac_create block:
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="mac_create">
<value name="VALUE">
<block type="text">
<field name="TEXT">00:00:00:00:00:00</field>
</block>
</value>
</block>
</xml>
Block is used on the “set mac_datatype to” row in the example:
- Key “mac” is loaded from the “item” dictionary.
- Value is transmitted to the “create MAC with” block.
- Output is variable “mac_datatype” with data type MAC, containing information about manufacturer and normalized value.
{
"user": "administrator",
"mac" : "00:00:00:00:00:11"
}