#! @PYTHON@
#
-# Copyright (c) 2010 Nicira Networks.
+# Copyright (c) 2010 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
import struct
import sys
+
class PcapException(Exception):
pass
+
class PcapReader(object):
def __init__(self, file_name):
self.file = open(file_name, "rb")
return packet
argv0 = sys.argv[0]
+
def usage():
print """\
%(argv0)s: print pcap file packet data as hex
try:
options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
['help', 'version'])
- except getopt.GetoptException, geo:
+ except getopt.GetoptException as geo:
sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
sys.exit(1)
print binascii.hexlify(packet)
- except PcapException, e:
+ except PcapException as e:
sys.stderr.write("%s: %s\n" % (argv0, e))
sys.exit(1)