mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Rework the DHCP analyzer to make it compatible again.
This commit is contained in:
parent
7838113dc2
commit
deeb5ec38e
14 changed files with 623 additions and 275 deletions
21
scripts/base/protocols/dhcp/utils.bro
Normal file
21
scripts/base/protocols/dhcp/utils.bro
Normal 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]));
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue