New appctl 'lldp/neighbor' displays lldp neighbor information.
Support json output with --format json --pretty
Supoort dot1 and dot3 tlv

Example outputs would be:
$ ovs-appctl lldp/neighbor
LLDP neighbor:
Interface: p1
  Chassis ID:         aa:aa:aa:aa:aa:aa
  PortID:             GigabitEthernet1/0/15
  TTL:                121
  PortDescr:          GigabitEthernet1/0/15 Interface
  SysName:            FakeSystemName
  SysDescr:           FakeSystemDesc
  Capability:         Bridge, on
  Capability:         Router, on
  MgmtIP:             192.168.0.1
  MgmtIface:          635
  MFS:                10240
  PMD autoneg: supported: yes, enabled: yes
    Adv:              10Base-T, HD: yes, FD: yes
    Adv:              100Base-TX, HD: yes, FD: yes
    Adv:              1000Base-T, HD: no, FD: yes
    MAU oper type:    30
  MDI Power: supported: yes, enabled: no, pair control: no
  VLAN:               1, pvid: yes, VLAN 0001
  PPVID:              supported: yes,enabled no

$ ovs-appctl --format json --pretty lldp/neighbor
{
  "lldp": {
    "interface": {
      "p1": {
        "chassis": {
          "FakeSystemName": {
            "capability": [
              {
                "enabled": true,
                "type": "Bridge"},
              {
                "enabled": true,
                "type": "Router"}],
            "descr": "FakeSystemDesc",
            "id": {
              "type": "mac",
              "value": "aa:aa:aa:aa:aa:aa"},
            "mgmt-iface": [
              635],
            "mgmt-ip": [
              "192.168.0.1"]}},
        "port": {
          "auto-negotiation": {
            "current": 30,
            "enabled": true,
            "supported": true},
          "desc": "GigabitEthernet1/0/15 Interface",
          "id": {
            "type": "ifname",
            "value": "GigabitEthernet1/0/15"},
          "mfs": 10240,
          "power": {
            "enabled": false,
            "paircontrol": false,
            "supported": true},
          "ttl": 121},
        "ppvid": {
          "enabled": false,
          "supported": true},
        "vlan": {
          "pvid": true,
          "value": "VLAN 0001",
          "vlan-id": 1}}}}}

  v2: fix code lint and build warn
  v3: fix more static analyze error
  v4: fix build error
  v5: add json output, add NEWS
  v6: add dot1 and dot3, fix review problems
  v7: split patch to patch set
  v8: refactor dot1 and dot3 from lldpd, fix review problems
  v9: clean dot1,dot3 list, fix review problems
 v10: refine CLI output format, fix review problems
 v11: fix build in windows, remove <None> in json format

Changliang Wu (4):
  util: Introduce nullable_string_not_empty() function.
  lldp: Add ovs-appctl lldp/neighbor command.
  lldp: Decode dot1,3 tlv and display in lldp/neighbor.
  tests: lldp: Add testcases for lldp/neighbor.

 NEWS                       |   5 +
 lib/colors.c               |   2 +-
 lib/lldp/lldp-const.h      |   5 +
 lib/lldp/lldp.c            | 171 +++++++++-
 lib/lldp/lldpd-structs.c   |  33 ++
 lib/lldp/lldpd-structs.h   |  69 ++++
 lib/ovs-lldp.c             | 678 ++++++++++++++++++++++++++++++++++++-
 lib/util.h                 |   6 +
 tests/automake.mk          |   1 +
 tests/ovs-lldp.at          | 221 ++++++++++++
 tests/testsuite.at         |   1 +
 vswitchd/ovs-vswitchd.8.in |   4 +
 12 files changed, 1189 insertions(+), 7 deletions(-)
 create mode 100644 tests/ovs-lldp.at

-- 
2.43.5

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to