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