Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a uniform function to align the messages #44

Open
ybubnov opened this issue Nov 13, 2016 · 0 comments
Open

Create a uniform function to align the messages #44

ybubnov opened this issue Nov 13, 2016 · 0 comments

Comments

@ybubnov
Copy link
Member

ybubnov commented Nov 13, 2016

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)).

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

No branches or pull requests

1 participant