include: update device attribute callbacks
PATCH 13/15 include: update device attribute callbacks
---
ocp.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
include/asm-ppc/ocp.h +1 -1
@@ -189,7 +189,7 @@ extern void ocp_for_each_device(void(*ca/* Sysfs support */ #define OCP_SYSFS_ADDTL (type, format, name, field) \ static ssize_t \ -show_##name##_##field(struct device *dev, char *buf) \ +show_##name##_##field(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct ocp_device *odev = to_ocp_dev(dev); \ type *add = odev->def->additions; \
2.6 kernel network programming
Hi all,
can someone tell me how i can listen and accept connections into a port from the kernel-space???
I start listening with the following function :
struct socket *sock;
struct sockaddr_in sin;
int error=0;
error=sock_create(PF_INET,SOCK_STREAM,IPPROTO_TCP,&sock);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons((unsigned short)port);
error=sock->ops->bind(sock,(struct sockaddr*)&sin,sizeof(sin));
sock->ops->listen(sock,48);How about accepting connections and sending some kind of a message for beggining?
Can someone help me please.
Thanks in advance,
chris.
Re: 2.6 kernel network programming
Quoted 18 lines · linux
Hi all,
can someone tell me how i can listen and accept connections into a port from the kernel-space???
I start listening with the following function :struct socket *sock; struct sockaddr_in sin; int error=0; error=sock_create(PF_INET,SOCK_STREAM,IPPROTO_TCP,&sock); sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = htons((unsigned short)port); error=sock->ops->bind(sock,(struct sockaddr*)&sin,sizeof(sin)); sock->ops->listen(sock,48);
Quoted 3 lines
How about accepting connections and sending some kind of a message for beggining?
Can someone help me please.
Looking at khttpd code in 2.4 kernel may help you .
http://lxr.linux.no/source/net/khttpd/sockets.c?v=2.4.28
Regards
Niraj