Source code for cybox.common.data_segment

# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import entities
from mixbox import fields

import cybox.bindings.cybox_common as common_binding
from cybox.common import Integer, String

[docs]class DataSize(String): _binding = common_binding _binding_class = common_binding.DataSizeType _namespace = '' units = fields.TypedField("units")
[docs] def is_plain(self): return (super(DataSize, self).is_plain() and self.units is None)
[docs]class DataSegment(entities.Entity): _binding = common_binding _binding_class = common_binding.DataSegmentType _namespace = '' id_ = fields.TypedField("id") data_format = fields.TypedField("Data_Format") data_size = fields.TypedField("Data_Size", DataSize) byte_order = fields.TypedField("Byte_Order", String) data_segment = fields.TypedField("Data_Segment", String) offset = fields.TypedField("Offset", Integer) search_distance = fields.TypedField("Search_Distance", Integer) search_within = fields.TypedField("Search_Within", Integer)