Peter Memishian wrote:
> > The reason I may not have an access to vnode right away is because I
> > am trying to keep track of all the socket connections by means of
> > system call intercepts.
>
> OK -- but please keep in mind that there is no supported and stable way to
> do this. Your code may be broken by changes to Solaris that may be made
> in any patch or build. There may be other ways to accomplish what you
> want (userland interposing; DTrace instrumentation; a STREAMS TPI module)
> that may prove more robust.
>
> > So in close() system call, the only information I receive is file
> > descriptor. Well, I could be wrong because I don't have solaris kernel
> > background and if I am wrong, please correct me. ;-) Anyhow, I was
> > thinking that there might be a way to access file descriptor type using
> > current process information together with file descriptor. So I am
> > curious if I still need to call getf().
>
> I think calling getf() is the easiest way to accomplish what you want.
>
>
I once wrote a module that did just this... a streams TPI module with an
autopush. In my case, I pushed it below TCP, just above IP. This
strategy doesn't work with S10 any more, thanks to the changes in the
FireEngine stack which removed that STREAMs boundary.
I'm not sure if a TPI module can be used above TCP to intercept socket()
calls, but it might be worth trying. You'd also need one above UDP, as
well as ICMP, if you were interested in those. (Or any other Layer 4
protocol, for that matter.)
-- Garrett
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code