Logging GI-Addr

Gregory Sloop gregs at sloop.net
Mon Feb 12 22:35:02 UTC 2018


"  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


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


More information about the dhcp-users mailing list