Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, name, request, value, options=None):
if not options:
options = {}
super(NdrString, self).__init__(name, request)
self.value = value
self.options = options
if not self.value:
raise exception.SullyRuntimeError("MISSING LEGO.tag DEFAULT VALUE")
self.push(primitives.String(self.value))
:param value: Default integer value
:type endian: chr
:param endian: (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
:type output_format: str
:param output_format: (Optional, def=binary) Output format, "binary" or "ascii"
:type signed: bool
:param signed: (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
:type full_range: bool
:param full_range: (Optional, def=False) If enabled the field mutates through *all* possible values.
:type fuzzable: bool
:param fuzzable: (Optional, def=True) Enable/disable fuzzing of this primitive
:type name: str
:param name: (Optional, def=None) Specifying a name gives you direct access to a primitive
"""
word = primitives.Word(value, endian, output_format, signed, full_range, fuzzable, name)
blocks.CURRENT.push(word)
def __init__(self, name, request, value, options=None):
if not options:
options = {}
super(DNSHostname).__init__(name, request)
self.value = value
self.options = options
if not self.value:
raise exception.SullyRuntimeError("MISSING LEGO.tag DEFAULT VALUE")
self.push(primitives.String(self.value))
def s_mirror(primitive_name, name=None):
"""
Push a mirror of another primitive onto the current block stack.
:type primitive_name: str
:param primitive_name: Name of target primitive
:type name: str
:param name: (Optional, def=None) Name of current primitive
"""
if primitive_name not in blocks.CURRENT.names:
raise exception.SullyRuntimeError("CAN NOT ADD A MIRROR FOR A NON-EXIST PRIMITIVE CURRENTLY")
mirror = primitives.Mirror(primitive_name, blocks.CURRENT, name)
blocks.CURRENT.push(mirror)
:param value: Default integer value
:type endian: chr
:param endian: (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
:type output_format: str
:param output_format: (Optional, def=binary) Output format, "binary" or "ascii"
:type signed: bool
:param signed: (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
:type full_range: bool
:param full_range: (Optional, def=False) If enabled the field mutates through *all* possible values.
:type fuzzable: bool
:param fuzzable: (Optional, def=True) Enable/disable fuzzing of this primitive
:type name: str
:param name: (Optional, def=None) Specifying a name gives you direct access to a primitive
"""
word = primitives.Word(value, endian, output_format, signed, full_range, fuzzable, name)
blocks.CURRENT.push(word)
def __init__(self, name, request, value, options=None):
if not options:
options = {}
super(Integer).__init__(name, request)
self.value = value
self.options = options
if not self.value:
raise exception.SullyRuntimeError("MISSING LEGO.ber_integer DEFAULT VALUE")
self.push(primitives.DWord(self.value, endian=BIG_ENDIAN))