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

post-lpc pr #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

post-lpc pr #3

wants to merge 7 commits into from

Conversation

cfriedt
Copy link

@cfriedt cfriedt commented Sep 6, 2020

Some upstreaming of changes since LPC 2019 / LPC 2020.

NLA_BINARY was removed from libnl in 2016, iirc, and the preferred
replacement is NLA_UNSPEC. I believe the reasoning was that NLA_BINARY
was getting misused.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change ensures that numeric baud rates are properly matched to
their symbolic values (115200 -> B115200, it is not a guarantee that
they are equal).

Also, previously uart_read() would peg the CPU with the O_NDELAY
flag. Here, we also add some common defaults for blocking UART I/O.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Previously, the actual number of bytes written did not match
what was expected in some cases, in practice. This change
adds a "write all" wrapper around write. Similarly, read did
not always return the full greybus message due to buffering.

In particular, this was the case for devices connected via
6LowPAN which has a very small MTU on IEEE 802.15.4 .

Similarly, a "read one message" wrapper was added
around read that first checks the length of the incoming
greybus message via its header and only reads precisely the
correct number of bytes.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
@cfriedt
Copy link
Author

cfriedt commented Sep 6, 2020

Let me know if you would like the PR to go against dev instead of master. I just saw that master had more recent commits than dev, so assumed it was the active branch.

When close(fd) is used on the a TCP/IP socket in Linux, it puts the socket
into a FIN_WAIT1 state and the TCP/IP connection is not completely severed
until the application terminates. On the server side, this has the effect
of keeping sockets open for an unnecessarily long period of time. If the
server is a memory-contstrained device such as a microcontroller, that
can have very negative effects.

For that reason, it is preferred to use shutdown(fd, SHUT_RDWR) instead.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
@cfriedt cfriedt force-pushed the master branch 2 times, most recently from 4e870cd to e8d35cd Compare December 25, 2020 01:56
This change ensures that gbridge connects to the device using the
correct socket address family (either AF_INET or AF_INET6) depending
on the value of the proto field in the resolved AvahiAddress.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change adds continuous integration via GitHub Actions.

Fixes #4

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change adds a new TLS controller based off of the TCP/IP controller.

The TLS controller allows the user to specify

a) a CA cert (for when self-signed certificates are used on the device)
b) a client certificate & key (for when the device is configured to also
   authenticate the client)

Also organized cflags and ldlibs in Makefile.am.

Fixes #6

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant