<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.ubtech-campaign-c489c55c-0346-4fea-b6fd-a64743c68c5f
        {mso-style-name:ubtech-campaign-c489c55c-0346-4fea-b6fd-a64743c68c5f;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For the other one (remote_id) use getOption(RAI_OPTION_AGENT_REMOTE_ID).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Kea-users [mailto:kea-users-bounces@lists.isc.org]
<b>On Behalf Of </b>Itay Rozenberg<br>
<b>Sent:</b> Tuesday, July 4, 2017 5:23 PM<br>
<b>To:</b> 'Gokulakrishnan Gopalakrishnan'<br>
<b>Cc:</b> 'kea-users@lists.isc.org'<br>
<b>Subject:</b> Re: [Kea-users] Parsing Option 82<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span class="ubtech-campaign-c489c55c-0346-4fea-b6fd-a64743c68c5f"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Greetings</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Type 001 – circuit_id - hex, you need to convert it to ascii. (try it on this web site:
<a href="http://www.rapidtables.com/convert/number/hex-to-ascii.htm">http://www.rapidtables.com/convert/number/hex-to-ascii.htm</a> )<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Type 002 – remote_id - Mac address<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Each of them can be hex or mac address.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Try this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">std::string hexToAscii(std::string c) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        int length = c.length();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        std::string newString;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        for (int i = 0; i < length; i+=2) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                std::string byte = c.substr(i, 2);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                char chr = (char)(int)strtol(byte.c_str(), NULL, 16);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                newString.push_back(chr);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        return newString;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">OptionPtr rai = query4_ptr->getOption(DHO_DHCP_AGENT_OPTIONS);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        if (rai) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                OptionPtr circuit_id_opt = rai->getOption(RAI_OPTION_AGENT_CIRCUIT_ID);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                if (circuit_id_opt) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                        string cid = hexToAscii(circuit_id_opt->toHexString().substr(2));<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For the other one (remote_id) use getOption(RAI_OPTION_AGENT_CIRCUIT_ID).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">itay<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Kea-users [<a href="mailto:kea-users-bounces@lists.isc.org">mailto:kea-users-bounces@lists.isc.org</a>]
<b>On Behalf Of </b>Gokulakrishnan Gopalakrishnan<br>
<b>Sent:</b> Tuesday, July 4, 2017 2:20 PM<br>
<b>To:</b> <a href="mailto:kea-users@lists.isc.org">kea-users@lists.isc.org</a><br>
<b>Subject:</b> [Kea-users] Parsing Option 82<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I'm trying to print and parse Option 82 but I couldn't understand the format in which it is received. My 'option->toText()' print this<o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;color:#263238">type=082, len=024:,<br>
options:<br>
  type=001, len=014: 01:0c:45:74:68:65:72:6e:65:74:31:2f:32:39<br>
  type=002, len=006: 04:62:73:56:13:bc</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;color:#263238">Can someone help me to understand this value?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;color:#263238">Thanks,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;color:#263238">Gokul</span><o:p></o:p></p>
</div>
</div>
<table class="MsoNormalTable" border="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="30%" style="width:30.0%;padding:.75pt .75pt .75pt .75pt"></td>
<td width="40%" style="width:40.0%;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><a href="https://www.partner.co.il/partnertvfa" target="_blank"><span style="text-decoration:none"><img border="0" width="419" height="140" id="_x0000_i1025" src="cid:image001.jpg@01D2F4EE.3BFFA850" alt="Banner"></span></a><br>
<a href="http://www.u-btech.com/products/xtrabanner/poweredby" target="_blank"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#98989B;letter-spacing:.75pt;text-decoration:none">Powered by U‑BTech
</span><b><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#B3D236;letter-spacing:.75pt;text-decoration:none">XTRA</span></b><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#98989B;letter-spacing:.75pt;text-decoration:none">BANNER</span></a><br>
<br>
<a href="mailto:XBanner@Orange.co.il?subject=Please%20do%20not%20enrich%20emails%20sent%20to%20me%20%5BRemoval%20Code%3A%20DNE420000%5D&body=Please%20do%20not%20enrich%20emails%20sent%20to%20me" target="_blank"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#98989B;letter-spacing:.75pt;text-decoration:none">Please
 do not enrich emails sent to me</span></a><o:p></o:p></p>
</td>
<td width="30%" style="width:30.0%;padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
<p>------------------------------------------------------------<br>
This message contains information that may be confidential or privileged.<br>
If you are not the intended recipient, you may not use, copy or disclose<br>
to anyone any of the information in this message. If you have received<br>
this message and are not the intended recipient, kindly notify the sender<br>
and delete this message from your computer.<o:p></o:p></p>
</div>
<p>------------------------------------------------------------<br>
This message contains information that may be confidential or privileged.<br>
If you are not the intended recipient, you may not use, copy or disclose<br>
to anyone any of the information in this message. If you have received<br>
this message and are not the intended recipient, kindly notify the sender<br>
and delete this message from your computer.</p></body>
</html>