当前位置: 首页>>代码示例>>Python>>正文


Python packetsexample.PacketsExample类代码示例

本文整理汇总了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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:9,代码来源:test_qps.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:10,代码来源:test_qps.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:11,代码来源:test_qps.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:13,代码来源:test_traffic_volume_responses.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:14,代码来源:test_qnamecounter.py

示例6: dataExample

    def dataExample(self):
        data = PacketsExample()
        data.add_packet({'flags': '0', 'queries': []})

        data.set_expected('', 1)

        data.put_information('QNames', {''})
        return data
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:8,代码来源:test_issue27.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:16,代码来源:test_traffic_volume_queries.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:17,代码来源:test_onlyanswers.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:11,代码来源:test_topnq.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:12,代码来源:test_ednsbufsiz.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:12,代码来源:test_ap.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:12,代码来源:test_ap.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:12,代码来源:test_rcode.py

示例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
开发者ID:niclabs,项目名称:ratadns-filters,代码行数:15,代码来源:test_clientsubnet.py

示例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
开发者ID:jaimesanz,项目名称:ratadns-filters,代码行数:23,代码来源:test_phs.py


注:本文中的packetsexample.PacketsExample类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。