How many c++ do I need to know to help?

Hello, I stumbled on article about haiku on register and was really interested about it so I spun up a virtual Machine with Haiku. And I started to wonder how many c++ I need to know to contribute code. I know some basic principles of programing and basics of OOP and I dabbled with c++ basic before. So what concepts I need to know to contribute?

4 Likes

Hello and welcome!

Most of Haiku is written in C++98, and not using much more than the basics classes and inheritance.

Let us know what you would like to hack on, and we can guide you through the corresponding code to get started.

1 Like

Networking is what I find interesting

Ok, so the network stack is split into several parts.

The low level where most things are actually implemented (IP, TCP, UDP) is in the form of kernel “add-ons” (known as modules in other operating systems): https://git.haiku-os.org/haiku/tree/src/add-ons/kernel/network

Then there is libnetwork that provies the BSD/UNIX scokets API on top of that as well as some additional services like DNS resolution: https://git.haiku-os.org/haiku/tree/src/system/libnetwork

There is also a C++ wrapper on top of libnetwork: https://git.haiku-os.org/haiku/tree/src/kits/network/libnetapi

And finally there is the net_server, which runs in the background and watches the state of network interfaces, handles DHCP requests and renewals, and sends notifications to other parts of the user interface (network preferences, NetworkStatus icon in the deskbar) when something changes: https://git.haiku-os.org/haiku/tree/src/servers/net

I think the main task that needs work in that area would be the IPv6 support that is not yet fully complete, and maybe support for zeroconf/bonjour/avahi in addition to DNS to advertise and discover machines on the local network.

Then there are the drivers for various ethernet and wifi interfaces: https://git.haiku-os.org/haiku/tree/src/add-ons/kernel/drivers/network in case you find hardware that’s not supported. But we should have reasonably good coverage here already, as we can reuse drivers from FreeBSD and OpenBSD.

1 Like

The Haiku’s net_server also act as “inetd”, aka listening on enabled network service(s) and launching the service binary, like sshd for ssh service, on each connection.

Regarding DNS, it will be great to have a system level DNS cache instead of the per-app DNS cache, like the tradional libbind.so where each app does its own DNS requests and have a local cache of entries.

As for mDNS for discovery and advertise of network local services, making it living in net_server.
Except if it make sense to allow also these features to be usable from kernel land, like network file systems kernel add-ons?

fwiw mDNS requires a cache according to the spec, and it should be per device

Yes, that why I suggest to manage the two features mDNS and system DNS cache together.

2 Likes