mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
21 lines
411 B
Text
21 lines
411 B
Text
##! 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]));
|
|
}
|
|
|