public class ApfFilter extends Object
ApfFilter
listens for IPv6 ICMPv6 router advertisements (RAs) and generates APF programs to
filter out redundant duplicate ones.
Threading model:
A collection of RAs we've received is kept in mRas. Generating APF programs uses mRas to
know what RAs to filter for, thus generating APF programs is dependent on mRas.
mRas can be accessed by multiple threads:
- ReceiveThread, which listens for RAs and adds them to mRas, and generates APF programs.
- callers of:
- setMulticastFilter(), which can cause an APF program to be generated.
- dump(), which dumps mRas among other things.
- shutdown(), which clears mRas.
So access to mRas is synchronized.Modifier and Type | Method and Description |
---|---|
static int |
bytesToInt(byte[] addrBytes) |
void |
dump(IndentingPrintWriter pw) |
static int |
ipv4BroadcastAddress(byte[] addrBytes,
int prefixLength) |
static ApfFilter |
maybeCreate(ApfCapabilities apfCapabilities,
NetworkInterface networkInterface,
IpManager.Callback ipManagerCallback,
boolean multicastFilter)
Create an
ApfFilter if apfCapabilities indicates support for packet
filtering using APF programs. |
void |
setLinkProperties(LinkProperties lp) |
void |
setMulticastFilter(boolean enabled) |
void |
shutdown() |
public static ApfFilter maybeCreate(ApfCapabilities apfCapabilities, NetworkInterface networkInterface, IpManager.Callback ipManagerCallback, boolean multicastFilter)
ApfFilter
if apfCapabilities
indicates support for packet
filtering using APF programs.public void shutdown()
public void setMulticastFilter(boolean enabled)
public void setLinkProperties(LinkProperties lp)
public void dump(IndentingPrintWriter pw)
public static int ipv4BroadcastAddress(byte[] addrBytes, int prefixLength)
public static int bytesToInt(byte[] addrBytes)