[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
Emile van Bergen writes...
> And in the case of the VLAN attribute, it
> *does* contain an unsigned integer value, one that's calculated as
> 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)
Well, that would be one method of defining the VLANID attribute that
would clearly an integer data type.
> 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).
No. My point was that packing multiple, separate fields into an opaque
data container is representing a complex data type, whether you perform
the packing using bit or octet offsets in a string type or arithmetic
manipulations on an integer type. Packing is packing. :-)
to unsubscribe send a message to firstname.lastname@example.org with
the word 'unsubscribe' in a single line as the message text body.