tfPppSetAuthPriority
Table of Contents >> Optional Protocols >> PPP Interface
| #include <trsocket.h> |
| int tfPppSetAuthPriority | ( |
| ttUser8Bit authMethod, | |
| ttUser8Bit priorityValue | |
| ); |
Function Description
This function is used to set priority value for PPP authentication methods. The priority value can be any integer between 1 (with highest priority) and 15 (lowest priority), inclusive. The authenticator will try to negotiate authentication method with the highest priority. If that authentication method is NAK-ed by the peer, it will choose the second one according to the priority value. The less the priority value, the higher priority to use.
The default priority value for the following authentication method is:
| TM_PPP_AUTHMETHOD_EAP | 1 |
| TM_PPP_AUTHMETHOD_MSCHAP_V2 | 2 (not supported yet) |
| TM_PPP_AUTHMETHOD_CHAP | 3 |
| TM_PPP_AUTHMETHOD_PAP | 4 |
| TM_PPP_AUTHMETHOD_MSCHAP_V1 | 5 |
Example
The user prefers the following priority sequence: MSCHAPv1, CHAP, PAP.
To achieve this, the user must call:
tfPppSetAuthPriority(TM_PPP_AUTHMETHOD_MSCHAP_V1, 1); tfPppSetAuthPriority(TM_PPP_AUTHMETHOD_CHAP, 2); tfPppSetAuthPriority(TM_PPP_AUTHMETHOD_PAP, 3);
Parameters
- authMethod
- The auth method to set the priority for. This should be one of the following:
- TM_PPP_AUTHMETHOD_EAP
- TM_PPP_AUTHMETHOD_CHAP
- TM_PPP_AUTHMETHOD_PAP
- TM_PPP_AUTHMETHOD_MSCHAP_V1
- priorityValue
- The desired priority value, 1 (highest priority) thorugh 15 (lowest priority) inclusive.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid parameter.