[Bro] (no subject)

ps sunu pssunu6 at gmail.com
Tue Apr 11 01:10:31 PDT 2017


Hi,

                i need known-device.log "dhcp_host_name" field into
dhcp.log below my code which will write  dhcp_host_name into dhcp.log
but its giving error many way i tried many ways but not find solution
and , some times its not

giving error but its not writing dhcp_host_name into dhcp.log



##! Tracks MAC address with hostnames seen in DHCP traffic. They are logged into
##! ``devices.log``.

@load /opt/bro/share/bro/policy/misc/known-devices.bro

module Known1;

export {
    redef record DHCP::Info += {
      ## The value of the DHCP host name option, if seen.
      dhcp_host_name:    string    &log &optional;
   };
}

event dhcp_request(c: connection, msg: dhcp_msg, req_addr: addr,
serv_addr: addr, host_name: string)
   {
   if ( msg$h_addr == "" )
      return;

   if ( msg$h_addr !in known_devices )
      {
      add known_devices[msg$h_addr];
      c$dhcp$$dhcp_host_name = host_name;
      }
   }

event dhcp_inform(c: connection, msg: dhcp_msg, host_name: string)
   {
   if ( msg$h_addr == "" )
      return;

   if ( msg$h_addr !in known_devices )
      {
      add known_devices[msg$h_addr];
      c$dhcp$$dhcp_host_name = host_name;
      }
   }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20170411/f123dfb3/attachment.html 


More information about the Bro mailing list