eigrpd: Cleanup tab/spacing of the *.c files

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-04-08 14:44:58 -04:00
parent 962251aeff
commit f9e5c9ca06
20 changed files with 3357 additions and 3501 deletions

View File

@ -70,43 +70,14 @@ config_write_debug (struct vty *vty)
int write = 0; int write = 0;
int i; int i;
const char *type_str[] = {"update", "request", "query", "reply", "hello", "", "probe", "ack", "", const char *type_str[] = {"update", "request", "query", "reply",
"hello", "", "probe", "ack", "",
"SIA query", "SIA reply", "stub", "all"}; "SIA query", "SIA reply", "stub", "all"};
const char *detail_str[] = {"", " send", " recv", "", " detail", const char *detail_str[] = {"", " send", " recv", "", " detail",
" send detail", " recv detail", " detail"}; " send detail", " recv detail", " detail"};
/* debug eigrp event. */ /* debug eigrp event. */
// if (IS_CONF_DEBUG_EIGRP (event, EVENT) == EIGRP_DEBUG_EVENT)
// {
// vty_out (vty, "debug eigrp event%s", VTY_NEWLINE);
// write = 1;
// }
/* debug eigrp packet all detail. */
// r = EIGRP_DEBUG_SEND_RECV|EIGRP_DEBUG_DETAIL;
// for (i = 0; i < 11; i++)
// r &= conf_debug_eigrp_packet[i] & (EIGRP_DEBUG_SEND_RECV|EIGRP_DEBUG_DETAIL);
// if (r == (EIGRP_DEBUG_SEND_RECV|EIGRP_DEBUG_DETAIL))
// {
// vty_out (vty, "debug eigrp packet all detail%s", VTY_NEWLINE);
//// return 1;
// }
//
// /* debug eigrp packet all. */
// r = EIGRP_DEBUG_SEND_RECV;
// for (i = 0; i < 11; i++)
// r &= conf_debug_eigrp_packet[i] & EIGRP_DEBUG_SEND_RECV;
// if (r == EIGRP_DEBUG_SEND_RECV)
// {
// vty_out (vty, "debug eigrp packet all%s", VTY_NEWLINE);
// for (i = 0; i < 11; i++)
// if (conf_debug_eigrp_packet[i] & EIGRP_DEBUG_DETAIL)
// vty_out (vty, "debug eigrp packet %s detail%s",
// type_str[i],
// VTY_NEWLINE);
//// return 1;
// }
/* debug eigrp packet */ /* debug eigrp packet */
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
@ -120,125 +91,9 @@ config_write_debug (struct vty *vty)
write = 1; write = 1;
} }
// int write = 0;
// int i, r;
//
// const char *type_str[] = {"hello", "dd", "ls-request", "ls-update", "ls-ack"};
// const char *detail_str[] = {"", " send", " recv", "", " detail",
// " send detail", " recv detail", " detail"};
//
// /* debug ospf ism (status|events|timers). */
// if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
// vty_out (vty, "debug ospf ism%s", VTY_NEWLINE);
// else
// {
// if (IS_CONF_DEBUG_OSPF (ism, ISM_STATUS))
// vty_out (vty, "debug ospf ism status%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (ism, ISM_EVENTS))
// vty_out (vty, "debug ospf ism event%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (ism, ISM_TIMERS))
// vty_out (vty, "debug ospf ism timer%s", VTY_NEWLINE);
// }
//
// /* debug ospf nsm (status|events|timers). */
// if (IS_CONF_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
// vty_out (vty, "debug ospf nsm%s", VTY_NEWLINE);
// else
// {
// if (IS_CONF_DEBUG_OSPF (nsm, NSM_STATUS))
// vty_out (vty, "debug ospf nsm status%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (nsm, NSM_EVENTS))
// vty_out (vty, "debug ospf nsm event%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (nsm, NSM_TIMERS))
// vty_out (vty, "debug ospf nsm timer%s", VTY_NEWLINE);
// }
//
// /* debug ospf lsa (generate|flooding|install|refresh). */
// if (IS_CONF_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
// vty_out (vty, "debug ospf lsa%s", VTY_NEWLINE);
// else
// {
// if (IS_CONF_DEBUG_OSPF (lsa, LSA_GENERATE))
// vty_out (vty, "debug ospf lsa generate%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (lsa, LSA_FLOODING))
// vty_out (vty, "debug ospf lsa flooding%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (lsa, LSA_INSTALL))
// vty_out (vty, "debug ospf lsa install%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (lsa, LSA_REFRESH))
// vty_out (vty, "debug ospf lsa refresh%s", VTY_NEWLINE);
//
// write = 1;
// }
//
// /* debug ospf zebra (interface|redistribute). */
// if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
// vty_out (vty, "debug ospf zebra%s", VTY_NEWLINE);
// else
// {
// if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
// vty_out (vty, "debug ospf zebra interface%s", VTY_NEWLINE);
// if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
// vty_out (vty, "debug ospf zebra redistribute%s", VTY_NEWLINE);
//
// write = 1;
// }
//
// /* debug ospf event. */
// if (IS_CONF_DEBUG_OSPF (event, EVENT) == OSPF_DEBUG_EVENT)
// {
// vty_out (vty, "debug ospf event%s", VTY_NEWLINE);
// write = 1;
// }
//
// /* debug ospf nssa. */
// if (IS_CONF_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
// {
// vty_out (vty, "debug ospf nssa%s", VTY_NEWLINE);
// write = 1;
// }
//
// /* debug ospf packet all detail. */
// r = OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL;
// for (i = 0; i < 5; i++)
// r &= conf_debug_ospf_packet[i] & (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL);
// if (r == (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL))
// {
// vty_out (vty, "debug ospf packet all detail%s", VTY_NEWLINE);
// return 1;
// }
//
// /* debug ospf packet all. */
// r = OSPF_DEBUG_SEND_RECV;
// for (i = 0; i < 5; i++)
// r &= conf_debug_ospf_packet[i] & OSPF_DEBUG_SEND_RECV;
// if (r == OSPF_DEBUG_SEND_RECV)
// {
// vty_out (vty, "debug ospf packet all%s", VTY_NEWLINE);
// for (i = 0; i < 5; i++)
// if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL)
// vty_out (vty, "debug ospf packet %s detail%s",
// type_str[i],
// VTY_NEWLINE);
// return 1;
// }
//
// /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
// (send|recv) (detail). */
// for (i = 0; i < 5; i++)
// {
// if (conf_debug_ospf_packet[i] == 0)
// continue;
//
// vty_out (vty, "debug ospf packet %s%s%s",
// type_str[i], detail_str[conf_debug_ospf_packet[i]],
// VTY_NEWLINE);
// write = 1;
// }
return write; return write;
} }
static int static int
eigrp_neighbor_packet_queue_sum (struct eigrp_interface *ei) eigrp_neighbor_packet_queue_sum (struct eigrp_interface *ei)
{ {
@ -376,7 +231,9 @@ show_ip_eigrp_interface_sub (struct vty *vty, struct eigrp *eigrp,
vty_out (vty, "%-7u", ei->nbrs->count); vty_out (vty, "%-7u", ei->nbrs->count);
vty_out (vty, "%u %c %-10u",0,'/', eigrp_neighbor_packet_queue_sum (ei)); vty_out (vty, "%u %c %-10u",0,'/', eigrp_neighbor_packet_queue_sum (ei));
vty_out (vty, "%-7u %-14u %-12u %-8u", 0, 0, 0, 0); vty_out (vty, "%-7u %-14u %-12u %-8u", 0, 0, 0, 0);
vty_out (vty, "%-8u %-8u %s",IF_DEF_PARAMS (ei->ifp)->v_hello,IF_DEF_PARAMS (ei->ifp)->v_wait,VTY_NEWLINE); vty_out (vty, "%-8u %-8u %s",
IF_DEF_PARAMS (ei->ifp)->v_hello,
IF_DEF_PARAMS (ei->ifp)->v_wait,VTY_NEWLINE);
} }
void void
@ -385,10 +242,17 @@ show_ip_eigrp_interface_detail (struct vty *vty, struct eigrp *eigrp,
{ {
vty_out (vty, "%-2s %s %d %-3s %s","","Hello interval is ", 0, " sec", VTY_NEWLINE); vty_out (vty, "%-2s %s %d %-3s %s","","Hello interval is ", 0, " sec", VTY_NEWLINE);
vty_out (vty, "%-2s %s %s %s","", "Next xmit serial","<none>", VTY_NEWLINE); vty_out (vty, "%-2s %s %s %s","", "Next xmit serial","<none>", VTY_NEWLINE);
vty_out (vty, "%-2s %s %d %s %d %s %d %s %d %s","","Un/reliable mcasts: ",0,"/",0,"Un/reliable ucasts: ",0,"/",0,VTY_NEWLINE); vty_out (vty, "%-2s %s %d %s %d %s %d %s %d %s",
vty_out (vty, "%-2s %s %d %s %d %s %d %s","","Mcast exceptions: ",0," CR packets: ",0," ACKs supressed: ",0,VTY_NEWLINE); "", "Un/reliable mcasts: ", 0, "/", 0, "Un/reliable ucasts: ",
vty_out (vty, "%-2s %s %d %s %d %s","","Retransmissions sent: ",0,"Out-of-sequence rcvd: ",0,VTY_NEWLINE); 0, "/", 0, VTY_NEWLINE);
vty_out (vty, "%-2s %s %s %s %s","","Authentication mode is ","not","set",VTY_NEWLINE); vty_out (vty, "%-2s %s %d %s %d %s %d %s",
"", "Mcast exceptions: ", 0, " CR packets: ",
0, " ACKs supressed: ", 0, VTY_NEWLINE);
vty_out (vty, "%-2s %s %d %s %d %s",
"", "Retransmissions sent: ", 0, "Out-of-sequence rcvd: ",
0 ,VTY_NEWLINE);
vty_out (vty, "%-2s %s %s %s %s",
"", "Authentication mode is ", "not","set", VTY_NEWLINE);
vty_out (vty, "%-2s %s %s", "", "Use multicast", VTY_NEWLINE); vty_out (vty, "%-2s %s %s", "", "Use multicast", VTY_NEWLINE);
} }
@ -408,7 +272,8 @@ show_ip_eigrp_neighbor_sub (struct vty *vty, struct eigrp_neighbor *nbr,
int detail) int detail)
{ {
vty_out (vty, "%-3u %-17s %-21s",0,eigrp_neigh_ip_string (nbr),eigrp_if_name_string (nbr->ei)); vty_out (vty, "%-3u %-17s %-21s", 0,
eigrp_neigh_ip_string (nbr), eigrp_if_name_string (nbr->ei));
vty_out (vty,"%-7lu", thread_timer_remain_second (nbr->t_holddown)); vty_out (vty,"%-7lu", thread_timer_remain_second (nbr->t_holddown));
vty_out (vty,"%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME); vty_out (vty,"%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME);
vty_out (vty,"%-7lu", nbr->retrans_queue->count); vty_out (vty,"%-7lu", nbr->retrans_queue->count);
@ -449,17 +314,20 @@ show_ip_eigrp_prefix_entry (struct vty *vty, struct eigrp_prefix_entry *tn)
vty_out (vty, "%s/%u, ",inet_ntoa (tn->destination_ipv4->prefix),tn->destination_ipv4->prefixlen); vty_out (vty, "%s/%u, ",inet_ntoa (tn->destination_ipv4->prefix),tn->destination_ipv4->prefixlen);
vty_out (vty, "%u successors, ",eigrp_topology_get_successor(tn)->count); vty_out (vty, "%u successors, ",eigrp_topology_get_successor(tn)->count);
vty_out (vty, "FD is %u, serno: %lu %s",tn->fdistance, tn->serno, VTY_NEWLINE); vty_out (vty, "FD is %u, serno: %lu %s",tn->fdistance, tn->serno, VTY_NEWLINE);
} }
void void
show_ip_eigrp_neighbor_entry (struct vty *vty, struct eigrp *eigrp, struct eigrp_neighbor_entry *te) show_ip_eigrp_neighbor_entry (struct vty *vty, struct eigrp *eigrp, struct eigrp_neighbor_entry *te)
{ {
if (te->adv_router == eigrp->neighbor_self) if (te->adv_router == eigrp->neighbor_self)
vty_out (vty, "%-7s%s, %s%s"," ","via Connected",eigrp_if_name_string (te->ei), VTY_NEWLINE); vty_out (vty, "%-7s%s, %s%s", " ", "via Connected",
eigrp_if_name_string (te->ei), VTY_NEWLINE);
else else
{ {
vty_out (vty, "%-7s%s%s (%u/%u), %s%s"," ","via ",inet_ntoa (te->adv_router->src),te->distance, te->reported_distance, eigrp_if_name_string (te->ei), VTY_NEWLINE); vty_out (vty, "%-7s%s%s (%u/%u), %s%s",
" ", "via ", inet_ntoa (te->adv_router->src),
te->distance, te->reported_distance,
eigrp_if_name_string (te->ei), VTY_NEWLINE);
} }
} }

View File

@ -305,8 +305,7 @@ eigrp_distribute_update (struct distribute *dist)
thread_cancel(ei->t_distribute); thread_cancel(ei->t_distribute);
} }
/* schedule Graceful restart for interface in 10sec */ /* schedule Graceful restart for interface in 10sec */
e->t_distribute = thread_add_timer(master, eigrp_distribute_timer_interface, ei,(10)); e->t_distribute = thread_add_timer(master, eigrp_distribute_timer_interface, ei, 10);
} }
/* /*

View File

@ -93,22 +93,14 @@
/* /*
* Prototypes * Prototypes
*/ */
int int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *);
eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *); int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *);
int int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *);
eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *); int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *);
int int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *);
eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *); int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *);
int int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *);
eigrp_fsm_event_lr(struct eigrp_fsm_action_message *); int eigrp_fsm_event_qact(struct eigrp_fsm_action_message *);
int
eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *);
int
eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *);
int
eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *);
int
eigrp_fsm_event_qact(struct eigrp_fsm_action_message *);
//--------------------------------------------------------------------- //---------------------------------------------------------------------
@ -142,7 +134,6 @@ struct {
{ eigrp_fsm_event_qact }, /* Event 5 */ { eigrp_fsm_event_qact }, /* Event 5 */
{ eigrp_fsm_event_lr_fcn }, /* Event 6 */ { eigrp_fsm_event_lr_fcn }, /* Event 6 */
{ eigrp_fsm_event_keep_state }, /* Event 7 */ { eigrp_fsm_event_keep_state }, /* Event 7 */
}, { }, {
//Active 1 state //Active 1 state
{ eigrp_fsm_event_keep_state }, /* Event 0 */ { eigrp_fsm_event_keep_state }, /* Event 0 */
@ -183,14 +174,16 @@ struct {
* Return number of occurred event (arrow in diagram). * Return number of occurred event (arrow in diagram).
* *
*/ */
int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg) { int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
{
// Loading base information from message // Loading base information from message
//struct eigrp *eigrp = msg->eigrp; //struct eigrp *eigrp = msg->eigrp;
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
struct eigrp_neighbor_entry *entry = msg->entry; struct eigrp_neighbor_entry *entry = msg->entry;
u_char actual_state = prefix->state; u_char actual_state = prefix->state;
if (entry == NULL) { if (entry == NULL)
{
entry = eigrp_neighbor_entry_new(); entry = eigrp_neighbor_entry_new();
entry->adv_router = msg->adv_router; entry->adv_router = msg->adv_router;
entry->ei = msg->adv_router->ei; entry->ei = msg->adv_router->ei;
@ -199,49 +192,63 @@ int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg) {
} }
// Dividing by actual state of prefix's FSM // Dividing by actual state of prefix's FSM
switch (actual_state) { switch (actual_state)
case EIGRP_FSM_STATE_PASSIVE: { {
case EIGRP_FSM_STATE_PASSIVE:
{
//Calculate resultant metrics and insert to correct position in entries list //Calculate resultant metrics and insert to correct position in entries list
eigrp_topology_update_distance(msg); eigrp_topology_update_distance(msg);
struct eigrp_neighbor_entry * head = struct eigrp_neighbor_entry * head =
(struct eigrp_neighbor_entry *) entry->prefix->entries->head->data; (struct eigrp_neighbor_entry *) entry->prefix->entries->head->data;
//zlog_info ("flag: %d rdist: %u dist: %u pfdist: %u pdist: %u", head->flags, head->reported_distance, head->distance, prefix->fdistance, prefix->distance); //zlog_info ("flag: %d rdist: %u dist: %u pfdist: %u pdist: %u", head->flags, head->reported_distance, head->distance, prefix->fdistance, prefix->distance);
if (head->reported_distance < prefix->fdistance) { if (head->reported_distance < prefix->fdistance)
{
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
} }
/* /*
* if best entry doesn't satisfy feasibility condition it means move to active state * if best entry doesn't satisfy feasibility condition it means move to active state
* dependently if it was query from successor * dependently if it was query from successor
*/ */
else { else
if (msg->packet_type == EIGRP_OPC_QUERY) { {
if (msg->packet_type == EIGRP_OPC_QUERY)
{
return EIGRP_FSM_EVENT_Q_FCN; return EIGRP_FSM_EVENT_Q_FCN;
} else { }
else
{
return EIGRP_FSM_EVENT_NQ_FCN; return EIGRP_FSM_EVENT_NQ_FCN;
} }
} }
break; break;
} }
case EIGRP_FSM_STATE_ACTIVE_0: { case EIGRP_FSM_STATE_ACTIVE_0:
{
eigrp_topology_update_distance(msg); eigrp_topology_update_distance(msg);
if (msg->packet_type == EIGRP_OPC_REPLY) { if (msg->packet_type == EIGRP_OPC_REPLY) {
listnode_delete(prefix->rij, entry->adv_router); listnode_delete(prefix->rij, entry->adv_router);
if (prefix->rij->count) { if (prefix->rij->count)
{
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
} else { }
else
{
zlog_info("All reply received\n"); zlog_info("All reply received\n");
if (((struct eigrp_neighbor_entry *) prefix->entries->head->data)->reported_distance if (((struct eigrp_neighbor_entry *) prefix->entries->head->data)->reported_distance
< prefix->fdistance) { < prefix->fdistance)
{
return EIGRP_FSM_EVENT_LR_FCS; return EIGRP_FSM_EVENT_LR_FCS;
} }
return EIGRP_FSM_EVENT_LR_FCN; return EIGRP_FSM_EVENT_LR_FCN;
} }
} else if (msg->packet_type == EIGRP_OPC_QUERY }
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG)) { else if (msg->packet_type == EIGRP_OPC_QUERY
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG))
{
return EIGRP_FSM_EVENT_QACT; return EIGRP_FSM_EVENT_QACT;
} }
@ -249,44 +256,60 @@ int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg) {
break; break;
} }
case EIGRP_FSM_STATE_ACTIVE_1: { case EIGRP_FSM_STATE_ACTIVE_1:
{
int change = eigrp_topology_update_distance(msg); int change = eigrp_topology_update_distance(msg);
if (msg->packet_type == EIGRP_OPC_QUERY if (msg->packet_type == EIGRP_OPC_QUERY
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG)) { && (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG))
{
return EIGRP_FSM_EVENT_QACT; return EIGRP_FSM_EVENT_QACT;
} else if (msg->packet_type == EIGRP_OPC_REPLY) { }
else if (msg->packet_type == EIGRP_OPC_REPLY)
{
listnode_delete(prefix->rij, entry->adv_router); listnode_delete(prefix->rij, entry->adv_router);
if (change == 1 if (change == 1
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG)) { && (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG))
{
return EIGRP_FSM_EVENT_DINC; return EIGRP_FSM_EVENT_DINC;
} else if (prefix->rij->count) { }
else if (prefix->rij->count)
{
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
} else { }
else
{
zlog_info("All reply received\n"); zlog_info("All reply received\n");
return EIGRP_FSM_EVENT_LR; return EIGRP_FSM_EVENT_LR;
} }
} else if (msg->packet_type == EIGRP_OPC_UPDATE && change == 1 }
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG)) { else if (msg->packet_type == EIGRP_OPC_UPDATE && change == 1
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG))
{
return EIGRP_FSM_EVENT_DINC; return EIGRP_FSM_EVENT_DINC;
} }
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
break; break;
} }
case EIGRP_FSM_STATE_ACTIVE_2: { case EIGRP_FSM_STATE_ACTIVE_2:
{
eigrp_topology_update_distance(msg); eigrp_topology_update_distance(msg);
if (msg->packet_type == EIGRP_OPC_REPLY) { if (msg->packet_type == EIGRP_OPC_REPLY)
{
listnode_delete(prefix->rij, entry->adv_router); listnode_delete(prefix->rij, entry->adv_router);
if (prefix->rij->count) { if (prefix->rij->count)
{
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
} else { }
else
{
zlog_info("All reply received\n"); zlog_info("All reply received\n");
if (((struct eigrp_neighbor_entry *) prefix->entries->head->data)->reported_distance if (((struct eigrp_neighbor_entry *) prefix->entries->head->data)->reported_distance
< prefix->fdistance) { < prefix->fdistance)
{
return EIGRP_FSM_EVENT_LR_FCS; return EIGRP_FSM_EVENT_LR_FCS;
} }
@ -297,24 +320,32 @@ int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg) {
break; break;
} }
case EIGRP_FSM_STATE_ACTIVE_3: { case EIGRP_FSM_STATE_ACTIVE_3:
{
int change = eigrp_topology_update_distance(msg); int change = eigrp_topology_update_distance(msg);
if (msg->packet_type == EIGRP_OPC_REPLY) { if (msg->packet_type == EIGRP_OPC_REPLY)
{
listnode_delete(prefix->rij, entry->adv_router); listnode_delete(prefix->rij, entry->adv_router);
if (change == 1 if (change == 1
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG)) { && (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG))
{
return EIGRP_FSM_EVENT_DINC; return EIGRP_FSM_EVENT_DINC;
} else if (prefix->rij->count) { }
else if (prefix->rij->count)
{
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
} else { }
else
{
zlog_info("All reply received\n"); zlog_info("All reply received\n");
return EIGRP_FSM_EVENT_LR; return EIGRP_FSM_EVENT_LR;
} }
} else if (msg->packet_type == EIGRP_OPC_UPDATE && change == 1 }
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG)) { else if (msg->packet_type == EIGRP_OPC_UPDATE && change == 1
&& (entry->flags & EIGRP_NEIGHBOR_ENTRY_SUCCESSOR_FLAG))
{
return EIGRP_FSM_EVENT_DINC; return EIGRP_FSM_EVENT_DINC;
} }
return EIGRP_FSM_KEEP_STATE; return EIGRP_FSM_KEEP_STATE;
@ -330,19 +361,21 @@ int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg) {
* Function made to execute in separate thread. * Function made to execute in separate thread.
* Load argument from thread and execute proper NSM function * Load argument from thread and execute proper NSM function
*/ */
int eigrp_fsm_event(struct eigrp_fsm_action_message *msg, int event) { int eigrp_fsm_event(struct eigrp_fsm_action_message *msg, int event)
{
zlog_info("EIGRP AS: %d State: %d Event: %d Network: %s\n", msg->eigrp->AS, zlog_info("EIGRP AS: %d State: %d Event: %d Network: %s\n", msg->eigrp->AS,
msg->prefix->state, event, eigrp_topology_ip_string(msg->prefix)); msg->prefix->state, event, eigrp_topology_ip_string(msg->prefix));
(*(NSM[msg->prefix->state][event].func))(msg); (*(NSM[msg->prefix->state][event].func))(msg);
return 1; return 1;
} }
/* /*
* Function of event 0. * Function of event 0.
* *
*/ */
int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg)
{
struct eigrp *eigrp = msg->eigrp; struct eigrp *eigrp = msg->eigrp;
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
struct list *successors = eigrp_topology_get_successor(prefix); struct list *successors = eigrp_topology_get_successor(prefix);
@ -355,10 +388,13 @@ int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg) {
prefix->reported_metric = prefix->reported_metric =
((struct eigrp_neighbor_entry *) successors->head->data)->total_metric; ((struct eigrp_neighbor_entry *) successors->head->data)->total_metric;
if (eigrp_nbr_count_get()) { if (eigrp_nbr_count_get())
{
prefix->req_action |= EIGRP_FSM_NEED_QUERY; prefix->req_action |= EIGRP_FSM_NEED_QUERY;
listnode_add(eigrp->topology_changes_internalIPV4,prefix); listnode_add(eigrp->topology_changes_internalIPV4,prefix);
} else { }
else
{
eigrp_fsm_event_lr(msg); //in the case that there are no more neighbors left eigrp_fsm_event_lr(msg); //in the case that there are no more neighbors left
} }
@ -367,7 +403,8 @@ int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg) {
return 1; return 1;
} }
int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg)
{
struct eigrp *eigrp = msg->eigrp; struct eigrp *eigrp = msg->eigrp;
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
struct list *successors = eigrp_topology_get_successor(prefix); struct list *successors = eigrp_topology_get_successor(prefix);
@ -379,10 +416,13 @@ int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg) {
((struct eigrp_neighbor_entry *) successors->head->data)->distance; ((struct eigrp_neighbor_entry *) successors->head->data)->distance;
prefix->reported_metric = prefix->reported_metric =
((struct eigrp_neighbor_entry *) successors->head->data)->total_metric; ((struct eigrp_neighbor_entry *) successors->head->data)->total_metric;
if (eigrp_nbr_count_get()) { if (eigrp_nbr_count_get())
{
prefix->req_action |= EIGRP_FSM_NEED_QUERY; prefix->req_action |= EIGRP_FSM_NEED_QUERY;
listnode_add(eigrp->topology_changes_internalIPV4,prefix); listnode_add(eigrp->topology_changes_internalIPV4,prefix);
} else { }
else
{
eigrp_fsm_event_lr(msg); //in the case that there are no more neighbors left eigrp_fsm_event_lr(msg); //in the case that there are no more neighbors left
} }
@ -391,13 +431,15 @@ int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg) {
return 1; return 1;
} }
int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg)
{
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
if (prefix->state == EIGRP_FSM_STATE_PASSIVE) { if (prefix->state == EIGRP_FSM_STATE_PASSIVE)
{
if (!eigrp_metrics_is_same(&prefix->reported_metric, if (!eigrp_metrics_is_same(&prefix->reported_metric,
&((struct eigrp_neighbor_entry *) prefix->entries->head->data)->total_metric)) { &((struct eigrp_neighbor_entry *) prefix->entries->head->data)->total_metric))
{
prefix->rdistance = prefix->rdistance =
prefix->fdistance = prefix->fdistance =
prefix->distance = prefix->distance =
@ -419,7 +461,8 @@ int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg) {
return 1; return 1;
} }
int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *msg)
{
struct eigrp *eigrp = msg->eigrp; struct eigrp *eigrp = msg->eigrp;
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
prefix->fdistance = prefix->fdistance =
@ -429,7 +472,8 @@ int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *msg) {
prefix->reported_metric = prefix->reported_metric =
((struct eigrp_neighbor_entry *) (prefix->entries->head->data))->total_metric; ((struct eigrp_neighbor_entry *) (prefix->entries->head->data))->total_metric;
if (prefix->state == EIGRP_FSM_STATE_ACTIVE_3) { if (prefix->state == EIGRP_FSM_STATE_ACTIVE_3)
{
struct list *successors = eigrp_topology_get_successor(prefix); struct list *successors = eigrp_topology_get_successor(prefix);
assert(successors); // It's like Napolean and Waterloo assert(successors); // It's like Napolean and Waterloo
@ -448,7 +492,8 @@ int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *msg) {
return 1; return 1;
} }
int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *msg)
{
struct list *successors = eigrp_topology_get_successor(msg->prefix); struct list *successors = eigrp_topology_get_successor(msg->prefix);
assert(successors); // Trump and his big hands assert(successors); // Trump and his big hands
@ -456,16 +501,18 @@ int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *msg) {
msg->prefix->state = msg->prefix->state =
msg->prefix->state == EIGRP_FSM_STATE_ACTIVE_1 ? msg->prefix->state == EIGRP_FSM_STATE_ACTIVE_1 ?
EIGRP_FSM_STATE_ACTIVE_0 : EIGRP_FSM_STATE_ACTIVE_2; EIGRP_FSM_STATE_ACTIVE_0 : EIGRP_FSM_STATE_ACTIVE_2;
msg->prefix->distance = ((struct eigrp_neighbor_entry *)successors->head->data)->distance; msg->prefix->distance =
if (!msg->prefix->rij->count) { ((struct eigrp_neighbor_entry *)successors->head->data)->distance;
if (!msg->prefix->rij->count)
(*(NSM[msg->prefix->state][eigrp_get_fsm_event(msg)].func))(msg); (*(NSM[msg->prefix->state][eigrp_get_fsm_event(msg)].func))(msg);
}
list_delete(successors); list_delete(successors);
return 1; return 1;
} }
int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *msg)
{
struct eigrp *eigrp = msg->eigrp; struct eigrp *eigrp = msg->eigrp;
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
prefix->state = EIGRP_FSM_STATE_PASSIVE; prefix->state = EIGRP_FSM_STATE_PASSIVE;
@ -477,7 +524,8 @@ int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *msg) {
prefix->fdistance = prefix->fdistance =
prefix->fdistance > prefix->distance ? prefix->fdistance > prefix->distance ?
prefix->distance : prefix->fdistance; prefix->distance : prefix->fdistance;
if (prefix->state == EIGRP_FSM_STATE_ACTIVE_2) { if (prefix->state == EIGRP_FSM_STATE_ACTIVE_2)
{
struct list *successors = eigrp_topology_get_successor(prefix); struct list *successors = eigrp_topology_get_successor(prefix);
assert(successors); // Having a spoon and all you need is a knife assert(successors); // Having a spoon and all you need is a knife
@ -495,7 +543,8 @@ int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *msg) {
return 1; return 1;
} }
int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg)
{
struct eigrp *eigrp = msg->eigrp; struct eigrp *eigrp = msg->eigrp;
struct eigrp_prefix_entry *prefix = msg->prefix; struct eigrp_prefix_entry *prefix = msg->prefix;
struct list *successors = eigrp_topology_get_successor(prefix); struct list *successors = eigrp_topology_get_successor(prefix);
@ -509,10 +558,14 @@ int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg) {
((struct eigrp_neighbor_entry *) (successors->head->data)); ((struct eigrp_neighbor_entry *) (successors->head->data));
prefix->rdistance = prefix->distance = best_successor->distance; prefix->rdistance = prefix->distance = best_successor->distance;
prefix->reported_metric = best_successor->total_metric; prefix->reported_metric = best_successor->total_metric;
if (eigrp_nbr_count_get()) {
if (eigrp_nbr_count_get())
{
prefix->req_action |= EIGRP_FSM_NEED_QUERY; prefix->req_action |= EIGRP_FSM_NEED_QUERY;
listnode_add(eigrp->topology_changes_internalIPV4,prefix); listnode_add(eigrp->topology_changes_internalIPV4,prefix);
} else { }
else
{
eigrp_fsm_event_lr(msg); //in the case that there are no more neighbors left eigrp_fsm_event_lr(msg); //in the case that there are no more neighbors left
} }
@ -521,7 +574,8 @@ int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg) {
return 1; return 1;
} }
int eigrp_fsm_event_qact(struct eigrp_fsm_action_message *msg) { int eigrp_fsm_event_qact(struct eigrp_fsm_action_message *msg)
{
struct list *successors = eigrp_topology_get_successor(msg->prefix); struct list *successors = eigrp_topology_get_successor(msg->prefix);
assert(successors); // Cats and no Dogs assert(successors); // Cats and no Dogs

View File

@ -184,9 +184,9 @@ eigrp_hello_parameter_decode (struct eigrp_neighbor *nbr,
} }
static u_char static u_char
eigrp_hello_authentication_decode(struct stream *s, struct eigrp_tlv_hdr_type *tlv_header, struct eigrp_neighbor *nbr) eigrp_hello_authentication_decode(struct stream *s, struct eigrp_tlv_hdr_type *tlv_header,
struct eigrp_neighbor *nbr)
{ {
struct TLV_MD5_Authentication_Type *md5; struct TLV_MD5_Authentication_Type *md5;
md5 = (struct TLV_MD5_Authentication_Type *) tlv_header; md5 = (struct TLV_MD5_Authentication_Type *) tlv_header;
@ -194,7 +194,8 @@ eigrp_hello_authentication_decode(struct stream *s, struct eigrp_tlv_hdr_type *t
if(md5->auth_type == EIGRP_AUTH_TYPE_MD5) if(md5->auth_type == EIGRP_AUTH_TYPE_MD5)
return eigrp_check_md5_digest(s, md5, nbr, EIGRP_AUTH_BASIC_HELLO_FLAG); return eigrp_check_md5_digest(s, md5, nbr, EIGRP_AUTH_BASIC_HELLO_FLAG);
else if (md5->auth_type == EIGRP_AUTH_TYPE_SHA256) else if (md5->auth_type == EIGRP_AUTH_TYPE_SHA256)
return eigrp_check_sha256_digest(s, (struct TLV_SHA256_Authentication_Type *) tlv_header, nbr, EIGRP_AUTH_BASIC_HELLO_FLAG); return eigrp_check_sha256_digest(s, (struct TLV_SHA256_Authentication_Type *)tlv_header,
nbr, EIGRP_AUTH_BASIC_HELLO_FLAG);
return 0; return 0;
} }
@ -392,7 +393,6 @@ eigrp_hello_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
if (IS_DEBUG_EIGRP_PACKET(0, RECV)) if (IS_DEBUG_EIGRP_PACKET(0, RECV))
zlog_debug("Hello Packet received from %s", inet_ntoa(nbr->src)); zlog_debug("Hello Packet received from %s", inet_ntoa(nbr->src));
} }
/** /**
@ -605,7 +605,8 @@ eigrp_hello_parameter_encode (struct eigrp_interface *ei, struct stream *s, u_ch
* *
*/ */
static struct eigrp_packet * static struct eigrp_packet *
eigrp_hello_encode (struct eigrp_interface *ei, in_addr_t addr, u_int32_t ack, u_char flags, struct in_addr *nbr_addr) eigrp_hello_encode (struct eigrp_interface *ei, in_addr_t addr, u_int32_t ack,
u_char flags, struct in_addr *nbr_addr)
{ {
struct eigrp_packet *ep; struct eigrp_packet *ep;
u_int16_t length = EIGRP_HEADER_LEN; u_int16_t length = EIGRP_HEADER_LEN;
@ -619,11 +620,13 @@ eigrp_hello_encode (struct eigrp_interface *ei, in_addr_t addr, u_int32_t ack, u
eigrp_packet_header_init(EIGRP_OPC_HELLO, ei, ep->s, 0, 0, ack); eigrp_packet_header_init(EIGRP_OPC_HELLO, ei, ep->s, 0, 0, ack);
// encode Authentication TLV // encode Authentication TLV
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,ei);
} }
else if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_SHA256) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) else if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_SHA256) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_SHA256_to_stream(ep->s,ei); length += eigrp_add_authTLV_SHA256_to_stream(ep->s,ei);
} }
@ -656,11 +659,13 @@ eigrp_hello_encode (struct eigrp_interface *ei, in_addr_t addr, u_int32_t ack, u
// set soruce address for the hello packet // set soruce address for the hello packet
ep->dst.s_addr = addr; ep->dst.s_addr = addr;
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_BASIC_HELLO_FLAG); eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_BASIC_HELLO_FLAG);
} }
else if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_SHA256) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) else if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_SHA256) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_sha256_digest(ei,ep->s, EIGRP_AUTH_BASIC_HELLO_FLAG); eigrp_make_sha256_digest(ei,ep->s, EIGRP_AUTH_BASIC_HELLO_FLAG);
} }

View File

@ -138,7 +138,6 @@ eigrp_if_table_lookup (struct interface *ifp, struct prefix *prefix)
int int
eigrp_if_delete_hook (struct interface *ifp) eigrp_if_delete_hook (struct interface *ifp)
{ {
struct route_node *rn; struct route_node *rn;
route_table_finish (IF_OIFS (ifp)); route_table_finish (IF_OIFS (ifp));
@ -222,7 +221,6 @@ eigrp_new_if_params (void)
UNSET_IF_PARAM (eip, auth_keychain); UNSET_IF_PARAM (eip, auth_keychain);
UNSET_IF_PARAM (eip, auth_type); UNSET_IF_PARAM (eip, auth_type);
return eip; return eip;
} }
@ -597,7 +595,6 @@ eigrp_bandwidth_to_scaled (u_int32_t bandwidth)
temp_bandwidth < EIGRP_MAX_METRIC ? temp_bandwidth : EIGRP_MAX_METRIC; temp_bandwidth < EIGRP_MAX_METRIC ? temp_bandwidth : EIGRP_MAX_METRIC;
return (u_int32_t) temp_bandwidth; return (u_int32_t) temp_bandwidth;
} }
u_int32_t u_int32_t

View File

@ -67,7 +67,6 @@ eigrp_nbr_new (struct eigrp_interface *ei)
nbr->ei = ei; nbr->ei = ei;
/* Set default values. */ /* Set default values. */
eigrp_nbr_state_set (nbr, EIGRP_NEIGHBOR_DOWN); eigrp_nbr_state_set (nbr, EIGRP_NEIGHBOR_DOWN);
return nbr; return nbr;
@ -187,7 +186,6 @@ eigrp_nbr_lookup_by_addr_process (struct eigrp *eigrp, struct in_addr nbr_addr)
void void
eigrp_nbr_delete (struct eigrp_neighbor *nbr) eigrp_nbr_delete (struct eigrp_neighbor *nbr)
{ {
eigrp_nbr_state_set(nbr, EIGRP_NEIGHBOR_DOWN); eigrp_nbr_state_set(nbr, EIGRP_NEIGHBOR_DOWN);
eigrp_topology_neighbor_down(nbr->ei->eigrp, nbr); eigrp_topology_neighbor_down(nbr->ei->eigrp, nbr);
@ -225,7 +223,6 @@ eigrp_nbr_state_get (struct eigrp_neighbor *nbr)
void void
eigrp_nbr_state_set (struct eigrp_neighbor *nbr, u_char state) eigrp_nbr_state_set (struct eigrp_neighbor *nbr, u_char state)
{ {
nbr->state = state; nbr->state = state;
if (eigrp_nbr_state_get(nbr) == EIGRP_NEIGHBOR_DOWN) if (eigrp_nbr_state_get(nbr) == EIGRP_NEIGHBOR_DOWN)
@ -317,7 +314,6 @@ eigrp_nbr_state_update (struct eigrp_neighbor *nbr)
} }
int eigrp_nbr_count_get(void){ int eigrp_nbr_count_get(void){
struct eigrp_interface *iface; struct eigrp_interface *iface;
struct listnode *node, *node2, *nnode2; struct listnode *node, *node2, *nnode2;
struct eigrp_neighbor *nbr; struct eigrp_neighbor *nbr;

View File

@ -132,6 +132,7 @@ eigrp_adjust_sndbuflen(struct eigrp * eigrp, unsigned int buflen)
return; return;
if (eigrpd_privs.change(ZPRIVS_RAISE)) if (eigrpd_privs.change(ZPRIVS_RAISE))
zlog_err("%s: could not raise privs, %s", __func__, safe_strerror(errno)); zlog_err("%s: could not raise privs, %s", __func__, safe_strerror(errno));
/* Now we try to set SO_SNDBUF to what our caller has requested /* Now we try to set SO_SNDBUF to what our caller has requested
* (the MTU of a newly added interface). However, if the OS has * (the MTU of a newly added interface). However, if the OS has
* truncated the actual buffer size to somewhat less size, try * truncated the actual buffer size to somewhat less size, try
@ -230,7 +231,6 @@ eigrp_network_set(struct eigrp *eigrp, struct prefix_ipv4 *p)
struct interface *ifp; struct interface *ifp;
struct listnode *node; struct listnode *node;
zlog_debug ("A");
rn = route_node_get(eigrp->networks, (struct prefix *) p); rn = route_node_get(eigrp->networks, (struct prefix *) p);
if (rn->info) if (rn->info)
{ {
@ -243,7 +243,6 @@ eigrp_network_set(struct eigrp *eigrp, struct prefix_ipv4 *p)
PREFIX_COPY_IPV4(pref,p); PREFIX_COPY_IPV4(pref,p);
rn->info = (void *) pref; rn->info = (void *) pref;
zlog_debug ("B");
/* Schedule Router ID Update. */ /* Schedule Router ID Update. */
// if (eigrp->router_id == 0) // if (eigrp->router_id == 0)
// eigrp_router_id_update(eigrp); // eigrp_router_id_update(eigrp);
@ -373,7 +372,6 @@ eigrp_network_unset(struct eigrp *eigrp, struct prefix_ipv4 *p)
if (eigrp_network_match_iface(co, &rn->p)) if (eigrp_network_match_iface(co, &rn->p))
{ {
zlog_debug("eigrp_network_unset()2");
found = 1; found = 1;
route_unlock_node(rn); route_unlock_node(rn);
break; break;
@ -454,10 +452,10 @@ eigrp_metrics_is_same(struct eigrp_metrics *metric1,
return 0; // if different return 0; // if different
} }
void void
eigrp_external_routes_refresh (struct eigrp *eigrp, int type) eigrp_external_routes_refresh (struct eigrp *eigrp, int type)
{ {
} }

View File

@ -71,6 +71,7 @@ const struct message eigrp_packet_type_str[] =
{ EIGRP_OPC_SIAQUERY, "SIAQuery"}, { EIGRP_OPC_SIAQUERY, "SIAQuery"},
{ EIGRP_OPC_SIAREPLY, "SIAReply"}, { EIGRP_OPC_SIAREPLY, "SIAReply"},
}; };
const size_t eigrp_packet_type_str_max = sizeof(eigrp_packet_type_str) / const size_t eigrp_packet_type_str_max = sizeof(eigrp_packet_type_str) /
sizeof(eigrp_packet_type_str[0]); sizeof(eigrp_packet_type_str[0]);
@ -82,7 +83,6 @@ static int eigrp_verify_header (struct stream *, struct eigrp_interface *, struc
struct eigrp_header *); struct eigrp_header *);
static int eigrp_check_network_mask (struct eigrp_interface *, struct in_addr); static int eigrp_check_network_mask (struct eigrp_interface *, struct in_addr);
static int eigrp_retrans_count_exceeded(struct eigrp_packet *ep, struct eigrp_neighbor *nbr) static int eigrp_retrans_count_exceeded(struct eigrp_packet *ep, struct eigrp_neighbor *nbr)
{ {
return 1; return 1;
@ -146,7 +146,6 @@ eigrp_make_md5_digest (struct eigrp_interface *ei, struct stream *s, u_char flag
MD5Final(digest, &ctx); MD5Final(digest, &ctx);
/* Append md5 digest to the end of the stream. */ /* Append md5 digest to the end of the stream. */
memcpy(auth_TLV->digest,digest,EIGRP_AUTH_TYPE_MD5_LEN); memcpy(auth_TLV->digest,digest,EIGRP_AUTH_TYPE_MD5_LEN);
@ -159,7 +158,8 @@ eigrp_make_md5_digest (struct eigrp_interface *ei, struct stream *s, u_char flag
} }
int int
eigrp_check_md5_digest (struct stream *s, struct TLV_MD5_Authentication_Type *authTLV,struct eigrp_neighbor *nbr, u_char flags) eigrp_check_md5_digest (struct stream *s,
struct TLV_MD5_Authentication_Type *authTLV,struct eigrp_neighbor *nbr, u_char flags)
{ {
MD5_CTX ctx; MD5_CTX ctx;
unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN]; unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
@ -170,7 +170,6 @@ eigrp_check_md5_digest (struct stream *s, struct TLV_MD5_Authentication_Type *au
struct TLV_MD5_Authentication_Type *auth_TLV; struct TLV_MD5_Authentication_Type *auth_TLV;
struct eigrp_header *eigrph; struct eigrp_header *eigrph;
if (nbr && ntohl(nbr->crypt_seqnum) > ntohl(authTLV->key_sequence)) if (nbr && ntohl(nbr->crypt_seqnum) > ntohl(authTLV->key_sequence))
{ {
zlog_warn ("interface %s: eigrp_check_md5 bad sequence %d (expect %d)", zlog_warn ("interface %s: eigrp_check_md5 bad sequence %d (expect %d)",
@ -299,11 +298,13 @@ eigrp_make_sha256_digest (struct eigrp_interface *ei, struct stream *s, u_char f
} }
int int
eigrp_check_sha256_digest (struct stream *s, struct TLV_SHA256_Authentication_Type *authTLV,struct eigrp_neighbor *nbr, u_char flags) eigrp_check_sha256_digest (struct stream *s,
struct TLV_SHA256_Authentication_Type *authTLV,
struct eigrp_neighbor *nbr, u_char flags)
{ {
return 1; return 1;
} }
/* /*
* eigrp_packet_dump * eigrp_packet_dump
* *
@ -317,27 +318,6 @@ eigrp_packet_dump (struct stream *s)
return; return;
} }
/*
* Converts a 24-bit integer represented as an unsigned char[3] *value
* in network byte order into uint32_t in host byte order
*/
//static uint32_t u24_32 (const unsigned char *value)
//{
// return (value[0] << 16) + (value[1] << 8) + value[2];
//}
//
///*
// * Converts an uint32_t value in host byte order into a 24-bit integer
// * in network byte order represented by unsigned char[3] *result
// */
//static unsigned char * u32_24 (uint32_t value, unsigned char *result)
//{
// value = htonl(value & 0x00FFFFFF);
// memcpy (result, (unsigned char *) &value + 1, 3);
//
// return result;
//}
int int
eigrp_write (struct thread *thread) eigrp_write (struct thread *thread)
{ {
@ -634,7 +614,6 @@ eigrp_read (struct thread *thread)
/* Read rest of the packet and call each sort of packet routine. */ /* Read rest of the packet and call each sort of packet routine. */
stream_forward_getp(ibuf, EIGRP_HEADER_LEN); stream_forward_getp(ibuf, EIGRP_HEADER_LEN);
/* New testing block of code for handling Acks */ /* New testing block of code for handling Acks */
if (ntohl(eigrph->ack) != 0) if (ntohl(eigrph->ack) != 0)
{ {
@ -650,7 +629,8 @@ eigrp_read (struct thread *thread)
{ {
if (ntohl(eigrph->ack) == ep->sequence_number) if (ntohl(eigrph->ack) == ep->sequence_number)
{ {
if((nbr->state == EIGRP_NEIGHBOR_PENDING) && (ntohl(eigrph->ack) == nbr->init_sequence_number)) if((nbr->state == EIGRP_NEIGHBOR_PENDING) &&
(ntohl(eigrph->ack) == nbr->init_sequence_number))
{ {
eigrp_nbr_state_set(nbr, EIGRP_NEIGHBOR_UP); eigrp_nbr_state_set(nbr, EIGRP_NEIGHBOR_UP);
zlog_info("Neighbor adjacency became full"); zlog_info("Neighbor adjacency became full");
@ -1009,7 +989,6 @@ static int
eigrp_verify_header (struct stream *ibuf, struct eigrp_interface *ei, eigrp_verify_header (struct stream *ibuf, struct eigrp_interface *ei,
struct ip *iph, struct eigrp_header *eigrph) struct ip *iph, struct eigrp_header *eigrph)
{ {
/* Check network mask, Silently discarded. */ /* Check network mask, Silently discarded. */
if (!eigrp_check_network_mask(ei, iph->ip_src)) if (!eigrp_check_network_mask(ei, iph->ip_src))
{ {
@ -1189,7 +1168,6 @@ eigrp_read_ipv4_tlv (struct stream *s)
{ {
tlv->destination_part[0] = stream_getc(s); tlv->destination_part[0] = stream_getc(s);
tlv->destination.s_addr = (tlv->destination_part[0]); tlv->destination.s_addr = (tlv->destination_part[0]);
} }
else if (tlv->prefix_length > 8 && tlv->prefix_length <= 16) else if (tlv->prefix_length > 8 && tlv->prefix_length <= 16)
{ {
@ -1203,8 +1181,9 @@ eigrp_read_ipv4_tlv (struct stream *s)
tlv->destination_part[0] = stream_getc(s); tlv->destination_part[0] = stream_getc(s);
tlv->destination_part[1] = stream_getc(s); tlv->destination_part[1] = stream_getc(s);
tlv->destination_part[2] = stream_getc(s); tlv->destination_part[2] = stream_getc(s);
tlv->destination.s_addr = ((tlv->destination_part[2] << 16) tlv->destination.s_addr = ((tlv->destination_part[2] << 16) +
+ (tlv->destination_part[1] << 8) + tlv->destination_part[0]); (tlv->destination_part[1] << 8) +
tlv->destination_part[0]);
} }
else if (tlv->prefix_length > 24 && tlv->prefix_length <= 32) else if (tlv->prefix_length > 24 && tlv->prefix_length <= 32)
{ {
@ -1212,9 +1191,10 @@ eigrp_read_ipv4_tlv (struct stream *s)
tlv->destination_part[1] = stream_getc(s); tlv->destination_part[1] = stream_getc(s);
tlv->destination_part[2] = stream_getc(s); tlv->destination_part[2] = stream_getc(s);
tlv->destination_part[3] = stream_getc(s); tlv->destination_part[3] = stream_getc(s);
tlv->destination.s_addr = ((tlv->destination_part[3] << 24) tlv->destination.s_addr = ((tlv->destination_part[3] << 24) +
+ (tlv->destination_part[2] << 16) + (tlv->destination_part[1] << 8) (tlv->destination_part[2] << 16) +
+ tlv->destination_part[0]); (tlv->destination_part[1] << 8) +
tlv->destination_part[0]);
} }
return tlv; return tlv;
} }
@ -1310,7 +1290,6 @@ eigrp_add_authTLV_MD5_to_stream (struct stream *s,
authTLV->key_sequence = 0; authTLV->key_sequence = 0;
memset(authTLV->Nullpad,0,sizeof(authTLV->Nullpad)); memset(authTLV->Nullpad,0,sizeof(authTLV->Nullpad));
keychain = keychain_lookup(IF_DEF_PARAMS (ei->ifp)->auth_keychain); keychain = keychain_lookup(IF_DEF_PARAMS (ei->ifp)->auth_keychain);
if(keychain) if(keychain)
key = key_lookup_for_send(keychain); key = key_lookup_for_send(keychain);
@ -1353,7 +1332,6 @@ eigrp_add_authTLV_SHA256_to_stream (struct stream *s,
authTLV->key_sequence = 0; authTLV->key_sequence = 0;
memset(authTLV->Nullpad,0,sizeof(authTLV->Nullpad)); memset(authTLV->Nullpad,0,sizeof(authTLV->Nullpad));
keychain = keychain_lookup(IF_DEF_PARAMS (ei->ifp)->auth_keychain); keychain = keychain_lookup(IF_DEF_PARAMS (ei->ifp)->auth_keychain);
if(keychain) if(keychain)
key = key_lookup_for_send(keychain); key = key_lookup_for_send(keychain);
@ -1377,7 +1355,6 @@ eigrp_add_authTLV_SHA256_to_stream (struct stream *s,
eigrp_authTLV_SHA256_free(authTLV); eigrp_authTLV_SHA256_free(authTLV);
return 0; return 0;
} }
struct TLV_MD5_Authentication_Type * struct TLV_MD5_Authentication_Type *
@ -1393,7 +1370,6 @@ eigrp_authTLV_MD5_new ()
void void
eigrp_authTLV_MD5_free (struct TLV_MD5_Authentication_Type *authTLV) eigrp_authTLV_MD5_free (struct TLV_MD5_Authentication_Type *authTLV)
{ {
XFREE(MTYPE_EIGRP_AUTH_TLV, authTLV); XFREE(MTYPE_EIGRP_AUTH_TLV, authTLV);
} }
@ -1410,11 +1386,9 @@ eigrp_authTLV_SHA256_new ()
void void
eigrp_authTLV_SHA256_free (struct TLV_SHA256_Authentication_Type *authTLV) eigrp_authTLV_SHA256_free (struct TLV_SHA256_Authentication_Type *authTLV)
{ {
XFREE(MTYPE_EIGRP_AUTH_SHA256_TLV, authTLV); XFREE(MTYPE_EIGRP_AUTH_SHA256_TLV, authTLV);
} }
struct TLV_IPv4_Internal_type * struct TLV_IPv4_Internal_type *
eigrp_IPv4_InternalTLV_new () eigrp_IPv4_InternalTLV_new ()
{ {
@ -1428,7 +1402,6 @@ eigrp_IPv4_InternalTLV_new ()
void void
eigrp_IPv4_InternalTLV_free (struct TLV_IPv4_Internal_type *IPv4_InternalTLV) eigrp_IPv4_InternalTLV_free (struct TLV_IPv4_Internal_type *IPv4_InternalTLV)
{ {
XFREE(MTYPE_EIGRP_IPV4_INT_TLV, IPv4_InternalTLV); XFREE(MTYPE_EIGRP_IPV4_INT_TLV, IPv4_InternalTLV);
} }

View File

@ -122,8 +122,8 @@ eigrp_query_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
dest_addr = prefix_ipv4_new(); dest_addr = prefix_ipv4_new();
dest_addr->prefix = tlv->destination; dest_addr->prefix = tlv->destination;
dest_addr->prefixlen = tlv->prefix_length; dest_addr->prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest = eigrp_topology_table_lookup_ipv4( struct eigrp_prefix_entry *dest =
eigrp->topology_table, dest_addr); eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
/* If the destination exists (it should, but one never know)*/ /* If the destination exists (it should, but one never know)*/
if (dest != NULL) if (dest != NULL)
@ -131,8 +131,8 @@ eigrp_query_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
struct eigrp_fsm_action_message *msg; struct eigrp_fsm_action_message *msg;
msg = XCALLOC(MTYPE_EIGRP_FSM_MSG, msg = XCALLOC(MTYPE_EIGRP_FSM_MSG,
sizeof(struct eigrp_fsm_action_message)); sizeof(struct eigrp_fsm_action_message));
struct eigrp_neighbor_entry *entry = eigrp_prefix_entry_lookup( struct eigrp_neighbor_entry *entry =
dest->entries, nbr); eigrp_prefix_entry_lookup(dest->entries, nbr);
msg->packet_type = EIGRP_OPC_QUERY; msg->packet_type = EIGRP_OPC_QUERY;
msg->eigrp = eigrp; msg->eigrp = eigrp;
msg->data_type = EIGRP_TLV_IPv4_INT; msg->data_type = EIGRP_TLV_IPv4_INT;
@ -168,7 +168,8 @@ eigrp_send_query (struct eigrp_interface *ei)
ei->eigrp->sequence_number, 0); ei->eigrp->sequence_number, 0);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,ei);
} }
@ -196,7 +197,8 @@ eigrp_send_query (struct eigrp_interface *ei)
return; return;
} }
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_UPDATE_FLAG); eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
} }

View File

@ -89,7 +89,8 @@ eigrp_send_reply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
zlog_info("REPLY SEND Prefix: %s", inet_ntoa(nbr->src)); zlog_info("REPLY SEND Prefix: %s", inet_ntoa(nbr->src));
/* Check if any list fits */ /* Check if any list fits */
if ((alist && access_list_apply (alist, (struct prefix *) pe2->destination_ipv4) == FILTER_DENY)|| if ((alist &&
access_list_apply (alist, (struct prefix *) pe2->destination_ipv4) == FILTER_DENY) ||
(plist && prefix_list_apply (plist, (struct prefix *) pe2->destination_ipv4) == PREFIX_DENY)|| (plist && prefix_list_apply (plist, (struct prefix *) pe2->destination_ipv4) == PREFIX_DENY)||
(alist_i && access_list_apply (alist_i, (struct prefix *) pe2->destination_ipv4) == FILTER_DENY)|| (alist_i && access_list_apply (alist_i, (struct prefix *) pe2->destination_ipv4) == FILTER_DENY)||
(plist_i && prefix_list_apply (plist_i, (struct prefix *) pe2->destination_ipv4) == PREFIX_DENY)) (plist_i && prefix_list_apply (plist_i, (struct prefix *) pe2->destination_ipv4) == PREFIX_DENY))
@ -97,11 +98,12 @@ eigrp_send_reply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
zlog_info("REPLY SEND: Setting Metric to max"); zlog_info("REPLY SEND: Setting Metric to max");
pe2->reported_metric.delay = EIGRP_MAX_METRIC; pe2->reported_metric.delay = EIGRP_MAX_METRIC;
} else { }
else
{
zlog_info("REPLY SEND: Not setting metric"); zlog_info("REPLY SEND: Not setting metric");
} }
/* /*
* End of filtering * End of filtering
*/ */
@ -113,7 +115,8 @@ eigrp_send_reply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
nbr->ei->eigrp->sequence_number, 0); nbr->ei->eigrp->sequence_number, 0);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei);
} }
@ -121,7 +124,8 @@ eigrp_send_reply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
length += eigrp_add_internalTLV_to_stream(ep->s, pe2); length += eigrp_add_internalTLV_to_stream(ep->s, pe2);
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG); eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
} }
@ -184,8 +188,8 @@ eigrp_reply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
dest_addr = prefix_ipv4_new(); dest_addr = prefix_ipv4_new();
dest_addr->prefix = tlv->destination; dest_addr->prefix = tlv->destination;
dest_addr->prefixlen = tlv->prefix_length; dest_addr->prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest = eigrp_topology_table_lookup_ipv4( struct eigrp_prefix_entry *dest =
eigrp->topology_table, dest_addr); eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, dest_addr);
/* /*
* Destination must exists * Destination must exists
*/ */
@ -194,8 +198,8 @@ eigrp_reply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
struct eigrp_fsm_action_message *msg; struct eigrp_fsm_action_message *msg;
msg = XCALLOC(MTYPE_EIGRP_FSM_MSG, msg = XCALLOC(MTYPE_EIGRP_FSM_MSG,
sizeof(struct eigrp_fsm_action_message)); sizeof(struct eigrp_fsm_action_message));
struct eigrp_neighbor_entry *entry = eigrp_prefix_entry_lookup( struct eigrp_neighbor_entry *entry =
dest->entries, nbr); eigrp_prefix_entry_lookup(dest->entries, nbr);
/* /*
* Filtering * Filtering

View File

@ -973,7 +973,6 @@ DEFUN (match_ip_address,
"IP access-list number\n" "IP access-list number\n"
"IP access-list number (expanded range)\n" "IP access-list number (expanded range)\n"
"IP Access-list name\n") "IP Access-list name\n")
{ {
return eigrp_route_match_add (vty, vty->index, "ip address", argv[0]); return eigrp_route_match_add (vty, vty->index, "ip address", argv[0]);
} }

View File

@ -89,8 +89,8 @@ eigrp_siaquery_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
dest_addr = prefix_ipv4_new(); dest_addr = prefix_ipv4_new();
dest_addr->prefix = tlv->destination; dest_addr->prefix = tlv->destination;
dest_addr->prefixlen = tlv->prefix_length; dest_addr->prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest = eigrp_topology_table_lookup_ipv4( struct eigrp_prefix_entry *dest =
eigrp->topology_table, dest_addr); eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
/* If the destination exists (it should, but one never know)*/ /* If the destination exists (it should, but one never know)*/
if (dest != NULL) if (dest != NULL)
@ -98,8 +98,8 @@ eigrp_siaquery_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
struct eigrp_fsm_action_message *msg; struct eigrp_fsm_action_message *msg;
msg = XCALLOC(MTYPE_EIGRP_FSM_MSG, msg = XCALLOC(MTYPE_EIGRP_FSM_MSG,
sizeof(struct eigrp_fsm_action_message)); sizeof(struct eigrp_fsm_action_message));
struct eigrp_neighbor_entry *entry = eigrp_prefix_entry_lookup( struct eigrp_neighbor_entry *entry =
dest->entries, nbr); eigrp_prefix_entry_lookup(dest->entries, nbr);
msg->packet_type = EIGRP_OPC_SIAQUERY; msg->packet_type = EIGRP_OPC_SIAQUERY;
msg->eigrp = eigrp; msg->eigrp = eigrp;
msg->data_type = EIGRP_TLV_IPv4_INT; msg->data_type = EIGRP_TLV_IPv4_INT;
@ -116,7 +116,6 @@ eigrp_siaquery_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
eigrp_hello_send_ack(nbr); eigrp_hello_send_ack(nbr);
} }
void void
eigrp_send_siaquery (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe) eigrp_send_siaquery (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
{ {
@ -130,14 +129,16 @@ eigrp_send_siaquery (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
nbr->ei->eigrp->sequence_number, 0); nbr->ei->eigrp->sequence_number, 0);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei);
} }
length += eigrp_add_internalTLV_to_stream(ep->s, pe); length += eigrp_add_internalTLV_to_stream(ep->s, pe);
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG); eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
} }

View File

@ -25,7 +25,6 @@
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA. * 02111-1307, USA.
*/ */
#include <zebra.h> #include <zebra.h>
#include "thread.h" #include "thread.h"
@ -89,8 +88,8 @@ eigrp_siareply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
dest_addr = prefix_ipv4_new(); dest_addr = prefix_ipv4_new();
dest_addr->prefix = tlv->destination; dest_addr->prefix = tlv->destination;
dest_addr->prefixlen = tlv->prefix_length; dest_addr->prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest = eigrp_topology_table_lookup_ipv4( struct eigrp_prefix_entry *dest =
eigrp->topology_table, dest_addr); eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
/* If the destination exists (it should, but one never know)*/ /* If the destination exists (it should, but one never know)*/
if (dest != NULL) if (dest != NULL)
@ -98,8 +97,8 @@ eigrp_siareply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
struct eigrp_fsm_action_message *msg; struct eigrp_fsm_action_message *msg;
msg = XCALLOC(MTYPE_EIGRP_FSM_MSG, msg = XCALLOC(MTYPE_EIGRP_FSM_MSG,
sizeof(struct eigrp_fsm_action_message)); sizeof(struct eigrp_fsm_action_message));
struct eigrp_neighbor_entry *entry = eigrp_prefix_entry_lookup( struct eigrp_neighbor_entry *entry =
dest->entries, nbr); eigrp_prefix_entry_lookup(dest->entries, nbr);
msg->packet_type = EIGRP_OPC_SIAQUERY; msg->packet_type = EIGRP_OPC_SIAQUERY;
msg->eigrp = eigrp; msg->eigrp = eigrp;
msg->data_type = EIGRP_TLV_IPv4_INT; msg->data_type = EIGRP_TLV_IPv4_INT;
@ -129,14 +128,16 @@ eigrp_send_siareply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
nbr->ei->eigrp->sequence_number, 0); nbr->ei->eigrp->sequence_number, 0);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei);
} }
length += eigrp_add_internalTLV_to_stream(ep->s, pe); length += eigrp_add_internalTLV_to_stream(ep->s, pe);
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG); eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
} }

View File

@ -60,7 +60,6 @@
#include "eigrpd/eigrp_fsm.h" #include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_snmp.h" #include "eigrpd/eigrp_snmp.h"
struct list *eigrp_snmp_iflist; struct list *eigrp_snmp_iflist;
/* Declare static local variables for convenience. */ /* Declare static local variables for convenience. */
@ -469,7 +468,6 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
{ {
struct eigrp *eigrp; struct eigrp *eigrp;
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
/* Check whether the instance identifier is valid */ /* Check whether the instance identifier is valid */
@ -540,7 +538,6 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
struct listnode *node, *nnode; struct listnode *node, *nnode;
int counter; int counter;
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
/* Check whether the instance identifier is valid */ /* Check whether the instance identifier is valid */
@ -825,6 +822,7 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
} }
return NULL; return NULL;
} }
static u_char * static u_char *
eigrpTopologyEntry (struct variable *v, oid *name, size_t *length, eigrpTopologyEntry (struct variable *v, oid *name, size_t *length,
int exact, size_t *var_len, WriteMethod **write_method) int exact, size_t *var_len, WriteMethod **write_method)
@ -833,7 +831,6 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
struct eigrp_interface *ei; struct eigrp_interface *ei;
struct listnode *node, *nnode; struct listnode *node, *nnode;
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
/* Check whether the instance identifier is valid */ /* Check whether the instance identifier is valid */
@ -1146,6 +1143,7 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
} }
return NULL; return NULL;
} }
static u_char * static u_char *
eigrpInterfaceEntry (struct variable *v, oid *name, size_t *length, eigrpInterfaceEntry (struct variable *v, oid *name, size_t *length,
int exact, size_t *var_len, WriteMethod **write_method) int exact, size_t *var_len, WriteMethod **write_method)
@ -1157,7 +1155,6 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
struct list *keylist; struct list *keylist;
int counter; int counter;
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
/* Check whether the instance identifier is valid */ /* Check whether the instance identifier is valid */
@ -1381,7 +1378,6 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
return NULL; return NULL;
} }
/* Register EIGRP-MIB. */ /* Register EIGRP-MIB. */
void void
eigrp_snmp_init () eigrp_snmp_init ()
@ -1390,6 +1386,4 @@ eigrpNbrLookup (struct variable *v, oid *name, size_t *length,
smux_init (eigrp_om->master); smux_init (eigrp_om->master);
REGISTER_MIB("ciscoEigrpMIB", eigrp_variables, variable, eigrp_oid); REGISTER_MIB("ciscoEigrpMIB", eigrp_variables, variable, eigrp_oid);
} }
#endif #endif

View File

@ -52,17 +52,12 @@
#include "eigrpd/eigrp_fsm.h" #include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h" #include "eigrpd/eigrp_memory.h"
static int static int eigrp_prefix_entry_cmp(struct eigrp_prefix_entry *, struct eigrp_prefix_entry *);
eigrp_prefix_entry_cmp(struct eigrp_prefix_entry *, struct eigrp_prefix_entry *); static void eigrp_prefix_entry_del(struct eigrp_prefix_entry *);
static void static int eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *,
eigrp_prefix_entry_del(struct eigrp_prefix_entry *);
static int
eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *,
struct eigrp_neighbor_entry *); struct eigrp_neighbor_entry *);
/* /*
* asdf;laksdjf;lajsdf;kasdjf;asdjf;
* asdfaskdjfa;sdkjf;adlskj
* Returns linkedlist used as topology table * Returns linkedlist used as topology table
* cmp - assigned function for comparing topology nodes * cmp - assigned function for comparing topology nodes
* del - assigned function executed before deleting topology node by list function * del - assigned function executed before deleting topology node by list function
@ -135,7 +130,6 @@ eigrp_prefix_entry_del(struct eigrp_prefix_entry *node)
* Returns new created toplogy node * Returns new created toplogy node
* cmp - assigned function for comparing topology entry * cmp - assigned function for comparing topology entry
*/ */
struct eigrp_prefix_entry * struct eigrp_prefix_entry *
eigrp_prefix_entry_new() eigrp_prefix_entry_new()
{ {
@ -154,7 +148,6 @@ eigrp_prefix_entry_new()
/* /*
* Topology entry comparison * Topology entry comparison
*/ */
static int static int
eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *entry1, eigrp_neighbor_entry_cmp(struct eigrp_neighbor_entry *entry1,
struct eigrp_neighbor_entry *entry2) struct eigrp_neighbor_entry *entry2)
@ -187,7 +180,6 @@ eigrp_neighbor_entry_new()
/* /*
* Freeing topology table list * Freeing topology table list
*/ */
void void
eigrp_topology_free(struct list *list) eigrp_topology_free(struct list *list)
{ {
@ -197,7 +189,6 @@ eigrp_topology_free(struct list *list)
/* /*
* Deleting all topology nodes in table * Deleting all topology nodes in table
*/ */
void void
eigrp_topology_cleanup(struct list *topology) eigrp_topology_cleanup(struct list *topology)
{ {
@ -209,7 +200,6 @@ eigrp_topology_cleanup(struct list *topology)
/* /*
* Adding topology node to topology table * Adding topology node to topology table
*/ */
void void
eigrp_prefix_entry_add(struct list *topology, struct eigrp_prefix_entry *node) eigrp_prefix_entry_add(struct list *topology, struct eigrp_prefix_entry *node)
{ {
@ -222,7 +212,6 @@ eigrp_prefix_entry_add(struct list *topology, struct eigrp_prefix_entry *node)
/* /*
* Adding topology entry to topology node * Adding topology entry to topology node
*/ */
void void
eigrp_neighbor_entry_add(struct eigrp_prefix_entry *node, eigrp_neighbor_entry_add(struct eigrp_prefix_entry *node,
struct eigrp_neighbor_entry *entry) struct eigrp_neighbor_entry *entry)
@ -237,7 +226,6 @@ eigrp_neighbor_entry_add(struct eigrp_prefix_entry *node,
/* /*
* Deleting topology node from topology table * Deleting topology node from topology table
*/ */
void void
eigrp_prefix_entry_delete(struct list *topology, eigrp_prefix_entry_delete(struct list *topology,
struct eigrp_prefix_entry *node) struct eigrp_prefix_entry *node)
@ -263,7 +251,6 @@ eigrp_prefix_entry_delete(struct list *topology,
/* /*
* Deleting topology entry from topology node * Deleting topology entry from topology node
*/ */
void void
eigrp_neighbor_entry_delete(struct eigrp_prefix_entry *node, eigrp_neighbor_entry_delete(struct eigrp_prefix_entry *node,
struct eigrp_neighbor_entry *entry) struct eigrp_neighbor_entry *entry)
@ -278,7 +265,6 @@ eigrp_neighbor_entry_delete(struct eigrp_prefix_entry *node,
/* /*
* Deleting all nodes from topology table * Deleting all nodes from topology table
*/ */
void void
eigrp_topology_delete_all(struct list *topology) eigrp_topology_delete_all(struct list *topology)
{ {
@ -289,7 +275,6 @@ eigrp_topology_delete_all(struct list *topology)
* Return 0 if topology is not empty * Return 0 if topology is not empty
* otherwise return 1 * otherwise return 1
*/ */
unsigned int unsigned int
eigrp_topology_table_isempty(struct list *topology) eigrp_topology_table_isempty(struct list *topology)
{ {
@ -307,7 +292,6 @@ eigrp_topology_table_lookup_ipv4(struct list *topology_table,
struct listnode *node; struct listnode *node;
for (ALL_LIST_ELEMENTS_RO(topology_table, node, data)) for (ALL_LIST_ELEMENTS_RO(topology_table, node, data))
{ {
if ((data->af == AF_INET) if ((data->af == AF_INET)
&& (data->destination_ipv4->prefix.s_addr == address->prefix.s_addr) && (data->destination_ipv4->prefix.s_addr == address->prefix.s_addr)
&& (data->destination_ipv4->prefixlen == address->prefixlen)) && (data->destination_ipv4->prefixlen == address->prefixlen))
@ -440,8 +424,8 @@ eigrp_topology_update_distance(struct eigrp_fsm_action_message *msg)
entry->reported_distance entry->reported_distance
> eigrp_calculate_metrics(eigrp, &int_data->metric) ? 2 : 3; // Increase : Decrease : No change > eigrp_calculate_metrics(eigrp, &int_data->metric) ? 2 : 3; // Increase : Decrease : No change
entry->reported_metric = int_data->metric; entry->reported_metric = int_data->metric;
entry->reported_distance = eigrp_calculate_metrics(eigrp, entry->reported_distance =
&int_data->metric); eigrp_calculate_metrics(eigrp, &int_data->metric);
entry->distance = eigrp_calculate_total_metrics(eigrp, entry); entry->distance = eigrp_calculate_total_metrics(eigrp, entry);
} }
else else

View File

@ -300,8 +300,8 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
dest_addr = prefix_ipv4_new(); dest_addr = prefix_ipv4_new();
dest_addr->prefix = tlv->destination; dest_addr->prefix = tlv->destination;
dest_addr->prefixlen = tlv->prefix_length; dest_addr->prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest = eigrp_topology_table_lookup_ipv4( struct eigrp_prefix_entry *dest =
eigrp->topology_table, dest_addr); eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
/*if exists it comes to DUAL*/ /*if exists it comes to DUAL*/
if (dest != NULL) if (dest != NULL)
@ -518,7 +518,8 @@ eigrp_update_send_init (struct eigrp_neighbor *nbr)
nbr->recv_sequence_number); nbr->recv_sequence_number);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei);
eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_INIT_FLAG); eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_INIT_FLAG);
@ -626,7 +627,8 @@ eigrp_update_send_EOT (struct eigrp_neighbor *nbr)
} }
} }
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG); eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
} }
@ -651,7 +653,6 @@ eigrp_update_send_EOT (struct eigrp_neighbor *nbr)
{ {
eigrp_send_packet_reliably(nbr); eigrp_send_packet_reliably(nbr);
} }
} }
void void
@ -678,7 +679,8 @@ eigrp_update_send (struct eigrp_interface *ei)
ei->eigrp->sequence_number, 0); ei->eigrp->sequence_number, 0);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,ei);
} }
@ -774,7 +776,6 @@ eigrp_update_send (struct eigrp_interface *ei)
void void
eigrp_update_send_all (struct eigrp *eigrp, struct eigrp_interface *exception) eigrp_update_send_all (struct eigrp *eigrp, struct eigrp_interface *exception)
{ {
struct eigrp_interface *iface; struct eigrp_interface *iface;
struct listnode *node, *node2, *nnode2; struct listnode *node, *node2, *nnode2;
struct eigrp_prefix_entry *pe; struct eigrp_prefix_entry *pe;
@ -882,14 +883,14 @@ eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
nbr->recv_sequence_number); nbr->recv_sequence_number);
// encode Authentication TLV, if needed // encode Authentication TLV, if needed
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei); length += eigrp_add_authTLV_MD5_to_stream(ep->s,nbr->ei);
} }
for (ALL_LIST_ELEMENTS(nbr->ei->eigrp->topology_table, node, nnode, pe)) for (ALL_LIST_ELEMENTS(nbr->ei->eigrp->topology_table, node, nnode, pe))
{ {
/* /*
* Filtering * Filtering
*/ */
@ -902,7 +903,6 @@ eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
alist_i = nbr->ei->list[EIGRP_FILTER_OUT]; alist_i = nbr->ei->list[EIGRP_FILTER_OUT];
plist_i = nbr->ei->prefix[EIGRP_FILTER_OUT]; plist_i = nbr->ei->prefix[EIGRP_FILTER_OUT];
/* Check if any list fits */ /* Check if any list fits */
if ((alist && access_list_apply (alist, if ((alist && access_list_apply (alist,
(struct prefix *) dest_addr) == FILTER_DENY)|| (struct prefix *) dest_addr) == FILTER_DENY)||
@ -924,14 +924,11 @@ eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
send_prefixes++; send_prefixes++;
} }
alist = e->list[EIGRP_FILTER_IN]; alist = e->list[EIGRP_FILTER_IN];
plist = e->prefix[EIGRP_FILTER_IN]; plist = e->prefix[EIGRP_FILTER_IN];
alist_i = nbr->ei->list[EIGRP_FILTER_IN]; alist_i = nbr->ei->list[EIGRP_FILTER_IN];
plist_i = nbr->ei->prefix[EIGRP_FILTER_IN]; plist_i = nbr->ei->prefix[EIGRP_FILTER_IN];
/* Check if any list fits */ /* Check if any list fits */
if ((alist && access_list_apply (alist, if ((alist && access_list_apply (alist,
(struct prefix *) dest_addr) == FILTER_DENY)|| (struct prefix *) dest_addr) == FILTER_DENY)||
@ -955,7 +952,6 @@ eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
tlv_max->destination = pe->destination_ipv4->prefix; tlv_max->destination = pe->destination_ipv4->prefix;
tlv_max->prefix_length = pe->destination_ipv4->prefixlen; tlv_max->prefix_length = pe->destination_ipv4->prefixlen;
/* prepare message for FSM */ /* prepare message for FSM */
struct eigrp_fsm_action_message *fsm_msg; struct eigrp_fsm_action_message *fsm_msg;
fsm_msg = XCALLOC(MTYPE_EIGRP_FSM_MSG, fsm_msg = XCALLOC(MTYPE_EIGRP_FSM_MSG,
@ -995,7 +991,8 @@ eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
} }
/* compute Auth digest */ /* compute Auth digest */
if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL)) if((IF_DEF_PARAMS (nbr->ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) &&
(IF_DEF_PARAMS (nbr->ei->ifp)->auth_keychain != NULL))
{ {
eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG); eigrp_make_md5_digest(nbr->ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
} }
@ -1013,7 +1010,6 @@ eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
zlog_debug("Enqueuing Update Init Len [%u] Seq [%u] Dest [%s]", zlog_debug("Enqueuing Update Init Len [%u] Seq [%u] Dest [%s]",
ep->length, ep->sequence_number, inet_ntoa(ep->dst)); ep->length, ep->sequence_number, inet_ntoa(ep->dst));
/*Put packet to retransmission queue*/ /*Put packet to retransmission queue*/
eigrp_fifo_push_head(nbr->retrans_queue, ep); eigrp_fifo_push_head(nbr->retrans_queue, ep);
@ -1175,5 +1171,3 @@ eigrp_update_send_process_GR (struct eigrp *eigrp, enum GR_type gr_type, struct
eigrp_update_send_interface_GR(ei, gr_type, vty); eigrp_update_send_interface_GR(ei, gr_type, vty);
} }
} }

View File

@ -56,7 +56,6 @@
#include "eigrpd/eigrp_dump.h" #include "eigrpd/eigrp_dump.h"
#include "eigrpd/eigrp_const.h" #include "eigrpd/eigrp_const.h"
static int static int
config_write_network (struct vty *vty, struct eigrp *eigrp) config_write_network (struct vty *vty, struct eigrp *eigrp)
{ {
@ -197,7 +196,6 @@ DEFUN_NOSH (router_eigrp,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (no_router_eigrp, DEFUN (no_router_eigrp,
no_router_eigrp_cmd, no_router_eigrp_cmd,
"no router eigrp (1-65535)", "no router eigrp (1-65535)",
@ -337,7 +335,7 @@ DEFUN (eigrp_network,
"Enable routing on an IP network\n" "Enable routing on an IP network\n"
"EIGRP network prefix\n") "EIGRP network prefix\n")
{ {
VTY_DECLVAR_CONTEXT(eigrp, eigrp) VTY_DECLVAR_CONTEXT(eigrp, eigrp);
struct prefix_ipv4 p; struct prefix_ipv4 p;
int ret; int ret;
@ -750,8 +748,6 @@ DEFUN (no_eigrp_if_ip_hellointerval,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (eigrp_if_ip_holdinterval, DEFUN (eigrp_if_ip_holdinterval,
eigrp_if_ip_holdinterval_cmd, eigrp_if_ip_holdinterval_cmd,
"ip hold-time eigrp (1-65535)", "ip hold-time eigrp (1-65535)",
@ -878,7 +874,6 @@ str2auth_type (const char *str, struct interface *ifp)
} }
return CMD_WARNING; return CMD_WARNING;
} }
DEFUN (eigrp_authentication_mode, DEFUN (eigrp_authentication_mode,
@ -996,7 +991,8 @@ DEFUN (no_eigrp_authentication_keychain,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
if((IF_DEF_PARAMS (ifp)->auth_keychain != NULL) && (strcmp(IF_DEF_PARAMS (ifp)->auth_keychain,argv[5]->arg)==0)) if((IF_DEF_PARAMS (ifp)->auth_keychain != NULL) &&
(strcmp(IF_DEF_PARAMS (ifp)->auth_keychain,argv[5]->arg)==0))
{ {
free (IF_DEF_PARAMS (ifp)->auth_keychain); free (IF_DEF_PARAMS (ifp)->auth_keychain);
IF_DEF_PARAMS (ifp)->auth_keychain = NULL; IF_DEF_PARAMS (ifp)->auth_keychain = NULL;
@ -1007,7 +1003,6 @@ DEFUN (no_eigrp_authentication_keychain,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (eigrp_redistribute_source_metric, DEFUN (eigrp_redistribute_source_metric,
eigrp_redistribute_source_metric_cmd, eigrp_redistribute_source_metric_cmd,
"redistribute " FRR_REDIST_STR_EIGRPD "redistribute " FRR_REDIST_STR_EIGRPD
@ -1037,7 +1032,6 @@ DEFUN (eigrp_redistribute_source_metric,
return eigrp_redistribute_set (eigrp, source, metrics_from_command); return eigrp_redistribute_set (eigrp, source, metrics_from_command);
} }
DEFUN (no_eigrp_redistribute_source_metric, DEFUN (no_eigrp_redistribute_source_metric,
no_eigrp_redistribute_source_metric_cmd, no_eigrp_redistribute_source_metric_cmd,
"no redistribute " FRR_REDIST_STR_EIGRPD "no redistribute " FRR_REDIST_STR_EIGRPD
@ -1091,7 +1085,6 @@ DEFUN (eigrp_variance,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (no_eigrp_variance, DEFUN (no_eigrp_variance,
no_eigrp_variance_cmd, no_eigrp_variance_cmd,
"no variance (1-128)", "no variance (1-128)",
@ -1139,7 +1132,6 @@ DEFUN (eigrp_maximum_paths,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (no_eigrp_maximum_paths, DEFUN (no_eigrp_maximum_paths,
no_eigrp_maximum_paths_cmd, no_eigrp_maximum_paths_cmd,
"no maximum-paths <1-32>", "no maximum-paths <1-32>",
@ -1527,8 +1519,6 @@ eigrp_vty_if_init (void)
/*EIGRP Summarization commands*/ /*EIGRP Summarization commands*/
install_element (INTERFACE_NODE, &eigrp_ip_summary_address_cmd); install_element (INTERFACE_NODE, &eigrp_ip_summary_address_cmd);
install_element (INTERFACE_NODE, &no_eigrp_ip_summary_address_cmd); install_element (INTERFACE_NODE, &no_eigrp_ip_summary_address_cmd);
} }
static void static void
@ -1536,7 +1526,6 @@ eigrp_vty_zebra_init (void)
{ {
install_element (EIGRP_NODE, &eigrp_redistribute_source_metric_cmd); install_element (EIGRP_NODE, &eigrp_redistribute_source_metric_cmd);
install_element (EIGRP_NODE, &no_eigrp_redistribute_source_metric_cmd); install_element (EIGRP_NODE, &no_eigrp_redistribute_source_metric_cmd);
} }
/* Install EIGRP related vty commands. */ /* Install EIGRP related vty commands. */

View File

@ -137,7 +137,6 @@ eigrp_master_init ()
eigrp_om->start_time = tv.tv_sec; eigrp_om->start_time = tv.tv_sec;
} }
/* Allocate new eigrp structure. */ /* Allocate new eigrp structure. */
static struct eigrp * static struct eigrp *
eigrp_new (const char *AS) eigrp_new (const char *AS)
@ -296,7 +295,6 @@ eigrp_finish_final (struct eigrp *eigrp)
eigrp_delete(eigrp); eigrp_delete(eigrp);
XFREE(MTYPE_EIGRP_TOP,eigrp); XFREE(MTYPE_EIGRP_TOP,eigrp);
} }
/*Look for existing eigrp process*/ /*Look for existing eigrp process*/