[GSOC 2024] MDNS / Bonjour / Avahi network discovery

@Nexus-6 maybe you should build the provided packages upstream on a R1B4? This way it can be installed on both beta and nightly, if build on nightly this can’t be installed on R1B4 (only through pkgman/HaikuDepot app as that is build on the buildmasters still using R1B4) :slight_smile: (I do the same for the CudaText packages)

Seems Genio is not using anything that requires a nightly installation, and thus, one can “convert” the package into a beta4 compatible one.

I just did this:

cd /var/shared_memory/
wget -c https://github.com/Genio-The-Haiku-IDE/Genio/releases/download/v2.1/genio-2.1.0-1-x86_64.hpkg
mkdir tmp_dir
package extract -C tmp_dir genio-2.1.0-1-x86_64.hpkg
sed -e 's/haiku >= r1~beta4_hrev57458-1/haiku >= r1~beta4_hrev56578_87-1/' -i tmp_dir/.PackageInfo
package create -z zstd -C tmp_dir genio-2.1.0-1-x86_64-beta4-compatible.hpkg

And Genio installs/runs fine on my beta4.

Pointing this out as a quick-n-dirty alternative/workaround, in case @Nexus-6 wants to avoid setting up a beta4 install :slight_smile:

1 Like


The error I got when I run the makefile in mDNSPosix directory(seems like I need to install some packages)
@PulkoMandy
@nephele

a makefile is not a shell script. You run it by using the “make” command.

1 Like


Seems like many changes need to be made to support haiku.And i might be wrong but is FreeBSD somewhat related?I saw it mentioned somewhere that Haiku uses a FreeBSD network compatibility layer to support many network devices


Looks much better now

That is only for the network drivers, but the interfacing between the network stack and the applications may be a bit different.

You will now have to look in the code where you get compilation errors, see if Haiku matches any of the existing OS or if new platform-specific code needs to be written.

It seems the ifa_msghdr structure is similar in the BSDs and documented for exemple here: route(4) - NetBSD Manual Pages

Linux has a similar but incompatible system: rtnetlink(7) - Linux manual page

I don’t know what would be the way to do this in Haiku, but maybe you can look at how the ‘route’ command line tool is implemented:
https://cgit.haiku-os.org/haiku/tree/src/bin/network/route/route.cpp
it appears to use ioctls like SIOCGRTTABLE, as well as a struct ifreq.

I would suggest configuring Genio to build the project instead of using the Terminal.
If you want to keep the project opened on the root of the repository you can tell Genio to execute

make -C mDNSPosix os=netbsd

or whatever OS you prefer.
Otherwise, close it and open the project from the directory mDNSPosix and omit the -C mDNSPosix parameter

make os=freebsd

1 Like

thanks @Begasus and @BiPolar for the heads up.
FYI @jackburton

2 Likes

Why push your IDE here?

Configuring it to build makes no sense if the build config isn‘t even finished yet.

I‘ve never used Genio and am not interested helping debug a build that is complicated further by this, especially since there are already enough problems with this build : )

1 Like

I agree ,which IDE do you recommend

The most straightforward way is to just run you build commands like make and version control like git directly from the command line.
For editing code, you can then use whichever text editor or IDE you personally prefer.

That way you can be sure that any errors you get are not caused by an IDE misconfiguration and people who like other text editors or IDEs than you are using will still be able to help you if you run into issues.

I know you are not ‘pushing’ your IDE, you were merely helping with the question posted. Don’t be bothered by the haters. You are doing great work! Keep it up.

3 Likes

Sorry to create the intense conversation here. I am just new to Haiku and do not know which IDE is the most suitable one to use here.

You have nothing to be sorry for. I know you are new here and getting used to Haiku and how to get things done. You will find the right toolset that works best for you.

I have tried to search ifa_msghdr, but it seems like I should look over the file named “route.h”? Seems like there should be a struct called ifa_msghdr to make it work(route.h « net « posix « headers - haiku - Haiku's main repository)

I’m no expert for Haiku development, so I hope this won’t cause more confusion than it helps, but I think I can offer a few pointers:

If, according to your research, the ifa_msghdr structure is part of the Posix specification and should exist in route.h, but you find that it’s not there on Haiku yet, and it’s also not to be found anywhere else in the Haiku source tree, then you should probably add it to that header file. The next error for RTM_NEWADDR in your screenshot is likely a similar situation.

If on the other hand you find out that it’s specific to FreeBSD, someone from the dev team will probably be able to tell you where it would be best to put it. I believe there is a FreeBSD compatibility layer somewhere where it could potentially be a good fit. You would also have to make sure that this is ok with respect to the license of the original code.

Once you have added the missing parts in the right place, you can submit a patch for Haiku for review. Once it’s merged, other software being ported can benefit from your additions.

If, on the other hand, you’re just looking for a quick and dirty way to progress further with your build, you could also create a new header as part of your project and put the declarations there. Then include that and move the code to the right place later. But this would leave you with more cleanup work.

There was a GSOC project for porting mDNSResponder for Haiku a long time ago (2009 if I remember right). If you can find the code / patches for that it might help you get started, but the code is some 15 years old and probably bitrotten quite a bit. But still, it might be helpful for finding out how the GSOC student got it to compile back then.

edit: The results of the GSOC 2009 are here: Google Code Archive - Long-term storage for Google Code Project Hosting.

There is this link to the email list that Ma Jie talks about code development:

https://marc.info/?l=haiku-development&m=123849925300848&w=2

There is also a reference on Haiku’s blog:

Is this implemented or done?