#include <pcap.h>#include <stdio.h>Include dependency graph for bpf_dump.c:

Go to the source code of this file.
Functions | |
| void | bpf_dump (struct bpf_program *p, int option) |
Variables | |
| const char | rcsid [] |
|
||||||||||||
|
Definition at line 34 of file bpf_dump.c. References bpf_image(), option, p, printf(), and puts().
00035 {
00036 struct bpf_insn *insn;
00037 int i;
00038 int n = p->bf_len;
00039
00040 insn = p->bf_insns;
00041 if (option > 2) {
00042 printf("%d\n", n);
00043 for (i = 0; i < n; ++insn, ++i) {
00044 printf("%u %u %u %u\n", insn->code,
00045 insn->jt, insn->jf, insn->k);
00046 }
00047 return ;
00048 }
00049 if (option > 1) {
00050 for (i = 0; i < n; ++insn, ++i)
00051 printf("{ 0x%x, %d, %d, 0x%08x },\n",
00052 insn->code, insn->jt, insn->jf, insn->k);
00053 return;
00054 }
00055 for (i = 0; i < n; ++insn, ++i) {
00056 #ifdef BDEBUG
00057 extern int bids[];
00058 printf(bids[i] > 0 ? "[%02d]" : " -- ", bids[i] - 1);
00059 #endif
00060 puts(bpf_image(insn, i));
00061 }
00062 }
|
|
|
Initial value:
"@(#) $Header: /tcpdump/master/libpcap/bpf_dump.c,v 1.12.4.1 2002/03/24 23:25:37 guy Exp $ (LBL)"
Definition at line 22 of file bpf_dump.c. |
1.3.5