This document provides a brief description of the radius OpEN APIs. It provides the following services:
- Add a RADIUS authentication server.
- Remove a RADIUS authentication server
- Set a RADIUS authentication server's port number
- Get a RADIUS authentication server's port number
- Set a RADIUS authentication server's type.
- Get a RADIUS authentication server's type.
- Set the RADIUS attribute 4.
- Clear the RADIUS attribute 4.
- Get the RADIUS attribute 4.
- Set the RADIUS shared secret specified in encrypted format (128 hexadecimal digits).
- Gets the number of configured servers of specified type (Auth or Acct).
- Gets the maximum number of retransmissions parameter.
- Sets the maximum number of retransmissions parameter.
- Gets the value of time-out duration parameter.
- Sets the time-out duration parameter.
- Gets radius-accounting mode parameter.
- Sets radius-accounting mode parameter.
- Gets first configured server.
- Get the configured server next in the list after the specified server.
- Get the server Name of specified radius server.
- Gets global selected radius server address and address type.
- Sets server name attribute to the Auth server.
- Set the radius authentication server type.
- Gets server Name of specified radius server.
- Get the round trip time.
- Retrieve the number of RADIUS access-request packets sent to requested server.
- Retrieve the number of RADIUS access-request packets retransmitted to requested server.
- Retrieve the number of RADIUS access-request packets received from requested server.
- Retrieve the number of RADIUS access-reject packets received from requested server.
- Retrieve the number of RADIUS access-challenge packets received from requested server.
- Retrieve the number of malformed RADIUS access-response packets received from requested server.
- Retrieve the number of RADIUS access-response bad auth packets received from requested server.
- Retrieve the number of RADIUS access-request packets destined for this server that have not yet timed out or received a response from this serverreceived from requested server.
- Retrieve the number of authentication time-outs to requested server.
- Retrieve the number of RADIUS packets of unknown type received from requested server on the authentication port.
- Retrieve the number of RADIUS packets received from server on the authentication port that were dropped for some other reason.
- Gets server name of specified accounting server.
- Verify a RADIUS accounting server is a configured server.
- Gets server name of specified accounting server.
- Get the round trip time.
- Retrieve the number of RADIUS accounting-request packets sent to requested server.
- Retrieve the number of RADIUS accounting-request packets retransmitted to requested server.
- Retrieve the number of RADIUS accounting-response packets received from requested server.
- Retrieve the number of malformed RADIUS accounting-response packets received from requested server.
- Retrieve the number of RADIUS accounting-response bad auth packets received from requested server.
- 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.
- Retrieve the number of accounting time-outs to requested server.
- Retrieve the number of RADIUS packets of unknown type received from requested server on the accounting port.
- Retrieve the number of RADIUS packets received from server on the accounting port that were dropped for some other reason.
- Gets first accounting configured server.
- Gets global selected Radius server address, server type and address type.
- Get the configured accounting server next in the list after the specified server.
- Get the port number of the accounting server being used.
- Sets the port number of the accounting server being used.
- Verify a RADIUS authentication server is a configured server.
- Set the shared secret being used between the radius client and the radius server.
- Set the shared secret being used between the radius client and the accounting server.
Example C Application radius_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
radius_example
radius_example.c is a sample application that demonstrates the use of OpEN's radius APIs. radius_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: radius_example <test#> <arg1> <arg2> ...
- 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.
- Usage: In below, <serverType> should be set to 1 for OPEN_RADIUS_SERVER_TYPE_AUTH and 2 for OPEN_RADIUS_SERVER_TYPE_ACCT.
- 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.
- Usage: In below, <serverConfig> should be set to 0 for OPEN_RADIUSGLOBAL and 1 for OPEN_RADIUSLOCAL.
- Usage: In below, <maxRetransmit> should be set in the range of 1 - 15.
- Usage: In below, <timeOut> should be set in the range of 1 - 30.
- Usage: In below, <mode> should be set to 0 for OPEN_DISABLE and 1 for OPEN_ENABLE.
- Usage: In below, <keyType> should be set to 0 for OPEN_FALSE and 1 for OPEN_TRUE.
- Test 0: Add a RADIUS authentication server: radius_example 0 <ipaddr|hostname> ip|dns <serverName>
- Test 1: Remove a RADIUS authentication server: radius_example 1 <ipaddr|hostname> ip|dns
- Test 2: Set a RADIUS authentication server's port number: radius_example 2 <ipaddr|hostname> ip|dns <port>
- Test 3: Get a RADIUS authentication server's port number: radius_example 3 <ipaddr|hostname> ip|dns
- Test 4: Set a RADIUS authentication server's type: radius_example 4 <ipaddr|hostname> ip|dns primary|secondary
- Test 5: Get a RADIUS authentication server's type: radius_example 5 <ipaddr|hostname> ip|dns
- Test 6: Set the RADIUS attribute 4: radius_example 6 <ipAddr>
- Test 7: Clear the RADIUS attribute 4: radius_example 7
- Test 8: Get the RADIUS attribute 4: radius_example 8
- Test 9: Set the RADIUS shared secret specified in encrypted format (128 hexadecimal digits): radius_example 9 <ipaddr|hostname> <secret>
- Test 10: Run API sanity checks: radius_example 10
- Test 11: Gets the number of configured servers of specified type (Auth or Acct): radius_example 11 <serverType>
- Test 12: Gets the maximum number of retransmissions parameter: radius_example 12 <pHostAddr>
- Test 13: Sets the maximum number of retransmissions parameter: radius_example 13 <pHostAddr><maxRetransmit><serverConfig>
- Test 14: Gets the value of time-out duration parameter: radius_example 14 <pHostAddr>
- Test 15: Sets the time-out duration parameter: radius_example 15 <pHostAddr><timeOut><serverConfig>
- Test 16: Gets radius-accounting mode parameter: radius_example 16
- Test 17: Sets radius-accounting mode parameter: radius_example 17 <mode>
- Test 18: Gets first configured server: radius_example 18
- Test 19: Get the configured server next in the list after the specified server: radius_example 19 <pCurServerAddr>
- Test 20: Get the server Name of specified radius server: radius_example 20 <pServerAddr><serverAddrType>
- Test 21: Gets global selected radius server address and address type: radius_example 21
- Test 22: Sets server name attribute to the Auth server: radius_example 22 <pServerAddr><serverAddrType><pServerName>
- Test 23: Set the radius authentication server type: radius_example 23 <pServerAddr><serverAddrType><serverEntryType>
- Test 24: Gets server Name of specified radius server: radius_example 24 <pServerName>
- Test 25: Get the round trip time: radius_example 25 <pHostAddr>
- Test 26: Retrieve the number of RADIUS access-request packets sent to requested server: radius_example 26 <pHostAddr>
- Test 27: Retrieve the number of RADIUS access-request packets retransmitted to requested server: radius_example 27 <pHostAddr>
- Test 28: Retrieve the number of RADIUS access-request packets received from requested server: radius_example 28 <pHostAddr>
- Test 29: Retrieve the number of RADIUS access-reject packets received from requested server: radius_example 29 <pHostAddr>
- Test 30: Retrieve the number of RADIUS access-challenge packets received from requested server: radius_example 30 <pHostAddr>
- Test 31: Retrieve the number of malformed RADIUS access-response packets received from requested server: radius_example 31 <pHostAddr>
- Test 32: Retrieve the number of RADIUS access-response bad auth packets received from requested server: radius_example 32 <pHostAddr>
- Test 33: Retrieve the number of RADIUS access-request packets destined for this server that have not yet timed out or received a response from this serverreceived from requested server: radius_example 33 <pHostAddr><pPacketCount>
- Test 34: Retrieve the number of authentication time-outs to requested server: radius_example 34 <pHostAddr>
- Test 35: Retrieve the number of RADIUS packets of unknown type received from requested server on the authentication port: radius_example 35 <pHostAddr>
- Test 36: Retrieve the number of RADIUS packets received from server on the authentication port that were dropped for some other reason: radius_example 36 <pHostAddr>
- Test 37: Gets server details of specified accounting server EXAMPLE_APP_NAME: radius_example 37 <pServerName>
- Test 38: Verify a RADIUS accounting server is a configured server: radius_example 38 <pServerAddr><serverAddrType>
- Test 39: Gets server EXAMPLE_APP_NAME of specified accounting server: radius_example 39 <pServerAddr><serverAddrType>
- Test 40: Get the round trip time: radius_example 40 <pHostAddr>
- Test 41: Retrieve the number of RADIUS accounting-request packets sent to requested server: radius_example 41 <pHostAddr>
- Test 42: Retrieve the number of RADIUS accounting-request packets retransmitted to requested server: radius_example 42 <pHostAddr>
- Test 43: Retrieve the number of RADIUS accounting-response packets received from requested server: radius_example 43 <pHostAddr>
- Test 44: Retrieve the number of malformed RADIUS accounting-response packets received from requested server: radius_example 44 <pHostAddr>
- Test 45: Retrieve the number of RADIUS accounting-response bad auth packets received from requested server: radius_example 45 <pHostAddr>
- Test 46: 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: radius_example 46 <pHostAddr>
- Test 47: Retrieve the number of accounting time-outs to requested server: radius_example 47 <pHostAddr>
- Test 48: Retrieve the number of RADIUS packets of unknown type received from requested server on the accounting port: radius_example 48 <pHostAddr>
- Test 49: Retrieve the number of RADIUS packets received from server on the accounting port that were dropped for some other reason: radius_example 49 <pHostAddr>
- Test 50: Gets first accounting configured server: radius_example 50
- Test 51: Get the configured accounting server next in the list after the specified server: radius_example 51 <pCurServerAddr>
- Test 52: Gets global selected Radius server address, server type and address type: radius_example 52 <servType>
- Test 53: Get the port number of the accounting server being used: radius_example 53 <pServerAddr><serverAddrType>
- Test 54: Sets the port number of the accounting server being used: radius_example 54 <pServerAddr><serverAddrType><port>
- Test 55: Verify a RADIUS authentication server is a configured server: radius_example 55 <pServerAddr><serverAddrType>
- Test 56: Set the shared secret being used between the radius client and the radius server: radius_example 56 <pServerAddr><serverConfig><keyType>
- Test 57: Set the shared secret being used between the radius client and the accounting server: radius_example 57 <pServerAddr><serverAddrType><pSharedSecret>
radius CLI/API Cross Reference