[776] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Question on use of getsockname function

daemon@ATHENA.MIT.EDU (Jeff Renicker)
Wed Jul 26 02:45:54 1995

Date: Tue, 25 Jul 95 16:25:01 EDT
To: linux-net@vger.rutgers.edu
From: jrenicker@goodyear.com (Jeff Renicker)

Hi folks!

I don't know if this is the right mailing group for this.  If not, tell me.

I'm attempting to modify the wu-ftpd and am having some problems getting
the data I need.

Here's the scenario:
(the names, etc are going to be fake ones)
There's a Linux system with IP address 1.2.3.4 and a domain name of abc.net.
It also has an alias (through a dummy interface) with IP address 1.2.3.55 and
a domain name of xyz.org.  What I'd like to do is for those who ftp to 
abc.net to be directed to directory /home/ftp/abc.net and those who ftp 
to xyz.org to be directed to directory /home/ftp/xyz.org.  This would 
allow different sets of files to be presented to the user based on the domain
name.  Basically I want to give the impression of two separate systems while 
only using one.

I saw that in ftpd.c the getsockname function is used.  I've not found a
detailed description of the function although it appears to return the IP
address of the Ethernet adapter.  My question is: does getsockname always
return the IP address of the adapter or does it return the IP address of the
host the user connected to?  If it always gives the address of the adapter
is there any way to get the IP address (or host/domain name) of a dummy
interface?

I'd appreciate any assistance you can give.

Thanx!
Jeff
====================================================================
Jeffrey E. Renicker               e-mail: jrenicker@goodyear.com
Goodyear Tire & Rubber Co.        voice:  216.796.3984
1144 E. Market St.                fax:    216.796.2222
Akron, OH 44316-0001
====================================================================


home help back first fref pref prev next nref lref last post