Skip to content

Commit 9c1c82e

Browse files
authored
add show dhcp_relay ipv4 counter entry, fix interface name offset issue (#16507)
Why I did it Add another cli entry: show dhcp_relay ipv4 counter Fix get all interface offset issue Work item tracking Microsoft ADO (17271822): How I did it show dhcp_relay ipv4 counter -i [ifname] show dhcp4relay_counters counts -i [ifname] How to verify it show dhcp4relay_counters counts | more 10 Message Type Ethernet144(RX)
1 parent 2b1c39e commit 9c1c82e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_interface(self):
5656
interfaces = []
5757
for key in self.db.keys(self.db.STATE_DB):
5858
if DHCPv4_COUNTER_TABLE in key:
59-
interfaces.append(key[21:])
59+
interfaces.append(key[19:])
6060
return interfaces
6161

6262
def get_dhcp4relay_msg_count(self, interface, dir):
@@ -274,6 +274,10 @@ def dhcp_relay_ipv4_destination():
274274
def dhcp_relay_ipv6_destination():
275275
get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=True)
276276

277+
@dhcp_relay_ipv4.command("counters")
278+
@click.option('-i', '--interface', required=False)
279+
def dhcp_relay_ip4counters(interface):
280+
ipv4_counters(interface)
277281

278282
@dhcp_relay_ipv6.command("counters")
279283
@click.option('-i', '--interface', required=False)

0 commit comments

Comments
 (0)