ospf6_interface_lsdb_hook(lsa, ospf6_lsremove_to_spf_reason(lsa));
}
-static u_char ospf6_default_iftype(struct interface *ifp)
+static uint8_t ospf6_default_iftype(struct interface *ifp)
{
if (if_is_pointopoint(ifp))
return OSPF_IFTYPE_POINTOPOINT;
return OSPF_IFTYPE_BROADCAST;
}
-static u_int32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
+static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
{
/* If all else fails, use default OSPF cost */
- u_int32_t cost;
- u_int32_t bw, refbw;
+ uint32_t cost;
+ uint32_t bw, refbw;
/* interface speed and bw can be 0 in some platforms,
* use ospf default bw. If bw is configured then it would
if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_NOAUTOCOST))
cost = oi->cost;
else {
- cost = (u_int32_t)((double)refbw / (double)bw + (double)0.5);
+ cost = (uint32_t)((double)refbw / (double)bw + (double)0.5);
if (cost < 1)
cost = 1;
else if (cost > UINT32_MAX)
static void ospf6_interface_recalculate_cost(struct ospf6_interface *oi)
{
- u_int32_t newcost;
+ uint32_t newcost;
newcost = ospf6_interface_get_cost(oi);
if (newcost == oi->cost)
oi = (struct ospf6_interface *)XCALLOC(MTYPE_OSPF6_IF,
sizeof(struct ospf6_interface));
- if (!oi) {
- zlog_err("Can't malloc ospf6_interface for ifindex %d",
- ifp->ifindex);
- return (struct ospf6_interface *)NULL;
- }
-
oi->area = (struct ospf6_area *)NULL;
oi->neighbor_list = list_new();
oi->neighbor_list->cmp = ospf6_neighbor_cmp;
for (ALL_LIST_ELEMENTS(oi->neighbor_list, node, nnode, on))
ospf6_neighbor_delete(on);
- list_delete_and_null(&oi->neighbor_list);
+ list_delete(&oi->neighbor_list);
THREAD_OFF(oi->thread_send_hello);
THREAD_OFF(oi->thread_send_lsupdate);
ospf6_interface_state_update(oi->interface);
}
-void ospf6_interface_if_del(struct interface *ifp)
-{
- struct ospf6_interface *oi;
-
- oi = (struct ospf6_interface *)ifp->info;
- if (oi == NULL)
- return;
-
- /* interface stop */
- if (oi->area)
- thread_execute(master, interface_down, oi, 0);
-
- listnode_delete(oi->area->if_list, oi);
- oi->area = (struct ospf6_area *)NULL;
-
- /* cut link */
- oi->interface = NULL;
- ifp->info = NULL;
-
- ospf6_interface_delete(oi);
-}
-
void ospf6_interface_state_update(struct interface *ifp)
{
struct ospf6_interface *oi;
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi->area);
}
-static void ospf6_interface_state_change(u_char next_state,
+static void ospf6_interface_state_change(uint8_t next_state,
struct ospf6_interface *oi)
{
- u_char prev_state;
+ uint8_t prev_state;
prev_state = oi->state;
oi->state = next_state;
return a;
}
-static u_char dr_election(struct ospf6_interface *oi)
+static uint8_t dr_election(struct ospf6_interface *oi)
{
struct listnode *node, *nnode;
struct ospf6_neighbor *on, *drouter, *bdrouter, myself;
struct ospf6_neighbor *best_drouter, *best_bdrouter;
- u_char next_state = 0;
+ uint8_t next_state = 0;
drouter = bdrouter = NULL;
best_drouter = best_bdrouter = NULL;
struct prefix *p;
struct listnode *i;
char strbuf[PREFIX2STR_BUFFER], drouter[32], bdrouter[32];
- const char *updown[3] = {"down", "up", NULL};
const char *type;
struct timeval res, now;
char duration[32];
type = "UNKNOWN";
vty_out(vty, "%s is %s, type %s\n", ifp->name,
- updown[if_is_operative(ifp)], type);
+ (if_is_operative(ifp) ? "up" : "down"), type);
vty_out(vty, " Interface ID: %d\n", ifp->ifindex);
if (ifp->info == NULL) {
DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
show_ipv6_ospf6_interface_ifname_prefix_cmd,
- "show ipv6 ospf6 interface IFNAME prefix [<X:X::X:X|X:X::X:X/M>] [<match|detail>]",
+ "show ipv6 ospf6 interface IFNAME prefix\
+ [<\
+ detail\
+ |<X:X::X:X|X:X::X:X/M> [<match|detail>]\
+ >]",
SHOW_STR
IP6_STR
OSPF6_STR
INTERFACE_STR
IFNAME_STR
"Display connected prefixes to advertise\n"
+ "Display details of the prefixes\n"
OSPF6_ROUTE_ADDRESS_STR
OSPF6_ROUTE_PREFIX_STR
OSPF6_ROUTE_MATCH_STR
DEFUN (show_ipv6_ospf6_interface_prefix,
show_ipv6_ospf6_interface_prefix_cmd,
- "show ipv6 ospf6 interface prefix [<X:X::X:X|X:X::X:X/M>] [<match|detail>]",
+ "show ipv6 ospf6 interface prefix\
+ [<\
+ detail\
+ |<X:X::X:X|X:X::X:X/M> [<match|detail>]\
+ >]",
SHOW_STR
IP6_STR
OSPF6_STR
INTERFACE_STR
"Display connected prefixes to advertise\n"
+ "Display details of the prefixes\n"
OSPF6_ROUTE_ADDRESS_STR
OSPF6_ROUTE_PREFIX_STR
OSPF6_ROUTE_MATCH_STR
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct listnode *i, *j;
- u_int32_t refbw;
+ uint32_t refbw;
refbw = strtol(argv[idx_number]->arg, NULL, 10);
if (refbw < 1 || refbw > 4294967) {