mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Better hex formatting functions for nbstat
This commit is contained in:
parent
3248b7f539
commit
65f51df590
1 changed files with 2 additions and 2 deletions
|
|
@ -154,8 +154,8 @@ action = function(host)
|
|||
end
|
||||
|
||||
-- MAC prefixes are matched on the first three bytes, all uppercase
|
||||
local prefix = string.upper(string.format("%02x%02x%02x", statistics:byte(1), statistics:byte(2), statistics:byte(3)))
|
||||
mac.address = ("%02x:%02x:%02x:%02x:%02x:%02x"):format( statistics:byte(1), statistics:byte(2), statistics:byte(3), statistics:byte(4), statistics:byte(5), statistics:byte(6) )
|
||||
local prefix = string.upper(stdnse.tohex(statistics:sub(1,3)))
|
||||
mac.address = stdnse.format_mac(statistics:sub(1,6))
|
||||
mac.manuf = mac_prefixes[prefix] or "unknown"
|
||||
|
||||
host.registry['nbstat'] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue