TCPIP_TELNET_AUTH_HANDLER Type

C

typedef bool (* TCPIP_TELNET_AUTH_HANDLER)(const char* user, const char* password, const TCPIP_TELNET_CONN_INFO* pInfo, const void* hParam);

Description

Telnet authentication callback.

Pointer to a function that will be called by the telnet module when a login operation is ongoing and user authentication needs to be performed.

Preconditions

None.

Members

MembersDescription
userThe user name entered as part of the login process.
passwordThe password entered as part of the login process.
pInfoPointer to a TCPIP_TELNET_CONN_INFO carrying specific connection information to help in the authentication process.
hParamParameter that was passed at the time of the handler registration.

Returns

  • True - If the authentication is successful and the telnet connection should be allowed.

  • False - If the authentication failed and the connection should be aborted.

Remarks

The handler is called in the telnet context. The handler should be kept as short as possible as it shouldn't block.

This is the PREFERRED method of authenticating the telnet connection.

Until the moment the authentication handler is registered any login attempts will fail.

The pInfo will be NULL if the telnet module is initialized with TCPIP_TELNET_AUTHENTICATION_INFO == true.