ANSC_STATUS
BbhmDiagnsStopDiag
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus        = ANSC_STATUS_SUCCESS;
    PBBHM_DIAG_NS_LOOKUP_OBJECT     pMyObject           = (PBBHM_DIAG_NS_LOOKUP_OBJECT  )hThisObject;

    if ( !(pMyObject->CheckCanStart((ANSC_HANDLE)pMyObject)))
    {
        returnStatus = pMyObject->SetControl((ANSC_HANDLE)pMyObject, BBHM_NS_LOOKUP_CONTROL_STOP);

        return  returnStatus;
    }
    return  ANSC_STATUS_SUCCESS;
}
ANSC_STATUS
BbhmDiagnsStartDiag
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus        = ANSC_STATUS_SUCCESS;
    PBBHM_DIAG_NS_LOOKUP_OBJECT     pMyObject           = (PBBHM_DIAG_NS_LOOKUP_OBJECT)hThisObject;
    PDSLH_NSLOOKUP_INFO             pDiagInfo           = (PDSLH_NSLOOKUP_INFO)pMyObject->hDslhDiagInfo;
    PBBHM_NS_LOOKUP_PROPERTY        pProperty           = (PBBHM_NS_LOOKUP_PROPERTY   )&pMyObject->Property;

    if ( pDiagInfo->bForced != FALSE )
    {
        if ( !(pMyObject->CheckCanStart((ANSC_HANDLE)pMyObject)))
        {
            returnStatus = pMyObject->SetControl((ANSC_HANDLE)pMyObject, BBHM_NS_LOOKUP_CONTROL_STOP);
        }
        pMyObject->ResetProperty    ((ANSC_HANDLE)pMyObject);

        if ( pMyObject->SetDstIp    ((ANSC_HANDLE)pMyObject, pDiagInfo->DNSServer) == ANSC_STATUS_SUCCESS)
        {
            pMyObject->SetNumPkts   ((ANSC_HANDLE)pMyObject, pDiagInfo->NumberOfRepetitions);
            pMyObject->SetSrcIp     ((ANSC_HANDLE)pMyObject, pDiagInfo->IfAddr );
            pMyObject->SetTimeOut   ((ANSC_HANDLE)pMyObject, pDiagInfo->Timeout);

            pMyObject->Open         (pMyObject);
            pMyObject->SetControl   ((ANSC_HANDLE)pMyObject, BBHM_NS_LOOKUP_CONTROL_START);
            BbhmDiageoStartDiag     ((ANSC_HANDLE)pMyObject);
        }
        else
        {
            pDiagInfo->DiagnosticState = DSLH_DIAG_STATE_TYPE_Error_NSLookup_DNSServer;
        }
        return ANSC_STATUS_SUCCESS;
    }
    else
    {
        if ( pMyObject->CheckCanStart   ((ANSC_HANDLE)pMyObject) )
        {
            pMyObject->ResetProperty    ((ANSC_HANDLE)pMyObject);

            if ( pMyObject->SetDstIp    ((ANSC_HANDLE)pMyObject, pDiagInfo->DNSServer) == ANSC_STATUS_SUCCESS)
            {
                pMyObject->SetNumPkts   ((ANSC_HANDLE)pMyObject, pDiagInfo->NumberOfRepetitions);
                pMyObject->SetSrcIp     ((ANSC_HANDLE)pMyObject, pDiagInfo->IfAddr );
                pMyObject->SetTimeOut   ((ANSC_HANDLE)pMyObject, pDiagInfo->Timeout);

                pMyObject->Open         ((ANSC_HANDLE)pMyObject);
                pMyObject->SetControl   ((ANSC_HANDLE)pMyObject, BBHM_NS_LOOKUP_CONTROL_START);
                BbhmDiageoStartDiag     ((ANSC_HANDLE)pMyObject);
            }
            else
            {
                pDiagInfo->DiagnosticState = DSLH_DIAG_STATE_TYPE_Error_NSLookup_DNSServer;
            }
            return ANSC_STATUS_SUCCESS;
        }
        else
        {
            AnscTraceFlow(("BbhmDiagnsStartDiag -- query task is already running...\n"));

            return  ANSC_STATUS_PENDING;
        }
    }
}