本文整理汇总了Python中packetsexample.PacketsExample类的典型用法代码示例。如果您正苦于以下问题:Python PacketsExample类的具体用法?Python PacketsExample怎么用?Python PacketsExample使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PacketsExample类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: data_only_answers
def data_only_answers(self):
na = 2
nq = 0
data = PacketsExample({'na': na, 'nq': nq})
for i in range(na):
data.add_packet({'flags': '8000'})
return data
示例2: data_only_queries
def data_only_queries(self):
na = 0
nq = 2
data = PacketsExample({'na': na, 'nq': nq})
data = PacketsExample()
for i in range(nq):
data.add_packet({'flags': '0'})
return data
示例3: data_example
def data_example(self):
na = 2
nq = 2
data = PacketsExample({'na': na, 'nq': nq})
for i in range(na):
data.add_packet({'flags': '8000'})
for i in range(nq):
data.add_packet({'flags': '0'})
return data
示例4: data_example
def data_example(self):
data = PacketsExample()
for i in range(30):
data.add_packet({"flags": "8000", "source": "12345678", "queries": [{"qname": "www.nic.cl."}]})
for i in range(25):
data.add_packet({"flags": "8000", "source": "1234567890", "queries": [{"qname": "www.uchile.cl."}]})
data.set_expected("udp", {"IPv4": 30, "IPv6": 25})
data.put_information("TrafficVolumeResponses", ["udp"])
return data
示例5: data_only_answers
def data_only_answers(self):
data = PacketsExample()
for i in range(5):
data.add_packet({'flags': '8000', 'queries': [
{'qname': 'www.nic.cl'}]})
data.set_expected('www.nic.cl', 5)
for i in range(3):
data.add_packet({'flags': '8000', 'queries': [
{'qname': 'www.jerry.cl'}]})
data.set_expected('www.jerry.cl', 3)
return data
示例6: dataExample
def dataExample(self):
data = PacketsExample()
data.add_packet({'flags': '0', 'queries': []})
data.set_expected('', 1)
data.put_information('QNames', {''})
return data
示例7: data_example
def data_example(self):
data = PacketsExample()
for i in range(30):
data.add_packet({'flags': '0', 'source': '12345678',
'queries': [{'qname': 'www.nic.cl.'}]})
for i in range(25):
data.add_packet({'flags': '0',
'source': '1234567890',
'queries': [{'qname': 'www.uchile.cl.'}]})
data.set_expected('udp', {'IPv4': 30, 'IPv6': 25})
data.put_information('TrafficVolumeQueries', ['udp'])
return data
示例8: data_only_queries
def data_only_queries(self):
data = PacketsExample()
data.do_not_change_order()
for i in range(5):
data.add_packet({'flags': '0', 'queries': [
{'qname': 'www.nic.cl'}]})
for i in range(3):
data.add_packet({'flags': '0', 'queries': [
{'qname': 'www.jerry.cl'}]})
for i in range(2):
data.add_packet({'flags': '0', 'queries': [
{'qname': 'www.pinky.cl'}]})
return data
示例9: data_just_answers
def data_just_answers(self):
data = PacketsExample()
data.add_packet({'flags': '8000', 'queries': [
{'qname': 'www.nic.cl'}]}) # Answers
data.add_packet({'flags': '8000', 'queries': [
{'qname': 'www.brain.cl'}]})
data.add_packet({'flags': '8000', 'queries': [
{'qname': 'www.pinky.cl'}]})
return data
示例10: data_example
def data_example(self):
data = PacketsExample()
for i in range(5):
data.add_packet({'flags': '0', 'queries': [
{'qname': 'www.nic.cl'}]})
data.set_expected('512-1023', 5)
data.put_information("EdnsBufsiz", ['512-1023'])
return data
示例11: data_without_queries
def data_without_queries(self):
answers = [{'flags': '8000', 'id': 'a6c7'}, {
'flags': '8000', 'id': '5433'}, {'flags': '8000', 'id': 'a276'}]
data = PacketsExample({'queries': 0, 'answers': len(answers)})
for answer in answers:
data.add_packet(answer)
data.set_expected('AloneAnswers', answers)
data.set_expected('AloneQueries', [])
return data
示例12: data_without_answers
def data_without_answers(self):
queries = [{'flags': '0', 'id': 'a6c7'}, {'flags': '0', 'id': '5433'},
{'flags': '0', 'id': 'a276'}, {'flags': '0', 'id': '4321'}]
data = PacketsExample({'queries': len(queries), 'answers': 0})
for query in queries:
data.add_packet(query)
data.set_expected('AloneAnswers', [])
data.set_expected('AloneQueries', queries)
return data
示例13: data_example
def data_example(self):
data = PacketsExample()
for i in range(5):
data.add_packet({'flags': '8000', 'queries': [
{'qname': 'www.nic.cl'}]})
data.set_expected(0, 5)
data.put_information("Rcode", [0])
return data
示例14: data_example
def data_example(self):
data = PacketsExample()
for i in range(5):
data.add_packet({'dest': 'encrypted(dnsip1)',
'source': 'encrypted(ip1)',
'flags': '0',
'queries': [
{'qname': 'www.ni_c.cl', 'qtype': '1'}]})
data.set_expected("encrypted(ip1)", 5)
data.put_information("src", ["encrypted(ip1)"])
return data
示例15: data_repeat_error
def data_repeat_error(self):
data = PacketsExample()
data.put_information('problematicSources', {
'encrypted(ip1)': [{'qname': 'www.ni_c.cl', 'qtype': '1'}],
'encrypted(ip2)': [{'qname': 'www.nic_labs.cl', 'qtype': '2'}]})
count_of_errors = {}
for i in range(3):
data.add_packet({'source': 'encrypted(ip1)', 'flags': '0',
'queries': [{'qname': 'www.ni_c.cl',
'qtype': '1'}]})
count_of_errors['encrypted(ip1)'] = 3
for i in range(2):
data.add_packet({'source': 'encrypted(ip2)', 'flags': '0',
'queries': [{'qname': 'www.nic_labs.cl',
'qtype': '2'}]})
count_of_errors['encrypted(ip2)'] = 2
data.put_information('countOfErrors', count_of_errors)
return data