<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: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=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:24.0pt;
        margin-bottom:.0001pt;
        mso-para-margin-top:0cm;
        mso-para-margin-right:0cm;
        mso-para-margin-bottom:0cm;
        mso-para-margin-left:2.0gd;
        mso-para-margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.bold
        {mso-style-name:bold;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:695421158;
        mso-list-type:hybrid;
        mso-list-template-ids:-841610798 1732125324 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:ideograph-traditional;
        mso-level-text:%2\3001;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:48.0pt;
        text-indent:-24.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:72.0pt;
        text-indent:-24.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:96.0pt;
        text-indent:-24.0pt;}
@list l0:level5
        {mso-level-number-format:ideograph-traditional;
        mso-level-text:%5\3001;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:120.0pt;
        text-indent:-24.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:144.0pt;
        text-indent:-24.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:168.0pt;
        text-indent:-24.0pt;}
@list l0:level8
        {mso-level-number-format:ideograph-traditional;
        mso-level-text:%8\3001;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:192.0pt;
        text-indent:-24.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:216.0pt;
        text-indent:-24.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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=ZH-TW link=blue vlink=purple style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Okis Chuang wrote:<span class=apple-converted-space> </span></span><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'><br><span style='background:white'>> Actually I can write a short perl script to do this, but I try to do<span class=apple-converted-space> </span></span><br><span style='background:white'>> with pure unlang.<span class=apple-converted-space> </span></span><br><br><span style='background:white'>  Unlang is not really intended to do that.<span class=apple-converted-space> </span></span><br><br><span style='background:white'>> In fact, the reason why I need this function is that sometimes we treat<span class=apple-converted-space> </span></span><br><span style='background:white'>> some<span class=apple-converted-space> </span></span><span class=bold><b><span style='background:#FFFF99'>attributes</span></b></span><span class=apple-converted-space><span style='background:white'> </span></span><span style='background:white'>as temporary variable for generating another<span class=apple-converted-space> </span></span><span class=bold><b><span style='background:#FFFF99'>attribute</span></b></span><span class=apple-converted-space><span style='background:white'> </span></span><br><span style='background:white'>> value pair.<span class=apple-converted-space> </span></span><br><br><span style='background:white'>  Use Tmp-String-0, or Tmp-Octets-0 instead.  That way the problem goes<span class=apple-converted-space> </span></span><br><span style='background:white'>away.  See "dictionary.freeradius.internal" for more examples.<span class=apple-converted-space> </span></span><br><br><span style='background:white'>> Then erase it before sending request or reply out. So I am wondering<span class=apple-converted-space> </span></span><br><span style='background:white'>> would majority of FR user do this things like this?<span class=apple-converted-space> </span></span><br><br><span style='background:white'>  And you don't need to erase the Tmp-*<span class=apple-converted-space> </span></span><span class=bold><b><span style='background:#FFFF99'>attributes</span></b></span><span class=apple-converted-space><span style='background:white'> </span></span><span style='background:white'>before sending a<span class=apple-converted-space> </span></span><br><span style='background:white'>packet.  They will *never* show up in a packet.<span class=apple-converted-space> </span></span><br><br><span style='background:white'>  Alan DeKok.<span class=apple-converted-space> <o:p></o:p></span></span></span></p><p class=MsoNormal><span class=apple-converted-space><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>-------------<o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Hi Alan, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Thanks for reply.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Yes, I totally can understand the solution you recommend, and I’ve been using this skill for quite a long time.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>But the situation I encountered is :<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;mso-para-margin-left:0gd;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>    </span></span></span><![endif]><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>I need to save some information returned in Access-Accept from external AAA in the attribute *<b>Class</b>* at the section *<b>post-auth</b>*. So it will return back to gateway.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;mso-para-margin-left:0gd;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>    </span></span></span><![endif]><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Then gateway will send Accounting-Start to my server. In this time, I need to pop out the information I saved in the attribute *<b>Class</b>* in the section *<b>accounting</b>* so that I can generate the avp what I need.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;mso-para-margin-left:0gd'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Hence, it cannot work by using Tmp-XXX internal attribute because those two events occur in two different sessions to FreeRADIUS. <o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>I thought Tmp-* attributes will not exist across two sessions at the same time.<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>So that way I must choose some kind of attribute that gateway must return back for saving temporary attribute value.<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Concerning about total available length of Class in our wifi gateway, I don’t want to do such a waste on attribute Class.<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Again, just like I said before, because Class is a multi-value attribute I can’t find a way to remove a specific value from entire Class array.<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>But anyway, if this is too much for unlang I can use perl to fulfill this definitely. Just curious about if unlang can totally achieve this. :P<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Cheers,<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black;background:white'>Okis.<o:p></o:p></span></p></div></body></html>