function calling

Hi ,
I am looking for an efficient way to call a function in application
from my filter.The filter is between the IP and IP_EN layer.I cannot use
dlopen/dlsym because i think the dlopen creates a fresh set of global
variables which is not what want.dlopen is called like this.
dlopen("/lib/dll/nfm-filter.so,RTLD_NOW); but i want something like
xxx("/dev/io-net/ip_ip0",…) so that i know it is calling my instance of
the function.Atleast could somebody tell me if it is possible.

Thanks

Sreekanth

Sreekanth <sreekanth@cambira.com> wrote:

Hi ,
I am looking for an efficient way to call a function in application
from my filter.The filter is between the IP and IP_EN layer.I cannot use
dlopen/dlsym because i think the dlopen creates a fresh set of global
variables which is not what want.dlopen is called like this.
dlopen("/lib/dll/nfm-filter.so,RTLD_NOW); but i want something like
xxx("/dev/io-net/ip_ip0",…) so that i know it is calling my instance of
the function.Atleast could somebody tell me if it is possible.

Your filter is loaded (dlopend) into io-net, so it belongs to
process io-net. You application is (I assume) another process,
so there is no way to “call a function in application from filter”.

You have to do “message passing” between 2 process. That is,
You can have your application talk to your filter, by calling
open("/dev/io-net/ip_ip0", …). You application then could
dectl() and you will receive it in your registrant.devctl()
function, and your filter then could decided to MsgReply()
the information.

-xtang

I am looking for an efficient way to call a function in
application
from my filter.The filter is between the IP and IP_EN layer.I cannot use
dlopen/dlsym because i think the dlopen creates a fresh set of global
variables which is not what want.dlopen is called like this.
dlopen("/lib/dll/nfm-filter.so,RTLD_NOW); but i want something like
xxx("/dev/io-net/ip_ip0",…) so that i know it is calling my instance
of
the function.Atleast could somebody tell me if it is possible.

Your filter is loaded (dlopend) into io-net, so it belongs to
process io-net. You application is (I assume) another process,
so there is no way to “call a function in application from filter”.

You have to do “message passing” between 2 process. That is,
You can have your application talk to your filter, by calling
open("/dev/io-net/ip_ip0", …). You application then could
dectl() and you will receive it in your registrant.devctl()
function, and your filter then could decided to MsgReply()
the information.

Does that mean intermediate filter should not call “dlopen” ?

Thanks
vasa

vasa <vv40in@rambler.ru> wrote:

I am looking for an efficient way to call a function in
application
from my filter.The filter is between the IP and IP_EN layer.I cannot use
dlopen/dlsym because i think the dlopen creates a fresh set of global
variables which is not what want.dlopen is called like this.
dlopen("/lib/dll/nfm-filter.so,RTLD_NOW); but i want something like
xxx("/dev/io-net/ip_ip0",…) so that i know it is calling my instance
of
the function.Atleast could somebody tell me if it is possible.

Your filter is loaded (dlopend) into io-net, so it belongs to
process io-net. You application is (I assume) another process,
so there is no way to “call a function in application from filter”.

You have to do “message passing” between 2 process. That is,
You can have your application talk to your filter, by calling
open("/dev/io-net/ip_ip0", …). You application then could
dectl() and you will receive it in your registrant.devctl()
function, and your filter then could decided to MsgReply()
the information.

Does that mean intermediate filter should not call “dlopen” ?

Yes, you can. Anybody can call dlopen(), as long as you know
what you are opening, and what you are looking for.

-xtang

“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:9se9no$44m$1@nntp.qnx.com

vasa <> vv40in@rambler.ru> > wrote:

I am looking for an efficient way to call a function in
application
from my filter.The filter is between the IP and IP_EN layer.I cannot
use
dlopen/dlsym because i think the dlopen creates a fresh set of global
variables which is not what want.dlopen is called like this.
dlopen("/lib/dll/nfm-filter.so,RTLD_NOW); but i want something like
xxx("/dev/io-net/ip_ip0",…) so that i know it is calling my
instance
of
the function.Atleast could somebody tell me if it is possible.

Your filter is loaded (dlopend) into io-net, so it belongs to
process io-net. You application is (I assume) another process,
so there is no way to “call a function in application from filter”.

You have to do “message passing” between 2 process. That is,
You can have your application talk to your filter, by calling
open("/dev/io-net/ip_ip0", …). You application then could
dectl() and you will receive it in your registrant.devctl()
function, and your filter then could decided to MsgReply()
the information.

Does that mean intermediate filter should not call “dlopen” ?

Yes, you can. Anybody can call dlopen(), as long as you know
what you are opening, and what you are looking for.

I called dlopen() and dlsym() and called functions
into loaded shared object into intermediate driver.
All were OK.

Is it possible ? Why dis You say I should not use that ?


Thanks
vasa

PS
Sorry, xtang. I sent previous to Your personal address – I was mistaiken :slight_smile:

I didn’t say i could not open.I am even able to execute code. What i meant
was i was not able to use the global variables initialized by the running
module.I think dlopen generates another set of global variables for its own
use.Which makes sense if we are accessing the shared object with multiple
processes but that is not what i require.I require a mechanism where the
application is able to access data structures as well as function calls from
the “RUNNING FILTER” not a copy of it.

Thanks

Sreekanth
“vasa” <vv40in@rambler.ru> wrote in message news:9see5h$n9i$1@inn.qnx.com

“Xiaodan Tang” <> xtang@qnx.com> > wrote in message
news:9se9no$44m$> 1@nntp.qnx.com> …
vasa <> vv40in@rambler.ru> > wrote:

I am looking for an efficient way to call a function in
application
from my filter.The filter is between the IP and IP_EN layer.I
cannot
use
dlopen/dlsym because i think the dlopen creates a fresh set of
global
variables which is not what want.dlopen is called like this.
dlopen("/lib/dll/nfm-filter.so,RTLD_NOW); but i want something like
xxx("/dev/io-net/ip_ip0",…) so that i know it is calling my
instance
of
the function.Atleast could somebody tell me if it is possible.

Your filter is loaded (dlopend) into io-net, so it belongs to
process io-net. You application is (I assume) another process,
so there is no way to “call a function in application from filter”.

You have to do “message passing” between 2 process. That is,
You can have your application talk to your filter, by calling
open("/dev/io-net/ip_ip0", …). You application then could
dectl() and you will receive it in your registrant.devctl()
function, and your filter then could decided to MsgReply()
the information.

Does that mean intermediate filter should not call “dlopen” ?

Yes, you can. Anybody can call dlopen(), as long as you know
what you are opening, and what you are looking for.


I called dlopen() and dlsym() and called functions
into loaded shared object into intermediate driver.
All were OK.

Is it possible ? Why dis You say I should not use that ?


Thanks
vasa

PS
Sorry, xtang. I sent previous to Your personal address – I was mistaiken
:slight_smile:
\