[Toybox] FTP commands
Rob Landley
rob at landley.net
Fri Dec 27 21:14:48 PST 2013
On 12/27/13 11:49, ibid.ag at gmail.com wrote:
> On Fri, Dec 27, 2013 at 08:39:42AM -0600, Rob Landley wrote:
>> On 12/12/13 19:39, ibid.ag at gmail.com wrote:
>>> On Thu, Dec 12, 2013 at 02:25:38PM +0530, Ashwini Sharma wrote:
>>>> Hi,
>>>>
>>>> The input parameter port was kept as string, so that the
>>>> user can also give service name like "ftp" instead of numeric PORT.
>> ...
>>> and initialize port to 0, if we want to keep support for -P ftp.
>>> (I don't imagine anyone using -P ssh or any non-numeric port other
>>> than "ftp".)
>>>
>>> OK, yes that works...
>>>
>>> Attaching my full diff, which also addresses a couple nitpicks:
>>
>> Um, diff relative to...? I've lost the plot.
>>
> Ashwini's second version; this patch replaces my first patch.
Except I applied your first patch this morning, so have to work out the
delta between them...
> The difference is that it leaves support for non-numeric ports in place.
> (It's your call if you want to use this patch or the other.)
>
>> I applied Ashwini's second version, and your first version. Lemme
>> push that, if you have further patches could you submit 'em against
>> that?
>
> Is there a call for non-numeric ports?
A function call, you mean?
man 5 services
man 3 getservbyname
Not entirely sure it's worth it, 95% of them are pointless. (Quote of
the day? Message send protocol? Appletalk zoneinfo?) When I went through
to look for "interesting" services, I came up with:
struct services {
char *name;
unsigned short port;
} services[] = {
{"ftp", 21}, {"ssh", 22}, {"telnet", 23}, {"smtp", 25},
{"mail", 25}, {"whois", 43}, {"domain", 53}, {"bootps", 67},
{"bootpc", 68}, {"tftp", 69}, {"finger", 79}, {"http", 80},
{"kerberos", 88}, {"pop3", 110}, {"sftp", 115}, {"ntp", 123},
{"snmp", 161}, {"bgp", 179}, {"irc", 194}, {"imap3", 220},
{"ldap", 389}, {"https", 443}, {"rsync", 873}, {"ftps", 990},
{"pop3s", 995}
};
Rob
1388207688.0
More information about the Toybox
mailing list