<commit_before><commit_msg>add a script to make test pcap file<commit_after>from lib.packet.scion import SCIONPacket
from lib.packet.scion import get_addr_from_type
from lib.packet.scion import PacketType
from lib.packet.path import CorePath
from lib.packet.host_addr import IPv4HostAddr
from scapy.utils import PcapWriter
from scapy.all import Ether,IP,UDP

path = CorePath(b"\x80\xa6\x01\x01\x00\x03\x00\x00\x00\x3f\x00\x00\x00\x6e\x7d\x55\x00\x1f\x00\x24\x00\xce\x9d\xf0\x20\x00\x00\x0d\x00\x47\x32\xa3\x80\xaa\x01\x01\x00\x03\x00\x00\x20\x00\x00\x0e\x00\x0a\x49\x93\x00\x29\x00\x2f\x00\x25\xd7\x53\x00\x4a\x00\x00\x00\x2a\x44\xc8")
pkt = SCIONPacket.from_values(src=IPv4HostAddr("1.2.3.4"), dst=IPv4HostAddr("5.6.7.8"), payload=b"ABC", path=path)
#pkt = SCIONPacket.from_values(src = get_addr_from_type(PacketType.BEACON), dst=IPv4HostAddr("5.6.7.8"), payload=b"ABC", path=path)

print len(pkt.pack())

pcap=PcapWriter('scion_test_packet.pcap')
e=Ether(dst="11:22:33:44:55:66",src="aa:bb:cc:dd:ee:ff")/IP()/UDP(sport=1234,dport=33333)/pkt.pack()
pcap.write(e)
{'fraction_non_alphanumeric': 0.17591721542803387, 'fraction_numerical': 0.13640639698965193, 'mean_word_length': 5.864516129032258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4722819', 'n_tokens_mistral': 584, 'n_tokens_neox': 526, 'n_words': 53}