kytos-ng / python-openflow

Low level OpenFlow messages parser used by Kytos SDN Platform
https://kytos.io/
MIT License
0 stars 3 forks source link

provide GenericAlignedStruct that auto Pads itself to keep alignment. #57

Open ajoaoff opened 3 years ago

ajoaoff commented 3 years ago

Original issue opened by @erickvermot at https://github.com/kytos/python-openflow/issues/411.

While implementing Match and ActionSetField classes (https://github.com/kytos/python-openflow/issues/348), padding to keep alignment of variable size structs was implemented. I suggest we place the custom get_size and pack methods in a new base class called GenericAlignedStruct to be used whenever needed, avoiding reimplementation and bugs. (the methods implementation can be found in the PR https://github.com/kytos/python-openflow/pull/392.)