void eigrp_if_init()
{
/* Initialize Zebra interface data structure. */
- //hook_register_prio(if_add, 0, eigrp_if_new);
+ // hook_register_prio(if_add, 0, eigrp_if_new);
hook_register_prio(if_del, 0, eigrp_if_delete_hook);
}
-
void eigrp_del_if_params(struct eigrp_if_params *eip)
{
if (eip->auth_keychain)
thread_add_event(master, eigrp_hello_timer, ei, (1), NULL);
/*Prepare metrics*/
- metric.bandwidth =
- eigrp_bandwidth_to_scaled(ei->params.bandwidth);
+ metric.bandwidth = eigrp_bandwidth_to_scaled(ei->params.bandwidth);
metric.delay = eigrp_delay_to_scaled(ei->params.delay);
metric.load = ei->params.load;
metric.reliability = ei->params.reliability;
* group. */
if (ei->member_allrouters) {
/* Only actually drop if this is the last reference */
- eigrp_if_drop_allspfrouters(ei->eigrp,
- ei->address,
+ eigrp_if_drop_allspfrouters(ei->eigrp, ei->address,
ei->ifp->ifindex);
/* Unset the flag regardless of whether the system call
to leave
}
}
-u_char eigrp_default_iftype(struct interface *ifp)
+uint8_t eigrp_default_iftype(struct interface *ifp)
{
if (if_is_pointopoint(ifp))
return EIGRP_IFTYPE_POINTOPOINT;
return EIGRP_IFTYPE_BROADCAST;
}
-void eigrp_if_free(struct eigrp_interface *ei,
- int source)
+void eigrp_if_free(struct eigrp_interface *ei, int source)
{
struct prefix dest_addr;
struct eigrp_prefix_entry *pe;
struct eigrp *eigrp = eigrp_lookup();
+ if (!eigrp)
+ return;
+
if (source == INTERFACE_DOWN_BY_VTY) {
THREAD_OFF(ei->t_hello);
eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
return NULL;
}
-u_int32_t eigrp_bandwidth_to_scaled(u_int32_t bandwidth)
+uint32_t eigrp_bandwidth_to_scaled(uint32_t bandwidth)
{
uint64_t temp_bandwidth = (256ull * 10000000) / bandwidth;
temp_bandwidth = temp_bandwidth < EIGRP_MAX_METRIC ? temp_bandwidth
: EIGRP_MAX_METRIC;
- return (u_int32_t)temp_bandwidth;
+ return (uint32_t)temp_bandwidth;
}
-u_int32_t eigrp_scaled_to_bandwidth(u_int32_t scaled)
+uint32_t eigrp_scaled_to_bandwidth(uint32_t scaled)
{
uint64_t temp_scaled = scaled * (256ull * 10000000);
temp_scaled =
temp_scaled < EIGRP_MAX_METRIC ? temp_scaled : EIGRP_MAX_METRIC;
- return (u_int32_t)temp_scaled;
+ return (uint32_t)temp_scaled;
}
-u_int32_t eigrp_delay_to_scaled(u_int32_t delay)
+uint32_t eigrp_delay_to_scaled(uint32_t delay)
{
return delay * 256;
}
-u_int32_t eigrp_scaled_to_delay(u_int32_t scaled)
+uint32_t eigrp_scaled_to_delay(uint32_t scaled)
{
return scaled / 256;
}