glastopf/conpot — pull request #57 by creolis (2013-06-21 01:30:45+00:00)
Title: SNMP dynamic response support got SET, GET and WALK

**Preliminary support for dynamic responses added and tested.**

Due to update-restrictions in SNMP MIBs ( most symbols are read-only ),
an additional table is maintained in order to keep track of values and changes
which is absolutely transparent to the client.

Documentation updated, default template updated,
SET, GET and WALK are fully supported,
BULK is still static at the moment ( I'm still working on that ).

The following data classes can be modified:

DisplayString, OctetString, Integer32, Counter32, Gauge32, TimeTicks

Unsupported data classes will be ignored and deliver the initial, unmodified value
loaded from the template.

At this stage, the following engine types are implemented:

increment ... increments the value by x.
decrement ... decrements the value by x.
randominc ... increments the value by random int between x and y.
randomdec ... decrements the value by random int between x and y.
randomint ... assigns random int between x and y.
sysuptime ... assigns the current uptime of the conpot process measured in milliseconds.
evaluate ... assigns the result of value evaluated as python code ( eval ).
static ... do not assign any value. This is default of no field is supplied and will always deliver the initial value

Additionally, a cap limits the minimum or maximum value. It hit, the value resets to the initial state.

**Examples:**

Increment by 1 until the value reaches 10, then reset to 0 again:

0
1:10

Increment by value between 1 and 10 until the value reaches 100, then reset to 0 again:

0
1:10:100

Deliver an Integer between 1 and 100:

0
1:100

Deliver current uptime ( of conpot, in milliseconds )

0

EVAL: Deliver value between 1 and 1000 modulo 10

0
random.randrange(0,100,10)

Just deliver the initial value ( "bar" ):

bar