Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - how to call a function from a LSM module of io-pkt(.so), the function is defined/implemented in another LSM module io-pkt.: (3 Items)
   
how to call a function from a LSM module of io-pkt(.so), the function is defined/implemented in another LSM module io-pkt.  
Hi,

How to i call a function from a io-pkt LSM module (.so), which is defined/implemented in another io-pkt  LSM module (.
so).  
There are two io-pkt LSM modules, lets say lsm-module1.so and lsm-module2.so.  The function1() is defined/implemented in
 lsm-module1.so. I want to call function1() from lsm-module2.so. The lsm-module1.so is mounted to io-pkt first and lsm-
module2.so is mouted later.
when i do mount of lsm-module2.so, I see error like "unresolved symbol function1()". Please let me know that how to fix 
the issue.
Thanks for the help.

./Prakash
Re: how to call a function from a LSM module of io-pkt(.so), the function is defined/implemented in another LSM module io-pkt.  
Not sure why this is happening but I guess that io-pkt, when it loads a module, it loads only those functions that it 
knows of, and leaves all other symbols unresolved.

Maybe you can play around with some ENVVARS to make io-pkt load all symbols. Maybe you can get a handle to module 1 
yourself and explicitly load the function you are looking for.

-Albrecht
Re: how to call a function from a LSM module of io-pkt(.so), the function is defined/implemented in another LSM module io-pkt.  
> Hi,
> 
> How to i call a function from a io-pkt LSM module (.so), which is defined/
> implemented in another io-pkt  LSM module (.so).  

You could search the addresses of the needed funktions in the other LSM. Look at dlopen amd dlsym.
Then you could call them by function-ptr.

If io-pkt loads lsm's with "RTLD_GLOBAL and  RTLD_WORLD, your approach should work, as is.
Well, I can't look at the source.

-Michael