Logging GI-Addr

Bill Shirley bill at c3po.polymerindustries.biz
Tue Feb 13 00:23:05 UTC 2018


Yes, that is correct.   Insert that line in with the rest of your logging.

on commit {
     log (
         info,
         concat (
             "Host:", pick-first-value(option fqdn.hostname, option host-name, "(none)"), "=>", pick-first-value(config-option 
server.ddns-hostname, "(none)")
...
             ,"  GIaddr:", pick-first-value(binary-to-ascii(10, 8, ".", packet(24,4)), "(none)")
#            ,"  Circuit:", pick-first-value(binary-to-ascii(10, 8, ":", option agent.circuit-id), "(none)")
#            ,"  Remote:", pick-first-value(option agent.remote-id, "(none)")

             ,"  ReqOpt:", pick-first-value(binary-to-ascii(10, 8, ",", option dhcp-parameter-request-list), "(none)")
         )
     );
}

Bill

On 2/12/2018 5:35 PM, Gregory Sloop wrote:
> Re: Logging GI-Addr
>
> 	"  GIaddr:", pick-first-value(binary-to-ascii(10, 8, ".", packet(24,4)), "(none)")
>
>
>
> So, let me break this down, and see if I understand it correctly.
> Starting from the inside...
>
> Offset into the packet 24 bytes, and return 4 bytes [4 octets].
> ---
>  I think this means that the OP, HType, HLen and HOPS, [4 bytes / 1 octet [each] *4]
>  XID [4 octets / 4 bytes]
>  SECs and FLAGs [4 bytes, 2 octets each*2]
>  Then continue to offset past the CIADDR, YADDR & SIADDR (Four octets, 4 bytes each in IPV4) to get to the GIAddr, at byte 24.
>  Grab 4 bytes, 4 octets
>
>  [The wikipedia page on dhcp is pretty handy here! https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol]
> ---
>
> Convert from binary to ASCII from base 8 to base 10. Separate the items with "."
>
> Grab the first non-null output from that output of binary-to-ascii.
> If there's no GIAddr in this packet, return "(none)"
>
> Do I have that right?
>
> Thanks so much!
>
> -Greg
>
>
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20180212/de25402f/attachment-0001.html>


More information about the dhcp-users mailing list