Skip to content

Commit

Permalink
add show dhcp_relay ipv4 counter entry, fix interface name offset iss…
Browse files Browse the repository at this point in the history
…ue (#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)
  • Loading branch information
jcaiMR committed Sep 11, 2023
1 parent 2b1c39e commit 9c1c82e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_interface(self):
interfaces = []
for key in self.db.keys(self.db.STATE_DB):
if DHCPv4_COUNTER_TABLE in key:
interfaces.append(key[21:])
interfaces.append(key[19:])
return interfaces

def get_dhcp4relay_msg_count(self, interface, dir):
Expand Down Expand Up @@ -274,6 +274,10 @@ def dhcp_relay_ipv4_destination():
def dhcp_relay_ipv6_destination():
get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=True)

@dhcp_relay_ipv4.command("counters")
@click.option('-i', '--interface', required=False)
def dhcp_relay_ip4counters(interface):
ipv4_counters(interface)

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

0 comments on commit 9c1c82e

Please sign in to comment.