zeek/scripts/base/protocols/dhcp/utils.bro
Daniel Thayer e36fcf0190 Fix typos and formatting in the dhcp protocol docs
Also added a link to an RFC and a Bro script (and corrected the name of the
script being referenced).
2013-10-15 16:19:06 -05:00

19 lines
393 B
Text

##! Utilities specific for DHCP processing.
module DHCP;
export {
## Reverse the octets of an IPv4 address.
##
## ip: An IPv4 address.
##
## Returns: A reversed IPv4 address.
global reverse_ip: function(ip: addr): addr;
}
function reverse_ip(ip: addr): addr
{
local octets = split(cat(ip), /\./);
return to_addr(cat(octets[4], ".", octets[3], ".", octets[2], ".", octets[1]));
}