ccn_btree_node_header Struct Reference

Structure of a node. More...


Data Fields

unsigned char magic [4]
 File magic.
unsigned char version [1]
 Format version.
unsigned char nodetype [1]
 Indicates root node, backup root, etc.
unsigned char level [1]
 Level within the tree.
unsigned char extsz [1]
 Header extension size (CCN_BT_SIZE_UNITS).


Detailed Description

Structure of a node.

These are as they appear on external storage, so we stick to single-byte types to keep it portable between machines. Multi-byte numeric fields are always in big-endian format.

Within a node, the entries are fixed size. The entries are packed together at the end of the node's storage, so that by examining the last entry the location of the other entries can be determined directly. The entsz field includes the whole entry, which consists of a payload followed by a trailer.

The keys are stored in the first portion of the node. They may be in multiple pieces, and the pieces may overlap arbitrarily. This offers a very simple form of compression, since the keys within a node are very likely to have a lot in common with each other.

A few bytes at the very beginning serve as a header.

This is the overall structure of a node:

+---+-----------------------+--------------+----+----+-- --+----+ |hdr|..string......space....| (free space) | E0 | E1 | ... | En | +---+-----------------------+--------------+----+----+-- --+----+

It is designed so that new entries can be added without having to rewrite all of the string space. Thus the header should not contain things that we expect to change often.

Definition at line 170 of file btree.h.


Field Documentation

unsigned char ccn_btree_node_header::magic[4]

File magic.

Definition at line 171 of file btree.h.

Referenced by ccn_btree_chknode(), and ccn_btree_init_node().

Format version.

Definition at line 172 of file btree.h.

Referenced by ccn_btree_chknode(), and ccn_btree_init_node().

Indicates root node, backup root, etc.

Definition at line 173 of file btree.h.

unsigned char ccn_btree_node_header::level[1]

Level within the tree.

Definition at line 174 of file btree.h.

Referenced by ccn_btree_chknode(), and ccn_btree_node_level().

unsigned char ccn_btree_node_header::extsz[1]

Header extension size (CCN_BT_SIZE_UNITS).

Definition at line 175 of file btree.h.

Referenced by ccn_btree_chknode().


The documentation for this struct was generated from the following file:

Generated on Thu Feb 16 00:44:31 2012 for Content-Centric Networking in C by  doxygen 1.5.6