Search in sources :

Example 16 with ApfGenerator

use of android.net.apf.ApfGenerator in project android_frameworks_base by ResurrectionRemix.

the class Bpf2Apf method main.

/**
     * Convert the output of "tcpdump -d" (human readable BPF program dump) piped in stdin into an
     * APF program and output it via stdout.
     */
public static void main(String[] args) throws Exception {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String line = null;
    StringBuilder responseData = new StringBuilder();
    ApfGenerator gen = new ApfGenerator();
    while ((line = in.readLine()) != null) convertLine(line, gen);
    System.out.write(gen.generate());
}
Also used : InputStreamReader(java.io.InputStreamReader) ApfGenerator(android.net.apf.ApfGenerator) BufferedReader(java.io.BufferedReader)

Aggregations

ApfGenerator (android.net.apf.ApfGenerator)16 GuardedBy (com.android.internal.annotations.GuardedBy)8 IllegalInstructionException (android.net.apf.ApfGenerator.IllegalInstructionException)4 ApfProgramEvent (android.net.metrics.ApfProgramEvent)4 VisibleForTesting (com.android.internal.annotations.VisibleForTesting)4 BufferedReader (java.io.BufferedReader)4 InputStreamReader (java.io.InputStreamReader)4 ArrayList (java.util.ArrayList)4 LargeTest (android.test.suitebuilder.annotation.LargeTest)3 SmallTest (android.test.suitebuilder.annotation.SmallTest)1