]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpcli: display chassis TTL
authorVincent Bernat <vincent@bernat.im>
Fri, 27 May 2016 12:05:30 +0000 (14:05 +0200)
committerVincent Bernat <vincent@bernat.im>
Fri, 27 May 2016 12:12:08 +0000 (14:12 +0200)
Fix #180.

NEWS
src/client/display.c
tests/integration/test_basic.py
tests/integration/test_lldpcli.py

diff --git a/NEWS b/NEWS
index 7b8fd070157bd487277e2d54f8264bfe416fba42..1cbcad2445140c7b3fbf297725b3eb6546e3d3d8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 lldpd (0.9.4)
   * Change:
     + Make lldpd accepts a `-p` option to specify the PID file.
+    + lldpcli will now display chassis TTL when detailed view is enabled.
 
 lldpd (0.9.3)
   * Change:
index 9817badefdc2fd6f2965500ca44c18efeeceeeeb..b4da61eacb89699848c77ad9f29adaa9ada8f6c4 100644 (file)
@@ -252,6 +252,9 @@ display_chassis(struct writer* w, lldpctl_atom_t* chassis, int details)
        }
        tag_datatag(w, "descr", "SysDescr",
            lldpctl_atom_get_str(chassis, lldpctl_k_chassis_descr));
+       if (details)
+               tag_datatag(w, "ttl", "TTL",
+                   lldpctl_atom_get_str(chassis, lldpctl_k_chassis_ttl));
 
        /* Management addresses */
        mgmts = lldpctl_atom_get(chassis, lldpctl_k_chassis_mgmt);
index 3563c80ec5a287b976ab96077256375ca6ac020f..f0043d8540befe4c2248cd1ac45592d5926d4d19 100644 (file)
@@ -21,6 +21,7 @@ def test_one_neighbor(lldpd1, lldpd, lldpcli, namespaces):
                        "lldp.eth0.rid": "1",
                        "lldp.eth0.chassis.mac": "00:00:00:00:00:02",
                        "lldp.eth0.chassis.name": "ns-2.example.com",
+                       "lldp.eth0.chassis.ttl": "120",
                        "lldp.eth0.chassis.mgmt-ip": "fe80::200:ff:fe00:2",
                        "lldp.eth0.chassis.Bridge.enabled": "off",
                        "lldp.eth0.chassis.Wlan.enabled": "off",
index 49e3b4b7c21e3ba5603fb9502cf315a2fe34ccee..40a5e2c3513055a9b448bc02be99d71dacb0592d 100644 (file)
@@ -29,6 +29,7 @@ Interface:    eth0, via: LLDP, RID: 1, Time: 0 day, 00:00:{seconds}
     ChassisID:    mac 00:00:00:00:00:02
     SysName:      ns-2.example.com
     SysDescr:     Spectacular GNU/Linux 2016 {uname}
+    TTL:          120
     MgmtIP:       fe80::200:ff:fe00:2
     Capability:   Bridge, off
     Capability:   Router, {router}
@@ -82,6 +83,7 @@ def test_json_output(lldpd1, lldpd, lldpcli, namespaces, uname):
                             "value": "00:00:00:00:00:02"
                         },
                         "descr": "Spectacular GNU/Linux 2016 {}".format(uname),
+                        "ttl": "120",
                         "mgmt-ip": "fe80::200:ff:fe00:2",
                         "capability": [
                             {"type": "Bridge", "enabled": False},
@@ -125,6 +127,7 @@ def test_xml_output(lldpd1, lldpd, lldpcli, namespaces, uname):
    <id label="ChassisID" type="mac">00:00:00:00:00:02</id>
    <name label="SysName">ns-2.example.com</name>
    <descr label="SysDescr">Spectacular GNU/Linux 2016 {uname}</descr>
+   <ttl label="TTL">120</ttl>
    <mgmt-ip label="MgmtIP">fe80::200:ff:fe00:2</mgmt-ip>
    <capability label="Capability" type="Bridge" enabled="off"/>
    <capability label="Capability" type="Router" enabled="{router}"/>