Tempered Optimism
So great news everyone, OpenVPN and the TUN/TAP driver is working on Haiku! While this is great news for the development of the project, I need to temper it with some problems that the project has encountered now. So first thing that I had to change first was going from TUN to TAP since OpenVPN wanted a Point-to-Point connection for the TUN driver and Point-to-Point isn’t quite a thing on Haiku yet. I had a lot of trouble with routing with TUN, so I moved onto TAP, and that seems to work… sort of. The main thing is that Haiku can be a client fine but it has some trouble being a server as OpenVPN can set the server up, and have a client OpenVPN connect to it (let us say the client is running Linux), but the client cannot ping the Haiku server. When I try to ping the server, ping will just say Destination Host Unreachable
. Looking further into it using tcpdump, I realized that the client is trying to send ARP request to try and find the server and the Haiku server isn’t responding. Checking the Haiku side of things, I noticed that it wasn’t receiving the ARP requests to begin with so I have a hunch it might be the VirtualBox NAT Network I am using but I am not ruling out the possibility of the TAP driver or the TAP interface.
The Weekly Problem
So we are just past the midway point for GSoC and last update I told you guys that I had a working (albeit somewhat buggy) TUN Driver working. I had gotten great feedback from Pulkomandy, Axel, and Korli to help with a more efficient driver and to make it more human-readable because it made no sense the way I had written it. I have very good news to bring to everyone in that all of the 3 main problems that I talked about last time are all solved! I think most of them got solved after I fully understood creating semaphores and imposed execution order by adding a write semaphore. While this new code made the driver much more efficient and less error-prone, there were two new errors that popped up during testing:
Project status overview
C# bindings for some parts of the Haiku API is now available, along with basic .NET SDK support for
building Haiku applications, in a .NET workload (more details below). The source code and install
instructions are currently in this GitHub repo.
.NET custom builds for Haiku are still regularly
updated to reflect the latest changes in both .NET and Haiku. Most recently, the datagram socket
hack has been removed as SOCK_DGRAM
support for Haiku has been merged.
Sorry for the late blog post everyone! Personal life and some roadblocks on the project got in the way but I am proud to say that the driver is up and working!
Problems, Problems, and more Problems
I got the semaphore problem settled, but I then ran into a problem where the data that the application on the interface side sends a packet was then not receiving the packet. Through some debugging I found out that the interface, when it goes into device_consumer_thread
for getting the receive function, it fails here. Looking deeper into when that interface->receive_funcs
element gets assigned I found the function here which I realized is never called when I call ifconfig
to set up the interface. I ran into the solution to the problem by just changing the type of datalink frame from loopback to an ethernet frame that the interface will be using from now on. That brought the packet to an interface and I started to get a new problem of course :)
As is the usual way of things, the monthly Activity Report is hereby combined with my Contract Report.
This report covers hrev57061 through hrev57126.
Argument handling on Haiku
Hi, I’m Nephele. I’ve not made a blog post before, but this seemed like a good opportunity.
There are two main ways to start an application from Haiku’s UI, directly and indirectly.
Directly by opening it, and indirectly by opening a file that the application you want supports (and is configured to handle).
The indirect way involves opening a file that the application supports and having the mimetype plus the registrar figure out where to forward this to. This can be done by launching a new application or by forwarding it to a running application via a BMessage.
(This is also how “open” in the Terminal works, it will open each argument as a document to open. Unlike xdg-open this supports opening multiple files at once.)
Project status overview
During this period, I have been working to get the Release build of .NET SDK to work more stably.
I have identified some issues related to POSIX thread scheduling in Haiku in the process. Sadly,
I cannot deliver stable builds of the SDK at the moment because that depends on edge-triggered
file events.
As mentioned on my
forum thread, I have ported some
sample applications of popular C# frameworks such as GtkSharp or FNA. Some other apps are a bit
tricky since they rely on native components. I will not explore these ports as part of GSoC; it is
the HaikuPorts community’s job to port native libraries.
More updates on the TUN Driver development!
So What’s Been Happening?
Thankfully I’ve been able to get a lot more done on the driver this week with finishing the write/sending functionality of the driver and I am currently on the reading/receiving functionality which is getting close to being done. At first I tried to implement a solution in the networking interface (tun.cpp) that didn’t use iovecs but that just caught up to me in the end and it was just significantly easier to copy and paste the code from ethernet.cpp’s send/receive functions as that is something that works a lot better than what I was implementing. Me and my mentors also decided on using the already made BufferQueue data structure for holding the data in the driver itself since it would just be plain easier to make the data parameter, when using read from a interface, a straight up net_buffer packet that it can immediately be read back and just use the net_buffer_module_info
structs read function member to get the byte stream information that any application needs. The main roadblock I have with the read functionality is using semaphores correctly to stop the networking stack from continuously reading data that isn’t there. As of writing this update, I am able to make read blocking but I am testing different ways I can release the semaphore for it to read data properly. Big shoutout to PulkoMandy and Korli for helping me with this issue!
While the change request to add reference images was being reviewed, I started working on ticket #18415, which suggests adding shear and perspective transformations. I decided to implement the perspective transformation since I still need to figure out which way I’m going to implement the shear transformation. Hopefully the experience in implementing the perspective transformation will give me information that will help me decide how to implement the shear transformation.
Handmaus provided two reasons in the ticket for why the perspective transformation would be useful. One example is Patchbay’s icon.
Intro
Hello again everyone! I wanted to write a long overdue update on how everything is going and what I’ve been learning over the past couple of weeks. Due to how my semester didn’t actually end until the 16th, progress has been relatively slow but now that I have more time I can get started on more things with this project.
Understanding the Project Better
(If I get anything wrong about anything I am about to say, please correct me!)
First things first, what are the actual specifics of what a TUN driver is (since I didn’t go over it in detail last time)? TUN drivers are essentially virtual network interfaces and and a driver that is typically used to establish communication between the operating system and user-space applications. For the network interface in specific, it is a virtual point-to-point connection that works at the IP level of the networking stack and routes all outgoing packets on the system through it where these packets are then sent to the driver. Looking at the driver element, you use your normal write and read syscalls on the driver to emulate the sending and receiving behavior respectfully. You can think of a TUN driver as part of the emulation of an IP interface.