我正在使用 tshark 动态解码 SMPP 协议,例如:
tshark -i any -V -Y smpp
这将实时显示每一个 SMPP 数据包,例如
Short Message Peer to Peer, Command: Submit_sm, Seq: 8475778, Len: 215
Length: 215
Operation: Submit_sm (0x00000004)
Sequence #: 8475778
Service type: (Default)
Type of number (originator): Alphanumeric (0x05)
Numbering plan indicator (originator): Unknown (0x00)
Originator address: \123\110\123\123\123aaa\123
Type of number (recipient): Unknown (0x00)
Numbering plan indicator (recipient): ISDN (E163/E164) (0x01)
Recipient address: 44123456789
.... ..00 = Messaging mode: Default SMSC mode (0x00)
..00 00.. = Message type: Default message type (0x00)
00.. .... = GSM features: No specific features selected (0x00)
Protocol id.: 0x43
有没有办法 grep 特定字段并仅输出这些字段?我尝试过:
tshark -i any -V -Y smpp | grep 'Operation|Type of number|Numbering plan indicator|Recipient address'
但它不起作用。我也尝试过:
tshark -i any -V -Y smpp -T fields -e 'smpp.dest_addr_ton' -e 'smpp.destination_addr'
但这只会输出值,而我想要输出类似的内容;
Type of number (recipient): Unknown (0x00)
Numbering plan indicator (recipient): ISDN (E163/E164) (0x01)
Recipient address: 44123456789
有人能给出建议吗?谢谢,卢卡斯