Adding tofino port tool to repo to have unique location and source of truth
Change-Id: I8ad0cd951b805f1ccc627afee2c4487d46b4b7e1
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/__init__.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/__init__.py
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/__init__.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/__init__.py
new file mode 100644
index 0000000..a72f5ea
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'pltfm_pm_rpc']
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/constants.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/constants.py
new file mode 100644
index 0000000..eb0d35a
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/constants.py
@@ -0,0 +1,12 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+from .ttypes import *
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc-remote b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc-remote
new file mode 100755
index 0000000..15bf28a
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc-remote
@@ -0,0 +1,180 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+import sys
+import pprint
+if sys.version_info[0] > 2:
+ from urllib.parse import urlparse
+else:
+ from urlparse import urlparse
+from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
+from thrift.protocol.TBinaryProtocol import TBinaryProtocol
+
+from pltfm_pm_rpc import pltfm_pm_rpc
+from pltfm_pm_rpc.ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+ print('')
+ print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
+ print('')
+ print('Functions:')
+ print(' pltfm_pm_status_t pltfm_pm_port_add(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port, pltfm_pm_port_speed_t ps, pltfm_pm_fec_type_t fec)')
+ print(' pltfm_pm_status_t pltfm_pm_port_del(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+ print(' pltfm_pm_status_t pltfm_pm_port_enable(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+ print(' pltfm_pm_status_t pltfm_pm_port_dis(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+ print(' pltfm_pm_status_t pltfm_pm_switchd_port_cleanup(pltfm_pm_device_t device)')
+ print(' pltfm_pm_oper_status_t pltfm_pm_port_oper_status_get(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+ print(' pltfm_pm_board_type_t pltfm_pm_board_type_get()')
+ print(' pltfm_pm_status_t pltfm_pm_port_an_set(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port, i32 an_flag)')
+ print(' pltfm_pm_status_t pltfm_pm_serdes_lane_map_set(pltfm_pm_device_t device)')
+ print(' pltfm_pm_status_t pltfm_pm_serdes_init(pltfm_pm_device_t device)')
+ print('')
+ sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent=2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+ssl = False
+validate = True
+ca_certs = None
+keyfile = None
+certfile = None
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+ parts = sys.argv[argi + 1].split(':')
+ host = parts[0]
+ if len(parts) > 1:
+ port = int(parts[1])
+ argi += 2
+
+if sys.argv[argi] == '-u':
+ url = urlparse(sys.argv[argi + 1])
+ parts = url[1].split(':')
+ host = parts[0]
+ if len(parts) > 1:
+ port = int(parts[1])
+ else:
+ port = 80
+ uri = url[2]
+ if url[4]:
+ uri += '?%s' % url[4]
+ http = True
+ argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+ framed = True
+ argi += 1
+
+if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
+ ssl = True
+ argi += 1
+
+if sys.argv[argi] == '-novalidate':
+ validate = False
+ argi += 1
+
+if sys.argv[argi] == '-ca_certs':
+ ca_certs = sys.argv[argi+1]
+ argi += 2
+
+if sys.argv[argi] == '-keyfile':
+ keyfile = sys.argv[argi+1]
+ argi += 2
+
+if sys.argv[argi] == '-certfile':
+ certfile = sys.argv[argi+1]
+ argi += 2
+
+cmd = sys.argv[argi]
+args = sys.argv[argi + 1:]
+
+if http:
+ transport = THttpClient.THttpClient(host, port, uri)
+else:
+ if ssl:
+ socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
+ else:
+ socket = TSocket.TSocket(host, port)
+ if framed:
+ transport = TTransport.TFramedTransport(socket)
+ else:
+ transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol(transport)
+client = pltfm_pm_rpc.Client(protocol)
+transport.open()
+
+if cmd == 'pltfm_pm_port_add':
+ if len(args) != 4:
+ print('pltfm_pm_port_add requires 4 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_port_add(eval(args[0]), eval(args[1]), eval(args[2]), eval(args[3]),))
+
+elif cmd == 'pltfm_pm_port_del':
+ if len(args) != 2:
+ print('pltfm_pm_port_del requires 2 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_port_del(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_port_enable':
+ if len(args) != 2:
+ print('pltfm_pm_port_enable requires 2 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_port_enable(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_port_dis':
+ if len(args) != 2:
+ print('pltfm_pm_port_dis requires 2 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_port_dis(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_switchd_port_cleanup':
+ if len(args) != 1:
+ print('pltfm_pm_switchd_port_cleanup requires 1 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_switchd_port_cleanup(eval(args[0]),))
+
+elif cmd == 'pltfm_pm_port_oper_status_get':
+ if len(args) != 2:
+ print('pltfm_pm_port_oper_status_get requires 2 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_port_oper_status_get(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_board_type_get':
+ if len(args) != 0:
+ print('pltfm_pm_board_type_get requires 0 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_board_type_get())
+
+elif cmd == 'pltfm_pm_port_an_set':
+ if len(args) != 3:
+ print('pltfm_pm_port_an_set requires 3 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_port_an_set(eval(args[0]), eval(args[1]), eval(args[2]),))
+
+elif cmd == 'pltfm_pm_serdes_lane_map_set':
+ if len(args) != 1:
+ print('pltfm_pm_serdes_lane_map_set requires 1 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_serdes_lane_map_set(eval(args[0]),))
+
+elif cmd == 'pltfm_pm_serdes_init':
+ if len(args) != 1:
+ print('pltfm_pm_serdes_init requires 1 args')
+ sys.exit(1)
+ pp.pprint(client.pltfm_pm_serdes_init(eval(args[0]),))
+
+else:
+ print('Unrecognized method %s' % cmd)
+ sys.exit(1)
+
+transport.close()
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc.py
new file mode 100644
index 0000000..0d9432b
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc.py
@@ -0,0 +1,2106 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+import logging
+from .ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+
+
+class Iface(object):
+ def pltfm_pm_port_add(self, device, dev_port, ps, fec):
+ """
+ Parameters:
+ - device
+ - dev_port
+ - ps
+ - fec
+ """
+ pass
+
+ def pltfm_pm_port_del(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ pass
+
+ def pltfm_pm_port_enable(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ pass
+
+ def pltfm_pm_port_dis(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ pass
+
+ def pltfm_pm_switchd_port_cleanup(self, device):
+ """
+ Parameters:
+ - device
+ """
+ pass
+
+ def pltfm_pm_port_oper_status_get(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ pass
+
+ def pltfm_pm_board_type_get(self):
+ pass
+
+ def pltfm_pm_port_an_set(self, device, dev_port, an_flag):
+ """
+ Parameters:
+ - device
+ - dev_port
+ - an_flag
+ """
+ pass
+
+ def pltfm_pm_serdes_lane_map_set(self, device):
+ """
+ Parameters:
+ - device
+ """
+ pass
+
+ def pltfm_pm_serdes_init(self, device):
+ """
+ Parameters:
+ - device
+ """
+ pass
+
+
+class Client(Iface):
+ def __init__(self, iprot, oprot=None):
+ self._iprot = self._oprot = iprot
+ if oprot is not None:
+ self._oprot = oprot
+ self._seqid = 0
+
+ def pltfm_pm_port_add(self, device, dev_port, ps, fec):
+ """
+ Parameters:
+ - device
+ - dev_port
+ - ps
+ - fec
+ """
+ self.send_pltfm_pm_port_add(device, dev_port, ps, fec)
+ return self.recv_pltfm_pm_port_add()
+
+ def send_pltfm_pm_port_add(self, device, dev_port, ps, fec):
+ self._oprot.writeMessageBegin('pltfm_pm_port_add', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_port_add_args()
+ args.device = device
+ args.dev_port = dev_port
+ args.ps = ps
+ args.fec = fec
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_port_add(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_port_add_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_add failed: unknown result")
+
+ def pltfm_pm_port_del(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ self.send_pltfm_pm_port_del(device, dev_port)
+ return self.recv_pltfm_pm_port_del()
+
+ def send_pltfm_pm_port_del(self, device, dev_port):
+ self._oprot.writeMessageBegin('pltfm_pm_port_del', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_port_del_args()
+ args.device = device
+ args.dev_port = dev_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_port_del(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_port_del_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_del failed: unknown result")
+
+ def pltfm_pm_port_enable(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ self.send_pltfm_pm_port_enable(device, dev_port)
+ return self.recv_pltfm_pm_port_enable()
+
+ def send_pltfm_pm_port_enable(self, device, dev_port):
+ self._oprot.writeMessageBegin('pltfm_pm_port_enable', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_port_enable_args()
+ args.device = device
+ args.dev_port = dev_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_port_enable(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_port_enable_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_enable failed: unknown result")
+
+ def pltfm_pm_port_dis(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ self.send_pltfm_pm_port_dis(device, dev_port)
+ return self.recv_pltfm_pm_port_dis()
+
+ def send_pltfm_pm_port_dis(self, device, dev_port):
+ self._oprot.writeMessageBegin('pltfm_pm_port_dis', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_port_dis_args()
+ args.device = device
+ args.dev_port = dev_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_port_dis(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_port_dis_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_dis failed: unknown result")
+
+ def pltfm_pm_switchd_port_cleanup(self, device):
+ """
+ Parameters:
+ - device
+ """
+ self.send_pltfm_pm_switchd_port_cleanup(device)
+ return self.recv_pltfm_pm_switchd_port_cleanup()
+
+ def send_pltfm_pm_switchd_port_cleanup(self, device):
+ self._oprot.writeMessageBegin('pltfm_pm_switchd_port_cleanup', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_switchd_port_cleanup_args()
+ args.device = device
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_switchd_port_cleanup(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_switchd_port_cleanup_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_switchd_port_cleanup failed: unknown result")
+
+ def pltfm_pm_port_oper_status_get(self, device, dev_port):
+ """
+ Parameters:
+ - device
+ - dev_port
+ """
+ self.send_pltfm_pm_port_oper_status_get(device, dev_port)
+ return self.recv_pltfm_pm_port_oper_status_get()
+
+ def send_pltfm_pm_port_oper_status_get(self, device, dev_port):
+ self._oprot.writeMessageBegin('pltfm_pm_port_oper_status_get', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_port_oper_status_get_args()
+ args.device = device
+ args.dev_port = dev_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_port_oper_status_get(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_port_oper_status_get_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_oper_status_get failed: unknown result")
+
+ def pltfm_pm_board_type_get(self):
+ self.send_pltfm_pm_board_type_get()
+ return self.recv_pltfm_pm_board_type_get()
+
+ def send_pltfm_pm_board_type_get(self):
+ self._oprot.writeMessageBegin('pltfm_pm_board_type_get', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_board_type_get_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_board_type_get(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_board_type_get_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_board_type_get failed: unknown result")
+
+ def pltfm_pm_port_an_set(self, device, dev_port, an_flag):
+ """
+ Parameters:
+ - device
+ - dev_port
+ - an_flag
+ """
+ self.send_pltfm_pm_port_an_set(device, dev_port, an_flag)
+ return self.recv_pltfm_pm_port_an_set()
+
+ def send_pltfm_pm_port_an_set(self, device, dev_port, an_flag):
+ self._oprot.writeMessageBegin('pltfm_pm_port_an_set', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_port_an_set_args()
+ args.device = device
+ args.dev_port = dev_port
+ args.an_flag = an_flag
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_port_an_set(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_port_an_set_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_an_set failed: unknown result")
+
+ def pltfm_pm_serdes_lane_map_set(self, device):
+ """
+ Parameters:
+ - device
+ """
+ self.send_pltfm_pm_serdes_lane_map_set(device)
+ return self.recv_pltfm_pm_serdes_lane_map_set()
+
+ def send_pltfm_pm_serdes_lane_map_set(self, device):
+ self._oprot.writeMessageBegin('pltfm_pm_serdes_lane_map_set', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_serdes_lane_map_set_args()
+ args.device = device
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_serdes_lane_map_set(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_serdes_lane_map_set_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_serdes_lane_map_set failed: unknown result")
+
+ def pltfm_pm_serdes_init(self, device):
+ """
+ Parameters:
+ - device
+ """
+ self.send_pltfm_pm_serdes_init(device)
+ return self.recv_pltfm_pm_serdes_init()
+
+ def send_pltfm_pm_serdes_init(self, device):
+ self._oprot.writeMessageBegin('pltfm_pm_serdes_init', TMessageType.CALL, self._seqid)
+ args = pltfm_pm_serdes_init_args()
+ args.device = device
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_pltfm_pm_serdes_init(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = pltfm_pm_serdes_init_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.ouch is not None:
+ raise result.ouch
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_serdes_init failed: unknown result")
+
+
+class Processor(Iface, TProcessor):
+ def __init__(self, handler):
+ self._handler = handler
+ self._processMap = {}
+ self._processMap["pltfm_pm_port_add"] = Processor.process_pltfm_pm_port_add
+ self._processMap["pltfm_pm_port_del"] = Processor.process_pltfm_pm_port_del
+ self._processMap["pltfm_pm_port_enable"] = Processor.process_pltfm_pm_port_enable
+ self._processMap["pltfm_pm_port_dis"] = Processor.process_pltfm_pm_port_dis
+ self._processMap["pltfm_pm_switchd_port_cleanup"] = Processor.process_pltfm_pm_switchd_port_cleanup
+ self._processMap["pltfm_pm_port_oper_status_get"] = Processor.process_pltfm_pm_port_oper_status_get
+ self._processMap["pltfm_pm_board_type_get"] = Processor.process_pltfm_pm_board_type_get
+ self._processMap["pltfm_pm_port_an_set"] = Processor.process_pltfm_pm_port_an_set
+ self._processMap["pltfm_pm_serdes_lane_map_set"] = Processor.process_pltfm_pm_serdes_lane_map_set
+ self._processMap["pltfm_pm_serdes_init"] = Processor.process_pltfm_pm_serdes_init
+
+ def process(self, iprot, oprot):
+ (name, type, seqid) = iprot.readMessageBegin()
+ if name not in self._processMap:
+ iprot.skip(TType.STRUCT)
+ iprot.readMessageEnd()
+ x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+ oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+ x.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+ return
+ else:
+ self._processMap[name](self, seqid, iprot, oprot)
+ return True
+
+ def process_pltfm_pm_port_add(self, seqid, iprot, oprot):
+ args = pltfm_pm_port_add_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_port_add_result()
+ try:
+ result.success = self._handler.pltfm_pm_port_add(args.device, args.dev_port, args.ps, args.fec)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_port_add", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_port_del(self, seqid, iprot, oprot):
+ args = pltfm_pm_port_del_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_port_del_result()
+ try:
+ result.success = self._handler.pltfm_pm_port_del(args.device, args.dev_port)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_port_del", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_port_enable(self, seqid, iprot, oprot):
+ args = pltfm_pm_port_enable_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_port_enable_result()
+ try:
+ result.success = self._handler.pltfm_pm_port_enable(args.device, args.dev_port)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_port_enable", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_port_dis(self, seqid, iprot, oprot):
+ args = pltfm_pm_port_dis_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_port_dis_result()
+ try:
+ result.success = self._handler.pltfm_pm_port_dis(args.device, args.dev_port)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_port_dis", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_switchd_port_cleanup(self, seqid, iprot, oprot):
+ args = pltfm_pm_switchd_port_cleanup_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_switchd_port_cleanup_result()
+ try:
+ result.success = self._handler.pltfm_pm_switchd_port_cleanup(args.device)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_switchd_port_cleanup", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_port_oper_status_get(self, seqid, iprot, oprot):
+ args = pltfm_pm_port_oper_status_get_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_port_oper_status_get_result()
+ try:
+ result.success = self._handler.pltfm_pm_port_oper_status_get(args.device, args.dev_port)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_port_oper_status_get", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_board_type_get(self, seqid, iprot, oprot):
+ args = pltfm_pm_board_type_get_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_board_type_get_result()
+ try:
+ result.success = self._handler.pltfm_pm_board_type_get()
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_board_type_get", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_port_an_set(self, seqid, iprot, oprot):
+ args = pltfm_pm_port_an_set_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_port_an_set_result()
+ try:
+ result.success = self._handler.pltfm_pm_port_an_set(args.device, args.dev_port, args.an_flag)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_port_an_set", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_serdes_lane_map_set(self, seqid, iprot, oprot):
+ args = pltfm_pm_serdes_lane_map_set_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_serdes_lane_map_set_result()
+ try:
+ result.success = self._handler.pltfm_pm_serdes_lane_map_set(args.device)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_serdes_lane_map_set", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_pltfm_pm_serdes_init(self, seqid, iprot, oprot):
+ args = pltfm_pm_serdes_init_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = pltfm_pm_serdes_init_result()
+ try:
+ result.success = self._handler.pltfm_pm_serdes_init(args.device)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except InvalidPltfmPmOperation as ouch:
+ msg_type = TMessageType.REPLY
+ result.ouch = ouch
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("pltfm_pm_serdes_init", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+
+class pltfm_pm_port_add_args(object):
+ """
+ Attributes:
+ - device
+ - dev_port
+ - ps
+ - fec
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ (2, TType.I32, 'dev_port', None, None, ), # 2
+ (3, TType.I32, 'ps', None, None, ), # 3
+ (4, TType.I32, 'fec', None, None, ), # 4
+ )
+
+ def __init__(self, device=None, dev_port=None, ps=None, fec=None,):
+ self.device = device
+ self.dev_port = dev_port
+ self.ps = ps
+ self.fec = fec
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.dev_port = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.ps = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.fec = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_add_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ if self.dev_port is not None:
+ oprot.writeFieldBegin('dev_port', TType.I32, 2)
+ oprot.writeI32(self.dev_port)
+ oprot.writeFieldEnd()
+ if self.ps is not None:
+ oprot.writeFieldBegin('ps', TType.I32, 3)
+ oprot.writeI32(self.ps)
+ oprot.writeFieldEnd()
+ if self.fec is not None:
+ oprot.writeFieldBegin('fec', TType.I32, 4)
+ oprot.writeI32(self.fec)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_add_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_add_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_del_args(object):
+ """
+ Attributes:
+ - device
+ - dev_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ (2, TType.I32, 'dev_port', None, None, ), # 2
+ )
+
+ def __init__(self, device=None, dev_port=None,):
+ self.device = device
+ self.dev_port = dev_port
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.dev_port = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_del_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ if self.dev_port is not None:
+ oprot.writeFieldBegin('dev_port', TType.I32, 2)
+ oprot.writeI32(self.dev_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_del_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_del_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_enable_args(object):
+ """
+ Attributes:
+ - device
+ - dev_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ (2, TType.I32, 'dev_port', None, None, ), # 2
+ )
+
+ def __init__(self, device=None, dev_port=None,):
+ self.device = device
+ self.dev_port = dev_port
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.dev_port = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_enable_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ if self.dev_port is not None:
+ oprot.writeFieldBegin('dev_port', TType.I32, 2)
+ oprot.writeI32(self.dev_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_enable_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_enable_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_dis_args(object):
+ """
+ Attributes:
+ - device
+ - dev_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ (2, TType.I32, 'dev_port', None, None, ), # 2
+ )
+
+ def __init__(self, device=None, dev_port=None,):
+ self.device = device
+ self.dev_port = dev_port
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.dev_port = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_dis_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ if self.dev_port is not None:
+ oprot.writeFieldBegin('dev_port', TType.I32, 2)
+ oprot.writeI32(self.dev_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_dis_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_dis_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_switchd_port_cleanup_args(object):
+ """
+ Attributes:
+ - device
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ )
+
+ def __init__(self, device=None,):
+ self.device = device
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_switchd_port_cleanup_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_switchd_port_cleanup_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_switchd_port_cleanup_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_oper_status_get_args(object):
+ """
+ Attributes:
+ - device
+ - dev_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ (2, TType.I32, 'dev_port', None, None, ), # 2
+ )
+
+ def __init__(self, device=None, dev_port=None,):
+ self.device = device
+ self.dev_port = dev_port
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.dev_port = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_oper_status_get_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ if self.dev_port is not None:
+ oprot.writeFieldBegin('dev_port', TType.I32, 2)
+ oprot.writeI32(self.dev_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_oper_status_get_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_oper_status_get_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_board_type_get_args(object):
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_board_type_get_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_board_type_get_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_board_type_get_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_an_set_args(object):
+ """
+ Attributes:
+ - device
+ - dev_port
+ - an_flag
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ (2, TType.I32, 'dev_port', None, None, ), # 2
+ (3, TType.I32, 'an_flag', None, None, ), # 3
+ )
+
+ def __init__(self, device=None, dev_port=None, an_flag=None,):
+ self.device = device
+ self.dev_port = dev_port
+ self.an_flag = an_flag
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.dev_port = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.an_flag = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_an_set_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ if self.dev_port is not None:
+ oprot.writeFieldBegin('dev_port', TType.I32, 2)
+ oprot.writeI32(self.dev_port)
+ oprot.writeFieldEnd()
+ if self.an_flag is not None:
+ oprot.writeFieldBegin('an_flag', TType.I32, 3)
+ oprot.writeI32(self.an_flag)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_port_an_set_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_port_an_set_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_serdes_lane_map_set_args(object):
+ """
+ Attributes:
+ - device
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ )
+
+ def __init__(self, device=None,):
+ self.device = device
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_serdes_lane_map_set_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_serdes_lane_map_set_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_serdes_lane_map_set_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_serdes_init_args(object):
+ """
+ Attributes:
+ - device
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.BYTE, 'device', None, None, ), # 1
+ )
+
+ def __init__(self, device=None,):
+ self.device = device
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.BYTE:
+ self.device = iprot.readByte()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_serdes_init_args')
+ if self.device is not None:
+ oprot.writeFieldBegin('device', TType.BYTE, 1)
+ oprot.writeByte(self.device)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class pltfm_pm_serdes_init_result(object):
+ """
+ Attributes:
+ - success
+ - ouch
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ouch=None,):
+ self.success = success
+ self.ouch = ouch
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ouch = InvalidPltfmPmOperation()
+ self.ouch.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('pltfm_pm_serdes_init_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ouch is not None:
+ oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+ self.ouch.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/ttypes.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/ttypes.py
new file mode 100644
index 0000000..3e0404c
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/ttypes.py
@@ -0,0 +1,175 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+
+from thrift.transport import TTransport
+
+
+class pltfm_pm_port_speed_t(object):
+ BF_SPEED_NONE = 0
+ BF_SPEED_1G = 1
+ BF_SPEED_10G = 2
+ BF_SPEED_25G = 3
+ BF_SPEED_40G = 4
+ BF_SPEED_40G_NB = 5
+ BF_SPEED_50G = 6
+ BF_SPEED_100G = 7
+ BF_SPEED_40G_NON_BREAKABLE = 8
+
+ _VALUES_TO_NAMES = {
+ 0: "BF_SPEED_NONE",
+ 1: "BF_SPEED_1G",
+ 2: "BF_SPEED_10G",
+ 3: "BF_SPEED_25G",
+ 4: "BF_SPEED_40G",
+ 5: "BF_SPEED_40G_NB",
+ 6: "BF_SPEED_50G",
+ 7: "BF_SPEED_100G",
+ 8: "BF_SPEED_40G_NON_BREAKABLE",
+ }
+
+ _NAMES_TO_VALUES = {
+ "BF_SPEED_NONE": 0,
+ "BF_SPEED_1G": 1,
+ "BF_SPEED_10G": 2,
+ "BF_SPEED_25G": 3,
+ "BF_SPEED_40G": 4,
+ "BF_SPEED_40G_NB": 5,
+ "BF_SPEED_50G": 6,
+ "BF_SPEED_100G": 7,
+ "BF_SPEED_40G_NON_BREAKABLE": 8,
+ }
+
+
+class pltfm_pm_fec_type_t(object):
+ BF_FEC_TYP_NONE = 0
+ BF_FEC_TYP_FIRECODE = 1
+ BF_FEC_TYP_REED_SOLOMON = 2
+
+ _VALUES_TO_NAMES = {
+ 0: "BF_FEC_TYP_NONE",
+ 1: "BF_FEC_TYP_FIRECODE",
+ 2: "BF_FEC_TYP_REED_SOLOMON",
+ }
+
+ _NAMES_TO_VALUES = {
+ "BF_FEC_TYP_NONE": 0,
+ "BF_FEC_TYP_FIRECODE": 1,
+ "BF_FEC_TYP_REED_SOLOMON": 2,
+ }
+
+
+class pltfm_pm_oper_status_t(object):
+ DOWN = 0
+ UP = 1
+
+ _VALUES_TO_NAMES = {
+ 0: "DOWN",
+ 1: "UP",
+ }
+
+ _NAMES_TO_VALUES = {
+ "DOWN": 0,
+ "UP": 1,
+ }
+
+
+class pltfm_pm_board_type_t(object):
+ BF_PLTFM_BD_ID_MAVERICKS_P0A = 564
+ BF_PLTFM_BD_ID_MAVERICKS_P0B = 4660
+ BF_PLTFM_BD_ID_MONTARA_P0A = 8756
+ BF_PLTFM_BD_ID_MONTARA_P0B = 12852
+ BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU = 16948
+ BF_PLTFM_BD_ID_UNKNOWN = 0
+ XFFFF = 1
+
+ _VALUES_TO_NAMES = {
+ 564: "BF_PLTFM_BD_ID_MAVERICKS_P0A",
+ 4660: "BF_PLTFM_BD_ID_MAVERICKS_P0B",
+ 8756: "BF_PLTFM_BD_ID_MONTARA_P0A",
+ 12852: "BF_PLTFM_BD_ID_MONTARA_P0B",
+ 16948: "BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU",
+ 0: "BF_PLTFM_BD_ID_UNKNOWN",
+ 1: "XFFFF",
+ }
+
+ _NAMES_TO_VALUES = {
+ "BF_PLTFM_BD_ID_MAVERICKS_P0A": 564,
+ "BF_PLTFM_BD_ID_MAVERICKS_P0B": 4660,
+ "BF_PLTFM_BD_ID_MONTARA_P0A": 8756,
+ "BF_PLTFM_BD_ID_MONTARA_P0B": 12852,
+ "BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU": 16948,
+ "BF_PLTFM_BD_ID_UNKNOWN": 0,
+ "XFFFF": 1,
+ }
+
+
+class InvalidPltfmPmOperation(TException):
+ """
+ Attributes:
+ - code
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'code', None, None, ), # 1
+ )
+
+ def __init__(self, code=None,):
+ self.code = code
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.code = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('InvalidPltfmPmOperation')
+ if self.code is not None:
+ oprot.writeFieldBegin('code', TType.I32, 1)
+ oprot.writeI32(self.code)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/pltfm_pm_rpc.thrift b/tools/test/tofino-port-auto-setup-tool/thrift/pltfm_pm_rpc.thrift
new file mode 100644
index 0000000..b556518
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/pltfm_pm_rpc.thrift
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
+ *
+ * Copyright (c) 2015-2016 Barefoot Networks, Inc.
+
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains the property of
+ * Barefoot Networks, Inc. and its suppliers, if any. The intellectual and
+ * technical concepts contained herein are proprietary to Barefoot Networks,
+ * Inc.
+ * and its suppliers and may be covered by U.S. and Foreign Patents, patents in
+ * process, and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material is
+ * strictly forbidden unless prior written permission is obtained from
+ * Barefoot Networks, Inc.
+ *
+ * No warranty, explicit or implicit is provided, unless granted under a
+ * written agreement with Barefoot Networks, Inc.
+ *
+ * $Id: $
+ *
+ ******************************************************************************/
+/*
+ pltfm_pm thrift file
+*/
+
+namespace py pltfm_pm_rpc
+namespace cpp pltfm_pm_rpc
+
+typedef i32 pltfm_pm_status_t
+typedef i32 pltfm_pm_dev_port_t
+typedef byte pltfm_pm_device_t
+
+exception InvalidPltfmPmOperation {
+ 1:i32 code
+}
+
+enum pltfm_pm_port_speed_t {
+ BF_SPEED_NONE = 0,
+ BF_SPEED_1G = 1,
+ BF_SPEED_10G = 2,
+ BF_SPEED_25G = 3,
+ BF_SPEED_40G = 4,
+ BF_SPEED_40G_NB = 5,
+ BF_SPEED_50G = 6,
+ BF_SPEED_100G = 7,
+ BF_SPEED_40G_NON_BREAKABLE = 8
+}
+
+enum pltfm_pm_fec_type_t {
+ BF_FEC_TYP_NONE = 0,
+ BF_FEC_TYP_FIRECODE = 1,
+ BF_FEC_TYP_REED_SOLOMON = 2
+}
+
+enum pltfm_pm_oper_status_t {
+ DOWN = 0,
+ UP = 1
+}
+
+enum pltfm_pm_board_type_t {
+ BF_PLTFM_BD_ID_MAVERICKS_P0A = 0x0234,
+ BF_PLTFM_BD_ID_MAVERICKS_P0B = 0x1234,
+ BF_PLTFM_BD_ID_MONTARA_P0A = 0x2234,
+ BF_PLTFM_BD_ID_MONTARA_P0B = 0x3234,
+ BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU = 0x4234,
+ BF_PLTFM_BD_ID_UNKNOWN = 0XFFFF
+}
+
+service pltfm_pm_rpc {
+ /* init */
+ pltfm_pm_status_t pltfm_pm_port_add(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port, 3:pltfm_pm_port_speed_t ps, 4:pltfm_pm_fec_type_t fec) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_port_del(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_port_enable(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_port_dis(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_switchd_port_cleanup(1:pltfm_pm_device_t device) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_oper_status_t pltfm_pm_port_oper_status_get(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_board_type_t pltfm_pm_board_type_get() throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_port_an_set(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port, 3:i32 an_flag) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_serdes_lane_map_set(1:pltfm_pm_device_t device) throws (1:InvalidPltfmPmOperation ouch);
+ pltfm_pm_status_t pltfm_pm_serdes_init(1:pltfm_pm_device_t device) throws (1:InvalidPltfmPmOperation ouch);
+}