473,221 Members | 2,215 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

netlink messages

Dear list,

I am writing a daemon in Python that listens on AF_NETLINK and
processes RTM_NETLINK messages. FWIW, code is below since there is
hardly any reference on the net yet.

As you can see from the code, the NETLINK message is all binary/hex.
Before I go about wrapping it in a Python class, I was wondering
whether such a class already existed or if someone is already
working on this.

Please let me know if you are or have any hints, and please keep me
on CC.

Python 2.5.1 (r251:54863, Apr 25 2007, 22:53:30)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>from socket import *
from select import *
from os import getpid
s.bind((getpid(), RTMGRP_LINK))
p = select((s,), (), (), 0)
([], [], [])
>># connect device
>>p = select((s,), (), (), 0)
([<socket._socketobject object at 0xb7d9b374>], [], [])
>>s2 = p[0][0]
d = s2.recv(4096)
'\xf8\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x01\x00\x0c\x00\x00\x00\x0 2\x10\x00\x00\xff\xff\xff\xff\t\x00\x03\x00eth0\x0 0\x00\x00\x00\x08\x00\r\x00\xe8\x03\x00\x00\x08\x0 0\x0f\x00\x00\x00\x00\x00\x05\x00\x10\x00\x02\x00\ x00\x00\x05\x00\x11\x00\x00\x00\x00\x00\x08\x00\x0 4\x00\xdc\x05\x00\x00\t\x00\x06\x00noop\x00\x00\x0 0\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\n\x00\x01\x00N\x80\x ba~4\x14\x00\x00\n\x00\x02\x00\xff\xff\xff\xff\xff \xff\x00\x00`\x00\x07\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
martin; (greetings from the heart of the sun.)
\____ echo mailto: !#^."<*>"|tr "<*mailto:" net@madduck

spamtraps: ma***********@madduck.net

"men always want to be a woman's first love.
women have a more subtle instinct:
what they like is to be a man's last romance."
-- oscar wilde

Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGbSWEIgvIgzMMSnURAp95AJ45+oEDXXXGckKCdKwv4t 8n0up1gwCfVJ2o

Jun 11 '07 #1
0 911

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: SJB | last post by:
I wanted to use python to receive some messages from the linux kernel via way of netlink sockets. However this doesn't seem to be supported from everything I have been able to find so far. Can...
by: piyush | last post by:
Sorry for repeated posting but I couldnt get things right/completely in the first post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
by: Adam | last post by:
Hi, How do i listen for windows messages in c# on compact.net? I have a window containing an instantiation of the HTML viewer control, which is a child of the main form. As the compact...
by: piyush | last post by:
Sorry for repeated posts, I couldnt get things right and complete in the previous post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
by: neonspark | last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu. Originally, I used: protected override bool...
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
by: hnshashi | last post by:
I have writtem kernel(2.4) module to commu. with user space appl. using netlink socket. I am getting compilation error. kernel module:-> #include <linux/skbuff.h> #include<linux/module.h> ...
by: Grant Edwards | last post by:
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages?...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.