IBM AS/400e Computer Hardware User Manual


 
Anonymous FTP
For information about anonymous FTP, see
AS/400e Information Center
,
SK3T-2027-01. For the URL to access the Information Center online, see “TCP/IP
Topics in the Information Center” on page xv.
/* End Function Specification ****************************************/
static int CheckClientAddress(char *ClientIPaddr_p, /* Entry point */
int Lgth_ClientIPaddr)
{
/********************************************************************/
/* Local Variables */
/********************************************************************/
int rc; /* Return code */
/********************************************************************/
/* Code */
/********************************************************************/
/* Check that client IP address input argument is dotted-decimal */
/* format of minimum length, with no leading blanks or periods, */
/* and contains only valid characters. */
if((Lgth_ClientIPaddr < 7) || /* Minimum IP address size */
(strspn(ClientIPaddr_p, ValidChars) < Lgth_ClientIPaddr)||
(strspn(ClientIPaddr_p, ".") EQ 1)|| /* Leading '.' in IP */
(strspn(ClientIPaddr_p, " ") EQ 1)) /* Leading blank in IP */
{
Figure 301. Sample FTP Logon Exit Program (Part 25 of 26)
/* Client's IP address not valid, or contains an incorrect character */
rc = 0; /* Client IP address input argument not valid */
}
else
{
/* Is client system allowed to log in to FTP server? */
if(NULL NEQ strstr(Reject, ClientIPaddr_p))
{
/* Return code=0-Reject the server logon operation, as the */
/* client IP address is found in the global */
/* "Reject" list. */
rc = 0; /* Reject the logon operation */
}
else
{
/* Continue the server logon operation checks. */
rc = 1; /* Continue the logon operation */
}
}
return(rc);
}
#undef _QTMFSVRLGN_C
Figure 301. Sample FTP Logon Exit Program (Part 26 of 26)
568 OS/400 TCP/IP Configuration and Reference V4R4
|
|
|