projects
/
cascardo
/
ovs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto-dpif-rid: Don't carry actset_output explicitly in metadata.
[cascardo/ovs.git]
/
ofproto
/
ipfix-gen-entities
diff --git
a/ofproto/ipfix-gen-entities
b/ofproto/ipfix-gen-entities
index
54951b6
..
a603cd1
100755
(executable)
--- a/
ofproto/ipfix-gen-entities
+++ b/
ofproto/ipfix-gen-entities
@@
-7,6
+7,8
@@
# notice and this notice are preserved. This file is offered as-is,
# without warranty of any kind.
# notice and this notice are preserved. This file is offered as-is,
# without warranty of any kind.
+from __future__ import print_function
+
import getopt
import re
import sys
import getopt
import re
import sys
@@
-48,16
+50,16
@@
class IpfixEntityHandler(xml.sax.handler.ContentHandler):
self.current_record = dict()
def startDocument(self):
self.current_record = dict()
def startDocument(self):
- print
"""\
+ print
(
"""\
/* IPFIX entities. */
#ifndef IPFIX_ENTITY
#define IPFIX_ENTITY(ENUM, ID, SIZE, NAME)
#endif
/* IPFIX entities. */
#ifndef IPFIX_ENTITY
#define IPFIX_ENTITY(ENUM, ID, SIZE, NAME)
#endif
-"""
+"""
)
def endDocument(self):
def endDocument(self):
- print
"""
-#undef IPFIX_ENTITY"""
+ print
(
"""
+#undef IPFIX_ENTITY"""
)
def startElement(self, name, attrs):
if name in self.RECORD_FIELDS:
def startElement(self, name, attrs):
if name in self.RECORD_FIELDS:
@@
-83,8
+85,8
@@
class IpfixEntityHandler(xml.sax.handler.ContentHandler):
self.current_record['dataTypeSize'] = self.DATA_TYPE_SIZE.get(
self.current_record['dataType'], 0)
self.current_record['dataTypeSize'] = self.DATA_TYPE_SIZE.get(
self.current_record['dataType'], 0)
- print
'IPFIX_ENTITY(%(enumName)s, %(elementId)s, ' \
- '%(dataTypeSize)i, %(name)s)' % self.current_record
+ print
('IPFIX_ENTITY(%(enumName)s, %(elementId)s, '
+ '%(dataTypeSize)i, %(name)s)' % self.current_record
)
self.current_record.clear()
def characters(self, content):
self.current_record.clear()
def characters(self, content):
@@
-97,7
+99,7
@@
def print_ipfix_entity_macros(xml_file):
def usage(name):
def usage(name):
- print
"""\
+ print
(
"""\
%(name)s: IPFIX entity definition generator
Prints C macros defining IPFIX entities from the standard IANA file at
<http://www.iana.org/assignments/ipfix/ipfix.xml>
%(name)s: IPFIX entity definition generator
Prints C macros defining IPFIX entities from the standard IANA file at
<http://www.iana.org/assignments/ipfix/ipfix.xml>
@@
-107,7
+109,7
@@
where XML is the standard IANA XML file defining IPFIX entities
The following options are also available:
-h, --help display this help message
-V, --version display version information\
The following options are also available:
-h, --help display this help message
-V, --version display version information\
-""" % {'name': name}
+""" % {'name': name}
)
sys.exit(0)
if __name__ == '__main__':
sys.exit(0)
if __name__ == '__main__':
@@
-122,7
+124,7
@@
if __name__ == '__main__':
if key in ['-h', '--help']:
usage()
elif key in ['-V', '--version']:
if key in ['-h', '--help']:
usage()
elif key in ['-V', '--version']:
- print
'ipfix-gen-entities (Open vSwitch)'
+ print
('ipfix-gen-entities (Open vSwitch)')
else:
sys.exit(0)
else:
sys.exit(0)