summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/source/docs/api-reference.rst10
-rw-r--r--pysnmp/hlapi/transport.py13
2 files changed, 23 insertions, 0 deletions
diff --git a/docs/source/docs/api-reference.rst b/docs/source/docs/api-reference.rst
index ad6b7f21..204caaa9 100644
--- a/docs/source/docs/api-reference.rst
+++ b/docs/source/docs/api-reference.rst
@@ -54,7 +54,10 @@ saves its configuration for the lifetime of SNMP engine object.
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.UdpTransportTarget
+ :members: setLocalAddress
+
.. autoclass:: pysnmp.hlapi.Udp6TransportTarget
+ :members: setLocalAddress
Asynchronous: asyncore
----------------------
@@ -87,7 +90,10 @@ Transport configuration
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.asyncore.UdpTransportTarget
+ :members: setLocalAddress
+
.. autoclass:: pysnmp.hlapi.asyncore.Udp6TransportTarget
+ :members: setLocalAddress
Asynchronous: asyncio
---------------------
@@ -121,7 +127,10 @@ Transport configuration
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.asyncio.UdpTransportTarget
+ :members: setLocalAddress
+
.. autoclass:: pysnmp.hlapi.asyncio.Udp6TransportTarget
+ :members: setLocalAddress
Asynchronous: trollius
----------------------
@@ -166,6 +175,7 @@ Transport configuration
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.twisted.UdpTransportTarget
+ :members: setLocalAddress
SNMP Engine
-----------
diff --git a/pysnmp/hlapi/transport.py b/pysnmp/hlapi/transport.py
index 30578836..1af38612 100644
--- a/pysnmp/hlapi/transport.py
+++ b/pysnmp/hlapi/transport.py
@@ -33,6 +33,19 @@ class AbstractTransportTarget(object):
return self.transportDomain, self.transportAddr
def setLocalAddress(self, iface):
+ """Set source address.
+
+ Parameters
+ ----------
+ iface : tuple
+ Indicates network address of a local interface from which SNMP packets will be originated.
+ Format is the same as of `transportAddress`.
+
+ Returns
+ -------
+ self
+
+ """
self.iface = iface
return self