I am looking at request information in a C module I am working on, and there are various value_pairs such as Framed-Protocol who's type is PW_TYPE_INTEGER but the content is actually a string. It does have a value in the dictionary and I am guessing it is being mapped from this, but then shouldn't the type be PW_TYPE_STRING? Or am I just looking at this incorrectly?
I am looking at request information in a C module I am working on, and there are various value_pairs such as Framed-Protocol who's type is PW_TYPE_INTEGER but the content is actually a string. It does have a value in the dictionary and I am guessing it is being mapped from this, but then shouldn't the type be PW_TYPE_STRING? Or am I just looking at this incorrectly?
It is mapped in the dictionary under heading: "Integer Translations". That string is a human readable translation of the integer that is the attribute value. Ivan Kalik Kalik Informatika ISP
This mapping is working correctly. When looking at the VALUE_PAIR struct for the Framed-Protocol attribute, how do I determine that the contents of VALUE_PAIR_DATA data; are actually a string and not an integer without prior knowledge? On Mon, May 11, 2009 at 1:32 PM, Ivan Kalik <tnt@kalik.net> wrote:
I am looking at request information in a C module I am working on, and there are various value_pairs such as Framed-Protocol who's type is PW_TYPE_INTEGER but the content is actually a string. It does have a value in the dictionary and I am guessing it is being mapped from this, but then shouldn't the type be PW_TYPE_STRING? Or am I just looking at this incorrectly?
It is mapped in the dictionary under heading: "Integer Translations". That string is a human readable translation of the integer that is the attribute value.
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
James Devine wrote:
This mapping is working correctly. When looking at the VALUE_PAIR struct for the Framed-Protocol attribute, how do I determine that the contents of VALUE_PAIR_DATA data; are actually a string and not an integer without prior knowledge?
vp->type And Framed-Protocol is an integer type. See vp->vp_integer. This should all be very clear from the existing code. Simply grep the code for PW_FRAMED_PROTOCOL, or PW_TYPE_INTEGER, and see what it does. Alan DeKok.
vp_prints_value did the trick, thanks On Mon, May 11, 2009 at 1:48 PM, Alan DeKok <aland@deployingradius.com>wrote:
James Devine wrote:
This mapping is working correctly. When looking at the VALUE_PAIR struct for the Framed-Protocol attribute, how do I determine that the contents of VALUE_PAIR_DATA data; are actually a string and not an integer without prior knowledge?
vp->type
And Framed-Protocol is an integer type. See vp->vp_integer.
This should all be very clear from the existing code. Simply grep the code for PW_FRAMED_PROTOCOL, or PW_TYPE_INTEGER, and see what it does.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Ivan Kalik -
James Devine