Getting Linux routing table using netlink.

In the previous article we discussed monitoring of the network interfaces using netlink. Now it’s time to do something more complex and interesting.
Let’s discover how to get and print system routing table like a “ip route” command do.

Continue reading “Getting Linux routing table using netlink.”

Simple Linux character device driver.

Character device is a one of the simplest way to communicate with module in the Linux kernel.
This devices are presented as special files in a /dev directory and supports direct reading and writing of any data, byte by byte, like a stream. Actually most of the pseudo-devices in /dev is a character devices: serial ports, modems, sound and video adapters, keyboards, some custom I/O interfaces. User space programs can easily open, read, write and do custom control requests with such device files.
Here I describing how to write a simple Linux kernel module which can create one or multiple character device.

Continue reading “Simple Linux character device driver.”