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

Class size


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, length, endian, format, inclusive, signed, math, fuzzable, name)
Create a sizer block bound to the block with the specified name.
Boolean mutate(self)
Wrap the mutation routine of the internal bit_field primitive.
Integer num_mutations(self)
Wrap the num_mutations routine of the internal bit_field primitive.
  render(self)
Render the sizer.
  reset(self)
Wrap the reset routine of the internal bit_field primitive.

Method Details

__init__(self, block_name, request, length=4, endian='<', format='binary', inclusive=False, signed=False, math=None, fuzzable=False, name=None)
(Constructor)

Create a sizer block bound to the block with the specified name. You *can not* create a sizer for any currently open blocks.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
request - Request this block belongs to
           (type=s_request)
length - (Optional, def=4) Length of sizer
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
inclusive - (Optional, def=False) Should the sizer count its own length?
           (type=Boolean)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
math - (Optional, def=None) Apply the mathematical operations defined in this function to the size
           (type=Function)
fuzzable - (Optional, def=False) Enable/disable fuzzing of this sizer
           (type=Boolean)
name - Name of this sizer field
           (type=String)

mutate(self)

Wrap the mutation routine of the internal bit_field primitive.
Returns:
True on success, False otherwise.
           (type=Boolean)

num_mutations(self)

Wrap the num_mutations routine of the internal bit_field primitive.
Returns:
Number of mutated forms this primitive can take.
           (type=Integer)

render(self)

Render the sizer.

reset(self)

Wrap the reset routine of the internal bit_field primitive.

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