aboutsummaryrefslogtreecommitdiff
path: root/src/tbf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tbf.h')
-rw-r--r--src/tbf.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/tbf.h b/src/tbf.h
index 9a9765c..f01ba61 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -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 */
};

Return to:

Send suggestions and report system problems to the System administrator.