本文整理汇总了Python中host.Host.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Host.__init__方法的具体用法?Python Host.__init__怎么用?Python Host.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类host.Host
的用法示例。
在下文中一共展示了Host.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self, name, mymac=(0,0,0,0,0,0), myip=(0,0,0,0), destip=(0,0,0,0), pkts=1):
Host.__init__(self, name, mymac, myip)
self.pkts_to_send = pkts
self.pkts_sent = 0
self.received_pkt_count = 0
self.current_destip_idx = 0
if isinstance(destip, list):
self.destip = map(lambda x: IpAddress(x), destip)
else:
self.destip = [IpAddress(destip)]
self.flows_started = 0
self.connections = {}
示例2: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self, **kwargs):
"""Constructor
Initialize object's private data.
rpcdebug:
Set RPC kernel debug flags and save log messages [default: '']
nfsdebug:
Set NFS kernel debug flags and save log messages [default: '']
dbgname:
Base name for log messages files to create [default: 'dbgfile']
tracename:
Base name for trace files to create [default: 'tracefile']
notrace:
Debug option so a trace is not actually started [default: False]
tcpdump:
Tcpdump command [default: '/usr/sbin/tcpdump']
messages:
Location of file for system messages [default: '/var/log/messages']
tmpdir:
Temporary directory where trace files are created [default: '/tmp']
"""
# Arguments
self.rpcdebug = kwargs.pop("rpcdebug", '')
self.nfsdebug = kwargs.pop("nfsdebug", '')
self.dbgname = kwargs.pop("dbgname", 'dbgfile')
self.tracename = kwargs.pop("tracename", 'tracefile')
self.notrace = kwargs.pop("notrace", False)
self.tcpdump = kwargs.pop("tcpdump", c.NFSTEST_TCPDUMP)
self.messages = kwargs.pop("messages", c.NFSTEST_MESSAGESLOG)
self.tmpdir = kwargs.pop("tmpdir", c.NFSTEST_TMPDIR)
self._nfsdebug = False
Host.__init__(self)
# Initialize object variables
self.dbgidx = 1
self.dbgfile = ''
self.traceidx = 1
self.tracefile = ''
self.tracefiles = []
self.clients = []
self.traceproc = None
self.nii_name = '' # nii_name for the client
self.nii_server = '' # nii_name for the server
示例3: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self, name, mymac, myip, tcp_port=80):
Host.__init__(self, name, mymac, myip)
self.received_pkt_count = 0
self.myport = tcp_port
self.controller = None
self.connections = {}
示例4: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self, host, katcp_port=7147, boffile=None, connect=False):
Host.__init__(self, host, katcp_port)
KatcpFpga.__init__(self, host, katcp_port, connect=connect)
self.boffile = boffile
示例5: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self, name, mymac):
Host.__init__(self, name, mymac, "10.0.0.1")
self.packet_id = 1 # uses odd numbers
self.move_host = False
self.move_host_switch = None
示例6: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self):
Host.__init__(self, "InSec", "65.32.2.133", ["sensenet.log", "a3f15cb.txt", "emplrec0451.log"], ["clientProtector", "sec0451", "SysAdmin"])
self.state = 1
示例7: __init__
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import __init__ [as 别名]
def __init__(self, id, ip, name=None):
Host.__init__(self, ip=ip, name=name)
self._id = id