So guys, in this section of the course, we will going to start a very basic example to demonstrate
the netlink communication between the user space and kernel space.
So as we discussed that any typical Netlink program consists of two components the user space program
and the Linux kernel space program.
Right?
These are two separate programs that we will going to write and we will independently compile both of
these programs and run.
So using netlink sockets, we will going to establish bi directional communication between the user
space and our Linux kernel module, which we will going to write.
So these two programs that is userspace and kernel space are completely independent and we will compile
and run them separately.
We will going to write a greet example in which user space application and Linux kernel module simply
exchange.
Hello, how are you kind of message.
Right.
So we will not going to establish any complicated communication first of all.
So we have chosen the simplest data that could be exchanged between the user space and kernel space.
Once we set up the basic communication infrastructure in place, then we will going to begin with our
Netlink project, which will be a little complicated.
So to begin with, we will first going to write our Linux kernel module and after that we will going
to write our userspace program.
So the steps which are involved in writing a typical Netlink based Linux kernel module is to register
the init and cleanup functions as usual.
So we have already seen our first example of writing Linux kernel module that every Linux kernel module
is supposed to have in it and cleanup functions.
Right.
Then we will going to initialize a special data structures which is provided by the Linux kernel called
Netlink kernel configuration.
We will understand that.
What is the use of this data structure when we will be discussing the code?
Right.
Then in the Linux kernel module, we will going to create a netlink socket.
Then we will also write a code to destruct and free all the resources that is occupied by this netlink
socket, because at some point of time you may choose to remove your Linux kernel module from the Linux
kernel.
Right?
Then we will going to write a code regarding how to receive a userspace message and then how your Linux
kernel module will going to process that userspace message.
And then finally, how your Linux kernel module reply back to the userspace application.
Right.
So we will going to write our first Netlink based Linux kernel module and we will demonstrate all these
steps.
As we discussed code along the way, we will encounter new APIs and functions to use.
We will discuss right there that what is the use of these APIs and why are we using them?
Right?
So now let us not give any more rest to our keyboard and let's start code.