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

Changes #1

Open
wants to merge 33 commits into
base: reference_point
Choose a base branch
from
Open

Changes #1

wants to merge 33 commits into from

Conversation

pengnam
Copy link
Owner

@pengnam pengnam commented Jul 21, 2021

freebsd-netlink

Design document is here
https://docs.google.com/document/d/1VGci3zucEhCphwLkCPVFjLkMudW2vdZUkgjTyqOSaCU/edit#

Note:

About headers:

As per common practice, I have seperated the userspace API from the kernel API (that has access to the userspace API). I kept it simple, and I kept the userspace api in linux/netlink.h and the kernel api in net/netlink.h

About the files:

  1. linux/netlink.h: userspace netlink header. To be added as part of include folder
  2. net/netlink.h: kernel netlink header. To be in the kernel source folder with the source files
  3. nl_sock.c: source file implementation. Contains most of the netlink code.

Existing major todo list

  1. we currently assume the initial m_get to retreive a message of a sufficient size for a packet which allows us to write straight into the buffer instead of using m_append. The reason for this is because when "closing" a message, we call nlmsg_end or other functions to end the header, we use pointer artihmethic to determine the size of the message. Alternative is to call m_pullup before calling nlmsg_end on the message, or to continuously resize and transfer the message when more data is needed.

  2. use m_tag for proto values in the m_buff

{
struct genl_family *fam = genl_find_family_by_id(family->id);
if (fam != NULL) {
LIST_REMOVE(fam, next);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locking ?

@pengnam pengnam changed the base branch from reference_point to releng/4.3 August 18, 2021 03:05
@pengnam pengnam changed the base branch from releng/4.3 to reference_point August 18, 2021 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants