]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/lde.h
Merge pull request #5396 from ton31337/fix/send_BGP_NOTIFY_CEASE_PEER_UNCONFIG_after_...
[mirror_frr.git] / ldpd / lde.h
index 7fa5219b121cdf22ec95be741b8df2e378f785bb..94077d16316be8b948d2a2881e4ab3fab01c0638 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef _LDE_H_
 #define _LDE_H_
 
-#include "openbsd-queue.h"
+#include "queue.h"
 #include "openbsd-tree.h"
 #include "if.h"
 
@@ -90,10 +90,12 @@ struct lde_nbr {
        struct in_addr           id;
        int                      v4_enabled;    /* announce/process v4 msgs */
        int                      v6_enabled;    /* announce/process v6 msgs */
+       int                      flags;         /* capabilities */
        struct fec_tree          recv_req;
        struct fec_tree          sent_req;
        struct fec_tree          recv_map;
        struct fec_tree          sent_map;
+       struct fec_tree          sent_map_pending;
        struct fec_tree          sent_wdraw;
        TAILQ_HEAD(, lde_addr)   addr_list;
 };
@@ -110,6 +112,7 @@ struct fec_nh {
        uint8_t                  flags;
 };
 #define F_FEC_NH_NEW           0x01
+#define F_FEC_NH_CONNECTED     0x02
 
 struct fec_node {
        struct fec               fec;
@@ -122,6 +125,13 @@ struct fec_node {
        void                    *data;          /* fec specific data */
 };
 
+#define CHUNK_SIZE             64
+struct label_chunk {
+       uint32_t                 start;
+       uint32_t                 end;
+       uint64_t                 used_mask;
+};
+
 #define LDE_GC_INTERVAL 300
 
 extern struct ldpd_conf        *ldeconf;
@@ -130,11 +140,13 @@ extern struct nbr_tree     lde_nbrs;
 extern struct thread   *gc_timer;
 
 /* lde.c */
-void            lde(const char *, const char *);
+void            lde(void);
+void            lde_init(struct ldpd_init *);
 int             lde_imsg_compose_parent(int, pid_t, void *, uint16_t);
+void            lde_imsg_compose_parent_sync(int, pid_t, void *, uint16_t);
 int             lde_imsg_compose_ldpe(int, uint32_t, pid_t, void *, uint16_t);
 int             lde_acl_check(char *, int, union ldpd_addr *, uint8_t);
-uint32_t        lde_assign_label(struct fec *, int);
+uint32_t        lde_update_label(struct fec_node *);
 void            lde_send_change_klabel(struct fec_node *, struct fec_nh *);
 void            lde_send_delete_klabel(struct fec_node *, struct fec_nh *);
 void            lde_fec2map(struct fec *, struct map *);
@@ -142,15 +154,26 @@ void               lde_map2fec(struct map *, struct in_addr, struct fec *);
 void            lde_send_labelmapping(struct lde_nbr *, struct fec_node *,
                    int);
 void            lde_send_labelwithdraw(struct lde_nbr *, struct fec_node *,
-                   uint32_t, struct status_tlv *);
-void            lde_send_labelwithdraw_all(struct fec_node *, uint32_t);
-void            lde_send_labelrelease(struct lde_nbr *, struct fec_node *,
+                   struct map *, struct status_tlv *);
+void            lde_send_labelwithdraw_wcard(struct lde_nbr *, uint32_t);
+void            lde_send_labelwithdraw_twcard_prefix(struct lde_nbr *,
+                   uint16_t, uint32_t);
+void            lde_send_labelwithdraw_twcard_pwid(struct lde_nbr *, uint16_t,
                    uint32_t);
-void            lde_send_notification(uint32_t, uint32_t, uint32_t, uint16_t);
+void            lde_send_labelwithdraw_pwid_wcard(struct lde_nbr *, uint16_t,
+                   uint32_t);
+void            lde_send_labelrelease(struct lde_nbr *, struct fec_node *,
+                   struct map *, uint32_t);
+void            lde_send_notification(struct lde_nbr *, uint32_t, uint32_t,
+                   uint16_t);
+void            lde_send_notification_eol_prefix(struct lde_nbr *, int);
+void            lde_send_notification_eol_pwid(struct lde_nbr *, uint16_t);
 struct lde_nbr *lde_nbr_find_by_lsrid(struct in_addr);
 struct lde_nbr *lde_nbr_find_by_addr(int, union ldpd_addr *);
 struct lde_map *lde_map_add(struct lde_nbr *, struct fec_node *, int);
 void            lde_map_del(struct lde_nbr *, struct lde_map *, int);
+struct fec     *lde_map_pending_add(struct lde_nbr *, struct fec_node *);
+void            lde_map_pending_del(struct lde_nbr *, struct fec *);
 struct lde_req *lde_req_add(struct lde_nbr *, struct fec *, int);
 void            lde_req_del(struct lde_nbr *, struct lde_req *, int);
 struct lde_wdraw *lde_wdraw_add(struct lde_nbr *, struct fec_node *);
@@ -174,13 +197,16 @@ void               lde_kernel_insert(struct fec *, int, union ldpd_addr *,
                    ifindex_t, uint8_t, int, void *);
 void            lde_kernel_remove(struct fec *, int, union ldpd_addr *,
                    ifindex_t, uint8_t);
-void            lde_kernel_reevaluate(struct fec *);
+void            lde_kernel_update(struct fec *);
 void            lde_check_mapping(struct map *, struct lde_nbr *);
 void            lde_check_request(struct map *, struct lde_nbr *);
+void            lde_check_request_wcard(struct map *, struct lde_nbr *);
 void            lde_check_release(struct map *, struct lde_nbr *);
 void            lde_check_release_wcard(struct map *, struct lde_nbr *);
 void            lde_check_withdraw(struct map *, struct lde_nbr *);
 void            lde_check_withdraw_wcard(struct map *, struct lde_nbr *);
+int             lde_wildcard_apply(struct map *, struct fec *,
+                   struct lde_map *);
 int             lde_gc_timer(struct thread *);
 void            lde_gc_start_timer(void);
 void            lde_gc_stop_timer(void);
@@ -191,21 +217,28 @@ struct l2vpn      *l2vpn_find(struct ldpd_conf *, const char *);
 void            l2vpn_del(struct l2vpn *);
 void            l2vpn_init(struct l2vpn *);
 void            l2vpn_exit(struct l2vpn *);
-struct l2vpn_if        *l2vpn_if_new(struct l2vpn *, struct kif *);
-struct l2vpn_if        *l2vpn_if_find(struct l2vpn *, unsigned int);
-struct l2vpn_if        *l2vpn_if_find_name(struct l2vpn *, const char *);
-struct l2vpn_pw        *l2vpn_pw_new(struct l2vpn *, struct kif *);
-struct l2vpn_pw *l2vpn_pw_find(struct l2vpn *, unsigned int);
-struct l2vpn_pw *l2vpn_pw_find_name(struct l2vpn *, const char *);
+struct l2vpn_if        *l2vpn_if_new(struct l2vpn *, const char *);
+struct l2vpn_if        *l2vpn_if_find(struct l2vpn *, const char *);
+void            l2vpn_if_update_info(struct l2vpn_if *, struct kif *);
+void            l2vpn_if_update(struct l2vpn_if *);
+struct l2vpn_pw        *l2vpn_pw_new(struct l2vpn *, const char *);
+struct l2vpn_pw *l2vpn_pw_find(struct l2vpn *, const char *);
+struct l2vpn_pw        *l2vpn_pw_find_active(struct l2vpn *, const char *);
+struct l2vpn_pw        *l2vpn_pw_find_inactive(struct l2vpn *, const char *);
+void            l2vpn_pw_update_info(struct l2vpn_pw *, struct kif *);
 void            l2vpn_pw_init(struct l2vpn_pw *);
 void            l2vpn_pw_exit(struct l2vpn_pw *);
 void            l2vpn_pw_reset(struct l2vpn_pw *);
 int             l2vpn_pw_ok(struct l2vpn_pw *, struct fec_nh *);
 int             l2vpn_pw_negotiate(struct lde_nbr *, struct fec_node *,
                    struct map *);
-void            l2vpn_send_pw_status(uint32_t, uint32_t, struct fec *);
+void            l2vpn_send_pw_status(struct lde_nbr *, uint32_t, struct fec *);
+void            l2vpn_send_pw_status_wcard(struct lde_nbr *, uint32_t,
+                   uint16_t, uint32_t);
 void            l2vpn_recv_pw_status(struct lde_nbr *, struct notify_msg *);
-void            l2vpn_sync_pws(int, union ldpd_addr *);
+void            l2vpn_recv_pw_status_wcard(struct lde_nbr *,
+                   struct notify_msg *);
+int             l2vpn_pw_status_update(struct zapi_pw_status *);
 void            l2vpn_pw_ctl(pid_t);
 void            l2vpn_binding_ctl(pid_t);