-
Notifications
You must be signed in to change notification settings - Fork 13
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
Make naming consistent #3
Conversation
da21770
to
bf47afc
Compare
$ cargo doc |
bf47afc
to
f449c00
Compare
@dmitris Fixed, thanks for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing in some general comments as well here since this is slated for inclusion in the book.
Naming wise, I think I actually prefer the verbosity unless the acronyms are well known - and I mean well known by people outside of networking... 😆
It might also be worth adding to the readme the philosohpy on naming for contributors so they can follow along when adding new protocols.
e.g
- Prefer field names as described in IEEE, IETF or other standards
- Where field names contain spaces, replace with
_
- The following contractions are permitted:
source -> src
,destination -> dst
,address -> addr
etc...
To be honest, I don't have any hard preference whether names should be short or verbose, but Alessandro's point for using the short ones ( |
Re |
c50e069
to
a6b9e53
Compare
1db8272
to
c70187d
Compare
* Use short names like `eth`, `hdr`, `proto`, since that's what Rust stdlib is doing with network-related names. * Name the protocol enums after the frames they are included in. So, for example, `EthProto` for protocol info included in the Ethernet header. * Remove all `from_be` methods, callers of the library should do that. * Use proto enums directly as member field types, so we avoid manual conversion. Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
c70187d
to
80de349
Compare
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
eth
,hdr
,proto
, since that's what Rust stdlib is doing with network-related names.EthProto
for protocol info included in the Ethernet header.from_be
methods, callers of the library should do that.Signed-off-by: Michal Rostecki vadorovsky@gmail.com