lang: core: util: Add hostname mapper function
This adds a new util package with some useful functionality which could be implemented as pure mcl, but instead we add it here as a good place to help with code reuse.
This commit is contained in:
12
examples/lang/hostname_mapper.mcl
Normal file
12
examples/lang/hostname_mapper.mcl
Normal file
@@ -0,0 +1,12 @@
|
||||
import "util"
|
||||
|
||||
$m = {
|
||||
"00:11:22:33:44:55" => "hostname1",
|
||||
"00:11:22:33:44:56" => "hostname1",
|
||||
"aa:bb:cc:dd:ee:fe" => "hostname2",
|
||||
"aa:bb:cc:dd:ee:ff" => "hostname2",
|
||||
}
|
||||
|
||||
print "mapper" {
|
||||
msg => util.hostname_mapper($m),
|
||||
}
|
||||
Reference in New Issue
Block a user