Rework the DHCP analyzer to make it compatible again.

This commit is contained in:
Vlad Grigorescu 2013-07-18 21:17:06 -04:00
parent 7838113dc2
commit deeb5ec38e
14 changed files with 623 additions and 275 deletions

View file

@ -0,0 +1,21 @@
##! Utilities specific for DHCP processing.
@load ./main
module DHCP;
export {
## Reverse the octets of an IPv4 IP.
##
## ip: An :bro:type:`addr` IPv4 address.
##
## Returns: A reversed addr.
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]));
}