#include
we need a rbtree root of type struct rb_node:
[looking for an entry]
struct intv_obj * intv = NULL;
struct rb_node * rb_node = chnl->rb_root;
while(rb_node){
struct intv_obj * intv_tmp;
intv_tmp = rb_entry(rb_node,struct intv_obj,rb_node);
if(time < intv_tmp->end){
intv = intv_tmp;
if(intv_tmp->start<=time) break; // we are done
rb_node = rb_node->left;
}
else
rb_node = rb_node->right;
}
return vma;
[inserting an entry]
[deleting an entry]