⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m2pppsecuritytest.c

📁 这是全套的PPP协议的源码
💻 C
📖 第 1 页 / 共 2 页
字号:
            }        else            {            break;            }        }    return OK;    }/***********************************************************************/STATUS pppSecuritySecretsEntryLeafValueShow    (    UINT32 link,    UINT32 idIndex,    UINT32 leafSubIdentifier    )    {    PPP_SECURITY_SECRETS_DIRECTION   direction =                                      PPP_SECURITY_SECRETS_DIRECTION_UNDEFINED;    PPP_SECURITY_PROTOCOL            protocol =                                     PPP_SECURITY_UNDEFINED_PROTOCOL;    char                             identity[256];    char                             secret[256];    PPP_SECURITY_SECRETS_STATUS      status =                                     PPP_SECURITY_SECRETS_STATUS_UNDEFINED;    if  (m2pppSecretsEntryAgentLookup(link, idIndex,                                       &direction,                                       &protocol,                                       identity,                                       secret,                                       &status)         != OK)        {        printf("m2pppSecretsEntryAgentLookup returned ERROR; ");        printf("link = %3d, idIndex = %2d\n", link, idIndex);        return ERROR;        }    else if  (status != PPP_SECURITY_SECRETS_STATUS_VALID)         {        printf("m2pppSecretsEntryAgentLookup invalid: ");        printf("link = %3d, idIndex = %2d\n", link, idIndex);        return ERROR;        }    switch(leafSubIdentifier)        {        case 1:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSLink = ", link);            break;        case 2:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSIdIndex = ", idIndex);            break;        case 3:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSDirection = ", direction);            break;        case 4:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSProtocol = ", protocol);            break;        case 5:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12.12s",                   link, idIndex, leafSubIdentifier,                    "pppSSIdentity = ", identity);            if  (strlen(identity) > 12)                 printf("*\n");            else                printf("\n");            break;        case 6:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12.12s",                   link, idIndex, leafSubIdentifier,                    "pppSSSecret = ", secret);            if  (strlen(identity) > 12)                 printf("*\n");            else                printf("\n");            break;        case 7:            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSStatus = ", status);            break;        default:            printf("invalid leafSubIdentifier: ");            printf("link = %3d, idIndex = %2d, leafSubIdentifier = %2d\n",                   link, idIndex, leafSubIdentifier);            return ERROR;        }    return OK;    }       /***********************************************************************/    STATUS pppSecuritySecretsEntryValuesShow    (    UINT32 link,    UINT32 idIndex    )    {    int     i;    STATUS  auxStatus = OK;    for (i=1; i<8; i++)        {        if  (pppSecuritySecretsEntryLeafValueShow(link, idIndex, i) != OK)            {            auxStatus = ERROR;            }        }    return auxStatus;    }/***********************************************************************/STATUS pppSecurityNextSecretsEntryLeafValueShow    (    UINT32 keyLink,    UINT32 keyIdIndex,    UINT32 leafSubIdentifier    )    {    UINT32 link = keyLink;    UINT32 idIndex = keyIdIndex;    PPP_SECURITY_SECRETS_DIRECTION   direction =                                      PPP_SECURITY_SECRETS_DIRECTION_UNDEFINED;    PPP_SECURITY_PROTOCOL            protocol =                                     PPP_SECURITY_UNDEFINED_PROTOCOL;    char                             identity[256];    char                             secret[256];    PPP_SECURITY_SECRETS_STATUS      status =                                     PPP_SECURITY_SECRETS_STATUS_UNDEFINED;    if  (m2pppNextSecretsEntryAgentLookup(2,                                          &link, &idIndex,                                           &direction,                                           &protocol,                                           identity,                                           secret,                                           &status)         != OK)        {        printf("m2pppNextSecretsEntryAgentLookup returned ERROR; ");        printf("keyLink = %3d, keyIdIndex = %2d\n", keyLink, keyIdIndex);        return ERROR;        }    else if  (status != PPP_SECURITY_SECRETS_STATUS_VALID)         {        printf("m2pppNextSecretsEntryAgentLookup returned NOT valid result");        printf("keyLink = %3d, keyIdIndex = %2d\n", keyLink, keyIdIndex);        return ERROR;        }    switch(leafSubIdentifier)        {        case 1:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSLink = ", link);            break;        case 2:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSIdIndex = ", idIndex);            break;        case 3:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSDirection = ", direction);            break;        case 4:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSProtocol = ", protocol);            break;        case 5:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12.12s",                   link, idIndex, leafSubIdentifier,                    "pppSSIdentity = ", identity);            if  (strlen(identity) > 12)                 printf("*\n");            else                printf("\n");            break;        case 6:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12.12s",                   link, idIndex, leafSubIdentifier,                    "pppSSSecret = ", secret);            if  (strlen(identity) > 12)                 printf("*\n");            else                printf("\n");            break;        case 7:            printf("(%3d, %2d)<: ", keyLink, keyIdIndex);            printf("link = %3d, idIndex = %2d, lsid = %2d, %-16.16s %12d\n",                   link, idIndex, leafSubIdentifier,                    "pppSSStatus = ", status);            break;        default:            printf("invalid leafSubIdentifier: ");            printf("link = %3d, idIndex = %2d, leafSubIdentifier = %2d\n",                   link, idIndex, leafSubIdentifier);            return ERROR;        }    return OK;    }       /***********************************************************************/    STATUS pppSecurityNextSecretsEntryValuesShow    (    UINT32 keyLink,    UINT32 keyIdIndex    )    {    int     i;    STATUS  auxStatus = OK;    for (i=1; i<8; i++)        {        if  (pppSecurityNextSecretsEntryLeafValueShow(keyLink, keyIdIndex, i)              != OK)            {            auxStatus = ERROR;            }        }    return auxStatus;    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -