From: Niraj kumar <niraj17@gmail.com>
To: linux <kernel@wired-net.gr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6 kernel network programming
Date: Tue, 17 May 2005 17:14:26 +0530 [thread overview]
Message-ID: <b82a8917050517044428d61050@mail.gmail.com> (raw)
In-Reply-To: <000b01c55ad2$5acaf690$0101010a@dioxide>
On 5/17/05, linux <kernel@wired-net.gr> wrote:
> 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.
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
prev parent reply other threads:[~2005-05-17 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-17 10:44 [PATCH 2.6.12-rc4 13/15] include: update device attribute callbacks Yani Ioannou
2005-05-19 6:25 ` [lm-sensors] [PATCH 2.6.12-rc4 13/15] include: update device Yani Ioannou
2005-05-17 11:19 ` 2.6 kernel network programming linux
2005-05-17 11:44 ` Niraj kumar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b82a8917050517044428d61050@mail.gmail.com \
--to=niraj17@gmail.com \
--cc=kernel@wired-net.gr \
--cc=linux-kernel@vger.kernel.org \
--cc=niraj17@iitbombay.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.