Esempio n. 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')
Esempio n. 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')
Esempio n. 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
Esempio n. 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))
Esempio n. 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
Esempio n. 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))