Extension to Samba IDL.

Christopher R. Hertel crh at nts.umn.edu
Mon Jun 19 02:34:01 GMT 2000


Yeah.  What Luke said...

See, the problem with the setup below is that you have to parse out 'var' 
first, so you need to know if 'var' is a byte or a word or a figment of 
Waldo's imagination.  Don't always know that.

*The* example is NetBIOS names.  If the first two bits are 00 then the 
next 6 bits are a length value, but if the first two bits are 11 then the 
next 14 bits are an offest into the packet.  Since the length value can 
be zero, you don't want to parse out two bytes and cross your fingers.

Chris -)-----

> > You can do this sort of thing without bitfields.
> > 
> > switch (var & 2)
> > {
> > 	case 0:
> > 	case 1:
> > }
> > 
> > or
> > 
> > switch ((var & 0xe) >> 1)
> > {
> > 	case 0:
> > 	case 2:
> > }
> 
> yeh.
>  
> > Which is what our compiler has to turn it into anyway.
> 
> yeh.
>  
> > Still, I guess bitfields are pretty common in the non-RPC stuff, so for
> > convenience I don't see any problem adding them.
> 
> chris needs run-time dynamic bit-fields!!
> 


-- 
Christopher R. Hertel -)-----                   University of Minnesota
crh at nts.umn.edu              Networking and Telecommunications Services

    Ideals are like stars; you will not succeed in touching them
    with your hands...you choose them as your guides, and following
    them you will reach your destiny.  --Carl Schultz



More information about the samba-technical mailing list