AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/samples/demo_netxduo_sntp_client.c
UINT kiss_of_death_handler(NX_SNTP_CLIENT *client_ptr, UINT KOD_code)
{

UINT    remove_server_from_list = NX_FALSE;
UINT    status = NX_SUCCESS;

    NX_PARAMETER_NOT_USED(client_ptr);

    /* Handle kiss of death by code group. */
    switch (KOD_code)
    {

        case NX_SNTP_KOD_RATE:
        case NX_SNTP_KOD_NOT_INIT:
        case NX_SNTP_KOD_STEP:

            /* Find another server while this one is temporarily out of service.  */
            status =  NX_SNTP_KOD_SERVER_NOT_AVAILABLE;

        break;

        case NX_SNTP_KOD_AUTH_FAIL:
        case NX_SNTP_KOD_NO_KEY:
        case NX_SNTP_KOD_CRYP_FAIL:

            /* These indicate the server will not service client with time updates
               without successful authentication. */


            remove_server_from_list =  NX_TRUE;

        break;


        default:

            /* All other codes. Remove server before resuming time updates. */

            remove_server_from_list =  NX_TRUE;
        break;
    }

    /* Removing the server from the active server list? */
    if (remove_server_from_list)
    {

        /* Let the caller know it has to bail on this server before resuming service. */
        status = NX_SNTP_KOD_REMOVE_SERVER;
    }

    return status;
}
/* This application defined handler for handling a Kiss of Death packet is not
   required by the SNTP Client. A KOD handler should determine 
   if the Client task should continue vs. abort sending/receiving time data
   from its current time server, and if aborting if it should remove
   the server from its active server list. 

   Note that the KOD list of codes is subject to change. The list
   below is current at the time of this software release. */
This application defined handler for handling a Kiss of Death packet is not
required by the SNTP Client. A KOD handler should determine
if the Client task should continue vs. abort sending/receiving time data
from its current time server, and if aborting if it should remove
the server from its active server list.

Note that the KOD list of codes is subject to change. The list
below is current at the time of this software release.
This application defined handler for handling a Kiss of Death packet is not required by the SNTP Client . A KOD handler should determine if the Client task should continue vs . abort sending / receiving time data from its current time server and if aborting if it should remove the server from its active server list . Note that the KOD list of codes is subject to change . The list below is current at the time of this software release .
UINT kiss_of_death_handler(NX_SNTP_CLIENT *client_ptr, UINT KOD_code)
{
UINT    remove_server_from_list = NX_FALSE;
UINT    status = NX_SUCCESS;
    NX_PARAMETER_NOT_USED(client_ptr);
    switch (KOD_code)
    {
        case NX_SNTP_KOD_RATE:
        case NX_SNTP_KOD_NOT_INIT:
        case NX_SNTP_KOD_STEP:
            status =  NX_SNTP_KOD_SERVER_NOT_AVAILABLE;
        break;
        case NX_SNTP_KOD_AUTH_FAIL:
        case NX_SNTP_KOD_NO_KEY:
        case NX_SNTP_KOD_CRYP_FAIL:
            remove_server_from_list =  NX_TRUE;
        break;
        default:
            remove_server_from_list =  NX_TRUE;
        break;
    }
    if (remove_server_from_list)
    {
        status = NX_SNTP_KOD_REMOVE_SERVER;
    }
    return status;
}
UINT kiss_of_death_handler ( NX_SNTP_CLIENT * client_ptr , UINT KOD_code ) { UINT remove_server_from_list = NX_FALSE ; UINT status = NX_SUCCESS ; NX_PARAMETER_NOT_USED ( client_ptr ) ; switch ( KOD_code ) { case NX_SNTP_KOD_RATE : case NX_SNTP_KOD_NOT_INIT : case NX_SNTP_KOD_STEP : status = NX_SNTP_KOD_SERVER_NOT_AVAILABLE ; break ; case NX_SNTP_KOD_AUTH_FAIL : case NX_SNTP_KOD_NO_KEY : case NX_SNTP_KOD_CRYP_FAIL : remove_server_from_list = NX_TRUE ; break ; default : remove_server_from_list = NX_TRUE ; break ; } if ( remove_server_from_list ) { status = NX_SNTP_KOD_REMOVE_SERVER ; } return status ; }
This application defined handler for handling a Kiss of Death packet is not
required by the SNTP Client.
This application defined handler for handling a Kiss of Death packet is not required by the SNTP Client .
/* Handle kiss of death by code group. */ /* Find another server while this one is temporarily out of service.  */ /* These indicate the server will not service client with time updates
               without successful authentication. */ /* All other codes. Remove server before resuming time updates. */ /* Removing the server from the active server list? */ /* Let the caller know it has to bail on this server before resuming service. */