示例#1
0
 def test_lookup(self):
     """
     Test the strings returned by the short lookup functions. 
     """
     self.assertEqual('LINKTYPE_ETHERNET', linklayer.lookup(1), 
                      'invalid long name')
     self.assertEqual('ethernet', linklayer.slookup(1), 
                      'invalid short name')
示例#2
0
 def test_lookup(self):
     """
     Test the strings returned by the short lookup functions.
     """
     self.assertEqual('LINKTYPE_ETHERNET', linklayer.lookup(1),
                      'invalid long name')
     self.assertEqual('ethernet', linklayer.slookup(1),
                      'invalid short name')
示例#3
0
 def __repr__(self):
     string = '%s-endian capture file version %d.%d\n'
     string += 'snapshot length: %d\n'
     string += 'linklayer type: %s\nnumber of packets: %d\n'
     string = string % (self.header.byteorder, self.header.major,
                        self.header.minor, self.header.snaplen,
                        linklayer.lookup(self.header.ll_type),
                        len(self.packets))
     return string
示例#4
0
 def __repr__(self):
     string = '%s-endian capture file version %d.%d\n'
     string += '%ssecond time resolution\n'
     string += 'snapshot length: %d\n'
     string += 'linklayer type: %s\nnumber of packets: %d\n'
     return string % (
         self.header.byteorder, self.header.major, self.header.minor, "nano"
         if self.header.ns_resolution else "micro", self.header.snaplen,
         linklayer.lookup(self.header.ll_type), len(self.packets))
示例#5
0
 def __repr__(self):
     string = '%s-endian capture file version %d.%d\n'
     string += 'snapshot length: %d\n'
     string += 'linklayer type: %s\nnumber of packets: %d\n'
     string = string % (self.header.byteorder, self.header.major,
                        self.header.minor, self.header.snaplen,
                        linklayer.lookup(self.header.ll_type),
                        len(self.packets))
     return string
示例#6
0
 def __repr__(self):
     string = '%s-endian capture file version %d.%d\n'
     string += '%ssecond time resolution\n'
     string += 'snapshot length: %d\n'
     string += 'linklayer type: %s\nnumber of packets: %d\n'
     return string % (self.header.byteorder, self.header.major,
                      self.header.minor,
                      "nano" if self.header.ns_resolution else "micro",
                      self.header.snaplen,
                      linklayer.lookup(self.header.ll_type),
                      len(self.packets))