]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_apiserver.h
Merge pull request #11836 from ak503/nhrp_nbma
[mirror_frr.git] / ospfd / ospf_apiserver.h
index 544a32a28ce193e29cc897097072d69557270dde..e28202e46f9e51e9e2c23000e4b258e750844b43 100644 (file)
 #ifndef _OSPF_APISERVER_H
 #define _OSPF_APISERVER_H
 
+#include <zebra.h>
+#include "ospf_api.h"
+#include "ospf_lsdb.h"
+
 /* MTYPE definition is not reflected to "memory.h". */
 #define MTYPE_OSPF_APISERVER MTYPE_TMP
 #define MTYPE_OSPF_APISERVER_MSGFILTER MTYPE_TMP
@@ -52,6 +56,9 @@ struct ospf_apiserver {
        /* Temporary storage for LSA instances to be refreshed. */
        struct ospf_lsdb reserve;
 
+       /* Sync reachable routers */
+       bool reachable_sync;
+
        /* filter for LSA update/delete notifies */
        struct lsa_filter_type *filter;
 
@@ -68,7 +75,7 @@ struct ospf_apiserver {
        struct thread *t_async_write;
 };
 
-enum event {
+enum ospf_apiserver_event {
        OSPF_APISERVER_ACCEPT,
        OSPF_APISERVER_SYNC_READ,
 #ifdef USE_ASYNC_READ
@@ -79,7 +86,7 @@ enum event {
 };
 
 /* -----------------------------------------------------------
- * Followings are functions to manage client connections.
+ * Following are functions to manage client connections.
  * -----------------------------------------------------------
  */
 
@@ -88,18 +95,18 @@ extern int ospf_apiserver_init(void);
 extern void ospf_apiserver_term(void);
 extern struct ospf_apiserver *ospf_apiserver_new(int fd_sync, int fd_async);
 extern void ospf_apiserver_free(struct ospf_apiserver *apiserv);
-extern void ospf_apiserver_event(enum event event, int fd,
+extern void ospf_apiserver_event(enum ospf_apiserver_event event, int fd,
                                 struct ospf_apiserver *apiserv);
 extern int ospf_apiserver_serv_sock_family(unsigned short port, int family);
-extern int ospf_apiserver_accept(struct thread *thread);
-extern int ospf_apiserver_read(struct thread *thread);
-extern int ospf_apiserver_sync_write(struct thread *thread);
-extern int ospf_apiserver_async_write(struct thread *thread);
+extern void ospf_apiserver_accept(struct thread *thread);
+extern void ospf_apiserver_read(struct thread *thread);
+extern void ospf_apiserver_sync_write(struct thread *thread);
+extern void ospf_apiserver_async_write(struct thread *thread);
 extern int ospf_apiserver_send_reply(struct ospf_apiserver *apiserv,
                                     uint32_t seqnr, uint8_t rc);
 
 /* -----------------------------------------------------------
- * Followings are message handler functions
+ * Following are message handler functions
  * -----------------------------------------------------------
  */
 
@@ -118,6 +125,8 @@ extern void ospf_apiserver_clients_notify_new_if(struct ospf_interface *oi);
 extern void ospf_apiserver_clients_notify_del_if(struct ospf_interface *oi);
 extern void ospf_apiserver_clients_notify_ism_change(struct ospf_interface *oi);
 extern void ospf_apiserver_clients_notify_nsm_change(struct ospf_neighbor *nbr);
+extern void
+ospf_apiserver_clients_notify_router_id_change(struct in_addr router_id);
 
 extern int ospf_apiserver_is_ready_type9(struct ospf_interface *oi);
 extern int ospf_apiserver_is_ready_type10(struct ospf_area *area);
@@ -144,10 +153,20 @@ extern int ospf_apiserver_handle_delete_request(struct ospf_apiserver *apiserv,
                                                struct msg *msg);
 extern int ospf_apiserver_handle_sync_lsdb(struct ospf_apiserver *apiserv,
                                           struct msg *msg);
+extern int ospf_apiserver_handle_sync_reachable(struct ospf_apiserver *apiserv,
+                                               struct msg *msg);
+extern int ospf_apiserver_handle_sync_ism(struct ospf_apiserver *apiserv,
+                                         struct msg *msg);
+extern int ospf_apiserver_handle_sync_nsm(struct ospf_apiserver *apiserv,
+                                         struct msg *msg);
+extern int ospf_apiserver_handle_sync_router_id(struct ospf_apiserver *apiserv,
+                                               struct msg *msg);
 
+extern void ospf_apiserver_notify_reachable(struct route_table *ort,
+                                           struct route_table *nrt);
 
 /* -----------------------------------------------------------
- * Followings are functions for LSA origination/deletion
+ * Following are functions for LSA origination/deletion
  * -----------------------------------------------------------
  */
 
@@ -164,12 +183,13 @@ extern struct ospf_interface *
 ospf_apiserver_if_lookup_by_addr(struct in_addr address);
 extern struct ospf_interface *
 ospf_apiserver_if_lookup_by_ifp(struct interface *ifp);
-extern int ospf_apiserver_originate1(struct ospf_lsa *lsa);
+extern int ospf_apiserver_originate1(struct ospf_lsa *lsa,
+                                    struct ospf_lsa *old);
 extern void ospf_apiserver_flood_opaque_lsa(struct ospf_lsa *lsa);
 
 
 /* -----------------------------------------------------------
- * Followings are callback functions to handle opaque types
+ * Following are callback functions to handle opaque types
  * -----------------------------------------------------------
  */
 
@@ -191,7 +211,7 @@ extern void ospf_apiserver_flush_opaque_lsa(struct ospf_apiserver *apiserv,
                                            uint8_t opaque_type);
 
 /* -----------------------------------------------------------
- * Followings are hooks when LSAs are updated or deleted
+ * Following are hooks when LSAs are updated or deleted
  * -----------------------------------------------------------
  */
 
@@ -201,7 +221,4 @@ extern void ospf_apiserver_flush_opaque_lsa(struct ospf_apiserver *apiserv,
 extern int ospf_apiserver_lsa_update(struct ospf_lsa *lsa);
 extern int ospf_apiserver_lsa_delete(struct ospf_lsa *lsa);
 
-extern void ospf_apiserver_clients_lsa_change_notify(uint8_t msgtype,
-                                                    struct ospf_lsa *lsa);
-
 #endif /* _OSPF_APISERVER_H */