]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_adjacency.h
Merge pull request #5639 from qlyoung/fix-zebra-ptm-double-free
[mirror_frr.git] / isisd / isis_adjacency.h
index cdcd5cf74abe68a27194af277e2c3ba97314ceac..93583fc1224372a31518af7c42911a1fc3f121ec 100644 (file)
  * 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; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * 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
  */
 
 #ifndef _ZEBRA_ISIS_ADJACENCY_H
 #define _ZEBRA_ISIS_ADJACENCY_H
 
+#include "isisd/isis_tlvs.h"
+
 enum isis_adj_usage {
        ISIS_ADJ_NONE,
        ISIS_ADJ_LEVEL1,
@@ -66,46 +68,65 @@ struct isis_dis_record {
        time_t last_dis_change; /* timestamp for last dis change */
 };
 
+struct bfd_session;
+
 struct isis_adjacency {
-       u_char snpa[ETH_ALEN];             /* NeighbourSNPAAddress */
-       u_char sysid[ISIS_SYS_ID_LEN];     /* neighbourSystemIdentifier */
-       u_char lanid[ISIS_SYS_ID_LEN + 1]; /* LAN id on bcast circuits */
+       uint8_t snpa[ETH_ALEN];             /* NeighbourSNPAAddress */
+       uint8_t sysid[ISIS_SYS_ID_LEN];     /* neighbourSystemIdentifier */
+       uint8_t lanid[ISIS_SYS_ID_LEN + 1]; /* LAN id on bcast circuits */
        int dischanges[ISIS_LEVELS];       /* how many DIS changes ? */
        /* an array of N levels for M records */
        struct isis_dis_record dis_record[DIS_RECORDS * ISIS_LEVELS];
-       enum isis_adj_state adj_state; /* adjacencyState */
-       enum isis_adj_usage adj_usage; /* adjacencyUsage */
-       struct list *area_addrs;       /* areaAdressesOfNeighbour */
-       struct nlpids nlpids;     /* protocols spoken ... */
-       struct list *ipv4_addrs;
+       enum isis_adj_state adj_state;    /* adjacencyState */
+       enum isis_adj_usage adj_usage;    /* adjacencyUsage */
+       struct area_addr *area_addresses; /* areaAdressesOfNeighbour */
+       unsigned int area_address_count;
+       struct nlpids nlpids; /* protocols spoken ... */
+       struct in_addr *ipv4_addresses;
+       unsigned int ipv4_address_count;
        struct in_addr router_address;
-       struct list *ipv6_addrs;
+       struct in6_addr *ipv6_addresses;
+       unsigned int ipv6_address_count;
        struct in6_addr router_address6;
-       u_char prio[ISIS_LEVELS];       /* priorityOfNeighbour for DIS */
+       uint8_t prio[ISIS_LEVELS];      /* priorityOfNeighbour for DIS */
        int circuit_t;                  /* from hello PDU hdr */
        int level;                      /* level (1 or 2) */
        enum isis_system_type sys_type; /* neighbourSystemType */
-       u_int16_t hold_time;            /* entryRemainingTime */
-       u_int32_t last_upd;
-       u_int32_t last_flap;      /* last time the adj flapped */
+       uint16_t hold_time;             /* entryRemainingTime */
+       uint32_t last_upd;
+       uint32_t last_flap; /* last time the adj flapped */
+       enum isis_threeway_state threeway_state;
+       uint32_t ext_circuit_id;
        int flaps;                    /* number of adjacency flaps  */
        struct thread *t_expire;      /* expire after hold_time  */
        struct isis_circuit *circuit; /* back pointer */
+       uint16_t *mt_set;      /* Topologies this adjacency is valid for */
+       unsigned int mt_count; /* Number of entries in mt_set */
+       struct bfd_session *bfd_session;
 };
 
-struct isis_adjacency *isis_adj_lookup(const u_char *sysid, struct list *adjdb);
-struct isis_adjacency *isis_adj_lookup_snpa(const u_char *ssnpa,
+struct isis_threeway_adj;
+
+struct isis_adjacency *isis_adj_lookup(const uint8_t *sysid,
+                                      struct list *adjdb);
+struct isis_adjacency *isis_adj_lookup_snpa(const uint8_t *ssnpa,
                                            struct list *adjdb);
-struct isis_adjacency *isis_new_adj(const u_char *id, const u_char *snpa,
+struct isis_adjacency *isis_new_adj(const uint8_t *id, const uint8_t *snpa,
                                    int level, struct isis_circuit *circuit);
 void isis_delete_adj(void *adj);
+void isis_adj_process_threeway(struct isis_adjacency *adj,
+                              struct isis_threeway_adj *tw_adj,
+                              enum isis_adj_usage adj_usage);
+DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj))
 void isis_adj_state_change(struct isis_adjacency *adj,
                           enum isis_adj_state state, const char *reason);
 void isis_adj_print(struct isis_adjacency *adj);
+const char *isis_adj_yang_state(enum isis_adj_state state);
 int isis_adj_expire(struct thread *thread);
 void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
                        char detail);
 void isis_adj_build_neigh_list(struct list *adjdb, struct list *list);
 void isis_adj_build_up_list(struct list *adjdb, struct list *list);
+int isis_adj_usage2levels(enum isis_adj_usage usage);
 
 #endif /* ISIS_ADJACENCY_H */