So, guys, now in this section of the course, we will going to learn how to write Netlink userspace
program.
So you can see on the slide that we will begin writing userspace Netlink program.
This userspace program will do the following in userspace program.
The very first thing that we will going to do is to create a userspace netlink socket.
Then from the main thread we will going to create a separate thread which is called netlink message
receiver thread.
Right?
So you can see in the below diagram that we have a userspace dot c program and from the main thread
which is represented by the yellow line, we create a new thread which is represented by the blue line.
Right?
The purpose of this separate thread is only to receive messages coming from the kernel space, whereas
in the main thread we will send the message to the kernel space.
So our userspace application will be to threaded application.
The main thread will take the responsibility to send the message to the kernel space, whereas the receiver
thread will take the responsibility to receive the messages from the kernel space.
So in the main thread we will ask the user for the input to send the greet message to the kernel.
So in fact we can design the main thread as a menu driven program, giving users multiple choices to
send different types of data to the kernel space as per the choice chosen by him.
So in the main thread we will ask the user the input and accordingly we will send message to the kernel
space receiver thread.
On the other hand, only has the responsibility to receive a messages from the kernel space and in this
case our receiver thread will going to receive a reply denoted by greet reply.
Right.
So the design of our user space application is fairly simple.
It is two threaded application.
The one thread will take the responsibility to send messages to the kernel space while the another thread
does exactly the opposite.
Right.