diff options
Diffstat (limited to 'src/tbf.h')
-rw-r--r-- | src/tbf.h | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -61,20 +61,23 @@ enum { CHILD_LEFT, CHILD_RIGHT }; #define FL_CHILD_LEFT 0x1 #define FL_CHILD_RIGHT 0x2 -enum { NST_INCOMPLETE, NST_INIT }; +enum node_status { NST_INCOMPLETE, NST_INIT }; struct node { uint8_t key[SHA256_LEN]; #ifdef DEBUG char *keystr; #endif - struct node *parent; - struct node *child[2]; - struct node *prev, *next; - pthread_cond_t notbusy; - int busy:1; - int status; - uint32_t ord; + struct node *parent; /* Parent node */ + struct node *child[2]; /* Left and right child nodes */ + struct node *prev, *next; /* More (prev) and less (next) recently + updated nodes. */ + pthread_cond_t notbusy; /* Prevent simultaneous updates */ + int busy:1; /* Node is in use if 1 */ + enum node_status status; /* Node status */ + uint32_t ord; /* Used when dumping nodes and computing tree + stats */ + /* Actual TBF payload: */ uint64_t timestamp; /* microseconds since epoch */ size_t tokens; /* tokens available */ }; |