Rao Shoaib schrieb:
James Carlson wrote:
Joachim Worringen writes:
I'm somewhat irritated that Solaris still is (or better: has become!)
unflexible in this respect - esp. compared with Linux...
See CR 4960910. The sonode switch should do what you're asking about,
and was integrated during S10 development.
I can verify that what Jim is suggesting does work. We recently used it
to implement a special type of socket similar to what you are trying to
do (not the same type though). The use of this framework allows you to
implement new socket types without requiring any kernel changes. I am
not sure if Linux if so flexible.
Rao, that's good to hear. But do you maybe have some (skeleton) code
that shows how a kernel module can hook itself into the socket() call to
set the pointers of the sonode struct to it's own functions?
On Linux, it looks like:
struct net_proto_family scisock_family_ops =
{
family: PF_SCI,
create: scisock_create,
};
static struct proto_ops scisock_stream_proto_ops = {
family: AF_SCI,
release: scisock_stream_release,
bind: scisock_bind,
connect: scisock_stream_connect,
socketpair: sock_no_socketpair,
accept: scisock_stream_accept,
getname: scisock_stream_getname,
poll: scisock_stream_poll,
ioctl: scisock_stream_ioctl,
listen: scisock_stream_listen,
shutdown: scisock_stream_shutdown,
setsockopt: scisock_stream_setsockopt,
getsockopt: scisock_stream_getsockopt,
sendmsg: scisock_stream_sendmsg,
recvmsg: scisock_stream_recvmsg,
mmap: sock_no_mmap,
sendpage: sock_no_sendpage,
};
in module init():
rc = sock_register(&scisock_family_ops);
And then in scisock_create():
static int scisock_create(struct socket *sock, int proto)
{
sock->ops = &scisock_stream_proto_ops;
...
The Solaris equivalent to this code is basically all I'm looking for.
thanks, Joachim
--
Joachim Worringen, Software Architect, Dolphin Interconnect Solutions
phone ++49/(0)228/324 08 17 - http://www.dolphinics.com
_______________________________________________
networking-discuss mailing list
[email protected]