Add onClatInterfaceStateUpdate method in IpClientLinkObserver.callback.

So far only IpClient checks if clat interface was added or removed via
onInterfaceAdded/Removed callbacks from netd, but this part of code is
running across IpClient and IpClientLinkObserver, i.e. IpClient has to
call the callback implementation insided its super class, and then check
if clat interface was added or removed in IpClient itself.

When parsing netlink events in Java layer is enabled, it's difficult to
make flags run correctly. Ideally IpClient doesn't need to distinguish
whether the flag of parsing netlink events is on or off, the caller of
callback should do that(i.e. IpClientLinkObserver), however, from the
perspective of IpClient, the behavior should be kept consistent. To
achieve this goal, add a new callback onClatInterfaceStateUpdate to
notify IpClient iff clat interface was added or removed.

To implement an alternative way of onInterfaceRemoved callback when
parsing netlink events is enabled, support RTM_DELLINK message parsing;
to replace the onInterfaceAdded call, support parsing the flags field
of StructIfinfoMsg header in RTM_NEWLINK message to check if the target
interface was added.

This CL also adds "framework-connectivity-test-defaults" in the network
stack integration test suite, which allows calling the hidden API in the
connectivity module to create the clat interface with a given name.

Bug: 163492391
Test: atest testIpClientLinkObserver_onClatInterfaceStateUpdate --iterations
Change-Id: I8120049bf6860b5d6e16082db956c3630b5ebcca
4 files changed