]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/ldpd.h
zebra: add pseudowire manager
[mirror_frr.git] / ldpd / ldpd.h
index 506891ff0733ca7aa23aab7b14e15715a4a0d7f8..21f5e16f88e3fbbaed092e323f084e8f807872d4 100644 (file)
@@ -27,7 +27,9 @@
 #include "imsg.h"
 #include "thread.h"
 #include "qobj.h"
+#include "prefix.h"
 #include "filter.h"
+#include "pw.h"
 
 #include "ldp.h"
 
@@ -76,6 +78,7 @@ enum imsg_type {
        IMSG_CTL_RELOAD,
        IMSG_CTL_SHOW_INTERFACE,
        IMSG_CTL_SHOW_DISCOVERY,
+       IMSG_CTL_SHOW_DISCOVERY_DTL,
        IMSG_CTL_SHOW_DISC_IFACE,
        IMSG_CTL_SHOW_DISC_TNBR,
        IMSG_CTL_SHOW_DISC_ADJ,
@@ -83,6 +86,10 @@ enum imsg_type {
        IMSG_CTL_SHOW_NBR_DISC,
        IMSG_CTL_SHOW_NBR_END,
        IMSG_CTL_SHOW_LIB,
+       IMSG_CTL_SHOW_LIB_BEGIN,
+       IMSG_CTL_SHOW_LIB_SENT,
+       IMSG_CTL_SHOW_LIB_RCVD,
+       IMSG_CTL_SHOW_LIB_END,
        IMSG_CTL_SHOW_L2VPN_PW,
        IMSG_CTL_SHOW_L2VPN_BINDING,
        IMSG_CTL_CLEAR_NBR,
@@ -122,8 +129,7 @@ enum imsg_type {
        IMSG_NEIGHBOR_UP,
        IMSG_NEIGHBOR_DOWN,
        IMSG_NETWORK_ADD,
-       IMSG_NETWORK_ADD_END,
-       IMSG_NETWORK_DEL,
+       IMSG_NETWORK_UPDATE,
        IMSG_SOCKET_IPC,
        IMSG_SOCKET_NET,
        IMSG_CLOSE_SOCKETS,
@@ -140,7 +146,18 @@ enum imsg_type {
        IMSG_RECONF_END,
        IMSG_DEBUG_UPDATE,
        IMSG_LOG,
-       IMSG_ACL_CHECK
+       IMSG_ACL_CHECK,
+       IMSG_GET_LABEL_CHUNK,
+       IMSG_RELEASE_LABEL_CHUNK,
+       IMSG_INIT
+};
+
+struct ldpd_init {
+       char             user[256];
+       char             group[256];
+       char             ctl_sock_path[MAXPATHLEN];
+       char             zclient_serv_path[MAXPATHLEN];
+       u_short          instance;
 };
 
 union ldpd_addr {
@@ -221,6 +238,13 @@ struct map {
                        uint32_t        group_id;
                        uint16_t        ifmtu;
                } pwid;
+               struct {
+                       uint8_t         type;
+                       union {
+                               uint16_t        prefix_af;
+                               uint16_t        pw_type;
+                       } u;
+               } twcard;
        } fec;
        struct {
                uint32_t        status_code;
@@ -245,10 +269,16 @@ struct notify_msg {
        uint16_t        msg_type;       /* network byte order */
        uint32_t        pw_status;
        struct map      fec;
+       struct {
+               uint16_t         type;
+               uint16_t         length;
+               char            *data;
+       } rtlvs;
        uint8_t         flags;
 };
 #define F_NOTIF_PW_STATUS      0x01    /* pseudowire status tlv present */
 #define F_NOTIF_FEC            0x02    /* fec tlv present */
+#define F_NOTIF_RETURNED_TLVS  0x04    /* returned tlvs present */
 
 struct if_addr {
        LIST_ENTRY(if_addr)      entry;
@@ -278,7 +308,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
@@ -332,12 +362,36 @@ DECLARE_QOBJ_TYPE(nbr_params)
 #define F_NBRP_GTSM             0x02
 #define F_NBRP_GTSM_HOPS        0x04
 
+struct ldp_stats {
+       uint32_t                 kalive_sent;
+       uint32_t                 kalive_rcvd;
+       uint32_t                 addr_sent;
+       uint32_t                 addr_rcvd;
+       uint32_t                 addrwdraw_sent;
+       uint32_t                 addrwdraw_rcvd;
+       uint32_t                 notif_sent;
+       uint32_t                 notif_rcvd;
+       uint32_t                 capability_sent;
+       uint32_t                 capability_rcvd;
+       uint32_t                 labelmap_sent;
+       uint32_t                 labelmap_rcvd;
+       uint32_t                 labelreq_sent;
+       uint32_t                 labelreq_rcvd;
+       uint32_t                 labelwdraw_sent;
+       uint32_t                 labelwdraw_rcvd;
+       uint32_t                 labelrel_sent;
+       uint32_t                 labelrel_rcvd;
+       uint32_t                 labelabreq_sent;
+       uint32_t                 labelabreq_rcvd;
+};
+
 struct l2vpn_if {
        RB_ENTRY(l2vpn_if)       entry;
        struct l2vpn            *l2vpn;
        char                     ifname[IF_NAMESIZE];
        unsigned int             ifindex;
-       uint16_t                 flags;
+       int                      operative;
+       uint8_t                  mac[ETHER_ADDR_LEN];
        QOBJ_FIELDS
 };
 RB_HEAD(l2vpn_if_head, l2vpn_if);
@@ -395,6 +449,12 @@ enum ldpd_process {
        PROC_LDE_ENGINE
 } ldpd_process;
 
+static const char * const log_procnames[] = {
+       "parent",
+       "ldpe",
+       "lde"
+};
+
 enum socket_type {
        LDP_SOCKET_DISC,
        LDP_SOCKET_EDISC,
@@ -459,7 +519,7 @@ struct ldpd_af_global {
 
 struct ldpd_global {
        int                      cmd_opts;
-       time_t                   uptime;
+       int                      sighup;
        struct in_addr           rtr_id;
        struct ldpd_af_global    ipv4;
        struct ldpd_af_global    ipv6;
@@ -496,6 +556,7 @@ struct kpw {
 };
 
 struct kaddr {
+       char                     ifname[IF_NAMESIZE];
        unsigned short           ifindex;
        int                      af;
        union ldpd_addr          addr;
@@ -507,6 +568,8 @@ struct kif {
        char                     ifname[IF_NAMESIZE];
        unsigned short           ifindex;
        int                      flags;
+       int                      operative;
+       uint8_t                  mac[ETHER_ADDR_LEN];
        int                      mtu;
 };
 
@@ -523,7 +586,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;
@@ -551,7 +613,9 @@ struct ctl_adj {
        char                     ifname[IF_NAMESIZE];
        union ldpd_addr          src_addr;
        uint16_t                 holdtime;
+       uint16_t                 holdtime_remaining;
        union ldpd_addr          trans_addr;
+       int                      ds_tlv;
 };
 
 struct ctl_nbr {
@@ -561,9 +625,12 @@ struct ctl_nbr {
        in_port_t                lport;
        union ldpd_addr          raddr;
        in_port_t                rport;
+       enum auth_method         auth_method;
        uint16_t                 holdtime;
        time_t                   uptime;
        int                      nbr_state;
+       struct ldp_stats         stats;
+       int                      flags;
 };
 
 struct ctl_rt {
@@ -575,7 +642,7 @@ struct ctl_rt {
        uint32_t                 remote_label;
        uint8_t                  flags;
        uint8_t                  in_use;
-       int                      first;
+       int                      no_downstream;
 };
 
 struct ctl_pw {
@@ -595,8 +662,9 @@ struct ctl_pw {
        uint32_t                 status;
 };
 
-extern struct ldpd_conf                *ldpd_conf;
+extern struct ldpd_conf                *ldpd_conf, *vty_conf;
 extern struct ldpd_global       global;
+extern struct ldpd_init                 init;
 
 /* parse.y */
 struct ldpd_conf       *parse_config(char *);
@@ -655,9 +723,6 @@ 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_reload_ref(struct ldpd_conf *, void **);
-struct ldpd_conf       *ldp_dup_config_ref(struct ldpd_conf *, void **ref);
-struct ldpd_conf       *ldp_dup_config(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);
@@ -713,8 +778,33 @@ int                 sock_set_ipv6_mcast_hops(int, int);
 int             sock_set_ipv6_mcast(struct iface *);
 int             sock_set_ipv6_mcast_loop(int);
 
+/* logmsg.h */
+struct in6_addr;
+union ldpd_addr;
+struct hello_source;
+struct fec;
+
+const char     *log_sockaddr(void *);
+const char     *log_in6addr(const struct in6_addr *);
+const char     *log_in6addr_scope(const struct in6_addr *, unsigned int);
+const char     *log_addr(int, const union ldpd_addr *);
+char           *log_label(uint32_t);
+const char     *log_time(time_t);
+char           *log_hello_src(const struct hello_source *);
+const char     *log_map(const struct map *);
+const char     *log_fec(const struct fec *);
+const char     *af_name(int);
+const char     *socket_name(int);
+const char     *nbr_state_name(int);
+const char     *if_state_name(int);
+const char     *if_type_name(enum iface_type);
+const char     *msg_name(uint16_t);
+const char     *status_code_name(uint32_t);
+const char     *pw_type_name(uint16_t);
+
 /* quagga */
 extern struct thread_master    *master;
+extern char                     ctl_sock_path[MAXPATHLEN];
 
 /* ldp_zebra.c */
 void            ldp_zebra_init(struct thread_master *);