* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
/* Initialize lists */
for (i = 0; i < EIGRP_FILTER_MAX; i++)
{
- ei->list[i] = NULL;
- ei->prefix[i] = NULL;
- ei->routemap[i] = NULL;
+ ei->list[i] = NULL;
+ ei->prefix[i] = NULL;
+ ei->routemap[i] = NULL;
}
return ei;
int
eigrp_if_delete_hook (struct interface *ifp)
{
-
struct route_node *rn;
route_table_finish (IF_OIFS (ifp));
UNSET_IF_PARAM (eip, auth_keychain);
UNSET_IF_PARAM (eip, auth_type);
-
return eip;
}
/* Set multicast memberships appropriately for new state. */
eigrp_if_set_multicast (ei);
- thread_add_event (master, eigrp_hello_timer, ei, (1));
+ thread_add_event(master, eigrp_hello_timer, ei, (1), NULL);
/*Prepare metrics*/
metric.bandwith = eigrp_bandwidth_to_scaled (EIGRP_IF_PARAM (ei,bandwidth));
/* The interface should belong to the EIGRP-all-routers group. */
if (!EI_MEMBER_CHECK (ei, MEMBER_ALLROUTERS)
&& (eigrp_if_add_allspfrouters (ei->eigrp, ei->address,
- ei->ifp->ifindex) >= 0))
+ ei->ifp->ifindex) >= 0))
/* Set the flag only if the system call to join succeeded. */
EI_MEMBER_JOINED (ei, MEMBER_ALLROUTERS);
}
/* Only actually drop if this is the last reference */
if (EI_MEMBER_COUNT (ei, MEMBER_ALLROUTERS) == 1)
eigrp_if_drop_allspfrouters (ei->eigrp, ei->address,
- ei->ifp->ifindex);
+ ei->ifp->ifindex);
/* Unset the flag regardless of whether the system call to leave
- the group succeeded, since it's much safer to assume that
- we are not a member. */
+ the group succeeded, since it's much safer to assume that
+ we are not a member. */
EI_MEMBER_LEFT (ei, MEMBER_ALLROUTERS);
}
}
void
eigrp_if_free (struct eigrp_interface *ei, int source)
{
+ struct prefix_ipv4 dest_addr;
+ struct eigrp_prefix_entry *pe;
+ struct eigrp *eigrp = eigrp_lookup ();
if (source == INTERFACE_DOWN_BY_VTY)
{
eigrp_hello_send(ei,EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
}
+ dest_addr.family = AF_INET;
+ dest_addr.prefix = ei->connected->address->u.prefix4;
+ dest_addr.prefixlen = ei->connected->address->prefixlen;
+ apply_mask_ipv4(&dest_addr);
+ pe = eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, &dest_addr);
+ if (pe)
+ eigrp_prefix_entry_delete (eigrp->topology_table, pe);
+
eigrp_if_down (ei);
list_delete (ei->nbrs);
}
/* Simulate down/up on the interface. This is needed, for example, when
- the MTU changes. */
+ the MTU changes. */
void
eigrp_if_reset (struct interface *ifp)
{
struct eigrp_interface *
eigrp_if_lookup_by_local_addr (struct eigrp *eigrp, struct interface *ifp,
- struct in_addr address)
+ struct in_addr address)
{
struct listnode *node;
struct eigrp_interface *ei;
struct eigrp_interface *
eigrp_if_lookup_by_name (struct eigrp *eigrp, const char *if_name)
{
- struct eigrp_interface *ei;
- struct listnode *node;
-
- /* iterate over all eigrp interfaces */
- for (ALL_LIST_ELEMENTS_RO (eigrp->eiflist, node, ei))
- {
- /* compare int name with eigrp interface's name */
- if(strcmp(ei->ifp->name, if_name) == 0)
- {
- return ei;
- }
- }
-
- return NULL;
+ struct eigrp_interface *ei;
+ struct listnode *node;
+
+ /* iterate over all eigrp interfaces */
+ for (ALL_LIST_ELEMENTS_RO (eigrp->eiflist, node, ei))
+ {
+ /* compare int name with eigrp interface's name */
+ if(strcmp(ei->ifp->name, if_name) == 0)
+ {
+ return ei;
+ }
+ }
+
+ return NULL;
}
/* determine receiving interface by ifp and source address */
struct eigrp_interface *
eigrp_if_lookup_recv_if (struct eigrp *eigrp, struct in_addr src,
- struct interface *ifp)
+ struct interface *ifp)
{
struct route_node *rn;
struct prefix_ipv4 addr;
continue;
if (prefix_match (CONNECTED_PREFIX (ei->connected),
- (struct prefix *) &addr))
+ (struct prefix *) &addr))
{
if ((match == NULL)
|| (match->address->prefixlen < ei->address->prefixlen))
u_int32_t
eigrp_bandwidth_to_scaled (u_int32_t bandwidth)
{
- u_int64_t temp_bandwidth = (256ull * 10000000) / bandwidth;
+ uint64_t temp_bandwidth = (256ull * 10000000) / bandwidth;
temp_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;
-
}
u_int32_t
eigrp_scaled_to_bandwidth (u_int32_t scaled)
{
- u_int64_t temp_scaled = scaled * (256ull * 10000000);
+ uint64_t temp_scaled = scaled * (256ull * 10000000);
temp_scaled =
- temp_scaled < EIGRP_MAX_METRIC ? temp_scaled : EIGRP_MAX_METRIC;
+ temp_scaled < EIGRP_MAX_METRIC ? temp_scaled : EIGRP_MAX_METRIC;
return (u_int32_t) temp_scaled;
}