-
Notifications
You must be signed in to change notification settings - Fork 257
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
Serialization buffers #356
Comments
An initial pass on an API is in the buf branch of my fork: https://github.com/jvalenzuela/OpENer/tree/buf. Doxygen documentation is included, so it can be reviewed via make doc. |
Hi, sorry for the long delay. |
I've noticed there are several types of memory buffers used to store raw, serialized data either received from the network or being encoded for transmission onto the network. Some examples are CipMessageRouterRequest.data and ENIPMessage. In addition to different storage types, there are many more various forms of accessing data within these buffers, such as:
All these are basically different ways of doing the same thing, and there are a lot of compiler warnings and just plain bugs due to casting away consts, pointer errors, and buffer overflow potentials due to incorrectly formed packets(e.g. assuming a received string contains a valid length).
Would you be interested in refactoring all raw buffer operations into a single, dedicated module that handles all the details associated with buffer management? External code can only get values from, and put values into buffers via function calls which refer to an opaque buffer data type. The actual buffer implementation, i.e. current get/put position maintenance, bounds checking, etc, will be hidden in the buffer module, and have one, uniform implementation(with unit tests).
The text was updated successfully, but these errors were encountered: