diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-27 01:32:06 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-27 01:32:06 +0200 |
commit | 255ab9408f6a9d6addd727c5697d4fbd8b6219f1 (patch) | |
tree | 2c0ade0c33778a1e70f219414b37355eda85c04a /eigrpd/eigrp_topology.c | |
parent | eigrpd: Refactor access/prefix list applications (diff) | |
download | frr-255ab9408f6a9d6addd727c5697d4fbd8b6219f1.tar.xz frr-255ab9408f6a9d6addd727c5697d4fbd8b6219f1.zip |
eigrpd: eigrp_neighbor_entry to eigrp_nexthop_entry
The struct 'eigrp_neighbor_entry' really represents
a nexthop for a prefix. Rename the structure to
better represent what we are representing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_topology.c')
-rw-r--r-- | eigrpd/eigrp_topology.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c index 64e65b694..2545f4d63 100644 --- a/eigrpd/eigrp_topology.c +++ b/eigrpd/eigrp_topology.c @@ -54,8 +54,8 @@ static int eigrp_prefix_entry_cmp(struct eigrp_prefix_entry *, struct eigrp_prefix_entry *); static void eigrp_prefix_entry_del(struct eigrp_prefix_entry *); -static int eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *, - struct eigrp_neighbor_entry *); +static int eigrp_nexthop_entry_cmp(struct eigrp_nexthop_entry *, + struct eigrp_nexthop_entry *); /* * Returns linkedlist used as topology table @@ -116,7 +116,7 @@ struct eigrp_prefix_entry *eigrp_prefix_entry_new() sizeof(struct eigrp_prefix_entry)); new->entries = list_new(); new->rij = list_new(); - new->entries->cmp = (int (*)(void *, void *))eigrp_neighbor_entry_cmp; + new->entries->cmp = (int (*)(void *, void *))eigrp_nexthop_entry_cmp; new->distance = new->fdistance = new->rdistance = EIGRP_MAX_METRIC; new->destination = NULL; @@ -126,8 +126,8 @@ struct eigrp_prefix_entry *eigrp_prefix_entry_new() /* * Topology entry comparison */ -static int eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *entry1, - struct eigrp_neighbor_entry *entry2) +static int eigrp_nexthop_entry_cmp(struct eigrp_nexthop_entry *entry1, + struct eigrp_nexthop_entry *entry2) { if (entry1->distance < entry2->distance) return -1; @@ -141,12 +141,12 @@ static int eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *entry1, * Returns new topology entry */ -struct eigrp_neighbor_entry *eigrp_neighbor_entry_new() +struct eigrp_nexthop_entry *eigrp_nexthop_entry_new() { - struct eigrp_neighbor_entry *new; + struct eigrp_nexthop_entry *new; - new = XCALLOC(MTYPE_EIGRP_NEIGHBOR_ENTRY, - sizeof(struct eigrp_neighbor_entry)); + new = XCALLOC(MTYPE_EIGRP_NEXTHOP_ENTRY, + sizeof(struct eigrp_nexthop_entry)); new->reported_distance = EIGRP_MAX_METRIC; new->distance = EIGRP_MAX_METRIC; @@ -185,8 +185,8 @@ void eigrp_prefix_entry_add(struct list *topology, /* * Adding topology entry to topology node */ -void eigrp_neighbor_entry_add(struct eigrp_prefix_entry *node, - struct eigrp_neighbor_entry *entry) +void eigrp_nexthop_entry_add(struct eigrp_prefix_entry *node, + struct eigrp_nexthop_entry *entry) { struct list *l = list_new(); @@ -229,13 +229,13 @@ void eigrp_prefix_entry_delete(struct list *topology, /* * Deleting topology entry from topology node */ -void eigrp_neighbor_entry_delete(struct eigrp_prefix_entry *node, - struct eigrp_neighbor_entry *entry) +void eigrp_nexthop_entry_delete(struct eigrp_prefix_entry *node, + struct eigrp_nexthop_entry *entry) { if (listnode_lookup(node->entries, entry) != NULL) { listnode_delete(node->entries, entry); eigrp_zebra_route_delete(node->destination); - XFREE(MTYPE_EIGRP_NEIGHBOR_ENTRY, entry); + XFREE(MTYPE_EIGRP_NEXTHOP_ENTRY, entry); } } @@ -283,11 +283,11 @@ eigrp_topology_table_lookup_ipv4(struct list *topology_table, struct list *eigrp_topology_get_successor(struct eigrp_prefix_entry *table_node) { struct list *successors = list_new(); - struct eigrp_neighbor_entry *data; + struct eigrp_nexthop_entry *data; struct listnode *node1, *node2; for (ALL_LIST_ELEMENTS(table_node->entries, node1, node2, data)) { - if (data->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG) { + if (data->flags & EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG) { listnode_add(successors, data); } } @@ -321,10 +321,10 @@ eigrp_topology_get_successor_max(struct eigrp_prefix_entry *table_node, return successors; } -struct eigrp_neighbor_entry * +struct eigrp_nexthop_entry * eigrp_prefix_entry_lookup(struct list *entries, struct eigrp_neighbor *nbr) { - struct eigrp_neighbor_entry *data; + struct eigrp_nexthop_entry *data; struct listnode *node, *nnode; for (ALL_LIST_ELEMENTS(entries, node, nnode, data)) { if (data->adv_router == nbr) { @@ -341,7 +341,7 @@ struct list *eigrp_neighbor_prefixes_lookup(struct eigrp *eigrp, { struct listnode *node1, *node11, *node2, *node22; struct eigrp_prefix_entry *prefix; - struct eigrp_neighbor_entry *entry; + struct eigrp_nexthop_entry *entry; /* create new empty list for prefixes storage */ struct list *prefixes = list_new(); @@ -365,7 +365,7 @@ enum metric_change eigrp_topology_update_distance(struct eigrp_fsm_action_messag { struct eigrp *eigrp = msg->eigrp; struct eigrp_prefix_entry *prefix = msg->prefix; - struct eigrp_neighbor_entry *entry = msg->entry; + struct eigrp_nexthop_entry *entry = msg->entry; enum metric_change change = METRIC_SAME; u_int32_t new_reported_distance; @@ -439,7 +439,7 @@ void eigrp_topology_update_all_node_flags(struct eigrp *eigrp) void eigrp_topology_update_node_flags(struct eigrp_prefix_entry *dest) { struct listnode *node; - struct eigrp_neighbor_entry *entry; + struct eigrp_nexthop_entry *entry; struct eigrp *eigrp = eigrp_lookup(); for (ALL_LIST_ELEMENTS_RO(dest->entries, node, entry)) { @@ -447,16 +447,16 @@ void eigrp_topology_update_node_flags(struct eigrp_prefix_entry *dest) <= (uint64_t)(dest->distance * eigrp->variance)) && entry->distance != EIGRP_MAX_METRIC) // is successor { - entry->flags |= EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG; - entry->flags &= ~EIGRP_NEIGHBOR_ENTRY_FSUCCESSOR_FLAG; + entry->flags |= EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG; + entry->flags &= ~EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG; } else if (entry->reported_distance < dest->fdistance) // is feasible successor { - entry->flags |= EIGRP_NEIGHBOR_ENTRY_FSUCCESSOR_FLAG; - entry->flags &= ~EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG; + entry->flags |= EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG; + entry->flags &= ~EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG; } else { - entry->flags &= ~EIGRP_NEIGHBOR_ENTRY_FSUCCESSOR_FLAG; - entry->flags &= ~EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG; + entry->flags &= ~EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG; + entry->flags &= ~EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG; } } } @@ -467,19 +467,19 @@ void eigrp_update_routing_table(struct eigrp_prefix_entry *prefix) struct list *successors = eigrp_topology_get_successor_max(prefix, eigrp->max_paths); struct listnode *node; - struct eigrp_neighbor_entry *entry; + struct eigrp_nexthop_entry *entry; if (successors) { eigrp_zebra_route_add(prefix->destination, successors); for (ALL_LIST_ELEMENTS_RO(successors, node, entry)) - entry->flags |= EIGRP_NEIGHBOR_ENTRY_INTABLE_FLAG; + entry->flags |= EIGRP_NEXTHOP_ENTRY_INTABLE_FLAG; list_delete(successors); } else { eigrp_zebra_route_delete(prefix->destination); for (ALL_LIST_ELEMENTS_RO(prefix->entries, node, entry)) - entry->flags &= ~EIGRP_NEIGHBOR_ENTRY_INTABLE_FLAG; + entry->flags &= ~EIGRP_NEXTHOP_ENTRY_INTABLE_FLAG; } } @@ -488,7 +488,7 @@ void eigrp_topology_neighbor_down(struct eigrp *eigrp, { struct listnode *node1, *node11, *node2, *node22; struct eigrp_prefix_entry *prefix; - struct eigrp_neighbor_entry *entry; + struct eigrp_nexthop_entry *entry; for (ALL_LIST_ELEMENTS(eigrp->topology_table, node1, node11, prefix)) { for (ALL_LIST_ELEMENTS(prefix->entries, node2, node22, entry)) { @@ -517,10 +517,10 @@ void eigrp_update_topology_table_prefix(struct list *table, { struct listnode *node1, *node2; - struct eigrp_neighbor_entry *entry; + struct eigrp_nexthop_entry *entry; for (ALL_LIST_ELEMENTS(prefix->entries, node1, node2, entry)) { if (entry->distance == EIGRP_MAX_METRIC) { - eigrp_neighbor_entry_delete(prefix, entry); + eigrp_nexthop_entry_delete(prefix, entry); } } if (prefix->distance == EIGRP_MAX_METRIC |