diff options
author | elie <elie> | 2015-09-14 05:45:34 +0000 |
---|---|---|
committer | elie <elie> | 2015-09-14 05:45:34 +0000 |
commit | 82e1b1a84d62ced461840eba9019cf8b21b8b072 (patch) | |
tree | 98cd16aca83a8ebd067966731e897ab2aaa9d7c7 /docs/source/faq/getting-peer-information.rst | |
parent | 1ae4badb5ae726badd6673c3bea37fab5465edad (diff) | |
download | pysnmp-82e1b1a84d62ced461840eba9019cf8b21b8b072.tar.gz |
some more missing files
Diffstat (limited to 'docs/source/faq/getting-peer-information.rst')
-rw-r--r-- | docs/source/faq/getting-peer-information.rst | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/source/faq/getting-peer-information.rst b/docs/source/faq/getting-peer-information.rst new file mode 100644 index 0000000..cf78802 --- /dev/null +++ b/docs/source/faq/getting-peer-information.rst @@ -0,0 +1,32 @@ + +Getting peer address information +-------------------------------- + +Q. How do I find out peer transport address or security information within + my receiving app (CommandResponder or Notification Receiver)? + +A. SNMP architecture forces you to distinguish communicating entities only + on the basis of their community names (SNMPv1/v2c) or + ContextEngineId/ContextName pair (SNMPv3). + + In other words, if one SNMP Manager should anyhow differ from another, + then they should use distinct community names or SNMP contexts. + Transport information should never be used for the identification purposes, + as in some cases it proves to be unreliable (cases include NAT device or + a proxy in the middle, not to mention address spoofing). + + As practice reveals, even perfect design does not always cope well with + the imperfect world. So we had to pinch a logic hole from the scope of an + SNMP app down to transport layer. Now with the + getTransportInfo(stateReference) method call you could get peer transport + information upon receiving its SNMP message. + +.. code-block:: python + + # Callback function for receiving notifications + def cbFun(snmpEngine, + stateReference, + contextEngineId, contextName, + varBinds, + cbCtx): + transportDomain, transportAddress = snmpEngine.msgAndPduDsp.getTransportInfo(stateReference) |