struct connected *connected;
int count = 0;
- for (nn = listhead (ifp->connected); nn; nextnode (nn))
- if ((connected = getdata (nn)) != NULL) {
+ for (ALL_LIST_ELEMENTS_RO (ifp->connected, nn, connected))
+ {
struct prefix *p;
p = connected->address;
unsigned int mtu;
mtu = 0;
- for (node = listhead (iflist); node; nextnode (node))
- {
- ifp = getdata (node);
- if (mtu < ifp->mtu6)
- mtu = ifp->mtu6;
- }
+ for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ if (mtu < ifp->mtu6)
+ mtu = ifp->mtu6;
+
return mtu;
}
void
ripng_interface_clean ()
{
- struct listnode *node;
+ struct listnode *node, *nnode;
struct interface *ifp;
struct ripng_interface *ri;
- for (node = listhead (iflist); node; nextnode (node))
+ for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
{
- ifp = getdata (node);
ri = ifp->info;
ri->enable_network = 0;
struct interface *ifp;
struct ripng_interface *ri;
- for (node = listhead (iflist); node; nextnode (node))
+ for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
{
- ifp = getdata (node);
ri = ifp->info;
ri->enable_network = 0;
int
ripng_enable_network_lookup_if (struct interface *ifp)
{
- struct listnode *listnode;
+ struct listnode *node;
struct connected *connected;
struct prefix_ipv6 address;
- for (listnode = listhead (ifp->connected); listnode; nextnode (listnode))
- if ((connected = getdata (listnode)) != NULL)
- {
- struct prefix *p;
- struct route_node *node;
-
- p = connected->address;
+ for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, connected))
+ {
+ struct prefix *p;
+ struct route_node *node;
- if (p->family == AF_INET6)
- {
- address.family = AF_INET6;
- address.prefix = p->u.prefix6;
- address.prefixlen = IPV6_MAX_BITLEN;
+ p = connected->address;
- node = route_node_match (ripng_enable_network,
- (struct prefix *)&address);
- if (node)
- {
- route_unlock_node (node);
- return 1;
- }
- }
- }
+ if (p->family == AF_INET6)
+ {
+ address.family = AF_INET6;
+ address.prefix = p->u.prefix6;
+ address.prefixlen = IPV6_MAX_BITLEN;
+
+ node = route_node_match (ripng_enable_network,
+ (struct prefix *)&address);
+ if (node)
+ {
+ route_unlock_node (node);
+ return 1;
+ }
+ }
+ }
return -1;
}
void
ripng_connect_set (struct interface *ifp, int set)
{
- struct listnode *nn;
+ struct listnode *node, *nnode;
struct connected *connected;
struct prefix_ipv6 address;
- for (nn = listhead (ifp->connected); nn; nextnode (nn))
- if ((connected = getdata (nn)) != NULL) {
+ for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, connected))
+ {
struct prefix *p;
p = connected->address;
struct interface *ifp;
struct listnode *node;
- for (node = listhead (iflist); node; nextnode (node))
- {
- ifp = getdata (node);
- ripng_enable_apply (ifp);
- }
+ for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ ripng_enable_apply (ifp);
}
\f
/* Clear all network and neighbor configuration */
struct interface *ifp;
struct listnode *node;
- for (node = listhead (iflist); node; nextnode (node))
- {
- ifp = getdata (node);
- ripng_passive_interface_apply (ifp);
- }
+ for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ ripng_passive_interface_apply (ifp);
}
/* Passive interface. */
struct ripng_interface *ri;
int write = 0;
- for (node = listhead (iflist); node; nextnode (node))
+ for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
{
- ifp = getdata (node);
ri = ifp->info;
/* Do not display the interface if there is no