mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-24 10:33:28 +08:00
fc213645d4
This commit adds support for RESP as defined in: http://redis.io/topics/protocol. It also supports inline commands and pipelining. Due to the popularity of RESP, numerous services are emerging that use this protocol. You may decode RESP packets on arbitrary ports using the "-T resp" option. Example captures can be found in tests/resp_*. A simple way to test this parser is to start redis-server and then run redis-cli commands such as "redis-cli set key value". Traditionally, redis-cli monitor is used to debug redis. Unfortunately, the "monitor" command can cause significant load on a redis-server in production. This parser may be used as a non-invasive alternative to redis-cli monitor.
15 lines
2.8 KiB
Plaintext
15 lines
2.8 KiB
Plaintext
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [S], seq 270581733, win 43690, options [mss 65495,sackOK,TS val 2004413385 ecr 0,nop,wscale 7], length 0
|
|
IP 127.0.0.1.6379 > 127.0.0.1.35934: Flags [S.], seq 3524975383, ack 270581734, win 43690, options [mss 65495,sackOK,TS val 2004413385 ecr 2004413385,nop,wscale 7], length 0
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [.], ack 1, win 342, options [nop,nop,TS val 2004413385 ecr 2004413385], length 0
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [P.], seq 1:13, ack 1, win 342, options [nop,nop,TS val 2004413683 ecr 2004413385], length 12: RESP "set test 1"
|
|
IP 127.0.0.1.6379 > 127.0.0.1.35934: Flags [.], ack 13, win 342, options [nop,nop,TS val 2004413683 ecr 2004413683], length 0
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [P.], seq 13:157, ack 1, win 342, options [nop,nop,TS val 2004413683 ecr 2004413683], length 144: RESP "incr test" "set test2 redis" "get test2" "lpush test3 r" "lpush test3 e" "lpush test3 d" "lpush test3 i" "lpush test3 s" "lrange test3 0 -1" "del test4"
|
|
IP 127.0.0.1.6379 > 127.0.0.1.35934: Flags [.], ack 157, win 350, options [nop,nop,TS val 2004413683 ecr 2004413683], length 0
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [P.], seq 157:168, ack 1, win 342, options [nop,nop,TS val 2004413683 ecr 2004413683], length 11: RESP "get test4"
|
|
IP 127.0.0.1.6379 > 127.0.0.1.35934: Flags [.], ack 168, win 350, options [nop,nop,TS val 2004413683 ecr 2004413683], length 0
|
|
IP 127.0.0.1.6379 > 127.0.0.1.35934: Flags [P.], seq 1:1289, ack 168, win 350, options [nop,nop,TS val 2004413683 ecr 2004413683], length 1288: RESP "OK" "2" "OK" "redis" "170" "171" "172" "173" "174" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "i" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "d" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "s" "i" "d" "e" "r" "i" "s" "i" "e" "r" "s" "i" "d" "e" "r" "0" null
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [.], ack 1289, win 1365, options [nop,nop,TS val 2004413683 ecr 2004413683], length 0
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [F.], seq 168, ack 1289, win 1365, options [nop,nop,TS val 2004413984 ecr 2004413683], length 0
|
|
IP 127.0.0.1.6379 > 127.0.0.1.35934: Flags [F.], seq 1289, ack 169, win 350, options [nop,nop,TS val 2004413984 ecr 2004413984], length 0
|
|
IP 127.0.0.1.35934 > 127.0.0.1.6379: Flags [.], ack 1290, win 1365, options [nop,nop,TS val 2004413984 ecr 2004413984], length 0
|