[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New Technical Issues RE: WG last call in progress on VLAN/Priority Draft
On Tue, Mar 14, 2006 at 01:27:48PM -0500, Nelson, David wrote:
> > RFC 2568 says
> > integer 32 bit unsigned value, most significant octet first.
> > That's it. No range, no interpretation, nothing else.
> I beg to differ. The way I interpret this RADIUS data type is as
> (1) Its an integer.
> (2) The range is defined as 0 .. 2**32-1.
> (3) Its unsigned.
> (4) Its big-endian.
> I see nothing that indicates this data type is anything other than an
> integer, typically expressed in a C language declaration as "unsigned
You're completely correct. And in the case of the VLAN attribute, it
*does* contain an unsigned integer value, one that's calculated as follows:
value = vlanflag * 16777216 + vlanid
The reverse goes as follows:
vlanflag = value / 16777216
vlanid = value % 16777216
* denotes unsigned integer multiplication,
+ denotes unsigned integer addition,
/ denotes unsigned integer division and
% denotes taking the reminder of an unsigned integer division,
all to be carried out on unsigned integers in the range 0 .. 2**32-1)
I'm not believing that people on this list would have to be explained
that shifting and masking bits are *not* magic operations that you can
only perform if you program in assembly (or its portable flavour, C),
but that those are normal mathematical operations on normal integers:
multiply and take remainder (by powers of 2).
You can do that, I think, even in Java, SAP/r3, XSLT, SQL and whatever.
This whole issue has nothing whatsoever to do with C structures.
E-Advies - Emile van Bergen email@example.com
tel. +31 (0)78 6136282 http://www.e-advies.nl
to unsubscribe send a message to firstname.lastname@example.org with
the word 'unsubscribe' in a single line as the message text body.