Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Scapy の ConditionalField について助けが必要です。ラムダ関数に問題があります。パケット内の特定のレイヤーをチェックするラムダ関数を取得するにはどうすればよいですか?
現在、私はコードを持っています
lamda pkt: pkt.haslayer(RTP) == 1
これは機能していないようです。pkt に pkt の内容が含まれているとは思えません。どうすればこれを回避できますか?
助けてくれてありがとう
試してみてくださいlambda pkt: pkt.haslayer(RTP)。私の推測ではhaslayer()、Python からは 1 とは見なされないものを返すTrueため、1 との比較は常に を返しFalseます。
lambda pkt: pkt.haslayer(RTP)
haslayer()
True
False