File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python
2
2
# @lint-avoid-python-3-compatibility-imports
3
- #
3
+ #
4
4
# undump Dump UNIX socket packets.
5
5
# For Linux, uses BCC, eBPF. Embedded C.
6
6
# USAGE: undump [-h] [-t] [-p PID]
35
35
description = "Dump UNIX socket packets" ,
36
36
formatter_class = argparse .RawDescriptionHelpFormatter ,
37
37
epilog = examples )
38
-
38
+
39
39
parser .add_argument ("-p" , "--pid" ,
40
40
help = "trace this PID only" )
41
41
args = parser .parse_args ()
75
75
76
76
FILTER_PID
77
77
78
- struct sk_buff *skb = (struct sk_buff *)PT_REGS_PARM1(ctx);
78
+ struct sk_buff *skb = (struct sk_buff *)PT_REGS_PARM1(ctx);
79
79
80
80
struct recv_data_t *data = unix_data.lookup(&zero);
81
- if (!data)
81
+ if (!data)
82
82
return 0;
83
83
84
84
unsigned int data_len = skb->len;
85
85
if(data_len > MAX_PKT)
86
86
return 0;
87
-
87
+
88
88
void *iodata = (void *)skb->data;
89
89
data->recv_len = data_len;
90
-
90
+
91
91
bpf_probe_read(data->pkt, data_len, iodata);
92
92
unix_recv_events.perf_submit(ctx, data, data_len+sizeof(u32));
93
-
93
+
94
94
return 0;
95
95
}
96
96
"""
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Tracing PID=49264 UNIX socket packets ... Hit Ctrl-C to end
29
29
30
30
# Here print bytes of receive
31
31
PID 49264 Recv 13 bytes
32
- 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 0a
32
+ 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 0a
33
33
PID 49264 Recv 8 bytes
34
34
61 62 63 64 65 66 67 0a
35
35
```
You can’t perform that action at this time.
0 commit comments