frr/bgpd
Sindhu Parvathi Gopinathan 75ce7c815f bgpd:add correct value into dfAlgorithm json output
FRR "show bgp l2 evpn es <esi-id> json" output shows 'dfAlgorithm'
same as 'dfPreference' value instead of algorithm.

Modified the code to set the correct DF algorithm value into
'dfAlgorithm' field.

torm-11# show bgp l2 evpn es
ES Flags: B - bypass, L local, R remote, I inconsistent
VTEP Flags: E ESR/Type-4, A active nexthop
ESI                            Flags RD                    #VNIs
VTEPs
03:44:38:39:ff:ff:01:00:00:01  LR    27.0.0.15:15          10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:01:00:00:02  LR    27.0.0.15:16          10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:01:00:00:03  LR    27.0.0.15:17          10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:02:00:00:01  R     -                     10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
03:44:38:39:ff:ff:02:00:00:02  R     -                     10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
03:44:38:39:ff:ff:02:00:00:03  R     -                     10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
torm-11#

Before Fix:-
```
torm-11# show bgp l2 evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "rd":"27.0.0.15:15",
  "type":[
    "local",
    "remote"
  ],
  "vteps":[
    {
      "vtep_ip":"27.0.0.16",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":32767 =====> dfAlgorithm is same as dfPreference
    },
    {
      "vtep_ip":"27.0.0.17",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":32767 =====> dfAlgorithm is same as dfPreference
    }
  ],
  "flags":[
    "up",
    "advertiseEVI"
  ],
  "originator_ip":"27.0.0.15",
  "remoteVniCount":10,
  "vrfCount":3,
  "macipPathCount":33,
  "macipGlobalPathCount":264,
  "inconsistentVniVtepCount":0,
  "localEsDfPreference":50000,
  "fragments":[
    {
      "rd":"27.0.0.15:15",
      "eviCount":10
    }
  ]
}
torm-11#
```

After Fix:-

```
torm-11# show bgp l2vpn evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "rd":"27.0.0.15:4",
  "type":[
    "local",
    "remote"
  ],
  "vteps":[
    {
      "vtep_ip":"27.0.0.16",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":"preference" ---- dfAlgorithm shows properly
    },
    {
      "vtep_ip":"27.0.0.17",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":"preference" --- dfAlgorithm shows properly
    }
  ],
  "vniCount":10,
  "flags":[
    "up",
    "advertiseEVI"
  ],
  "originator_ip":"27.0.0.15",
  "remoteVniCount":10,
  "vrfCount":3,
  "macipPathCount":33,
  "macipGlobalPathCount":264,
  "inconsistentVniVtepCount":0,
  "localEsDfPreference":50000,
  "fragments":[
    {
      "rd":"27.0.0.15:4",
      "eviCount":10
    }
  ]
}
torm-11#
```

Ticket:#3411912

Issue:3411912

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
2023-04-16 10:29:09 -07:00
..
rfapi bgpd: rfapi memleak fixes 2023-04-11 12:27:36 -07:00
rfp-example *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
.gitignore
bgp_addpath.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_addpath.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_addpath_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_advertise.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_advertise.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_aspath.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_aspath.h Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_attr.c bgpd: Ensure stream received has enough data 2023-03-29 07:59:49 -04:00
bgp_attr.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_attr_evpn.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_attr_evpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_bfd.c doc: Add missing rfc9384 to BGP supported RFC list 2023-04-01 21:56:37 +03:00
bgp_bfd.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgp_bmp.c bgpd: bmp fix peer-up ports byte order 2023-04-03 17:19:32 +02:00
bgp_bmp.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
bgp_btoa.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_clist.c bgpd: Deprecate BGP internet community 2023-02-17 18:53:01 +02:00
bgp_clist.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_community.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_community.h bgpd: Deprecate BGP internet community 2023-02-17 18:53:01 +02:00
bgp_community_alias.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_community_alias.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_conditional_adv.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
bgp_conditional_adv.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_damp.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_damp.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
bgp_debug.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_debug.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_dump.c bgpd: increase buffer size used for dumping BGP to MRT files 2023-03-30 14:23:48 +01:00
bgp_dump.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_ecommunity.c bgpd: fix ecommunity parsing for AS4 2023-04-03 18:59:35 +00:00
bgp_ecommunity.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_encap_tlv.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_encap_tlv.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_encap_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_errors.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_errors.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_evpn.c bgpd: Simplify the checking local path 2023-04-13 08:47:06 +08:00
bgp_evpn.h bgpd: Treat withdraw variable as a bool 2023-04-06 17:41:32 -04:00
bgp_evpn_mh.c bgpd:add correct value into dfAlgorithm json output 2023-04-16 10:29:09 -07:00
bgp_evpn_mh.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
bgp_evpn_private.h bgpd: Drop afi_t from bgp_evpn_global_node_lookup() 2023-03-14 12:05:58 +02:00
bgp_evpn_vty.c bgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup() 2023-03-14 12:01:56 +02:00
bgp_evpn_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_filter.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_filter.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec.c bgpd: Treat withdraw variable as a bool 2023-04-06 17:41:32 -04:00
bgp_flowspec.h bgpd: Treat withdraw variable as a bool 2023-04-06 17:41:32 -04:00
bgp_flowspec_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_util.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_util.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_vty.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_fsm.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_fsm.h *: Convert thread_cancelXXX to event_cancelXXX 2023-03-24 08:32:17 -04:00
bgp_io.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_io.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_keepalives.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
bgp_keepalives.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_label.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_label.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_labelpool.c *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgp_labelpool.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgp_lcommunity.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_lcommunity.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mac.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_mac.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_main.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_memory.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_memory.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_mpath.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mpath.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mplsvpn.c bgpd: Use the actual pointer type instead of a void 2023-04-10 14:14:01 -04:00
bgp_mplsvpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mplsvpn_snmp.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_mplsvpn_snmp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_network.c Merge pull request #13084 from opensourcerouting/fix/bgp_vrf_md5_password 2023-03-26 08:21:31 -04:00
bgp_network.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
bgp_nexthop.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_nexthop.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_nht.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_nht.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_open.c Merge pull request #12953 from donaldsharp/struct_event 2023-03-24 13:48:53 -05:00
bgp_open.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_packet.c bgpd: Treat withdraw variable as a bool 2023-04-06 17:41:32 -04:00
bgp_packet.h bgpd: Treat withdraw variable as a bool 2023-04-06 17:41:32 -04:00
bgp_pbr.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_pbr.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_rd.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_rd.h Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_regex.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_regex.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_route.c bgpd: Fix crash for show bgp ... neighbor received-routes detail|PREFIX 2023-04-13 23:37:06 +03:00
bgp_route.h bgpd : aggregate-address memory leak fix 2023-03-30 00:19:20 -07:00
bgp_routemap.c Merge pull request #12837 from donaldsharp/unlikely_routemap 2023-04-04 08:20:25 -04:00
bgp_routemap_nb.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_routemap_nb.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_routemap_nb_config.c yang, bgpd: Fix "aggregator-asn" to support asdot 2023-03-16 07:00:53 +01:00
bgp_rpki.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_rpki.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_script.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_script.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_snmp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp_bgp4.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_snmp_bgp4.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgp_snmp_bgp4v2.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_snmp_bgp4v2.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgp_table.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_table.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
bgp_trace.c *: make sure config.h or zebra.h is first 2021-04-23 12:06:35 +02:00
bgp_trace.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_updgrp.c bgpd: Remove unnecessary check for groups 2023-04-16 13:52:35 +08:00
bgp_updgrp.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
bgp_updgrp_adv.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_updgrp_packet.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
bgp_vnc_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vpn.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vty.c bgpd: add cli command to control explicit-null label usage 2023-04-11 16:08:09 +02:00
bgp_vty.h Merge pull request #12805 from karlquan/kquan_self_orig 2023-02-21 08:38:07 -05:00
bgp_zebra.c Merge pull request #13060 from opensourcerouting/feature/allow_peering_with_127.0.0.1 2023-03-31 00:14:27 -05:00
bgp_zebra.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgpd.c bgpd : aggregate-address memory leak fix 2023-03-30 00:19:20 -07:00
bgpd.h bgpd: add cli command to control explicit-null label usage 2023-04-11 16:08:09 +02:00
Makefile
subdir.am Revert "bgpd: optimal router reflection cli and fsm changes" 2023-01-17 18:15:28 +02:00