summaryrefslogtreecommitdiff
path: root/tftpy/TftpClient.py
diff options
context:
space:
mode:
authorJaroslaw Niec <zuljin@go2.pl>2013-11-24 16:31:23 +0100
committerJaroslaw Niec <zuljin@go2.pl>2013-11-24 16:31:23 +0100
commitfe4e86b719f6561e5c50812a900b5ff7af741f69 (patch)
tree1a016fbad159240409b6972d73211ded2aa8ef0a /tftpy/TftpClient.py
parent75d346a339768012455bff98e2b0545ab7f0ecc4 (diff)
downloadtftpy-fe4e86b719f6561e5c50812a900b5ff7af741f69.tar.gz
Added localip parameter for TFTPClient
Diffstat (limited to 'tftpy/TftpClient.py')
-rw-r--r--tftpy/TftpClient.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tftpy/TftpClient.py b/tftpy/TftpClient.py
index a935b34..62f1dda 100644
--- a/tftpy/TftpClient.py
+++ b/tftpy/TftpClient.py
@@ -12,13 +12,14 @@ class TftpClient(TftpSession):
download can be initiated via the download() method, or an upload via the
upload() method."""
- def __init__(self, host, port, options={}):
+ def __init__(self, host, port, options={}, localip = ""):
TftpSession.__init__(self)
self.context = None
self.host = host
self.iport = port
self.filename = None
self.options = options
+ self.localip = localip
if self.options.has_key('blksize'):
size = self.options['blksize']
tftpassert(types.IntType == type(size), "blksize must be an int")
@@ -48,7 +49,8 @@ class TftpClient(TftpSession):
output,
self.options,
packethook,
- timeout)
+ timeout,
+ localip = self.localip)
self.context.start()
# Download happens here
self.context.end()
@@ -82,7 +84,8 @@ class TftpClient(TftpSession):
input,
self.options,
packethook,
- timeout)
+ timeout,
+ localip = self.localip)
self.context.start()
# Upload happens here
self.context.end()