How to get destination IP in the socket programming?

How to get destination IP in the socket programming?

Post by wang » Fri, 13 Apr 2001 18:33:34



man getpeername

>HI all,

>I am running a server through inetd written in C.
>I am running it on a server with multiple ip addresses
>on it.

>I want to know that to which IP address was the request
>was sent to the server deamon.

>How can i find it using the C socket programming in my server.

>Thanks .

>With Regards,
>Manish.

>-----------------------------------

 
 
 

How to get destination IP in the socket programming?

Post by Barry Margoli » Sat, 14 Apr 2001 04:57:21



>man getpeername

No, man getsockname


>>I am running a server through inetd written in C.
>>I am running it on a server with multiple ip addresses
>>on it.

>>I want to know that to which IP address was the request
>>was sent to the server deamon.

>>How can i find it using the C socket programming in my server.

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. getting destination IP address from multiplexed socket

Hi,

I have a slight problem.  I have an app that subscribes to multiple
multicast groups on the same port number.  Only problem is that
based upon which multicast group it is, the data is treated differently.
Is there a way under Linux to get this information?  I know that
the IP_RECVDSTADDR socket option works under FreeBSD, but I would prefer
to work under Linux since I am more comfortable with it.

Thanks,
Tuan
--
--
Tuan Hoang
The MITRE Corporation

2. Client receives TCP packets but does not ACK

3. How to get the destination IP using UDP socket

4. TkNet v1.1 - Net statistics working?

5. rh6.2, changing IP address gets destination host unreachable

6. Sound and PNP and the ISA bus

7. Getting original source/destination IP address after NAT

8. Caldera WS 3.1.1, CD Changers and no make config

9. Getting connected socket's ip address

10. getting socket info from busy program

11. Getting remote IP address of connected socket

12. Socket programming: Getting local port number...

13. Getting the IP addr of a socket