Skip to content

[REQUEST]: More nuanced array length handling to deal with arcane protocols #66

@acamilo

Description

@acamilo

Description

I would like to begin a discussion about the difficulty of adding more nuanced array length handling.
This is related to #45 and #60 and #60 would solve my problem but i suspect it's not the ideal solution.

I have a packet where the length of the array is not immediately preceding he packet but is instead another field in the packet. The feature i'm requesting is to use a syntax similar to a LookbackDecider to use a previously decoded field as the array length.

I have looked around in the code and have thought about implementing this myself but i would almost certainly need to increase my understanding about the internals of the library first.

class TestPacket(Structured):
     seq: uint32
     id: uint32
     length: uint32
     unrelated: uint32
     stuff: uint8
     data: array[Header[attrgetter('length')],uint32]

Use

No response

Anything else?

Your library is awesome.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions