Package sulley :: Module blocks :: Class repeat
[show private | hide private]
[frames | no frames]

Class repeat


This block type is kind of special in that it is a hybrid between a block and a primitive (it can be fuzzed). The user does not need to be wary of this fact.
Method Summary
  __init__(self, block_name, request, min_reps, max_reps, step, variable, fuzzable, name)
Repeat the rendered contents of the specified block cycling from min_reps to max_reps counting by step.
Boolean mutate(self)
Mutate the primitive by stepping through the fuzz library, return False on completion.
Integer num_mutations(self)
Determine the number of repetitions we will be making.
  render(self)
Nothing fancy on render, simply return the value.
  reset(self)
Reset the fuzz state of this primitive.

Method Details

__init__(self, block_name, request, min_reps=0, max_reps=None, step=1, variable=None, fuzzable=True, name=None)
(Constructor)

Repeat the rendered contents of the specified block cycling from min_reps to max_reps counting by step. By default renders to nothing. This block modifier is useful for fuzzing overflows in table entries. This block modifier MUST come after the block it is being applied to.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
request - Request this block belongs to
           (type=s_request)
min_reps - (Optional, def=0) Minimum number of block repetitions
           (type=Integer)
max_reps - (Optional, def=None) Maximum number of block repetitions
           (type=Integer)
step - (Optional, def=1) Step count between min and max reps
           (type=Integer)
variable - (Optional, def=None) Repititions will be derived from this variable, disables fuzzing
           (type=Sulley Integer Primitive)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

mutate(self)

Mutate the primitive by stepping through the fuzz library, return False on completion. If variable-bounding is specified then fuzzing is implicitly disabled. Instead, the render() routine will properly calculate the correct repitition and return the appropriate data.
Returns:
True on success, False otherwise.
           (type=Boolean)

num_mutations(self)

Determine the number of repetitions we will be making.
Returns:
Number of mutated forms this primitive can take.
           (type=Integer)

render(self)

Nothing fancy on render, simply return the value.

reset(self)

Reset the fuzz state of this primitive.

Generated by Epydoc 2.1 on Fri Jul 27 17:40:03 2007 http://epydoc.sf.net