#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
#define OPENAPI_TITLE "RADIUS"
#define EXAMPLE_APP_NAME "radius_example"
typedef struct
{
exampleFunction_t *function;
char *description;
char *parmSyntax;
} functionTableEntry_t;
{
if (strcmp(argv, "ip") == 0)
{
}
else if (strcmp(argv, "dns") == 0)
{
}
printf("Invalid keyword for server address type. Valid choices are 'ip' or 'dns'.\n");
}
{
if (argc != 5)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.
pstart = argv[2];
serverAddr.
size = strlen(argv[2]) + 1;
addrType = addrTypeParmCheck(argv[3]);
serverName.pstart = argv[4];
serverName.size = strlen(argv[4]) + 1;
{
printf("Bad return code trying to add server: (result = %d)\n",
result);
}
else
{
printf("Server added.\n");
}
}
{
if (argc != 4)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.pstart = argv[2];
serverAddr.size = strlen(argv[2]) + 1;
addrType = addrTypeParmCheck(argv[3]);
{
printf("Bad return code trying to remove server: (result = %d)\n",
result);
}
else
{
printf("Server removed.\n");
}
}
{
uint32_t portNumber;
if (argc != 5)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.pstart = argv[2];
serverAddr.size = strlen(argv[2]) + 1;
addrType = addrTypeParmCheck(argv[3]);
errno = 0;
portNumber = strtol(argv[4], NULL, 0);
if (errno != 0)
{
printf("Invalid port number parameter: (%s)\n", argv[4]);
return;
}
{
printf("Bad return code trying to set port number: (result = %d)\n",
result);
}
else
{
printf("Port number set.\n");
}
}
{
uint32_t portNumber;
if (argc != 4)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.pstart = argv[2];
serverAddr.size = strlen(argv[2]) + 1;
addrType = addrTypeParmCheck(argv[3]);
{
printf("Bad return code trying to get port number: (result = %d)\n",
result);
}
else
{
printf("Port number retrieved. portNumber = %d\n", portNumber);
}
}
{
if (argc != 5)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.pstart = argv[2];
serverAddr.size = strlen(argv[2]) + 1;
addrType = addrTypeParmCheck(argv[3]);
if (strcmp(argv[4], "primary") == 0)
{
type = OPEN_RADIUS_SERVER_ENTRY_TYPE_PRIMARY;
}
else if (strcmp(argv[4], "secondary") == 0)
{
type = OPEN_RADIUS_SERVER_ENTRY_TYPE_SECONDARY;
}
else
{
printf("Invalid keyword for server type. Valid choices are 'primary' or 'secondary'.\n");
return;
}
{
printf("Bad return code trying to set server type: (result = %d)\n",
result);
}
else
{
printf("Server type set.\n");
}
}
{
if (argc != 4)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.pstart = argv[2];
serverAddr.size = strlen(argv[2]) + 1;
addrType = addrTypeParmCheck(argv[3]);
{
printf("Bad return code trying to get server type: (result = %d)\n",
result);
}
else
{
printf("Server type retrieved: %s\n",
(type == OPEN_RADIUS_SERVER_ENTRY_TYPE_PRIMARY)?"primary":
(type == OPEN_RADIUS_SERVER_ENTRY_TYPE_SECONDARY)?"secondary":"UNKNOWN");
}
}
{
struct in_addr inAddr;
if (argc != 3)
{
printf("Incorrect number of parameters.\n");
return;
}
if (inet_aton(argv[2], &inAddr) == 0)
{
printf("Error parsing IPv4 address parameter. %s", argv[2]);
return;
}
memset(&ipAddr, 0, sizeof(ipAddr));
ipAddr.addr.ipv4 = ntohl(inAddr.s_addr);
{
printf("Bad return code trying to set attribute 4: (result = %d)\n",
result);
}
else
{
printf("Attribute 4 set.\n");
}
}
{
if (argc != 2)
{
printf("Incorrect number of parameters.\n");
return;
}
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("Bad return code trying to clear attribute 4: (result = %d)\n",
result);
}
else
{
printf("Attribute 4 cleared.\n");
}
}
{
struct in_addr inAddr;
if (argc != 2)
{
printf("Incorrect number of parameters.\n");
return;
}
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("Bad return code trying to get attribute 4: (result = %d)\n",
result);
}
else
{
{
printf("Attribute 4 not set.\n");
}
else
{
inAddr.s_addr = htonl(ipAddr.
addr.
ipv4);
printf("Attribute 4: %s.\n", inet_ntoa(inAddr));
}
}
}
{
uint32_t expectedEncryptedSecretSize;
if (argc != 4)
{
printf("Incorrect number of parameters.\n");
return;
}
serverAddr.pstart = argv[2];
serverAddr.size = strlen(argv[2]) + 1;
encryptedSecret.pstart = argv[3];
encryptedSecret.size = strlen(argv[3]) + 1;
if (encryptedSecret.size != expectedEncryptedSecretSize)
{
printf("WARNING: Encrypted secret string is required to be %d hexadecimal characters. String with %d characters provided.\n",
(expectedEncryptedSecretSize - 1), (encryptedSecret.size - 1));
printf(" Proceeding to invoke OpEN call with provided data.\n");
}
{
printf("Bad return code trying to set secret: (result = %d)\n",
result);
}
else
{
printf("Secret set.\n");
}
}
functionTableEntry_t functionTable[] =
{
{authServerAdd, "Add a "OPENAPI_TITLE" authentication server", "<ipaddr|hostname> ip|dns <serverName>"},
{authServerRemove, "Remove a "OPENAPI_TITLE" authentication server", "<ipaddr|hostname> ip|dns"},
{authServerPortNumberSet, "Set a "OPENAPI_TITLE" authentication server's port number", "<ipaddr|hostname> ip|dns <port>"},
{authServerPortNumberGet, "Get a "OPENAPI_TITLE" authentication server's port number", "<ipaddr|hostname> ip|dns"},
{authServerTypeSet, "Set a "OPENAPI_TITLE" authentication server's type", "<ipaddr|hostname> ip|dns primary|secondary"},
{authServerTypeGet, "Get a "OPENAPI_TITLE" authentication server's type", "<ipaddr|hostname> ip|dns"},
{authAttribute4Set, "Set the "OPENAPI_TITLE" attribute 4", "<ipAddr>"},
{authAttribute4Clear, "Clear the "OPENAPI_TITLE" attribute 4", ""},
{authAttribute4Get, "Get the "OPENAPI_TITLE" attribute 4", ""},
{authServerSecretEncSet, "Set the "OPENAPI_TITLE" shared secret specified in encrypted format (128 hexadecimal digits)", "<ipaddr|hostname> <secret>"},
};
#define NUMBER_OF_FUNCTIONS sizeof(functionTable)/sizeof(functionTable[0])
void printAppMenu()
{
int i;
printf("\nUsage: %s <test#> <arg1> <arg2> ... \n\n", EXAMPLE_APP_NAME);
printf("Usage: In below, <serverEntryType> should be set to 1 for OPEN_RADIUS_SERVER_ENTRY_TYPE_PRIMARY and 2 for OPEN_RADIUS_SERVER_ENTRY_TYPE_SECONDARY.\n");
printf("Usage: In below, <serverType> should be set to 1 for OPEN_RADIUS_SERVER_TYPE_AUTH and 2 for OPEN_RADIUS_SERVER_TYPE_ACCT.\n");
printf("Usage: In below, <serverAddrType> should be set to 1 for OPEN_IP_ADDRESS_IPV4, 2 for OPEN_IP_ADDRESS_IPV6 and 3 for OPEN_IP_ADDRESS_DNS.\n");
printf("Usage: In below, <serverConfig> should be set to 0 for OPEN_RADIUSGLOBAL and 1 for OPEN_RADIUSLOCAL.\n");
printf("Usage: In below, <maxRetransmit> should be set in the range of 1 - 15.\n");
printf("Usage: In below, <timeOut> should be set in the range of 1 - 30.\n");
printf("Usage: In below, <mode> should be set to 0 for OPEN_DISABLE and 1 for OPEN_ENABLE.\n");
printf("Usage: In below, <keyType> should be set to 0 for OPEN_FALSE and 1 for OPEN_TRUE.\n");
for (i = 0; i < NUMBER_OF_FUNCTIONS; i++)
{
printf("\tTest %d: %s: %s %d %s\n",
i, functionTable[i].description, EXAMPLE_APP_NAME, i, functionTable[i].parmSyntax);
}
printf("\tTest 10: Run API sanity checks: \n"
"\t%s 10 \n", EXAMPLE_APP_NAME);
printf("\tTest 11: Gets the number of configured servers of specified type (Auth or Acct): \n"
"\t%s 11 <serverType>\n", EXAMPLE_APP_NAME);
printf("\tTest 12: Gets the maximum number of retransmissions parameter: \n"
"\t%s 12 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 13: Sets the maximum number of retransmissions parameter: \n"
"\t%s 13 <pHostAddr><maxRetransmit><serverConfig>\n", EXAMPLE_APP_NAME);
printf("\tTest 14: Gets the value of time-out duration parameter: \n"
"\t%s 14 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 15: Sets the time-out duration parameter: \n"
"\t%s 15 <pHostAddr><timeOut><serverConfig>\n", EXAMPLE_APP_NAME);
printf("\tTest 16: Gets radius-accounting mode parameter: \n"
"\t%s 16 \n", EXAMPLE_APP_NAME);
printf("\tTest 17: Sets radius-accounting mode parameter: \n"
"\t%s 17 <mode>\n", EXAMPLE_APP_NAME);
printf("\tTest 18: Gets first configured server: \n"
"\t%s 18 \n", EXAMPLE_APP_NAME);
printf("\tTest 19: Get the configured server next in the list after the specified server: \n"
"\t%s 19 <pCurServerAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 20: Get the server Name of specified radius server: \n"
"\t%s 20 <pServerAddr><serverAddrType>\n", EXAMPLE_APP_NAME);
printf("\tTest 21: Gets global selected radius server address and address type: \n"
"\t%s 21\n", EXAMPLE_APP_NAME);
printf("\tTest 22: Sets server name attribute to the Auth server: \n"
"\t%s 22 <pServerAddr><serverAddrType><pServerName>\n", EXAMPLE_APP_NAME);
printf("\tTest 23: Set the radius authentication server type: \n"
"\t%s 23 <pServerAddr><serverAddrType><serverEntryType>\n", EXAMPLE_APP_NAME);
printf("\tTest 24: Gets server Name of specified radius server: \n"
"\t%s 24 <pServerName>\n", EXAMPLE_APP_NAME);
printf("\tTest 25: Get the round trip time: \n"
"\t%s 25 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 26: Retrieve the number of RADIUS access-request packets sent to requested server: \n"
"\t%s 26 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 27: Retrieve the number of RADIUS access-request packets retransmitted to requested server: \n"
"\t%s 27 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 28: Retrieve the number of RADIUS access-request packets received from requested server: \n"
"\t%s 28 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 29: Retrieve the number of RADIUS access-reject packets received from requested server: \n"
"\t%s 29 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 30: Retrieve the number of RADIUS access-challenge packets received from requested server: \n"
"\t%s 30 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 31: Retrieve the number of malformed RADIUS access-response packets received from requested server: \n"
"\t%s 31 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 32: Retrieve the number of RADIUS access-response bad auth packets received from requested server: \n"
"\t%s 32 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 33: Retrieve the number of RADIUS access-request packets destined for this server that have not\n"
"\t\tyet timed out or received a response from this server received from requested server: \n"
"\t%s 33 <pHostAddr><pPacketCount>\n", EXAMPLE_APP_NAME);
printf("\tTest 34: Retrieve the number of authentication time-outs to requested server: \n"
"\t%s 34 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 35: Retrieve the number of RADIUS packets of unknown type received from requested server on the\n"
"\t\t authentication port: \n"
"\t%s 35 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 36: Retrieve the number of RADIUS packets received from server on the authentication port that\n"
"\t\twere dropped for some other reason: \n"
"\t%s 36 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 37: Gets server details of specified accounting server EXAMPLE_APP_NAME: \n"
"\t%s 37 <pServerName>\n", EXAMPLE_APP_NAME);
printf("\tTest 38: Verify a RADIUS accounting server is a configured server: \n"
"\t%s 38 <pServerAddr><serverAddrType>\n", EXAMPLE_APP_NAME);
printf("\tTest 39: Gets server EXAMPLE_APP_NAME of specified accounting server: \n"
"\t%s 39 <pServerAddr><serverAddrType>\n", EXAMPLE_APP_NAME);
printf("\tTest 40: Get the round trip time: \n"
"\t%s 40 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 41: Retrieve the number of RADIUS accounting-request packets sent to requested server: \n"
"\t%s 41 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 42: Retrieve the number of RADIUS accounting-request packets retransmitted to requested server: \n"
"\t%s 42 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 43: Retrieve the number of RADIUS accounting-response packets received from requested server: \n"
"\t%s 43 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 44: Retrieve the number of malformed RADIUS accounting-response packets received from requested server: \n"
"\t%s 44 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 45: Retrieve the number of RADIUS accounting-response bad auth packets received from requested server: \n"
"\t%s 45 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 46: Retrieve the number of RADIUS accounting-request packets destined for this server that have not yet\n"
"\t\ttimed out or received a response from this server received from requested server: \n"
"\t%s 46 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 47: Retrieve the number of accounting time-outs to requested server: \n"
"\t%s 47 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 48: Retrieve the number of RADIUS packets of unknown type received from requested server on the\n"
"\t\taccounting port: \n"
"\t%s 48 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 49: Retrieve the number of RADIUS packets received from server on the accounting port that were dropped\n"
"\t\tfor some other reason: \n"
"\t%s 49 <pHostAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 50: Gets first accounting configured server: \n"
"\t%s 50 \n", EXAMPLE_APP_NAME);
printf("\tTest 51: Get the configured accounting server next in the list after the specified server: \n"
"\t%s 51 <pCurServerAddr>\n", EXAMPLE_APP_NAME);
printf("\tTest 52: Gets global selected Radius server address, server type and address type: \n"
"\t%s 52 <servType>\n", EXAMPLE_APP_NAME);
printf("\tTest 53: Get the port number of the accounting server being used: \n"
"\t%s 53 <pServerAddr><serverAddrType>\n", EXAMPLE_APP_NAME);
printf("\tTest 54: Sets the port number of the accounting server being used: \n"
"\t%s 54 <pServerAddr><serverAddrType><port>\n", EXAMPLE_APP_NAME);
printf("\tTest 55: Verify a RADIUS authentication server is a configured server: \n"
"\t%s 55 <pServerAddr><serverAddrType>\n", EXAMPLE_APP_NAME);
printf("\tTest 56: Set the shared secret being used between the radius client and the radius server: \n"
"\t%s 56 <pServerAddr><serverConfig><keyType>\n", EXAMPLE_APP_NAME);
printf("\tTest 57: Set the shared secret being used between the radius client and the accounting server: \n"
"\t%s 57 <pServerAddr><serverAddrType><pSharedSecret>\n", EXAMPLE_APP_NAME);
printf("\n");
return;
}
{
uint32_t roundTripTime;
uint32_t maxRetransmit;
uint32_t timeout;
uint32_t port;
uint32_t count;
uint32_t packetCount;
OPEN_RADIUS_SERVER_TYPE_t servType=1;
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t paramStatus;
char buffer[20];
char strServAddr[100];
char strServName[30];
char strSharedSecret[30];
badBufdescPointer.pstart = (void *) NULL;
badBufdescPointer.size = sizeof(buffer);
zeroLenBuf.pstart = buffer;
zeroLenBuf.size = 0;
serAddr.pstart = strServAddr;
serAddr.size = sizeof(strServAddr);
serName.pstart = strServName;
serName.size = sizeof(strServName);
sharedSecret.pstart = strSharedSecret;
sharedSecret.size = sizeof(strSharedSecret);
printf("Testing radius OpEN APIs sanity:\n");
printf("Testing openapiRadiusConfiguredServersCountGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerRetransGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusServerTimeOutGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusAccountingModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 2:(result = %d)\n", result);
printf("Testing openapiRadiusServerFirstIPHostNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerNextIPHostNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusServerHostNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusServerGlobalSelectedGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerNameSet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusNamedServerAddrGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatRTTGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatAccessReqGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatAccessRetransGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatAccessAcceptGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatAccessRejectGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatAccessChallengeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatMalformedAccessResponseGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatBadAuthGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatPendingReqGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatTimeoutsGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatUnknownTypeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerStatPktsDroppedGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusNamedAcctServerAddrGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusServerAcctHostNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatRTTGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatReqGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatRetransGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatResponseGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatMalformedResponseGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatBadAuthGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatPendingReqGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatTimeoutsGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatUnknownTypeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerStatPktsDroppedGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerFirstIPHostNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiRadiusServerGlobalCurentGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusAcctServerNextIPHostNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusAccountingHostNameServerPortNumGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiRadiusAccountingHostNameServerSharedSecretSet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 4:(result = %d)\n", result);
printf("buffdesc 0 length size argument 4:(result = %d)\n", result);
return;
}
void
OPEN_RADIUS_SERVER_TYPE_t type,
uint32_t *pCount)
{
type, pCount)))
{
printf("Bad return code trying to gets the number of configured servers"
" of specified type (Auth or Acct). (result = %d)\n", result);
}
else
{
printf("Number of configured %s servers are %d\n",
(OPEN_RADIUS_SERVER_TYPE_AUTH == type) ? "Auth" :
(OPEN_RADIUS_SERVER_TYPE_ACCT == type) ? "Acct" : "invalid type" ,
*pCount);
}
return;
}
void
uint32_t *pMaxRetransmit,
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t *pParamStatus)
{
pMaxRetransmit, pParamStatus)))
{
printf("Bad return code trying to gets the maximum number of"
" retransmissions parameter. (result = %d)\n", result);
}
else
{
printf("Maximum retransmissions information of server:%s is maxRetransmit:%d"
" and radius server config is %d\n", (char*)pHostAddr->pstart, *pMaxRetransmit,
*pParamStatus);
}
return;
}
void
uint32_t maxRetransmit,
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t paramStatus)
{
pHostAddr, maxRetransmit,
paramStatus)))
{
printf("Bad return code trying to sets the maximum number of"
" retransmissions parameter. (result = %d)\n", result);
}
else
{
printf("Maximum number of retransmissions is set to %d and server config "
"is set to %s for server:%s\n", maxRetransmit,
(OPEN_RADIUSGLOBAL == paramStatus) ? "GLOBAL" :
(OPEN_RADIUSLOCAL == paramStatus) ? "LOCAL" : "Invalid" ,
(char *)pHostAddr->pstart);
}
return;
}
void
uint32_t *pTimeOut,
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t *pParamStatus)
{
pTimeOut, pParamStatus)))
{
printf("Bad return code trying to gets the value of time-out duration"
" parameter. (result = %d)\n", result);
}
else
{
printf("server:%s timeout value is %d and server config is %s\n",
(char *)pHostAddr->pstart, *pTimeOut,
(OPEN_RADIUSGLOBAL == *pParamStatus) ? "GLOBAL" :
(OPEN_RADIUSLOCAL == *pParamStatus) ? "LOCAL" : "invalid");
}
return;
}
void
uint32_t timeOut,
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t paramStatus)
{
timeOut, paramStatus)))
{
printf("Bad return code trying to sets the time-out duration parameter."
" (result = %d)\n", result);
}
else
{
printf("server:%s timeout value is set to %d and server config is set to %s\n",
(char *)pHostAddr->pstart, timeOut,
(OPEN_RADIUSGLOBAL == paramStatus) ? "GLOBAL" :
(OPEN_RADIUSLOCAL == paramStatus) ? "LOCAL" : "invalid");
}
return;
}
void
{
{
printf("Bad return code trying to gets radius-accounting mode parameter."
" (result = %d)\n", result);
}
else
{
printf("Radius accounting is in %s mode\n",
}
return;
}
void
{
{
printf("Bad return code trying to sets radius-accounting mode parameter."
" (result = %d)\n", result);
}
else
{
printf("Radius accounting mode is successfully %s\n",
}
return;
}
void
{
pServerAddr, pType)))
{
printf("Bad return code trying to gets first configured server."
" (result = %d)\n", result);
}
else
{
printf("Details of first configured server details:- server:%s addrType:%s\n",
(char *)pServerAddr->pstart,
}
return;
}
void
{
pNextServerAddr, pType)))
{
printf("Bad return code trying to get the configured server next in the"
" list after the specified server. (result = %d)\n", result);
}
else
{
printf("Details of next configured server details after given server:%s :-"
" server:%s addrType:%s\n", (char *)pCurServerAddr->pstart,
(char *)pNextServerAddr->pstart,
}
return;
}
void
{
type, pServerName)))
{
printf("Bad return code trying to get the server Name of specified radius"
" server. (result = %d)\n", result);
}
else
{
printf("Server name of server:%s addrType:%s is %s\n",
(char *)pServerAddr->pstart,
(char *)pServerName->pstart);
}
return;
}
void
{
pServerAddr, pServerAddrType)))
{
printf("Bad return code trying to gets global selected radius server address"
" and address type. (result = %d)\n", result);
}
else
{
printf("Global selected details server:%s addrType:%s \n",
(char *)pServerAddr->pstart,
}
return;
}
void
{
type, pServerName)))
{
printf("Bad return code trying to sets server name attribute to the Auth"
" server. (result = %d)\n", result);
}
else
{
printf("Server name of server:%s addrType:%s is successfully set to %s\n",
(char *)pServerAddr->pstart,
(char *)pServerName->pstart);
}
return;
}
void
uint32_t type)
{
addrType, type)))
{
printf("Bad return code trying to set the radius authentication server type."
" (result = %d)\n", result);
}
else
{
printf("Server type of server:%s addrType:%s is successfully set to %s\n",
(char *)pServerAddr->pstart,
(OPEN_RADIUS_SERVER_ENTRY_TYPE_PRIMARY == type) ? "Primary" :
(OPEN_RADIUS_SERVER_ENTRY_TYPE_SECONDARY == type) ? "Secondary" : "Invalid");
}
return;
}
void
{
pServerAddr, pType)))
{
printf("Bad return code trying to gets server Name of specified"
" radius server. (result = %d)\n", result);
}
else
{
printf("Server address details with serverName:%s is server:%s addrType:%s\n",
(char *)pServerName->pstart, (char *)pServerAddr->pstart,
}
return;
}
void
uint32_t *pRoundTripTime)
{
pRoundTripTime)))
{
printf("Bad return code trying to get the round trip time."
" (result = %d)\n", result);
}
else
{
printf("Round trip time to radius authentication server:%s is %d \n",
(char *)pHostAddr->pstart, *pRoundTripTime);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
"access-request packets sent to requested server. (result = %d)\n",
result);
}
else
{
printf("Access-request packet count sent to radius authentication"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" access-request packets retransmitted to requested server."
" (result = %d)\n", result);
}
else
{
printf("Access-request packet count retransmitted to radius authentication"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" access-request packets received from requested server. (result = %d)\n",
result);
}
else
{
printf("Access-request packet count received from radius authentication"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" access-reject packets received from requested server. (result = %d)\n",
result);
}
else
{
printf("Access-reject packet count received from radius authentication"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" access-challenge packets received from requested server."
" (result = %d)\n", result);
}
else
{
printf("Access-challenge packet count received from radius authentication"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of malformed RADIUS"
" access-response packets received from requested server. (result = %d)\n",
result);
}
else
{
printf("Malformed access-response packet count received from radius"
" authentication server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" access-response bad auth packets received from requested server."
" (result = %d)\n", result);
}
else
{
printf("Access-response bad auth packet count received from radius"
" authentication server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" access-request packets destined for this server that have not yet"
" timed out or received a response from requested server. (result = %d)\n", result);
}
else
{
printf("Non timed out access-request packet count received from radius"
" authentication server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of authentication"
" time-outs to requested server. (result = %d)\n", result);
}
else
{
printf("Authentication time-out count to radius authentication server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS packets"
" of unknown type received from requested server on the authentication port."
" (result = %d)\n", result);
}
else
{
printf("Unknown type packet received count from radius authentication server:%s"
" on authentication port is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS packets"
" received from server on the authentication port that were dropped"
"for some other reason. (result = %d)\n", result);
}
else
{
printf("Dropped packet count received from radius authentication server:%s"
" on authentication port is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
{
pServerAddr, pType)))
{
printf("Bad return code trying to gets server name of specified accounting"
" server. (result = %d)\n", result);
}
else
{
printf("Acct server address details with serverName:%s is server:%s addrType:%s\n",
(char *)pServerName->pstart, (char *)pServerAddr->pstart,
}
return;
}
void
{
pServerAddr,
type, pVerified)))
{
printf("Bad return code trying to verify a RADIUS accounting server"
" is a configured server. (result = %d)\n", result);
}
else
{
printf("Radius accounting server[ip:%s addrType:%s] %s \n",
(char *)pServerAddr->pstart,
(
OPEN_TRUE == *pVerified) ?
"Exist" :
"Doesn't exist");
}
return;
}
void
{
type, pServerName)))
{
printf("Bad return code trying to gets server name of specified accounting"
" server. (result = %d)\n", result);
}
else
{
printf("Server name of server:%s addrType:%s is %s\n",
(char *)pServerAddr->pstart,
(char *)pServerName->pstart);
}
return;
}
void
uint32_t *pRoundTripTime)
{
pRoundTripTime)))
{
printf("Bad return code trying to get the round trip time."
" (result = %d)\n", result);
}
else
{
printf("Round trip time to radius acct server:%s is %d \n",
(char *)pHostAddr->pstart, *pRoundTripTime);
}
return;
}
void
uint32_t *pPacketCount)
{
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" accounting-request packets sent to requested server. (result = %d)\n", result);
}
else
{
printf("Accounting-request packet count sent to radius server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" accounting-request packets retransmitted to requested server."
" (result = %d)\n", result);
}
else
{
printf("Accounting-request packet count retransmitted to radius server:%s"
" is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" accounting-response packets received from requested server."
" (result = %d)\n", result);
}
else
{
printf("Accounting-response packet count received from server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of malformed RADIUS"
" accounting-response packets received from requested server."
" (result = %d)\n", result);
}
else
{
printf("Malformed accounting-response packet count received from radius"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr, pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" accounting-response bad auth packets received from requested server."
" (result = %d)\n", result);
}
else
{
printf("Accounting-response bad auth packet count received from radius"
" server:%s is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS"
" accounting-request packets destined for this server that have"
" not yet timed out or received a response from this server received"
"from requested server. (result = %d)\n", result);
}
else
{
printf("Non timed out accounting-request packet count received from radius"
" server:%s is %d \n", (char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pTimeout)
{
pHostAddr,
pTimeout)))
{
printf("Bad return code trying to retrieve the number of accounting"
" time-outs to requested server. (result = %d)\n", result);
}
else
{
printf("Accounting time-out count to server:%s is %d \n",
(char *)pHostAddr->pstart, *pTimeout);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS packets"
" of unknown type received from requested server on the accounting port."
" (result = %d)\n", result);
}
else
{
printf("Unknown type packet received count from server:%s"
" on accounting port is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
uint32_t *pPacketCount)
{
pHostAddr,
pPacketCount)))
{
printf("Bad return code trying to retrieve the number of RADIUS packets"
" received from server on the accounting port that were dropped for"
" some other reason. (result = %d)\n", result);
}
else
{
printf("Dropped packet count received from radius authentication server:%s"
" on accounting port is %d \n",
(char *)pHostAddr->pstart, *pPacketCount);
}
return;
}
void
{
pServerAddr,
pType)))
{
printf("Bad return code trying to gets first accounting configured server."
" (result = %d)\n", result);
}
else
{
printf("Details of first accounting configured server details:- server:%s addrType:%s\n",
(char *)pServerAddr->pstart,
}
return;
}
void
OPEN_RADIUS_SERVER_TYPE_t servType,
{
pServerAddr, pType)))
{
printf("Bad return code trying to gets global selected Radius server"
" address, server type and address type. (result = %d)\n", result);
}
else
{
printf("Global selected %s server:[%s addrType:%s] \n",
(OPEN_RADIUS_SERVER_TYPE_AUTH == servType) ? "Auth" :
(OPEN_RADIUS_SERVER_TYPE_ACCT == servType) ? "Acct" : "invalid type" ,
(char *)pServerAddr->pstart,
}
return;
}
void
{
pCurServerAddr,
pNextServerAddr,
pType)))
{
printf("Bad return code trying to get the configured accounting server next"
" in the list after the specified server. (result = %d)\n", result);
}
else
{
printf("Details of next configured acct server details after given server:%s :-"
" server:%s addrType:%s\n", (char *)pCurServerAddr->pstart,
(char *)pNextServerAddr->pstart,
}
return;
}
void
uint32_t *pPort)
{
pServerAddr,
type, pPort)))
{
printf("Bad return code trying to get the port number of the accounting"
" server being used. (result = %d)\n", result);
}
else
{
printf("Port number of acct server[ip:%s addrType:%s] is %d\n",
(char *)pServerAddr->pstart,
*pPort);
}
return;
}
void
uint32_t port)
{
pServerAddr,
type, port)))
{
printf("Bad return code trying to sets the port number of the accounting"
" server being used. (result = %d)\n", result);
}
else
{
printf("Port number %d is successfully set for acct server[ip:%s addrType:%s]\n",
port,
(char *)pServerAddr->pstart,
}
return;
}
void
{
pServerAddr,
type, pVerified)))
{
printf("Bad return code trying to verify a RADIUS authentication server"
" is a configured server. (result = %d)\n", result);
}
else
{
printf("Radius authentication server[ip:%s addrType:%s] %s \n",
(char *)pServerAddr->pstart,
(
OPEN_TRUE == *pVerified) ?
"Exist" :
"Doesn't exist");
}
return;
}
void
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t paramStatus,
{
pServerAddr,
paramStatus,
keyType)))
{
printf("Bad return code trying to set the shared secret being used between"
" the radius client and the radius server. (result = %d)\n", result);
}
else
{
printf("secret for an accounting/server[ip:%s serverConfigParam:%s]"
" is sucessfully %s \n",
(char *)pServerAddr->pstart,
(OPEN_RADIUSGLOBAL == paramStatus) ? "GLOBAL" :
(OPEN_RADIUSLOCAL == paramStatus) ? "LOCAL" : "invalid",
(
OPEN_TRUE == keyType) ?
"configured" :
"cleared");
}
return;
}
void
{
pServerAddr,
type,
pSharedSecret)))
{
printf("Bad return code trying to set the shared secret being used between"
" the radius client and the accounting server. (result = %d)\n", result);
}
else
{
printf("Secret for accounting server[ip:%s addrType:%s] is sucessfully set\n",
(char *)pServerAddr->pstart,
}
return;
}
int main(int argc, char **argv)
{
uint32_t testNum;
char switch_os_revision_string[100];
int show_help = 1;
uint32_t port;
OPEN_RADIUS_SERVER_TYPE_t servType;
OPEN_RADIUS_SERVER_CONFIGPARAMS_FLAG_t servConfig;
char strAddr[100];
open_buffdesc servAddr = {.pstart = strAddr, .size =
sizeof(strAddr)};
char strNxtAddr[100];
open_buffdesc servNxtAddr = {.pstart = strNxtAddr, .size =
sizeof(strNxtAddr)};
char strName[32];
open_buffdesc servName = {.pstart = strName, .size =
sizeof(strName)};
char strsharedSecret[100];
open_buffdesc sharedSecret = {.pstart = strsharedSecret, .size =
sizeof(strsharedSecret)};
uint32_t maxRetransmit;
uint32_t count;
uint32_t packetCount;
uint32_t timeOut;
uint32_t roundTripTime;
if (argc < 2)
{
printAppMenu();
exit(1);
}
l7proc_crashlog_register();
{
printf("\nFailed to initialize RPC to OpEN. Exiting (result = %d)\n", result);
exit(2);
}
{
sleep(1);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Starting %s OpEN API example application", OPENAPI_TITLE);
printf("\n");
buffDesc.pstart = switch_os_revision_string;
buffDesc.size = sizeof(switch_os_revision_string);
printf("Network OS version = %s\n", switch_os_revision_string);
else
printf("Network OS version retrieve error\n");
printf("OpEN API Version = %d.%d.%d.%d\n",
openApiVersion.
maint_level,
openApiVersion.
build_num);
else
printf("OpEN API Version retrieve error\n");
printf("\n");
errno = 0;
testNum = strtol(argv[1], NULL, 0);
if (errno != 0)
{
printf("Invalid test number: (%s)\n", argv[1]);
printAppMenu();
exit(1);
}
if (testNum < NUMBER_OF_FUNCTIONS)
{
functionTable[testNum].function(&clientHandle, argc, argv);
show_help = 0;
}
else
{
switch (testNum - (NUMBER_OF_FUNCTIONS))
{
case 0:
if (argc == 2)
{
runSanity(&clientHandle);
show_help = 0;
}
break;
case 1:
if (argc == 3)
{
servType = atoi(argv[2]);
radiusConfiguredServersCountGet(&clientHandle, servType, &count);
show_help = 0;
}
break;
case 2:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerRetransGet(&clientHandle, &servAddr, &maxRetransmit, &servConfig);
show_help = 0;
}
break;
case 3:
if (5 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
maxRetransmit = atoi(argv[3]);
servConfig = atoi(argv[4]);
radiusServerRetransSet(&clientHandle, &servAddr, maxRetransmit, servConfig);
show_help = 0;
}
break;
case 4:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerTimeOutGet(&clientHandle, &servAddr, &timeOut, &servConfig);
show_help = 0;
}
break;
case 5:
if (5 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
timeOut = atoi(argv[3]);
servConfig = atoi(argv[4]);
radiusServerTimeOutSet(&clientHandle, &servAddr, timeOut, servConfig);
show_help = 0;
}
break;
case 6:
if (argc == 2)
{
radiusAccountingModeGet(&clientHandle, &accntMode);
show_help = 0;
}
break;
case 7:
if (argc == 3)
{
accntMode = atoi(argv[2]);
radiusAccountingModeSet(&clientHandle, accntMode);
show_help = 0;
}
break;
case 8:
if (2 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
servAddr.size = sizeof(strAddr);
radiusServerFirstIPHostNameGet(&clientHandle, &servAddr, &serverAddrType);
show_help = 0;
}
break;
case 9:
if (argc == 3)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
memset(strNxtAddr, 0, sizeof(strNxtAddr));
servNxtAddr.size = sizeof(strNxtAddr);
radiusServerNextIPHostNameGet(&clientHandle, &servAddr,
&servNxtAddr, &serverAddrType);
show_help = 0;
}
break;
case 10:
if (4 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
memset(strName, 0, sizeof(strName));
servName.size = sizeof(strName);
radiusServerHostNameGet(&clientHandle, &servAddr, serverAddrType,
&servName);
show_help = 0;
}
break;
case 11:
if (argc == 2)
{
memset(strAddr, 0, sizeof(strAddr));
servAddr.size = sizeof(strAddr);
radiusServerGlobalSelectedGet(&clientHandle, &servAddr,
&serverAddrType);
show_help = 0;
}
break;
case 12:
if (argc == 5)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
memset(strName, 0, sizeof(strName));
strncpy(strName, argv[4], sizeof(strName)-1);
servName.size = strlen(strName);
radiusServerNameSet(&clientHandle, &servAddr, serverAddrType,
&servName);
show_help = 0;
}
break;
case 13:
if (argc == 5)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
serverEntryType = atoi(argv[4]);
radiusAuthServerTypeSet(&clientHandle, &servAddr, serverAddrType,
serverEntryType);
show_help = 0;
}
break;
case 14:
if (argc == 3)
{
memset(strName, 0, sizeof(strName));
strncpy(strName, argv[2], sizeof(strName)-1);
servName.size = strlen(strName);
memset(strAddr, 0, sizeof(strAddr));
servAddr.size = sizeof(strAddr);
radiusNamedServerAddrGet(&clientHandle, &servName, &servAddr,
&serverAddrType);
show_help = 0;
}
break;
case 15:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatRTTGet(&clientHandle, &servAddr, &roundTripTime);
show_help = 0;
}
break;
case 16:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatAccessReqGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 17:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatAccessRetransGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 18:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatAccessAcceptGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 19:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatAccessRejectGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 20:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatAccessChallengeGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 21:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatMalformedAccessResponseGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 22:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatBadAuthGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 23:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatPendingReqGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 24:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatTimeoutsGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 25:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatUnknownTypeGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 26:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusServerStatPktsDroppedGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 27:
if (3 == argc)
{
memset(strName, 0, sizeof(strName));
strncpy(strName, argv[2], sizeof(strName)-1);
servName.size = strlen(strName);
memset(strAddr, 0, sizeof(strAddr));
servAddr.size = sizeof(strAddr);
radiusNamedAcctServerAddrGet(&clientHandle, &servName, &servAddr,
&serverAddrType);
show_help = 0;
}
break;
case 28:
if (4 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
radiusAccountingServerIPHostNameVerify(&clientHandle, &servAddr,
serverAddrType, &verified);
show_help = 0;
}
break;
case 29:
if (4 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
memset(strName, 0, sizeof(strName));
servName.size = sizeof(strName);
radiusServerAcctHostNameGet(&clientHandle, &servAddr, serverAddrType,
&servName);
show_help = 0;
}
break;
case 30:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatRTTGet(&clientHandle, &servAddr, &roundTripTime);
show_help = 0;
}
break;
case 31:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatReqGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 32:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatRetransGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 33:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatResponseGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 34:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatMalformedResponseGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 35:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatBadAuthGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 36:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatPendingReqGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 37:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatTimeoutsGet(&clientHandle, &servAddr, &timeOut);
show_help = 0;
}
break;
case 38:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatUnknownTypeGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 39:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
radiusAcctServerStatPktsDroppedGet(&clientHandle, &servAddr, &packetCount);
show_help = 0;
}
break;
case 40:
if (2 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
servAddr.size = sizeof(strAddr);
radiusAcctServerFirstIPHostNameGet(&clientHandle, &servAddr, &serverAddrType);
show_help = 0;
}
break;
case 41:
if (3 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
memset(strNxtAddr, 0, sizeof(strNxtAddr));
servNxtAddr.size = sizeof(strNxtAddr);
radiusAcctServerNextIPHostNameGet(&clientHandle, &servAddr,
&servNxtAddr, &serverAddrType);
show_help = 0;
}
break;
case 42:
if (3 == argc)
{
servType = atoi(argv[2]);
radiusServerGlobalCurentGet(&clientHandle, servType, &servAddr, &serverAddrType);
show_help = 0;
}
break;
case 43:
if (4 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
radiusAccountingHostNameServerPortNumGet(&clientHandle, &servAddr,
serverAddrType, &port);
show_help = 0;
}
break;
case 44:
if (5 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
port = atoi(argv[4]);
radiusAccountingHostNameServerPortNumSet(&clientHandle, &servAddr,
serverAddrType, port);
show_help = 0;
}
break;
case 45:
if (4 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
radiusHostNameServerAddrVerify(&clientHandle, &servAddr,
serverAddrType, &verified);
show_help = 0;
}
break;
case 46:
if (5 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
servConfig = atoi(argv[3]);
keyType = atoi(argv[4]);
radiusHostNameServerSharedSecretKeyTypeSet(&clientHandle, &servAddr, servConfig, keyType);
show_help = 0;
}
break;
case 47:
if (5 == argc)
{
memset(strAddr, 0, sizeof(strAddr));
strncpy(strAddr, argv[2], sizeof(strAddr)-1);
servAddr.size = strlen(strAddr);
serverAddrType = atoi(argv[3]);
memset(strsharedSecret, 0, sizeof(strsharedSecret));
strncpy(strsharedSecret, argv[4], sizeof(strsharedSecret)-1);
sharedSecret.size = sizeof(strsharedSecret);
radiusAccountingHostNameServerSharedSecretSet(&clientHandle, &servAddr,
serverAddrType, &sharedSecret);
show_help = 0;
}
break;
default:
break;
}
}
if (show_help == 1)
{
printAppMenu();
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Stopping %s OpEN API example application", OPENAPI_TITLE);
return 0;
}