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

API-design #10

Closed
florianl opened this issue Jul 23, 2019 · 0 comments
Closed

API-design #10

florianl opened this issue Jul 23, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request WorkInProgress work is not finished yet

Comments

@florianl
Copy link
Owner

The current API design makes the use of go-conntrack fairly hard to use, without deeper knowledge of conntrack. E.g. the returned ConnAttrs are from type []byte with variable size instead of proper Go types. So the returned values for AttrOrigIPv4Src could be an net.IP instead of []byte.

So in the future it could look something like:

type IPTuple struct {
       Src   net.IP
       Dst   net.IP
      ...
}

type Con struct {
    Origin      *IPTuple
    Reply      *IPTuple
    ID            *uint32
   ...
}

As not all attributes, which are possible, are provided every time, the returned Con struct contains pointers.These pointers can be nil, if the given attribute is not provided.

@florianl florianl added the enhancement New feature or request label Jul 23, 2019
@florianl florianl self-assigned this Jul 23, 2019
@florianl florianl added the WorkInProgress work is not finished yet label Jul 26, 2019
@florianl florianl pinned this issue Aug 8, 2019
@florianl florianl closed this as completed Oct 2, 2019
@florianl florianl unpinned this issue Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WorkInProgress work is not finished yet
Projects
None yet
Development

No branches or pull requests

1 participant