# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import print_function
+
import binascii
import getopt
import struct
def usage():
- print """\
+ print("""\
%(argv0)s: print pcap file packet data as hex
usage: %(argv0)s FILE
where FILE is a PCAP file.
The following options are also available:
-h, --help display this help message
-V, --version display version information\
-""" % {'argv0': argv0}
+""" % {'argv0': argv0})
sys.exit(0)
if __name__ == "__main__":
if key in ['-h', '--help']:
usage()
elif key in ['-V', '--version']:
- print "ovs-pcap (Open vSwitch) @VERSION@"
+ print("ovs-pcap (Open vSwitch) @VERSION@")
else:
sys.exit(0)
if packet is None:
break
- print binascii.hexlify(packet)
+ print(binascii.hexlify(packet))
except PcapException as e:
sys.stderr.write("%s: %s\n" % (argv0, e))