<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">With what you are doing you need to tag the option125 as an option.  You will also need to</div><div class="">adjust the starting point of your substring as that option has other stuff in it.  From the packet</div><div class="">dump the string would appear to start at byte 8.<br class=""><div class=""><blockquote type="cite" class=""><div bgcolor="#FFFFFF" text="#000000" class=""><blockquote cite="mid:40BDE5B1-5F57-44EA-9E09-7964D3B8E21A@thehobsons.co.uk" type="cite" class=""><blockquote type="cite" class=""><pre wrap="" class="">log (debug, concat("opt-125: ", substring(option option125,8,7)));</pre></blockquote></blockquote></div></blockquote><div class="">However what you really want to do is to create an option space for Polycon to properly encode / decode</div><div class="">the vendor string.  The following appears to get the name properly from a modified version of the</div><div class="">option.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-family: Menlo; background-color: rgb(254, 244, 156);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #a6a519" class="">option</span> space polycon;</div><div style="margin: 0px; font-family: Menlo; background-color: rgb(254, 244, 156);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #a6a519" class="">option</span> polycon.name code 1 = text;</div><div style="margin: 0px; font-family: Menlo; background-color: rgb(254, 244, 156);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #a6a519" class="">option</span> vendor.polycon code 13885 = encapsulate polycon;</div><div style="margin: 0px; font-family: Menlo; background-color: rgb(254, 244, 156); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-family: Menlo; color: rgb(39, 180, 28); background-color: rgb(254, 244, 156);" class="">if (exists polycon.name)<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {</span></div><div style="margin: 0px; font-family: Menlo; background-color: rgb(254, 244, 156);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #a6a519" class="">log</span> (info, concat(<span style="font-variant-ligatures: no-common-ligatures; color: #27b41c" class="">"polycon:"</span>, option polycon.name));</div><div style="margin: 0px; font-family: Menlo; background-color: rgb(254, 244, 156); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-family: Menlo; color: rgb(166, 165, 25); background-color: rgb(254, 244, 156);" class="">}</div></div><div class=""><br class=""></div><div class="">Adding additional sub-options is left as an exercise to the reader.</div><div class=""><br class=""></div><div class="">Shawn</div></div></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Apr 12, 2016, at 7:48 AM, Doug Hughes <<a href="mailto:doug@will.to" class="">doug@will.to</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta content="text/html; charset=windows-1252" http-equiv="Content-Type" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    Thanks, Simon<br class="">
    <br class="">
    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.<br class="">
    <br class="">
    Here's the raw:<br class="">
    0110  00 00 00 00 00 00 63 82 53 63 35 01 01 39 02 02  
    ......c.Sc5..9..<br class="">
    0120  4e 37 0a 01 1c a0 42 03 04 2a 02 06 0f 33 04 00  
    N7....B..*...3..<br class="">
    0130  00 a8 c0 3c 76 00 00 36 3d 71 01 07 50 6f 6c 79  
    ...<v..6=q..Poly<br class="">
    0140  63 6f 6d 02 15 53 6f 75 6e 64 50 6f 69 6e 74 49  
    com..SoundPointI<br class="">
    0150  50 2d 53 50 49 50 5f 33 33 30 03 10 32 33 34 35  
    P-SPIP_330..2345<br class="">
    0160  2d 31 32 32 30 30 2d 30 30 31 2c 31 04 1e 53 49  
    -12200-001,1..SI<br class="">
    0170  50 2f 33 2e 32 2e 34 2e 30 32 36 37 2f 33 31 2d  
    P/3.2.4.0267/31-<br class="">
    0180  4a 61 6e 2d 31 31 20 31 36 3a 34 33 05 1d 42 52   Jan-11
    16:43..BR<br class="">
    0190  2f 34 2e 32 2e 33 2e 30 30 30 33 2f 30 37 2d 4a  
    /4.2.3.0003/07-J<br class="">
    01a0  61 6e 2d 31 31 20 30 39 3a 32 36 7d 76 00 00 36   an-11
    09:26}v..6<br class="">
    01b0  3d 71 01 07 50 6f 6c 79 63 6f 6d 02 15 53 6f 75  
    =q..Polycom..Sou<br class="">
    01c0  6e 64 50 6f 69 6e 74 49 50 2d 53 50 49 50 5f 33  
    ndPointIP-SPIP_3<br class="">
    01d0  33 30 03 10 32 33 34 35 2d 31 32 32 30 30 2d 30  
    30..2345-12200-0<br class="">
    01e0  30 31 2c 31 04 1e 53 49 50 2f 33 2e 32 2e 34 2e  
    01,1..SIP/3.2.4.<br class="">
    01f0  30 32 36 37 2f 33 31 2d 4a 61 6e 2d 31 31 20 31  
    0267/31-Jan-11 1<br class="">
    0200  36 3a 34 33 05 1d 42 52 2f 34 2e 32 2e 33 2e 30  
    6:43..BR/4.2.3.0<br class="">
    0210  30 30 33 2f 30 37 2d 4a 61 6e 2d 31 31 20 30 39  
    003/07-Jan-11 09<br class="">
    0220  3a 32 36 ff 00 00 00 00 00 00 00 00 00 00 00 00  
    :26.............<br class="">
    0230  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
    ................<br class="">
    <br class="">
    <br class="">
    Here it is in wireshark:(snip)<br class="">
    I've tried substring(8,7) which seems like it should work, but many
    other possibilitie as well.<br class="">
    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.<br class="">
    <br class="">
    <span id="cid:part1.06080409.00040806@will.to"><gjiefggc.png></span><br class="">
    <br class="">
    <div class="moz-cite-prefix">On 4/12/2016 2:53 AM, Simon Hobson
      wrote:<br class="">
    </div>
    <blockquote cite="mid:40BDE5B1-5F57-44EA-9E09-7964D3B8E21A@thehobsons.co.uk" type="cite" class="">
      <pre wrap="" class="">Doug Hughes <a class="moz-txt-link-rfc2396E" href="mailto:doug@will.to"><doug@will.to></a> wrote:

</pre>
      <blockquote type="cite" class="">
        <pre wrap="" class="">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.
</pre>
      </blockquote>
      <pre wrap="" class="">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
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a>
</pre>
    </blockquote>
    <br class="">
  </div>

_______________________________________________<br class="">dhcp-users mailing list<br class=""><a href="mailto:dhcp-users@lists.isc.org" class="">dhcp-users@lists.isc.org</a><br class="">https://lists.isc.org/mailman/listinfo/dhcp-users</div></blockquote></div><br class=""></body></html>