]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/ldpd.h
Merge pull request #3405 from LabNConsulting/working/master/fix-vrf
[mirror_frr.git] / ldpd / ldpd.h
index cba1939d98b67e845256380387ecf115435ada82..91135055817fa1cb8b477383b554bfe2ef1c1888 100644 (file)
 #ifndef _LDPD_H_
 #define _LDPD_H_
 
-#include "openbsd-queue.h"
+#include "queue.h"
 #include "openbsd-tree.h"
 #include "imsg.h"
 #include "thread.h"
 #include "qobj.h"
 #include "prefix.h"
 #include "filter.h"
+#include "vty.h"
+#include "pw.h"
+#include "zclient.h"
 
 #include "ldp.h"
 
@@ -43,7 +46,6 @@
 #define LDPD_OPT_NOACTION      0x00000004
 
 #define TCP_MD5_KEY_LEN                80
-#define L2VPN_NAME_LEN         32
 
 #define        RT_BUF_SIZE             16384
 #define        MAX_RTSOCK_BUF          128 * 1024
@@ -101,8 +103,10 @@ enum imsg_type {
        IMSG_CTL_LOG_VERBOSE,
        IMSG_KLABEL_CHANGE,
        IMSG_KLABEL_DELETE,
-       IMSG_KPWLABEL_CHANGE,
-       IMSG_KPWLABEL_DELETE,
+       IMSG_KPW_ADD,
+       IMSG_KPW_DELETE,
+       IMSG_KPW_SET,
+       IMSG_KPW_UNSET,
        IMSG_IFSTATUS,
        IMSG_NEWADDR,
        IMSG_DELADDR,
@@ -146,7 +150,8 @@ enum imsg_type {
        IMSG_DEBUG_UPDATE,
        IMSG_LOG,
        IMSG_ACL_CHECK,
-       IMSG_INIT
+       IMSG_INIT,
+       IMSG_PW_UPDATE
 };
 
 struct ldpd_init {
@@ -154,7 +159,7 @@ struct ldpd_init {
        char             group[256];
        char             ctl_sock_path[MAXPATHLEN];
        char             zclient_serv_path[MAXPATHLEN];
-       u_short          instance;
+       unsigned short instance;
 };
 
 union ldpd_addr {
@@ -305,7 +310,7 @@ struct iface {
        struct if_addr_head      addr_list;
        struct in6_addr          linklocal;
        enum iface_type          type;
-       uint16_t                 flags;
+       int                      operative;
        struct iface_af          ipv4;
        struct iface_af          ipv6;
        QOBJ_FIELDS
@@ -387,8 +392,8 @@ struct l2vpn_if {
        struct l2vpn            *l2vpn;
        char                     ifname[IF_NAMESIZE];
        unsigned int             ifindex;
-       uint16_t                 flags;
-       uint8_t                  mac[ETHER_ADDR_LEN];
+       int                      operative;
+       uint8_t                  mac[ETH_ALEN];
        QOBJ_FIELDS
 };
 RB_HEAD(l2vpn_if_head, l2vpn_if);
@@ -404,8 +409,10 @@ struct l2vpn_pw {
        uint32_t                 pwid;
        char                     ifname[IF_NAMESIZE];
        unsigned int             ifindex;
+       bool                     enabled;
        uint32_t                 remote_group;
        uint16_t                 remote_mtu;
+       uint32_t                 local_status;
        uint32_t                 remote_status;
        uint8_t                  flags;
        QOBJ_FIELDS
@@ -417,8 +424,7 @@ DECLARE_QOBJ_TYPE(l2vpn_pw)
 #define F_PW_STATUSTLV         0x02    /* status tlv negotiated */
 #define F_PW_CWORD_CONF                0x04    /* control word configured */
 #define F_PW_CWORD             0x08    /* control word negotiated */
-#define F_PW_STATUS_UP         0x10    /* pseudowire is operational */
-#define F_PW_STATIC_NBR_ADDR   0x20    /* static neighbor address configured */
+#define F_PW_STATIC_NBR_ADDR   0x10    /* static neighbor address configured */
 
 struct l2vpn {
        RB_ENTRY(l2vpn)          entry;
@@ -516,7 +522,6 @@ struct ldpd_af_global {
 
 struct ldpd_global {
        int                      cmd_opts;
-       int                      sighup;
        struct in_addr           rtr_id;
        struct ldpd_af_global    ipv4;
        struct ldpd_af_global    ipv6;
@@ -542,17 +547,8 @@ struct kroute {
        uint16_t                 flags;
 };
 
-struct kpw {
-       unsigned short           ifindex;
-       int                      pw_type;
-       int                      af;
-       union ldpd_addr          nexthop;
-       uint32_t                 local_label;
-       uint32_t                 remote_label;
-       uint8_t                  flags;
-};
-
 struct kaddr {
+       char                     ifname[IF_NAMESIZE];
        unsigned short           ifindex;
        int                      af;
        union ldpd_addr          addr;
@@ -564,7 +560,8 @@ struct kif {
        char                     ifname[IF_NAMESIZE];
        unsigned short           ifindex;
        int                      flags;
-       uint8_t                  mac[ETHER_ADDR_LEN];
+       int                      operative;
+       uint8_t                  mac[ETH_ALEN];
        int                      mtu;
 };
 
@@ -581,7 +578,6 @@ struct ctl_iface {
        char                     name[IF_NAMESIZE];
        unsigned int             ifindex;
        int                      state;
-       uint16_t                 flags;
        enum iface_type          type;
        uint16_t                 hello_holdtime;
        uint16_t                 hello_interval;
@@ -667,11 +663,14 @@ struct ldpd_conf  *parse_config(char *);
 int                     cmdline_symset(char *);
 
 /* kroute.c */
+void            pw2zpw(struct l2vpn_pw *, struct zapi_pw *);
 void            kif_redistribute(const char *);
 int             kr_change(struct kroute *);
 int             kr_delete(struct kroute *);
-int             kmpw_set(struct kpw *);
-int             kmpw_unset(struct kpw *);
+int             kmpw_add(struct zapi_pw *);
+int             kmpw_del(struct zapi_pw *);
+int             kmpw_set(struct zapi_pw *);
+int             kmpw_unset(struct zapi_pw *);
 
 /* util.c */
 uint8_t                 mask2prefixlen(in_addr_t);
@@ -692,7 +691,8 @@ void                 embedscope(struct sockaddr_in6 *);
 void            recoverscope(struct sockaddr_in6 *);
 void            addscope(struct sockaddr_in6 *, uint32_t);
 void            clearscope(struct in6_addr *);
-struct sockaddr        *addr2sa(int af, union ldpd_addr *, uint16_t);
+void            addr2sa(int af, const union ldpd_addr *, uint16_t,
+                   union sockunion *su);
 void            sa2addr(struct sockaddr *, int *, union ldpd_addr *,
                    in_port_t *);
 socklen_t       sockaddr_len(struct sockaddr *);
@@ -718,7 +718,7 @@ struct ldpd_af_conf *ldp_af_conf_get(struct ldpd_conf *, int);
 struct ldpd_af_global  *ldp_af_global_get(struct ldpd_global *, int);
 int                     ldp_is_dual_stack(struct ldpd_conf *);
 in_addr_t               ldp_rtr_id_get(struct ldpd_conf *);
-int                     ldp_reload(struct ldpd_conf *);
+int                     ldp_config_apply(struct vty *, struct ldpd_conf *);
 void                    ldp_clear_config(struct ldpd_conf *);
 void                    merge_config(struct ldpd_conf *, struct ldpd_conf *);
 struct ldpd_conf       *config_new_empty(void);