17.3.1 Use of linked lists

Figure 17.4: Linked list implementation in ns.
\includegraphics{linked-list}

There are a number of linked lists used heavily in the implementation:

Figure 17.4 provides a schematic of how the linked list is organized. Each object in the list is linked through a ``LINK_ENTRY'' that is a protected member of the class. This entry contains a pointer to the next item in the list and also a pointer to the address of the previous ``next'' pointer in the preceding object. Various macros found in ~ns/list.h can be used to manipulate the list; the implementation of linked-lists in ns is similar to the queue implementation found in some variants of BSD UNIX.

Tom Henderson 2011-11-05