0
Scapyを使用して複数のフラグ属性を持つパケットを設定する方法はありますか?Scapy BGP Flags属性
私は、オプションの推移の両方の属性を持つBGPレイヤーを設定しようとしています。私はこのgithubファイルを使用しています:https://github.com/levigross/Scapy/blob/master/scapy/contrib/bgp.py。 107行目に、私が追加しようとしているフラグがあります。
過去には試みには、失敗しました:
>>>a=BGPPathAttribute(flags=["Optional","Transitive"])
>>>send(a)
TypeError: unsupported operand type(s) for &: 'str' and 'int'
>>>a=BGPPathAttribute(flags=("Optional","Transitive"))
>>>send(a)
TypeError: unsupported operand type(s) for &: 'tuple' and 'int'
>>>a=BGPPathAttribute(flags="Optional")/BGPPathAttribute(flags="Transitive")
Creates 2 separate path attributes: One which is Optional and Non-Transitive and the other which is Well Known and Transitive.
>>>a=BGPPathAttribute(flags="Optional", flags="Transitive")
SyntaxError: keyword argument repeated
>>>a=BGPPathAttribute(flags="OT")
ValueError: ['OT'] is not in list
おかげで、私はフラグ= 192セット、それはオプションと推移の両方に、あなたが興味がある場合には別の方法を発見しました。 –
私はそれをエレガントなものとは見なしていないので、私はそれに言及しませんでしたが、今は完璧のためにそれを含めました。ありがとう! – Yoel