rnode_ Struct Reference

A radix node. More...

Data Fields

u_int16_t prefix_len
 length of prefix, in bits
u_int16_t instance
 instance to distinguish prefixes
 next route to same destination
 parent internal node for this node
u_int8_t prefix [0]
 placeholder for the prefix

Detailed Description

A radix node.

This is the structure that gets imbedded in the thing you are storing in the radix tree, the moral equivalent to a patnode_t. In the current incarnation the prefix data needs to immediately follow this in the superstructure, something like

struct foo { ...stuff...; rnode_t rnode; u_int32_t prefix[4]; ...stuff...; };

Note that the tree potentially allows more than one rnode having a particular prefix to be stored in the tree simultaneously, with these being distinguished by the `instance' structure member. Rnodes with the same prefix are chained together through the `next' pointer, and are always sorted by ascending `instance'. If you don't want to store multiple instances of the same prefix in the tree, always specify the instance as zero. If, on the other hand, you wanted to use the instance because you were storing interface destination prefixes in the tree, and there was no guarantee that the same prefix wouldn't be configured on more than one interface (there is no such guarantee) so you needed to differentiate different instances of the same prefix, then using the instance as an ifindex would probably do about the right thing.

The documentation for this struct was generated from the following file:
2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:24:32 2010 for libjuniper by Doxygen 1.4.5