]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospfd.h
*: Convert thread_add_XXX functions to event_add_XXX
[mirror_frr.git] / ospfd / ospfd.h
index 3a43010f85f6faff7721114fcb2de3670a77b50a..dcb5a30e67a41402b3f976b300b21df880b72dab 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd main header.
  * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * 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
  */
 
 #ifndef _ZEBRA_OSPFD_H
@@ -116,7 +101,25 @@ struct ospf_redist {
                struct route_map *map;
        } route_map; /* +1 is for default-information */
 #define ROUTEMAP_NAME(R)   (R->route_map.name)
-#define ROUTEMAP(R)        (R->route_map.map)
+#define ROUTEMAP(R) (R->route_map.map)
+};
+
+/* OSPF area flood reduction info */
+struct ospf_area_fr_info {
+       bool enabled;       /* Area support for Flood Reduction */
+       bool configured;    /* Flood Reduction configured per area knob */
+       bool state_changed; /* flood reduction state change info */
+       int router_lsas_recv_dc_bit; /* Number of unique router lsas
+                                     * received with DC bit set.
+                                     * (excluding self)
+                                     */
+       bool area_ind_lsa_recvd;     /* Indication lsa received in this area */
+       bool area_dc_clear;       /* Area has atleast one lsa with dc bit 0(
+                                     * excluding indication lsa)
+                                     */
+       struct ospf_lsa *indication_lsa_self; /* Indication LSA generated
+                                              * in the area.
+                                              */
 };
 
 /* ospf->config */
@@ -142,7 +145,7 @@ struct ospf_gr_info {
        bool prepare_in_progress;
        bool finishing_restart;
        uint32_t grace_period;
-       struct thread *t_grace_period;
+       struct event *t_grace_period;
 };
 
 /* OSPF instance structure. */
@@ -254,30 +257,30 @@ struct ospf {
        int redistribute;               /* Num of redistributed protocols. */
 
        /* Threads. */
-       struct thread *t_abr_task;        /* ABR task timer. */
-       struct thread *t_asbr_check;    /* ASBR check timer. */
-       struct thread *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
+       struct event *t_abr_task;                /* ABR task timer. */
+       struct event *t_abr_fr;                  /* ABR FR timer. */
+       struct event *t_asbr_check;              /* ASBR check timer. */
+       struct event *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
                                                     update timer. */
-       struct thread *t_distribute_update; /* Distirbute list update timer. */
-       struct thread *t_spf_calc;        /* SPF calculation timer. */
-       struct thread *t_ase_calc;        /* ASE calculation timer. */
-       struct thread
-               *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
-       struct thread *t_sr_update; /* Segment Routing update timer */
+       struct event *t_distribute_update; /* Distirbute list update timer. */
+       struct event *t_spf_calc;          /* SPF calculation timer. */
+       struct event *t_ase_calc;          /* ASE calculation timer. */
+       struct event *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
+       struct event *t_sr_update;       /* Segment Routing update timer */
 
        unsigned int maxage_delay;      /* Delay on Maxage remover timer, sec */
-       struct thread *t_maxage;        /* MaxAge LSA remover timer. */
-       struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */
+       struct event *t_maxage;         /* MaxAge LSA remover timer. */
+       struct event *t_maxage_walker;  /* MaxAge LSA checking timer. */
 
-       struct thread
+       struct event
                *t_deferred_shutdown; /* deferred/stub-router shutdown timer*/
 
-       struct thread *t_write;
+       struct event *t_write;
 #define OSPF_WRITE_INTERFACE_COUNT_DEFAULT    20
-       struct thread *t_default_routemap_timer;
+       struct event *t_default_routemap_timer;
 
        int write_oi_count; /* Num of packets sent per thread invocation */
-       struct thread *t_read;
+       struct event *t_read;
        int fd;
        struct stream *ibuf;
        struct list *oi_write_q;
@@ -309,7 +312,7 @@ struct ospf {
                struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
        } lsa_refresh_queue;
 
-       struct thread *t_lsa_refresher;
+       struct event *t_lsa_refresher;
        time_t lsa_refresher_started;
 #define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
        uint16_t lsa_refresh_interval;
@@ -378,7 +381,7 @@ struct ospf {
        /* delay timer to process external routes
         * with summary address.
         */
-       struct thread *t_external_aggr;
+       struct event *t_external_aggr;
 
        /* delay interval in seconds */
        uint16_t aggr_delay_interval;
@@ -406,6 +409,9 @@ struct ospf {
        bool ti_lfa_enabled;
        enum protection_type ti_lfa_protection_type;
 
+       /* Flood Reduction configuration state */
+       bool fr_configured;
+
        QOBJ_FIELDS;
 };
 DECLARE_QOBJ_TYPE(ospf);
@@ -571,8 +577,8 @@ struct ospf_area {
        struct p_spaces_head *p_spaces;
 
        /* Threads. */
-       struct thread *t_stub_router;     /* Stub-router timer */
-       struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
+       struct event *t_stub_router;     /* Stub-router timer */
+       struct event *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
 
        /* Statistics field. */
        uint32_t spf_calculation; /* SPF Calculation Count. */
@@ -591,6 +597,8 @@ struct ospf_area {
        uint32_t act_ints;  /* Active interfaces. */
        uint32_t full_nbrs; /* Fully adjacent neighbors. */
        uint32_t full_vls;  /* Fully adjacent virtual neighbors. */
+
+       struct ospf_area_fr_info fr_info; /* Flood reduction info. */
 };
 
 /* OSPF config network structure. */
@@ -618,7 +626,7 @@ struct ospf_nbr_nbma {
        uint32_t v_poll;
 
        /* Poll timer thread. */
-       struct thread *t_poll;
+       struct event *t_poll;
 
        /* State change. */
        uint32_t state_change;
@@ -645,9 +653,11 @@ struct ospf_nbr_nbma {
 #define LSA_OPTIONS_NSSA_GET(area)                                             \
        (((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0)
 
-#define OSPF_TIMER_ON(T,F,V) thread_add_timer (master,(F),ospf,(V),&(T))
-#define OSPF_AREA_TIMER_ON(T,F,V) thread_add_timer (master, (F), area, (V), &(T))
-#define OSPF_POLL_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr_nbma, (V), &(T))
+#define OSPF_TIMER_ON(T, F, V) event_add_timer(master, (F), ospf, (V), &(T))
+#define OSPF_AREA_TIMER_ON(T, F, V)                                            \
+       event_add_timer(master, (F), area, (V), &(T))
+#define OSPF_POLL_TIMER_ON(T, F, V)                                            \
+       event_add_timer(master, (F), nbr_nbma, (V), &(T))
 
 /* Extern variables. */
 extern struct ospf_master *om;