dest_addr.prefixlen = ei->connected->address->prefixlen;
apply_mask(&dest_addr);
pe = eigrp_topology_table_lookup_ipv4(eigrp->topology_table,
- (struct prefix_ipv4 *)&dest_addr);
+ &dest_addr);
if (pe == NULL) {
pe = eigrp_prefix_entry_new();
void eigrp_if_free(struct eigrp_interface *ei, int source)
{
- struct prefix_ipv4 dest_addr;
+ struct prefix dest_addr;
struct eigrp_prefix_entry *pe;
struct eigrp *eigrp = eigrp_lookup();
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);
+ dest_addr = *ei->connected->address;
+ apply_mask(&dest_addr);
pe = eigrp_topology_table_lookup_ipv4(eigrp->topology_table,
&dest_addr);
if (pe)
{
struct eigrp_neighbor *nbr;
struct TLV_IPv4_Internal_type *tlv;
- struct prefix_ipv4 dest_addr;
+ struct prefix dest_addr;
u_int16_t type;
u_int16_t length;
tlv = eigrp_read_ipv4_tlv(s);
dest_addr.family = AF_INET;
- dest_addr.prefix = tlv->destination;
+ dest_addr.u.prefix4 = tlv->destination;
dest_addr.prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest =
eigrp_topology_table_lookup_ipv4(
while (s->endp > s->getp) {
type = stream_getw(s);
if (type == EIGRP_TLV_IPv4_INT) {
- struct prefix_ipv4 dest_addr;
+ struct prefix dest_addr;
stream_set_getp(s, s->getp - sizeof(u_int16_t));
tlv = eigrp_read_ipv4_tlv(s);
dest_addr.family = AF_INET;
- dest_addr.prefix = tlv->destination;
+ dest_addr.u.prefix4 = tlv->destination;
dest_addr.prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest =
eigrp_topology_table_lookup_ipv4(
while (s->endp > s->getp) {
type = stream_getw(s);
if (type == EIGRP_TLV_IPv4_INT) {
- struct prefix_ipv4 dest_addr;
+ struct prefix dest_addr;
stream_set_getp(s, s->getp - sizeof(u_int16_t));
tlv = eigrp_read_ipv4_tlv(s);
dest_addr.family = AFI_IP;
- dest_addr.prefix = tlv->destination;
+ dest_addr.u.prefix4 = tlv->destination;
dest_addr.prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest =
eigrp_topology_table_lookup_ipv4(
while (s->endp > s->getp) {
type = stream_getw(s);
if (type == EIGRP_TLV_IPv4_INT) {
- struct prefix_ipv4 dest_addr;
+ struct prefix dest_addr;
stream_set_getp(s, s->getp - sizeof(u_int16_t));
tlv = eigrp_read_ipv4_tlv(s);
dest_addr.family = AFI_IP;
- dest_addr.prefix = tlv->destination;
+ dest_addr.u.prefix4 = tlv->destination;
dest_addr.prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest =
eigrp_topology_table_lookup_ipv4(
struct eigrp_prefix_entry *
eigrp_topology_table_lookup_ipv4(struct list *topology_table,
- struct prefix_ipv4 *address)
+ struct prefix *address)
{
struct eigrp_prefix_entry *data;
struct listnode *node;
for (ALL_LIST_ELEMENTS_RO(topology_table, node, data)) {
- if (prefix_same(data->destination,
- (struct prefix *)address))
+ if (prefix_same(data->destination, address))
return data;
}
extern void eigrp_topology_delete_all(struct list *);
extern unsigned int eigrp_topology_table_isempty(struct list *);
extern struct eigrp_prefix_entry *
-eigrp_topology_table_lookup_ipv4(struct list *, struct prefix_ipv4 *);
+eigrp_topology_table_lookup_ipv4(struct list *, struct prefix *);
extern struct list *eigrp_topology_get_successor(struct eigrp_prefix_entry *);
extern struct list *
eigrp_topology_get_successor_max(struct eigrp_prefix_entry *pe,
u_char same;
struct access_list *alist;
struct prefix_list *plist;
- struct prefix_ipv4 dest_addr;
+ struct prefix dest_addr;
struct eigrp *e;
u_char graceful_restart;
u_char graceful_restart_final;
/*searching if destination exists */
dest_addr.family = AF_INET;
- dest_addr.prefix = tlv->destination;
+ dest_addr.u.prefix4 = tlv->destination;
dest_addr.prefixlen = tlv->prefix_length;
struct eigrp_prefix_entry *dest =
eigrp_topology_table_lookup_ipv4(
pe->serno = eigrp->serno;
pe->destination = (struct prefix *)prefix_ipv4_new();
prefix_copy(pe->destination,
- (struct prefix *)&dest_addr);
+ &dest_addr);
pe->af = AF_INET;
pe->state = EIGRP_FSM_STATE_PASSIVE;
pe->nt = EIGRP_TOPOLOGY_TYPE_REMOTE;
/* Check if access-list fits */
if (alist
- && access_list_apply(
- alist,
- (struct prefix *)&dest_addr)
+ && access_list_apply(alist,
+ &dest_addr)
== FILTER_DENY) {
/* If yes, set reported metric to Max */
ne->reported_metric.delay =
/* Check if prefix-list fits */
if (plist
- && prefix_list_apply(
- plist,
- (struct prefix *)&dest_addr)
+ && prefix_list_apply(plist,
+ &dest_addr)
== PREFIX_DENY) {
/* If yes, set reported metric to Max */
ne->reported_metric.delay =
/* Check if access-list fits */
if (alist
- && access_list_apply(
- alist,
- (struct prefix *)&dest_addr)
+ && access_list_apply(alist,
+ &dest_addr)
== FILTER_DENY) {
/* If yes, set reported metric to Max */
ne->reported_metric.delay =
/* Check if prefix-list fits */
if (plist
- && prefix_list_apply(
- plist,
- (struct prefix *)&dest_addr)
+ && prefix_list_apply(plist,
+ &dest_addr)
== PREFIX_DENY) {
/* If yes, set reported metric to Max */
ne->reported_metric.delay =
/* Check if any list fits */
if ((alist
&& access_list_apply (alist,
- (struct prefix *) dest_addr) == FILTER_DENY)||
+ dest_addr) == FILTER_DENY)||
(plist && prefix_list_apply (plist,
- (struct prefix *) dest_addr) == PREFIX_DENY)||
+ dest_addr) == PREFIX_DENY)||
(alist_i && access_list_apply (alist_i,
- (struct prefix *) dest_addr) == FILTER_DENY)||
+ dest_addr) == FILTER_DENY)||
(plist_i && prefix_list_apply (plist_i,
- (struct prefix *) dest_addr) == PREFIX_DENY)) {
+ dest_addr) == PREFIX_DENY)) {
//pe->reported_metric.delay = EIGRP_MAX_METRIC;
continue;
} else {
/* Check if any list fits */
if ((alist
&& access_list_apply(alist,
- (struct prefix *)dest_addr)
+ dest_addr)
== FILTER_DENY)
|| (plist
&& prefix_list_apply(plist,
- (struct prefix *)dest_addr)
+ dest_addr)
== PREFIX_DENY)
|| (alist_i
&& access_list_apply(alist_i,
- (struct prefix *)dest_addr)
+ dest_addr)
== FILTER_DENY)
|| (plist_i
&& prefix_list_apply(plist_i,
- (struct prefix *)dest_addr)
+ dest_addr)
== PREFIX_DENY)) {
// pe->reported_metric.delay = EIGRP_MAX_METRIC;
continue;