diff options
author | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2023-01-04 00:17:58 +0100 |
---|---|---|
committer | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2023-01-04 00:17:58 +0100 |
commit | 283ef1b0d396f39d44528f75f75f9d3add1b2622 (patch) | |
tree | d5a78856f2fe618cdb694b47a98bfcc6b667e0ff /zebra/zebra_evpn_mac.c | |
parent | Merge pull request #12557 from donaldsharp/getenv_two_times (diff) | |
download | frr-283ef1b0d396f39d44528f75f75f9d3add1b2622.tar.xz frr-283ef1b0d396f39d44528f75f75f9d3add1b2622.zip |
zebra: Evpn mac vni detail show command
New show command "show evpn mac vni xx detail [json]"
to display details of all the mac entries for the
requested VNI.
Output of show evpn mac vni xx detail json:
{
"numMacs":2,
"macs":{
"ca:be:63:7c:81:05":{
"type":"local",
"intf":"veth100",
"ifindex":8,
"uptime":"00:06:55",
"localSequence":0,
"remoteSequence":0,
"detectionCount":0,
"isDuplicate":false,
"syncNeighCount":0,
"neighbors":{
"active":[
"fe80::c8be:63ff:fe7c:8105"
],
"inactive":[
]
}
}
}
}
Also added remoteEs field in the JSON output of
"show evpn mac vni xx json".
Output of show evpn mac vni xx json:
"00:02:00:00:00:0d":{
"type":"remote",
"remoteEs":"03:44:38:39:ff:ff:02:00:00:02",
"localSequence":0,
"remoteSequence":0,
"detectionCount":0,
"isDuplicate":false
}
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Diffstat (limited to 'zebra/zebra_evpn_mac.c')
-rw-r--r-- | zebra/zebra_evpn_mac.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 218184ad0..2c953eef1 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -653,8 +653,13 @@ void zebra_evpn_print_mac(struct zebra_mac *mac, void *ctxt, json_object *json) json_object_int_add(json_mac, "vlan", vid); } else if (CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE)) { json_object_string_add(json_mac, "type", "remote"); - json_object_string_addf(json_mac, "remoteVtep", "%pI4", - &mac->fwd_info.r_vtep_ip); + if (mac->es) + json_object_string_add(json_mac, "remoteEs", + mac->es->esi_str); + else + json_object_string_addf( + json_mac, "remoteVtep", "%pI4", + &mac->fwd_info.r_vtep_ip); } else if (CHECK_FLAG(mac->flags, ZEBRA_MAC_AUTO)) json_object_string_add(json_mac, "type", "auto"); @@ -937,8 +942,13 @@ void zebra_evpn_print_mac_hash(struct hash_bucket *bucket, void *ctxt) "", mac->loc_seq, mac->rem_seq); } else { json_object_string_add(json_mac, "type", "remote"); - json_object_string_addf(json_mac, "remoteVtep", "%pI4", - &mac->fwd_info.r_vtep_ip); + if (mac->es) + json_object_string_add(json_mac, "remoteEs", + mac->es->esi_str); + else + json_object_string_addf( + json_mac, "remoteVtep", "%pI4", + &mac->fwd_info.r_vtep_ip); json_object_object_add(json_mac_hdr, buf1, json_mac); json_object_int_add(json_mac, "localSequence", mac->loc_seq); |