]> git.ipfire.org Git - thirdparty/lldpd.git/blobdiff - src/lldpd-structs.h
build: fix compilation with `--enable-fdp --disable-cdp`
[thirdparty/lldpd.git] / src / lldpd-structs.h
index 707b7a22a36a4f2e20f4fa5f33f09e0a8fdb4a25..f6b03d7de821b4fc458d84ebc2a9203d2f8f760d 100644 (file)
@@ -129,6 +129,13 @@ struct lldpd_dot3_power {
 MARSHAL(lldpd_dot3_power);
 #endif
 
+#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+struct cdpv2_power {
+       u_int16_t request_id;
+       u_int16_t management_id;
+};
+#endif
+
 enum {
        LLDPD_AF_UNSPEC = 0,
        LLDPD_AF_IPV4,
@@ -136,26 +143,16 @@ enum {
        LLDPD_AF_LAST
 };
 
-inline static int
-lldpd_af(int af)
-{
-       switch (af) {
-       case LLDPD_AF_IPV4: return AF_INET;
-       case LLDPD_AF_IPV6: return AF_INET6;
-       case LLDPD_AF_LAST: return AF_MAX;
-       default: return AF_UNSPEC;
-       }
-}
-
 #define LLDPD_MGMT_MAXADDRSIZE 16 /* sizeof(struct in6_addr) */
+union lldpd_address {
+       struct in_addr          inet;
+       struct in6_addr         inet6;
+       u_int8_t                octets[LLDPD_MGMT_MAXADDRSIZE]; /* network byte order! */
+};
 struct lldpd_mgmt {
        TAILQ_ENTRY(lldpd_mgmt) m_entries;
-       int                             m_family;
-       union {
-               struct in_addr          inet;
-               struct in6_addr         inet6;
-               u_int8_t                octets[LLDPD_MGMT_MAXADDRSIZE]; /* network byte order! */
-       } m_addr;
+       int                     m_family;
+       union lldpd_address     m_addr;
        size_t                  m_addrsize;
        u_int32_t               m_iface;
 };
@@ -177,8 +174,6 @@ struct lldpd_chassis {
        u_int16_t                c_cap_available;
        u_int16_t                c_cap_enabled;
 
-       u_int16_t                c_ttl;
-
        TAILQ_HEAD(, lldpd_mgmt) c_mgmt;
 
 #ifdef ENABLE_LLDPMED
@@ -244,6 +239,8 @@ struct lldpd_port {
        struct lldpd_chassis    *p_chassis;    /* Attached chassis */
        time_t                   p_lastchange; /* Time of last change of values */
        time_t                   p_lastupdate; /* Time of last update received */
+       time_t                   p_lastremove;  /* Time of last removal of a remote port. Used for local ports only
+                                                * Used for deciding lldpStatsRemTablesLastChangeTime */
        struct lldpd_frame      *p_lastframe;  /* Frame received during last update */
        u_int8_t                 p_protocol;   /* Protocol used to get this port */
        u_int8_t                 p_hidden_in:1; /* Considered as hidden for reception */
@@ -258,7 +255,9 @@ struct lldpd_port {
        char                    *p_id;
        int                      p_id_len;
        char                    *p_descr;
+       int                      p_descr_force; /* Description has been forced by user */
        u_int16_t                p_mfs;
+       u_int16_t                p_ttl; /* TTL for remote port */
 
 #ifdef ENABLE_DOT3
        /* Dot3 stuff */
@@ -274,6 +273,10 @@ struct lldpd_port {
        struct lldpd_med_power   p_med_power;
 #endif
 
+#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+       struct cdpv2_power p_cdp_power;
+#endif
+
 #ifdef ENABLE_DOT1
        u_int16_t                p_pvid;
        TAILQ_HEAD(, lldpd_vlan) p_vlans;
@@ -370,13 +373,16 @@ MARSHAL_END(lldpd_port_set);
 struct lldpd_config {
        int c_paused;           /* lldpd is paused */
        int c_tx_interval;      /* Transmit interval */
+       int c_ttl;              /* TTL */
        int c_smart;            /* Bitmask for smart configuration (see SMART_*) */
        int c_receiveonly;      /* Receive only mode */
        int c_max_neighbors;    /* Maximum number of neighbors (per protocol) */
 
        char *c_mgmt_pattern;   /* Pattern to match a management address */
        char *c_cid_pattern;    /* Pattern to match interfaces to use for chassis ID */
+       char *c_cid_string;     /* User defined string for chassis ID */
        char *c_iface_pattern;  /* Pattern to match interfaces to use */
+       char *c_perm_ifaces;    /* Pattern to match interfaces to keep */
 
        char *c_platform;       /* Override platform description (for CDP) */
        char *c_description;    /* Override chassis description */
@@ -397,11 +403,14 @@ struct lldpd_config {
        int c_bond_slave_src_mac_type; /* Src mac type in lldp frames over bond
                                          slaves */
        int c_lldp_portid_type; /* The PortID type */
+       int c_lldp_agent_type;  /* The agent type */
 };
 MARSHAL_BEGIN(lldpd_config)
 MARSHAL_STR(lldpd_config, c_mgmt_pattern)
 MARSHAL_STR(lldpd_config, c_cid_pattern)
+MARSHAL_STR(lldpd_config, c_cid_string)
 MARSHAL_STR(lldpd_config, c_iface_pattern)
+MARSHAL_STR(lldpd_config, c_perm_ifaces)
 MARSHAL_STR(lldpd_config, c_hostname)
 MARSHAL_STR(lldpd_config, c_platform)
 MARSHAL_STR(lldpd_config, c_description)