#include "eigrpd/eigrp_vty.h"
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
-#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_dump.h"
#include "eigrpd/eigrp_types.h"
#include "eigrpd/eigrp_metric.h"
+DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IF, "EIGRP interface");
+DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IF_INFO, "EIGRP Interface Information");
+
struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp,
struct prefix *p)
{
free(eip->auth_keychain);
}
+/*
+ * Set the network byte order of the 3 bytes we send
+ * of the mtu of the link.
+ */
+static void eigrp_mtu_convert(struct eigrp_metrics *metric, uint32_t host_mtu)
+{
+ uint32_t network_mtu = htonl(host_mtu);
+ uint8_t *nm = (uint8_t *)&network_mtu;
+
+ metric->mtu[0] = nm[1];
+ metric->mtu[1] = nm[2];
+ metric->mtu[2] = nm[3];
+}
+
int eigrp_if_up(struct eigrp_interface *ei)
{
struct eigrp_prefix_descriptor *pe;
/* Set multicast memberships appropriately for new state. */
eigrp_if_set_multicast(ei);
- thread_add_event(master, eigrp_hello_timer, ei, (1), NULL);
+ thread_add_event(master, eigrp_hello_timer, ei, (1), &ei->t_hello);
/*Prepare metrics*/
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;
- metric.mtu[0] = 0xDC;
- metric.mtu[1] = 0x05;
- metric.mtu[2] = 0x00;
+ eigrp_mtu_convert(&metric, ei->ifp->mtu);
metric.hop_count = 0;
metric.flags = 0;
metric.tag = 0;