Skip to content

Create a uniform function to align the messages #44

Description

@ybubnov

The OpenFlow specification mentions about the message padding, that forces some
of the structures with variable size to be aligned up to 8-byte boundary. Currently the
ofp package does not have any uniform approach to deal with it, instead it contains
copy-pasted snippets, like this one below:

padding := make([]byte, (header.Len+7)/8*8-header.Len)
nn, err := encoding.ReadFrom(r, padding)

Therefore, it would be better to refactor this part and introduce a new function as part of
the encoding package, that will handle this automatically (e.g. ReadFullFrom(r, &values, 8)).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions