Ejemplo n.º 1
0
class BoxedGreedy(Structure):
    sof = Magic(b'\xAA')
    a = LengthField(UBInt8())
    b = UBInt8()
    payload = Payload()
    c = UBInt16()
    d = VariableRawPayload(a)
    eof = Magic(b'\xbb')
Ejemplo n.º 2
0
class MyTargetMessage(Structure):
    # inherited from the parent message
    _length = LengthField(DependentField('length'))
    payload = VariableRawPayload(_length)
Ejemplo n.º 3
0
 class MyVarSeqMessage(Structure):
     s = VariableRawPayload(None)
     b = UBInt8Sequence(None)
Ejemplo n.º 4
0
class SuperChild(Structure):
    options = DependentField('options')
    ubseq = DependentField('ubseq')
    length = LengthField(DependentField('submessage_length'))

    remaining = VariableRawPayload(length)
Ejemplo n.º 5
0
 class MyLengthyMessage(Structure):
     length = LengthField(UBInt16())
     payload = VariableRawPayload(length)
Ejemplo n.º 6
0
 class MyMuiltipliedLengthMessage(Structure):
     length = LengthField(UBInt8(), multiplier=8)
     payload = VariableRawPayload(length)
Ejemplo n.º 7
0
class UDPFrame(Structure):
    source_port = UBInt16()
    destination_port = UBInt16()
    length = LengthField(UBInt16())
    checksum = UBInt16()
    data = VariableRawPayload(length)