LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to get local(xp_laddr) transport address in montavista(linux) while using rpc (https://www.linuxquestions.org/questions/programming-9/how-to-get-local-xp_laddr-transport-address-in-montavista-linux-while-using-rpc-851332/)

santhu.s 12-20-2010 04:41 AM

How to get local(xp_laddr) transport address in montavista(linux) while using rpc
 
Hi all,

Need your help in fixing the below problem....

I have facing a problem when porting a code on Solaries to Motavista Linux. The code on solaries is an implementation of a simulator which simulates many virtual systems( having different ip address ). And the code implementation is using RPC interfaces for implementing the same. SVCXPRT data structure is used to extract the ip address's as below.

The structure(data) SVCXPRT of the RPC interface on solaries is having the two data members called xp_rtaddr(remote tranfport addess) and xp_ltaddr(local transport address). As per my knowledge the xp_ltaddr gives the ip address of the virtual system to which actualy data(message) as been sent so the simulator can use the ip address to simulate the perticular virtual machine and to provide the services of that system.
The XP_rtaddr and xp_ltaddr are of netdb pointer type members.

But when it comes to Montavista linux, it is also having the structure SVCXPRT which differs in few cases in definition when compares to solaries.
Which is having one member called xp_raddr which seems equal to solaries xp_rtaddr( but the type is diffesrent i.e, sockaddr_in type member). I think this will give the remote address.

Now My problem is I am unable find any member in SVCXPRT data structure which provides the local transport address( equivalent to solaries xp_ltaddr). I tried to get the same on net but i could not find any way.
I found one interface in RPC on linux i.e, get_myaddr() which gives the address of the physical system. But simulator needs the address of the virtual system to which the message is actually been sent, to simulate the perticular system.

My question's,
1. is there any way on Montavista(Linux) to get the local transport address which will be same as solaries xp_ltaddr.

2. Is there any possibality in the socket programming to get the ip address of the message receiver on the receiving end after erceiving the message on socket( using recefrom() interface ). As per my undersatnding when we use recv, recvfrom etc facilities to receive the message we will get only the address of the message sender.

Please help me in fixing this problem on Montavista(Linux).
If this is not the right place for above query, Please guide me to the related site.

I will be greate full to your help.

Thanks in advance.


All times are GMT -5. The time now is 09:24 AM.