]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_siaquery.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / eigrpd / eigrp_siaquery.c
index b242bcaae9b7352b6ee2a74b9412b8c671c23c95..1c2ec3731f8c1bc1ac12317534e7468f64080337 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Sending and Receiving EIGRP SIA-Query Packets.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * 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 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>
@@ -52,7 +37,6 @@
 #include "eigrpd/eigrp_macros.h"
 #include "eigrpd/eigrp_topology.h"
 #include "eigrpd/eigrp_fsm.h"
-#include "eigrpd/eigrp_memory.h"
 
 /*EIGRP SIA-QUERY read function*/
 void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,
@@ -62,7 +46,7 @@ void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,
        struct eigrp_neighbor *nbr;
        struct TLV_IPv4_Internal_type *tlv;
 
-       u_int16_t type;
+       uint16_t type;
 
        /* increment statistics. */
        ei->siaQuery_in++;
@@ -80,14 +64,14 @@ void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,
                if (type == EIGRP_TLV_IPv4_INT) {
                        struct prefix dest_addr;
 
-                       stream_set_getp(s, s->getp - sizeof(u_int16_t));
+                       stream_set_getp(s, s->getp - sizeof(uint16_t));
 
                        tlv = eigrp_read_ipv4_tlv(s);
 
                        dest_addr.family = AFI_IP;
                        dest_addr.u.prefix4 = tlv->destination;
                        dest_addr.prefixlen = tlv->prefix_length;
-                       struct eigrp_prefix_entry *dest =
+                       struct eigrp_prefix_descriptor *dest =
                                eigrp_topology_table_lookup_ipv4(
                                        eigrp->topology_table, &dest_addr);
 
@@ -95,9 +79,9 @@ void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,
                         * know)*/
                        if (dest != NULL) {
                                struct eigrp_fsm_action_message msg;
-                               struct eigrp_nexthop_entry *entry =
-                                       eigrp_prefix_entry_lookup(dest->entries,
-                                                                 nbr);
+                               struct eigrp_route_descriptor *entry =
+                                       eigrp_route_descriptor_lookup(
+                                               dest->entries, nbr);
                                msg.packet_type = EIGRP_OPC_SIAQUERY;
                                msg.eigrp = eigrp;
                                msg.data_type = EIGRP_INT;
@@ -114,27 +98,27 @@ void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,
 }
 
 void eigrp_send_siaquery(struct eigrp_neighbor *nbr,
-                        struct eigrp_prefix_entry *pe)
+                        struct eigrp_prefix_descriptor *pe)
 {
        struct eigrp_packet *ep;
-       u_int16_t length = EIGRP_HEADER_LEN;
+       uint16_t length = EIGRP_HEADER_LEN;
 
-       ep = eigrp_packet_new(nbr->ei->ifp->mtu, nbr);
+       ep = eigrp_packet_new(EIGRP_PACKET_MTU(nbr->ei->ifp->mtu), nbr);
 
        /* Prepare EIGRP INIT UPDATE header */
        eigrp_packet_header_init(EIGRP_OPC_SIAQUERY, nbr->ei->eigrp, ep->s, 0,
                                 nbr->ei->eigrp->sequence_number, 0);
 
        // 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 ((nbr->ei->params.auth_type == EIGRP_AUTH_TYPE_MD5)
+           && (nbr->ei->params.auth_keychain != NULL)) {
                length += eigrp_add_authTLV_MD5_to_stream(ep->s, nbr->ei);
        }
 
        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 ((nbr->ei->params.auth_type == EIGRP_AUTH_TYPE_MD5)
+           && (nbr->ei->params.auth_keychain != NULL)) {
                eigrp_make_md5_digest(nbr->ei, ep->s, EIGRP_AUTH_UPDATE_FLAG);
        }