

Using it in the wrong place leads to a KP. ) cannot be used in a few contexts (interruptions). The standard packet-sending API (sock_create, connect. Sprintf(message,"EXTRACT / Time: %llu / InputPool: %4d / BlockingPool: %4d / NonblockingPool: %4d / Request: %4d\n", Msg.msg_namelen = sizeof(struct sockaddr_in) If (errorops->connect(sock, (struct sockaddr *)&sin, sizeof(struct sockaddr), 0)

#define INADDR_SEND ((unsigned long int)0x0a00020f) //10.0.2.15Įrror = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock) PS: It's my first question here, so please don't hesitate to tell me if I'm doing something wrong, I'll keep it in mind for future :) Do you think I should rather use this API? If yes, have you got any example? Unfortunately I haven't found any relevant documentation apart from an quite interesting but outdated Red Hat presentation from 2005. However it doesn't work at all when I try to monitor the disk events: it generates a kernel panic during boot.Ĭonsequently, here's my main question: Have you any idea why my code causes so much trouble when inserted in the disk events function? (add_disk_randomness)Īlternatively, I've read about the netpoll API, which is supposed to handle this kind of UDP-in-kernel problems. (You might also want to download the complete modified random.c file here.)īy inserting this code inside the appropriate random.c functions, I'm able to send a UDP packet for each access to /dev/random and /dev/urandom, and each keyboard/mouse events used by the random number generator to harvest entropy. You can find the typical piece of code I use at the end of this message. So far, I've managed to monitor a few things owing to the sock_create and sock_sendmsg functions.
#Get command packet sender how to#
I'm trying to figure out how to send UDP packets from the Linux Kernel (3.3.4), in order to monitor the behavior of the random number generator (/drivers/char/random.c). Even if a similar topic already exists, I noticed that it dates back two years, thus I guess it's more appropriate to open a fresh one.
