This plugin validates MAC-addresses. The following MAC-address-formats are supported:
1 # Backup-and-Restore: user:/tests/mac
3 # Mount `macaddr` plugin
4 sudo kdb mount macconf.ecf user:/tests/mac macaddr
6 # Setting a MAC address using colons
7 kdb set user:/tests/mac/mac1 00:A0:C9:14:C8:29
10 # Setting a MAC address using hyphens
11 kdb set user:/tests/mac/mac2 00-A0-C9-14-C8-29
14 # Setting a MAC address using one hyphen
15 kdb set user:/tests/mac/mac3 00A0C9-14C829
18 # Setting a MAC address using an integer value
19 kdb set user:/tests/mac/mac4 17661175009296
22 # Marking written keys as MAC addresses
23 kdb meta-set user:/tests/mac/mac1 check/macaddr ""
24 kdb meta-set user:/tests/mac/mac2 check/macaddr ""
25 kdb meta-set user:/tests/mac/mac3 check/macaddr ""
26 kdb meta-set user:/tests/mac/mac4 check/macaddr ""
28 # Setting a MAC address using an invalid address
29 kdb set user:/tests/mac/mac1 00:G1:C9:14:C8:29
32 # Setting a MAC address using an invalid address
33 kdb set user:/tests/mac/mac1 00:E1:C914:C8:29
36 # Setting a MAC address using an invalid address
37 kdb set user:/tests/mac/mac4 281474976710656
40 # Retrieving a MAC address with colons as integer
41 kdb get user:/tests/mac/mac1
44 # Retrieving a MAC address with hyphens as integer
45 kdb get user:/tests/mac/mac2
48 # Retrieving a MAC address with one hyphen as integer
49 kdb get user:/tests/mac/mac3
52 # Retrieving an integer MAC address
53 kdb get user:/tests/mac/mac4
56 kdb rm -r user:/tests/mac
57 sudo kdb umount user:/tests/mac
None.
None.