log statement doesn't

Shawn Routhier sar at isc.org
Wed Apr 13 18:02:59 UTC 2016


With what you are doing you need to tag the option125 as an option.  You will also need to
adjust the starting point of your substring as that option has other stuff in it.  From the packet
dump the string would appear to start at byte 8.
>>> log (debug, concat("opt-125: ", substring(option option125,8,7)));
However what you really want to do is to create an option space for Polycon to properly encode / decode
the vendor string.  The following appears to get the name properly from a modified version of the
option.

option space polycon;
option polycon.name code 1 = text;
option vendor.polycon code 13885 = encapsulate polycon;

if (exists polycon.name) {
log (info, concat("polycon:", option polycon.name));

}

Adding additional sub-options is left as an exercise to the reader.

Shawn

> On Apr 12, 2016, at 7:48 AM, Doug Hughes <doug at will.to> wrote:
> 
> Thanks, Simon
> 
> I now have the prefix string printed.. So that's good, but no matter what I seem to put for the substring offset, there's nothing further printed. I'm scratching my head because I can see the text in the package and I just wish there was an easier way to extract it.
> 
> Here's the raw:
> 0110  00 00 00 00 00 00 63 82 53 63 35 01 01 39 02 02   ......c.Sc5..9..
> 0120  4e 37 0a 01 1c a0 42 03 04 2a 02 06 0f 33 04 00   N7....B..*...3..
> 0130  00 a8 c0 3c 76 00 00 36 3d 71 01 07 50 6f 6c 79   ...<v..6=q..Poly
> 0140  63 6f 6d 02 15 53 6f 75 6e 64 50 6f 69 6e 74 49   com..SoundPointI
> 0150  50 2d 53 50 49 50 5f 33 33 30 03 10 32 33 34 35   P-SPIP_330..2345
> 0160  2d 31 32 32 30 30 2d 30 30 31 2c 31 04 1e 53 49   -12200-001,1..SI
> 0170  50 2f 33 2e 32 2e 34 2e 30 32 36 37 2f 33 31 2d   P/3.2.4.0267/31-
> 0180  4a 61 6e 2d 31 31 20 31 36 3a 34 33 05 1d 42 52   Jan-11 16:43..BR
> 0190  2f 34 2e 32 2e 33 2e 30 30 30 33 2f 30 37 2d 4a   /4.2.3.0003/07-J
> 01a0  61 6e 2d 31 31 20 30 39 3a 32 36 7d 76 00 00 36   an-11 09:26}v..6
> 01b0  3d 71 01 07 50 6f 6c 79 63 6f 6d 02 15 53 6f 75   =q..Polycom..Sou
> 01c0  6e 64 50 6f 69 6e 74 49 50 2d 53 50 49 50 5f 33   ndPointIP-SPIP_3
> 01d0  33 30 03 10 32 33 34 35 2d 31 32 32 30 30 2d 30   30..2345-12200-0
> 01e0  30 31 2c 31 04 1e 53 49 50 2f 33 2e 32 2e 34 2e   01,1..SIP/3.2.4.
> 01f0  30 32 36 37 2f 33 31 2d 4a 61 6e 2d 31 31 20 31   0267/31-Jan-11 1
> 0200  36 3a 34 33 05 1d 42 52 2f 34 2e 32 2e 33 2e 30   6:43..BR/4.2.3.0
> 0210  30 30 33 2f 30 37 2d 4a 61 6e 2d 31 31 20 30 39   003/07-Jan-11 09
> 0220  3a 32 36 ff 00 00 00 00 00 00 00 00 00 00 00 00   :26.............
> 0230  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
> 
> 
> Here it is in wireshark:(snip)
> I've tried substring(8,7) which seems like it should work, but many other possibilitie as well.
> maybe I should build up a custom option with 2 32 bit ints in the front to try to force it with a suboption? It doesn't seem like it should be this difficult.
> 
> <gjiefggc.png>
> 
> On 4/12/2016 2:53 AM, Simon Hobson wrote:
>> Doug Hughes <doug at will.to> <mailto:doug at will.to> wrote:
>> 
>>> option option125 code 125 = string;
>>> 
>>> log (debug, concat("hw: ", binary-to-ascii(16,8,":", hardware)));
>>> log (debug, concat("client-id: ", binary-to-ascii(16,8,":",substring(dhcp-client
>>> -identifier,16,1))));
>>> log (debug, concat("opt-125: ", substring(option125,1,7)));
>>> log (debug, "check option125");
>>> 
>>> The only lines that output anything are the 'hw' line at the beginning and the plain old option125 at the end. The other 2 lines output nothing, not even the plain text.. I wish there was extra levels of debugging that I could turn on to see raw options processing.
>> Try changing "substring(option125,1,7)" to "pick-first-value(substring(option125,1,7),"")" and see what happens (check the man page to make sure I've got that right). Ditto for client-id.
>> With concat, if any element is null, then the whole result is null, and so log won't log anything.
>> 
>> _______________________________________________
>> dhcp-users mailing list
>> dhcp-users at lists.isc.org <mailto:dhcp-users at lists.isc.org>
>> https://lists.isc.org/mailman/listinfo/dhcp-users <https://lists.isc.org/mailman/listinfo/dhcp-users>
> 
> _______________________________________________
> 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/20160413/b99581b9/attachment.html>


More information about the dhcp-users mailing list