Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pimd: convert uptime to epoch for igmp vrf groups
Currently, json output of show ip igmp vrf <vrf-id> groups commands are having "uptime" in "00:14:16" format. uptime is converted into epoch format and added json attributes accordingly. Supported commands: ``` show ip igmp vrf <vrf-id> groups json show ip igmp vrf <vrf-id> groups detail json ``` Sample ip igmp vrf <vrf-id> groups... json output: Before Fix: ``` tor-12# show ip igmp vrf red groups swp3 detail json {"totalGroups":5,"watermarkLimit":0,"swp3":{"name":"swp3","state":"up","address":"20.20.20.2","index":5,"flagMulticast":true,"flagBroadcast":true,"flagAllMulticast":true,"lanDelayEnabled":true,"groups":[{"group":"225.1.101.5","mode":"EXCLUDE","timer":"00:05:03","sourcesCount":1,"version":3,"uptime":"00:16:03","sources":[{"source":"*","timer":"05:03","forwarded":true,"uptime":"00:16:03"}]},{"group":"225.1.101.4","mode":"EXCLUDE","timer":"00:05:03","sourcesCount":1,"version":3,"uptime":"00:16:03","sources":[{"source":"*","timer":"05:03","forwarded":true,"uptime":"00:16:03"}]},{"group":"225.1.101.3","mode":"EXCLUDE","timer":"00:05:03","sourcesCount":1,"version":3,"uptime":"00:16:03","sources":[{"source":"*","timer":"05:03","forwarded":true,"uptime":"00:16:03"}]},{"group":"225.1.101.2","mode":"EXCLUDE","timer":"00:05:03","sourcesCount":1,"version":3,"uptime":"00:16:03","sources":[{"source":"*","timer":"05:03","forwarded":true,"uptime":"00:16:03"}]},{"group":"225.1.101.1","mode":"EXCLUDE","timer":"00:05:03","sourcesCount":1,"version":3,"uptime":"00:16:03","sources":[{"source":"*","timer":"05:03","forwarded":true,"uptime":"00:16:03"}]}]}} tor-12# ``` ``` tor-12# show ip igmp vrf red groups json { "totalGroups":5, "watermarkLimit":0, "swp3":{ "name":"swp3", "state":"up", "address":"20.20.20.2", "index":5, "flagMulticast":true, "flagBroadcast":true, "flagAllMulticast":true, "lanDelayEnabled":true, "groups":[ { "group":"225.1.101.5", "mode":"EXCLUDE", "timer":"00:05:25", "sourcesCount":1, "version":3, "uptime":"00:14:16" }, { "group":"225.1.101.4", "mode":"EXCLUDE", "timer":"00:05:25", "sourcesCount":1, "version":3, "uptime":"00:14:16" }, { "group":"225.1.101.3", "mode":"EXCLUDE", "timer":"00:05:25", "sourcesCount":1, "version":3, "uptime":"00:14:16" }, { "group":"225.1.101.2", "mode":"EXCLUDE", "timer":"00:05:25", "sourcesCount":1, "version":3, "uptime":"00:14:16" }, { "group":"225.1.101.1", "mode":"EXCLUDE", "timer":"00:05:25", "sourcesCount":1, "version":3, "uptime":"00:14:16" } ] } } tor-12# ``` After Fix: ``` tor-12# show ip igmp vrf red groups detail json {"totalGroups":5,"watermarkLimit":0,"swp3": {"name":"swp3","state":"up","address":"20.20.20.2","index":5,"flagMulticast":true,"flagBroadcast":true,"flagAllMulticast":true,"lanDelayEnabled":true,"groups":[{"group":"225.1.101.5","mode":"EXCLUDE","timer":"00:05:34","sourcesCount":1,"version":3,"uptime":"00:00:55","sources":[{"source":"*","timer":"05:34","forwarded":true,"uptime":"00:00:55","grpUptimeEpoch":1691123525,"grpUptimeEpochStr":"Fri Aug 4 04:32:05 2023\n"}]},{"group":"225.1.101.4","mode":"EXCLUDE","timer":"00:05:34","sourcesCount":1,"version":3,"uptime":"00:00:55","sources":[{"source":"*","timer":"05:34","forwarded":true,"uptime":"00:00:55","grpUptimeEpoch":1691123525,"grpUptimeEpochStr":"Fri Aug 4 04:32:05 2023\n"}]},{"group":"225.1.101.3","mode":"EXCLUDE","timer":"00:05:34","sourcesCount":1,"version":3,"uptime":"00:00:55","sources":[{"source":"*","timer":"05:34","forwarded":true,"uptime":"00:00:55","grpUptimeEpoch":1691123525,"grpUptimeEpochStr":"Fri Aug 4 04:32:05 2023\n"}]},{"group":"225.1.101.2","mode":"EXCLUDE","timer":"00:05:34","sourcesCount":1,"version":3,"uptime":"00:00:55","sources":[{"source":"*","timer":"05:34","forwarded":true,"uptime":"00:00:55","grpUptimeEpoch":1691123525,"grpUptimeEpochStr":"Fri Aug 4 04:32:05 2023\n"}]},{"group":"225.1.101.1","mode":"EXCLUDE","timer":"00:05:34","sourcesCount":1,"version":3,"uptime":"00:00:55","sources":[{"source":"*","timer":"05:34","forwarded":true,"uptime":"00:00:55","grpUptimeEpoch":1691123525,"grpUptimeEpochStr":"Fri Aug 4 04:32:05 2023\n"}]}]}} tor-12# tor-12# ``` ``` tor-12# show ip igmp vrf red groups json { "totalGroups":5, "watermarkLimit":0, "swp3":{ "name":"swp3", "state":"up", "address":"20.20.20.2", "index":5, "flagMulticast":true, "flagBroadcast":true, "flagAllMulticast":true, "lanDelayEnabled":true, "groups":[ { "group":"225.1.101.5", "mode":"EXCLUDE", "timer":"00:05:06", "sourcesCount":1, "version":3, "uptime":"00:00:58", "igmpGrpUptimeEpoch":1691123524, "igmpGrpUptimeEpochStr":"Fri Aug 4 04:32:04 2023\n" }, { "group":"225.1.101.3", "mode":"EXCLUDE", "timer":"00:05:06", "sourcesCount":1, "version":3, "uptime":"00:00:58", "igmpGrpUptimeEpoch":1691123524, "igmpGrpUptimeEpochStr":"Fri Aug 4 04:32:04 2023\n" }, { "group":"225.1.101.2", "mode":"EXCLUDE", "timer":"00:05:06", "sourcesCount":1, "version":3, "uptime":"00:00:58", "igmpGrpUptimeEpoch":1691123524, "igmpGrpUptimeEpochStr":"Fri Aug 4 04:32:04 2023\n" }, { "group":"225.1.101.1", "mode":"EXCLUDE", "timer":"00:05:06", "sourcesCount":1, "version":3, "uptime":"00:00:58", "igmpGrpUptimeEpoch":1691123524, "igmpGrpUptimeEpochStr":"Fri Aug 4 04:32:04 2023\n" } ] } } tor-12# ``` Ticket:#3541629 Issue:3541629 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
- Loading branch information