IBM AS/400e Computer Hardware User Manual


 
/* If user has logged in as ANONYMOUS. */
if(0 == memcmp("ANONYMOUS ", User_Id, 10))
{
/* Determine how to continue with ANONYMOUS logon attempt. */
if(NULL NEQ strstr(Limit, ClientIPaddr_p))
{
/* If users system IP address is found in the "Limit" list, */
/* return ReturnCode of 6, user profile and initial */
/* current library values as output parameters. */
memcpy(UserProfile_p, "USERA1 ", 10);
memcpy(InitCurrLib_p, "PUBLIC ", 10);
rc=6;
}
else
{
/* Users system IP address is NOT found in the "Limit" list,*/
/* return ReturnCode of 5, user profile output parameter; */
/* use the initial current library that is specified by the */
/* user profile information. */
memcpy(UserProfile_p, "USERA1 ", 10);
rc=5;
}
Figure 301. Sample FTP Logon Exit Program (Part 17 of 26)
} /* End If USER is ANONYMOUS */
else /* Else USER is not ANONYMOUS */
{
/* Set receiver variable length. */
Lgth_Receiver_var = sizeof(Qsy_USRI0300_T);
/* Set return information format. */
memcpy(Format_Name, "USRI0300", sizeof(Format_Name));
/* Set user identifier passed in. */
memset(User_Id, BLANK, sizeof(User_Id));
memcpy(User_Id, UserId_p, Lgth_UserId);
/* Call QSYRUSRI - Retrieve User Information API */
QSYRUSRI(&Receiver_var, /* Return Information receiver var */
Lgth_Receiver_var,/* Receiver variable length */
Format_Name, /* Return information format name */
User_Id, /* User ID seeking information */
&error_code); /* Error return information */
/* Check if an error occurred (byte_available not equal 0) */
if(0 NEQ error_code.Bytes_Available)
{
/* Return ReturnCode of 0 only (Reject logon); */
Figure 301. Sample FTP Logon Exit Program (Part 18 of 26)
564 OS/400 TCP/IP Configuration and Reference V4R4