-/* $OpenBSD: eigrpd.h,v 1.3 2015/10/04 22:54:38 renato Exp $ */
+/* $OpenBSD: eigrpd.h,v 1.4 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
/* routing information advertised by update/query/reply messages */
struct rinfo {
- int af;
- enum route_type type;
- union eigrpd_addr prefix;
- uint8_t prefixlen;
- union eigrpd_addr nexthop;
- struct classic_metric metric;
- struct classic_emetric emetric;
+ int af;
+ enum route_type type;
+ union eigrpd_addr prefix;
+ uint8_t prefixlen;
+ union eigrpd_addr nexthop;
+ struct classic_metric metric;
+ struct classic_emetric emetric;
};
struct rinfo_entry {
- TAILQ_ENTRY(rinfo_entry) entry;
- struct rinfo rinfo;
+ TAILQ_ENTRY(rinfo_entry) entry;
+ struct rinfo rinfo;
};
TAILQ_HEAD(rinfo_head, rinfo_entry);
#define IN6ADDRSZ 16
struct seq_addr_entry {
- TAILQ_ENTRY(seq_addr_entry) entry;
- int af;
- union eigrpd_addr addr;
+ TAILQ_ENTRY(seq_addr_entry) entry;
+ int af;
+ union eigrpd_addr addr;
};
TAILQ_HEAD(seq_addr_head, seq_addr_entry);
#define REDIST_NO 0x40
struct redist_metric {
- uint32_t bandwidth;
- uint32_t delay;
- uint8_t reliability;
- uint8_t load;
- uint16_t mtu;
+ uint32_t bandwidth;
+ uint32_t delay;
+ uint8_t reliability;
+ uint8_t load;
+ uint16_t mtu;
};
struct redistribute {
- SIMPLEQ_ENTRY(redistribute) entry;
- uint8_t type;
- int af;
- union eigrpd_addr addr;
- uint8_t prefixlen;
- struct redist_metric *metric;
+ SIMPLEQ_ENTRY(redistribute) entry;
+ uint8_t type;
+ int af;
+ union eigrpd_addr addr;
+ uint8_t prefixlen;
+ struct redist_metric *metric;
struct {
- uint32_t as;
- uint32_t metric;
- uint32_t tag;
+ uint32_t as;
+ uint32_t metric;
+ uint32_t tag;
} emetric;
};
SIMPLEQ_HEAD(redist_list, redistribute);
-/* $OpenBSD: interface.c,v 1.6 2015/10/10 05:09:19 renato Exp $ */
+/* $OpenBSD: interface.c,v 1.7 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
void
if_del(struct iface *iface)
{
- struct eigrp_iface *ei;
struct if_addr *if_addr;
log_debug("%s: interface %s", __func__, iface->name);
- while ((ei = TAILQ_FIRST(&iface->ei_list)) != NULL)
- eigrp_if_del(ei);
-
while ((if_addr = TAILQ_FIRST(&iface->addr_list)) != NULL) {
TAILQ_REMOVE(&iface->addr_list, if_addr, entry);
free(if_addr);
RB_REMOVE(iface_id_head, &ifaces_by_id, ei);
TAILQ_REMOVE(&ei->eigrp->ei_list, ei, e_entry);
TAILQ_REMOVE(&ei->iface->ei_list, ei, i_entry);
+ message_list_clr(&ei->query_list);
+ message_list_clr(&ei->update_list);
if (ei->state == IF_STA_ACTIVE)
eigrp_if_reset(ei);
-/* $OpenBSD: kroute.c,v 1.1 2015/10/02 04:26:47 renato Exp $ */
+/* $OpenBSD: kroute.c,v 1.2 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
kr.flags |= F_DYNAMIC;
kr.priority = rtm->rtm_priority;
-
if (rtm->rtm_type == RTM_CHANGE) {
/*
* The kernel doesn't allow RTM_CHANGE for multipath routes.
-/* $OpenBSD: rde.c,v 1.4 2015/10/10 05:12:33 renato Exp $ */
+/* $OpenBSD: rde.c,v 1.5 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
void
rde_instance_init(struct eigrp *eigrp)
{
- struct rde_nbr nbr;
+ struct rde_nbr nbr;
memset(&nbr, 0, sizeof(nbr));
nbr.flags = F_RDE_NBR_SELF | F_RDE_NBR_REDIST;
-/* $OpenBSD: rde.h,v 1.2 2015/10/05 01:59:33 renato Exp $ */
+/* $OpenBSD: rde.h,v 1.3 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
struct eigrp_route *);
struct eigrp_route *rt_get_successor_fc(struct rt_node *);
-void rde_send_ack(struct rde_nbr *);
void rde_send_update(struct eigrp_iface *, struct rinfo *);
void rde_send_update_all(struct rt_node *, struct rinfo *);
void rde_send_query(struct eigrp_iface *, struct rinfo *,
struct rt_node *, struct eigrp_route *);
void rde_check_link_down_nbr(struct rde_nbr *);
void rde_check_link_down(unsigned int);
-struct eigrp_interface;
void rde_check_link_cost_change(struct rde_nbr *,
- struct eigrp_interface *);
+ struct eigrp_iface *);
#endif /* _RDE_H_ */
-/* $OpenBSD: rde_dual.c,v 1.5 2015/10/20 11:26:40 jsg Exp $ */
+/* $OpenBSD: rde_dual.c,v 1.6 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
memcpy(&ri->prefix, &rn->prefix, sizeof(ri->prefix));
ri->prefixlen = rn->prefixlen;
ri->metric.delay = EIGRP_INFINITE_METRIC;
- ri->metric.bandwidth = 0;
- ri->metric.mtu[0] = 0;
- ri->metric.mtu[1] = 0;
- ri->metric.mtu[2] = 0;
- ri->metric.hop_count = 0;
- ri->metric.reliability = 0;
- ri->metric.load = 0;
- ri->metric.tag = 0;
- ri->metric.flags = 0;
- if (ri->type == EIGRP_ROUTE_EXTERNAL) {
- ri->emetric.routerid = 0;
- ri->emetric.as = 0;
- ri->emetric.tag = 0;
- ri->emetric.metric = 0;
- ri->emetric.protocol = 0;
- ri->emetric.flags = 0;
- }
}
void
}
void
-rde_check_link_cost_change(struct rde_nbr *nbr, struct eigrp_interface *ei)
+rde_check_link_cost_change(struct rde_nbr *nbr, struct eigrp_iface *ei)
{
}
-/* $OpenBSD: rtp.c,v 1.2 2015/10/05 01:59:33 renato Exp $ */
+/* $OpenBSD: rtp.c,v 1.3 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
fatal("rtp_send_ack");
/* EIGRP header */
- if (gen_eigrp_hdr(buf, EIGRP_OPC_HELLO, 0, 0, eigrp->as))
- goto fail;
+ if (gen_eigrp_hdr(buf, EIGRP_OPC_HELLO, 0, 0, eigrp->as)) {
+ log_warnx("%s: failed to send message", __func__);
+ ibuf_free(buf);
+ return;
+ }
/* send unreliably */
send_packet(nbr->ei, nbr, 0, buf);
ibuf_free(buf);
- return;
-fail:
- log_warnx("%s: failed to send message", __func__);
- ibuf_free(buf);
}
/* timers */
-/* $OpenBSD: tlv.c,v 1.4 2015/10/05 01:59:33 renato Exp $ */
+/* $OpenBSD: tlv.c,v 1.5 2015/10/21 03:48:09 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
/* adjust tlv length */
if ((tlvp = ibuf_seek(buf, original_size, sizeof(*tlvp))) == NULL)
- fatalx("gen_ipv4_internal_tlv: buf_seek failed");
+ fatalx("gen_route_tlv: buf_seek failed");
tlvp->length = htons(tlvlen);
return (0);