Lollipop, lollipop, lollipop....

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Lollipop, lollipop, lollipop....

Tommaso Pecorella
... to be singed, of course, and her'e's the link if you don't know what I'm talking about: https://www.youtube.com/watch?v=3rYoRaxgOE0 <https://www.youtube.com/watch?v=3rYoRaxgOE0>

Ok, now that I made you sing, let me be serious a second.

A lollipop is (also) a method to have circular counters, and they're used both in 6LoWPAN and RPL.

The operations of a lollipop counter are described here:
http://pbg.web.engr.illinois.edu/courses/cs598fa09/readings/p83.pdf <http://pbg.web.engr.illinois.edu/courses/cs598fa09/readings/p83.pdf>
https://tools.ietf.org/html/rfc6550 <https://tools.ietf.org/html/rfc6550>
https://tools.ietf.org/html/rfc8505 <https://tools.ietf.org/html/rfc8505>

Both RFC 6550 and RFC 8505 use a 8-bit lollipop counter, with the very same constants.
This is not a big issue, and I did develop a class implementing it - no problem.

The problem (if it's a problem) is that the code is very specialized, meaning that it *only* supports 8-bit counters. I can extend it to use different internal constants but it kinda misses the point of making it generic.

Do you think it's worth extending it to be a template and be something like LollipopCounter<uint8_t>, LollipopCounter <uint16_t> ?
In case, is someone expert i templates willing to help me ?

last but not least, since it's a counter the best place to put it is in... I'd say network/utils, but suggestions are welcome.

Cheers,

T.


--------------------------------------------------------------

Build a man a fire, and he'll be warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.

— Sir Terry Pratchett
--------------------------------------------------------------

Tommaso Pecorella - Ph.D.

Assistant professor
Dpt. Ingegneria dell'Informazione
Università di Firenze

CNIT - Università di Firenze Unit

via di S. Marta 3
50139, Firenze
ITALY

email: [hidden email]
       [hidden email]

phone : +39-055-2758540
mobile: +39-320-4379803
fax   : +39-055-2758570