示例#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')
示例#2
0
class MyTargetMessage(Structure):
    # inherited from the parent message
    _length = LengthField(DependentField('length'))
    payload = VariableRawPayload(_length)
示例#3
0
 class MyVarSeqMessage(Structure):
     s = VariableRawPayload(None)
     b = UBInt8Sequence(None)
示例#4
0
class SuperChild(Structure):
    options = DependentField('options')
    ubseq = DependentField('ubseq')
    length = LengthField(DependentField('submessage_length'))

    remaining = VariableRawPayload(length)
示例#5
0
 class MyLengthyMessage(Structure):
     length = LengthField(UBInt16())
     payload = VariableRawPayload(length)
示例#6
0
 class MyMuiltipliedLengthMessage(Structure):
     length = LengthField(UBInt8(), multiplier=8)
     payload = VariableRawPayload(length)
class UDPFrame(Structure):
    source_port = UBInt16()
    destination_port = UBInt16()
    length = LengthField(UBInt16())
    checksum = UBInt16()
    data = VariableRawPayload(length)