Merge "Add toString() to Ipv6ForwardingRule"
This commit is contained in:
@@ -1473,6 +1473,15 @@ public class BpfCoordinator {
|
||||
// to Objects.hash() to avoid autoboxing overhead.
|
||||
return Objects.hash(upstreamIfindex, downstreamIfindex, address, srcMac, dstMac);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "upstreamIfindex: " + upstreamIfindex
|
||||
+ ", downstreamIfindex: " + downstreamIfindex
|
||||
+ ", address: " + address.getHostAddress()
|
||||
+ ", srcMac: " + srcMac
|
||||
+ ", dstMac: " + dstMac;
|
||||
}
|
||||
}
|
||||
|
||||
/** Tethering client information class. */
|
||||
|
||||
@@ -2092,4 +2092,11 @@ public class BpfCoordinatorTest {
|
||||
assertNull(mBpfUpstream4Map.getValue(upstream4KeyB));
|
||||
assertNull(mBpfDownstream4Map.getValue(downstream4KeyB));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIpv6ForwardingRuleToString() throws Exception {
|
||||
final Ipv6ForwardingRule rule = buildTestForwardingRule(UPSTREAM_IFINDEX, NEIGH_A, MAC_A);
|
||||
assertEquals("upstreamIfindex: 1001, downstreamIfindex: 1003, address: 2001:db8::1, "
|
||||
+ "srcMac: 12:34:56:78:90:ab, dstMac: 00:00:00:00:00:0a", rule.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user