Questions tagged [netlink]

Netlink is a socket based inter process communication protocol for Linux systems. It is currently the preferred way, as of 2.6, of communicating with user space from the kernel.

337 questions
0
votes
2 answers

android vold mechanism in the main function

By going through the code of vold, I found there are a couple of lines of code in main.cpp (system/vold/main.cpp) that I dont get the real function of these. Those are.. 1. vm->setBroadcaster((SocketListener *)…
Sam
  • 4,521
  • 13
  • 46
  • 81
0
votes
2 answers

Netlink sockets does not add routes to routing table for IPv6

I want to be able to add a new IPv6 address but have not been able to so far..The program runs with success but nothing is reflected in the routing table. #include #include #include #include…
Akshay
  • 329
  • 1
  • 7
  • 19
0
votes
1 answer

netlink scatter send causes error response from kernel (NLMSG_ERROR)

I'm writing a program that uses the Netlink protocol to gather task statistics. I'm not getting very far because the kernel responds with an error to what I believe is a valid packet. I've used strace to compare the behaviour of my program with that…
Nicole
  • 699
  • 1
  • 5
  • 15
0
votes
1 answer

netlink socket event listener in kernel

I am using netlink socket to communicate between user space application and a kernel module. However I want to stop routing data from kernel to the user app when the user app closes. Is there a way to get an event in kernel, when a process using…
Anup Warnulkar
  • 773
  • 1
  • 8
  • 25
0
votes
1 answer

Send data to kernel using genetlink

Up until now, I've used Genetlink to enable users to send my module some basic commands, with no parameters needed. Times have changed and I need to enable the users to add some more data to the message. Specifically, I need them to be able to send…
Noich
  • 14,631
  • 15
  • 62
  • 90
0
votes
1 answer

how to add command in nl80211 interface

I want to add a new command in nl80211 interface. i browsed but didnt get information in much details. As far as i know, for adding command we need to add command in enum nl80211_commands present in /usr/include/linux/nl80211.h file line 515, and we…
Rafal
  • 1,120
  • 3
  • 15
  • 23
0
votes
1 answer

Adding route with libnl-3-route "Invalid input data or parameter"

I'm trying to adding route (kernel 2.6.32-57) with libnl-3-routing. I use the documentation : Netlink library Netlink routing But the routing chapter is empty... ;) The problem is the kernel response with "Invalid input data or parameter". I have…
Manticore
  • 441
  • 5
  • 24
0
votes
1 answer

Kernel as client, User application as server using netlink

I want to establish connection between kernel module and user application with the kernel as a client. In other words, kernel will send message to the user app, wait for reply, receive reply, and then continue execution. For example, inside kernel…
Isa A
  • 1,342
  • 13
  • 31
0
votes
2 answers

An error while attempting to write a netlink socket program in C

First thing's first, you can find the details of my situation from my previous post I've spent the past day or so working on a first attempt on a netlink socket program. And I don't attempt to make it sound like I didn't get all this code from other…
thewill2live
  • 215
  • 2
  • 6
0
votes
1 answer

Size of data send via NetLink

I'm trying to get the size of a chunk of data sent via NetLink (Linux Kernel). I have tried with size = nlh->nlmsg_len - NLMSG_HDRLEN, but that isn't returning the correct size. What's the correct way to get the message's data size?
alexandernst
  • 14,352
  • 22
  • 97
  • 197
0
votes
0 answers

sendmsg causing kernel panic

I tried below program using Netlink sockets and it worked like a charm. Src : http://binwaheed.blogspot.in/2010/08/after-reading-kernel-source-i-finally.html Kernel Module #include #include #include…
user1227554
  • 113
  • 1
  • 1
  • 5
0
votes
1 answer

Closing telnet session will redirect the stdout to a http socket

I have a program that display the log output to the stdout. So if I open a telnet session to my target linux and then launch on this telnet session my program then I will get the log messages displayed on my telnet session. In my program I have a…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
0
votes
0 answers

Problems with netlink socket, kernel opps 0002

I try to send some data from user mode to my kernel module. But when it send something, it triggers a kernel error: Bug:unable to handle kernel paging request ad ffff88022f168bc0 IP: [<...>]build_skb+0xf5/0x1c0 #include "socket.hpp" using namespace…
Yifan Sun
  • 772
  • 1
  • 10
  • 25
0
votes
2 answers

How to get network link L2 address via netlink?

I'm using netlink to get interfaces, its names, types etc. but I can't get L2 address (ugly_data is nlmsghdr*): struct ifinfomsg *iface; struct rtattr *attribute; int len; iface = (struct ifinfomsg *) NLMSG_DATA(ugly_data); len =…
Frederic Blase
  • 510
  • 1
  • 4
  • 15
0
votes
2 answers

Knowing the interface that caused a link status change in netlink

I have written a program using Netlink sockets. I am able to successfully detect the link status change (i.e., when the network cable is plugged/unplugged). But in both the cases I am getting a RTM_NEWLINK event. I thought I could query the…
Thomas
  • 489
  • 1
  • 8
  • 13
1 2 3
22
23