From honza@szt.cdrail.cz
Received: by maskin (mbox dlanor)
 (with Cubic Circle's cucipop (v1.31 1998/05/13) Fri Nov  5 19:34:00 1999)
X-From_: honza@szt.cdrail.cz  Fri Nov  5 14:33:54 1999
Return-Path: <honza@szt.cdrail.cz>
Delivered-To: dlanor@oden.se
Received: from ns1.cdrail.cz (ns1.cdrail.cz [193.85.180.2])
	by mail.ettnet.se (Postfix) with SMTP id 39C2239084
	for <dlanor@oden.se>; Fri,  5 Nov 1999 14:33:54 +0100 (MET)
Received: (qmail 21316 invoked from network); 5 Nov 1999 13:38:37 -0000
Received: from unknown (HELO cd00000phaux000.pha.cdrail.cz) (10.4.1.2)
  by ns1.cdrail.cz with SMTP; 5 Nov 1999 13:38:37 -0000
Received: from ov.szt.cdrail.cz by cd00000phaux000.pha.cdrail.cz (8.8.8/1.1.8.2/01Aug96-0244PM)
	id OAA0000032146; Fri, 5 Nov 1999 14:39:07 +0100 (MET)
Received: from falcon ([10.12.240.74] (may be forged))
	by ov.szt.cdrail.cz (8.8.6/8.8.6) with SMTP id OAA02063
	for <dlanor@oden.se>; Fri, 5 Nov 1999 14:38:28 +0100 (MET)
Message-Id: <199911051338.OAA02063@ov.szt.cdrail.cz>
Date: Fri, 05 Nov 1999 14:20:20 +0100
From: honza@szt.cdrail.cz (Jan Krivanek)
Subject: Re: aFTP port commands
To: dlanor@oden.se (Ronald Andersson)
Mime-Version: 1.0
Content-type: text/plain; charset="iso-8859-2"
Content-transfer-encoding: 8bit
X-Hardware: ATARI Falcon030
X-Mailer: aMail 1.22pb4/MiNT

On Fri, 05 Nov 1999 11:11:22 +0100 (MET), Ronald Andersson wrote:

RA > Hello Jan,
	Hi!

RA > Please tell me what method you use to determine the info to be sent to the
RA > server when sending the PORT commands. I suspect your method is one of those
RA > that should no longer be used. The CIB method will work with STiK as well as
RA > STinG, as it was defined in coordination with Dan Ackerman, so there are no
RA > compatibility reasons to use any other method.

	I think I use the CIB method ;), here you are:

#define	UC(b)	(((int)b)&0xff)

int napoj_data(void)
{
CIB	*cib_dat, *cib_ctr;
char	cmd[128];
char	*a, *p;

	if (ftp_server.passive) {
		if (send_cmd("PASV\r\n") != 227)
			return(-1);
		else
			return(1);
	}
	
	d=TCP_open(0, 0, 1, GETBLOK+10);
	if (d<0)
		return(-1);
	cib_ctr = CNgetinfo(s);
	cib_dat = CNgetinfo(d);
	a = (char *)&(cib_ctr->address.lhost);
	p = (char *)&(cib_dat->address.lport);
	sprintf(cmd, "PORT %d,%d,%d,%d,%d,%d\r\n",  UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]), UC(p[0]), UC(p[1]));
	if (send_cmd(cmd) > 400)
		return(-1);
	data = 1;
	return(1);
}

   BFN
         Honza
-----                                                     -----
      e-mail: honza@szt.cdrail.cz, aFTP & aMail developer
      ATACK Software & Hardware, http://www.pwp.cz/atack/
 ATARI Falcon030 @ 40MHz | 14MB RAM | FreeMiNT + N.AES + Thing




