]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_circuit.h
isisd: implement Remote LFA
[mirror_frr.git] / isisd / isis_circuit.h
index 7c380fb0d9722456c86e74df7a34b4039ec55388..9a8982dc06ef58231c34be178b747bf1c0b6ee1f 100644 (file)
@@ -50,16 +50,18 @@ struct metric {
 };
 
 struct isis_bcast_info {
-       uint8_t snpa[ETH_ALEN];             /* SNPA of this circuit */
-       char run_dr_elect[2];               /* Should we run dr election ? */
-       struct thread *t_run_dr[2];      /* DR election thread */
-       struct thread *t_send_lan_hello[2]; /* send LAN IIHs in this thread */
-       struct list *adjdb[2];              /* adjacency dbs */
-       struct list *lan_neighs[2];      /* list of lx neigh snpa */
-       char is_dr[2];                      /* Are we level x DR ? */
+       uint8_t snpa[ETH_ALEN];               /* SNPA of this circuit */
+       char run_dr_elect[ISIS_LEVELS];       /* Should we run dr election ? */
+       struct thread *t_run_dr[ISIS_LEVELS]; /* DR election thread */
+       struct thread *t_send_lan_hello[ISIS_LEVELS]; /* send LAN IIHs in this
+                                                        thread */
+       struct list *adjdb[ISIS_LEVELS];              /* adjacency dbs */
+       struct list *lan_neighs[ISIS_LEVELS];     /* list of lx neigh snpa */
+       char is_dr[ISIS_LEVELS];                  /* Are we level x DR ? */
        uint8_t l1_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-1 DR */
        uint8_t l2_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-2 DR */
-       struct thread *t_refresh_pseudo_lsp[2];  /* refresh pseudo-node LSPs */
+       struct thread *t_refresh_pseudo_lsp[ISIS_LEVELS]; /* refresh pseudo-node
+                                                            LSPs */
 };
 
 struct isis_p2p_info {
@@ -77,6 +79,7 @@ struct isis_circuit_arg {
 struct isis_circuit {
        int state;
        uint8_t circuit_id;       /* l1/l2 bcast CircuitID */
+       struct isis *isis;
        struct isis_area *area;      /* back pointer to the area */
        struct interface *interface; /* interface info from z */
        int fd;                      /* IS-IS l1/2 socket */
@@ -86,10 +89,11 @@ struct isis_circuit {
         * Threads
         */
        struct thread *t_read;
-       struct thread *t_send_csnp[2];
-       struct thread *t_send_psnp[2];
+       struct thread *t_send_csnp[ISIS_LEVELS];
+       struct thread *t_send_psnp[ISIS_LEVELS];
        struct isis_tx_queue *tx_queue;
-       struct isis_circuit_arg level_arg[2]; /* used as argument for threads */
+       struct isis_circuit_arg
+               level_arg[ISIS_LEVELS]; /* used as argument for threads */
 
        /* there is no real point in two streams, just for programming kicker */
        int (*rx)(struct isis_circuit *circuit, uint8_t *ssnpa);
@@ -107,7 +111,7 @@ struct isis_circuit {
                struct isis_bcast_info bc;
                struct isis_p2p_info p2p;
        } u;
-       uint8_t priority[2]; /* l1/2 IS configured priority */
+       uint8_t priority[ISIS_LEVELS]; /* l1/2 IS configured priority */
        int pad_hellos;     /* add padding to Hello PDUs ? */
        char ext_domain;    /* externalDomain   (boolean) */
        int lsp_regenerate_pending[ISIS_LEVELS];
@@ -117,12 +121,12 @@ struct isis_circuit {
        struct isis_passwd passwd;     /* Circuit rx/tx password */
        int is_type;                   /* circuit is type == level of circuit
                                        * differentiated from circuit type (media) */
-       uint32_t hello_interval[2];   /* hello-interval in seconds */
-       uint16_t hello_multiplier[2]; /* hello-multiplier */
-       uint16_t csnp_interval[2];    /* csnp-interval in seconds */
-       uint16_t psnp_interval[2];    /* psnp-interval in seconds */
-       uint8_t metric[2];
-       uint32_t te_metric[2];
+       uint32_t hello_interval[ISIS_LEVELS];   /* hello-interval in seconds */
+       uint16_t hello_multiplier[ISIS_LEVELS]; /* hello-multiplier */
+       uint16_t csnp_interval[ISIS_LEVELS];    /* csnp-interval in seconds */
+       uint16_t psnp_interval[ISIS_LEVELS];    /* psnp-interval in seconds */
+       uint8_t metric[ISIS_LEVELS];
+       uint32_t te_metric[ISIS_LEVELS];
        struct isis_ext_subtlvs *ext; /* Extended parameters (TE + Adj SID */
        int ip_router;  /* Route IP ? */
        int is_passive; /* Is Passive ? */
@@ -131,11 +135,18 @@ struct isis_circuit {
        int ipv6_router;            /* Route IPv6 ? */
        struct list *ipv6_link;     /* our link local IPv6 addresses */
        struct list *ipv6_non_link; /* our non-link local IPv6 addresses */
-       uint16_t upadjcount[2];
+       uint16_t upadjcount[ISIS_LEVELS];
 #define ISIS_CIRCUIT_FLAPPED_AFTER_SPF 0x01
        uint8_t flags;
        bool disable_threeway_adj;
        struct bfd_info *bfd_info;
+       struct ldp_sync_info *ldp_sync_info;
+       bool lfa_protection[ISIS_LEVELS];
+       bool rlfa_protection[ISIS_LEVELS];
+       uint32_t rlfa_max_metric[ISIS_LEVELS];
+       struct hash *lfa_excluded_ifaces[ISIS_LEVELS];
+       bool tilfa_protection[ISIS_LEVELS];
+       bool tilfa_node_protection[ISIS_LEVELS];
        /*
         * Counters as in 10589--11.2.5.9
         */
@@ -143,8 +154,8 @@ struct isis_circuit {
        uint32_t init_failures;     /* intialisationFailures */
        uint32_t ctrl_pdus_rxed;    /* controlPDUsReceived */
        uint32_t ctrl_pdus_txed;    /* controlPDUsSent */
-       uint32_t
-               desig_changes[2]; /* lanLxDesignatedIntermediateSystemChanges */
+       uint32_t desig_changes[ISIS_LEVELS]; /* lanLxDesignatedIntermediateSystemChanges
+                                             */
        uint32_t rej_adjacencies; /* rejectedAdjacencies */
        /*
         * Counters as in ietf-isis@2019-09-09.yang
@@ -159,7 +170,7 @@ struct isis_circuit {
 DECLARE_QOBJ_TYPE(isis_circuit)
 
 void isis_circuit_init(void);
-struct isis_circuit *isis_circuit_new(void);
+struct isis_circuit *isis_circuit_new(struct isis *isis);
 void isis_circuit_del(struct isis_circuit *circuit);
 struct isis_circuit *circuit_lookup_by_ifp(struct interface *ifp,
                                           struct list *list);