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

📄 bootplib.c

📁 VxWorks BSP框架源代码包含头文件和驱动
💻 C
📖 第 1 页 / 共 5 页
字号:
        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_NBDD_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->nbddServers->num < number) ?                     pBootpParams->nbddServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->nbddServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->nbddServers->num = limit;        }        /* Retrieve value for NetBIOS Node Type option. */    if (pBootpParams->nbNodeType != NULL)        {        length = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_NB_NODETYPE, &length);        if (cp != NULL)            *pBootpParams->nbNodeType = *cp;        else            *pBootpParams->nbNodeType = 0;        }        /* Retrieve NetBIOS scope. */    if (pBootpParams->nbScope != NULL)        {        length = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_NB_SCOPE, &length);        if (cp != NULL)            {            bcopy ( (char *)cp, pBootpParams->nbScope, length);            pBootpParams->nbScope [length] = EOS;            }        else            pBootpParams->nbScope[0] = EOS;        }        /* Retrieve IP addresses of X Window font servers. */    if (pBootpParams->xFontServers != NULL &&         pBootpParams->xFontServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_XFONT_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->xFontServers->num < number) ?                     pBootpParams->xFontServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->xFontServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->xFontServers->num = limit;        }        /* Retrieve IP addresses of X Window Display Manager systems. */    if (pBootpParams->xDisplayManagers != NULL &&         pBootpParams->xDisplayManagers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_XDISPLAY_MANAGER,                            &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->xDisplayManagers->num < number) ?                     pBootpParams->xDisplayManagers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->xDisplayManagers->addrlist[loop],                       sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->xDisplayManagers->num = limit;        }        /* Retrieve NIS+ domain name. */    if (pBootpParams->nispDomain != NULL)        {        length = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_NISP_DOMAIN, &length);        if (cp != NULL)            {            bcopy ( (char *)cp, pBootpParams->nispDomain, length);            pBootpParams->nispDomain [length] = EOS;            }        else            pBootpParams->nispDomain[0] = EOS;        }        /* Retrieve IP addresses of NIS+ servers. */    if (pBootpParams->nispServers != NULL &&         pBootpParams->nispServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_NISP_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->nispServers->num < number) ?                     pBootpParams->nispServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->nispServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->nispServers->num = limit;        }        /* Retrieve IP addresses of Mobile IP Home Agents. */    if (pBootpParams->ipAgents != NULL &&         pBootpParams->ipAgents->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_MOBILEIP_HA, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->ipAgents->num < number) ?                     pBootpParams->ipAgents->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->ipAgents->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->ipAgents->num = limit;        }        /* Retrieve IP addresses of SMTP servers. */    if (pBootpParams->smtpServers != NULL &&         pBootpParams->smtpServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_SMTP_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->smtpServers->num < number) ?                     pBootpParams->smtpServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->smtpServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->smtpServers->num = limit;        }        /* Retrieve IP addresses of POP3 servers. */    if (pBootpParams->pop3Servers != NULL &&         pBootpParams->pop3Servers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_POP3_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->pop3Servers->num < number) ?                     pBootpParams->pop3Servers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->pop3Servers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->pop3Servers->num = limit;        }        /* Retrieve IP addresses of NNTP servers. */    if (pBootpParams->nntpServers != NULL &&         pBootpParams->nntpServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_NNTP_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->nntpServers->num < number) ?                     pBootpParams->nntpServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->nntpServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->nntpServers->num = limit;        }        /* Retrieve IP addresses of World Wide Web servers. */    if (pBootpParams->wwwServers != NULL &&         pBootpParams->wwwServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_WWW_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->wwwServers->num < number) ?                     pBootpParams->wwwServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->wwwServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->wwwServers->num = limit;        }        /* Retrieve IP addresses of finger servers. */    if (pBootpParams->fingerServers != NULL &&         pBootpParams->fingerServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_FINGER_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->fingerServers->num < number) ?                     pBootpParams->fingerServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->fingerServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->fingerServers->num = limit;        }        /* Retrieve IP addresses of Internet Relay Chat servers. */    if (pBootpParams->ircServers != NULL &&         pBootpParams->ircServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_IRC_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->ircServers->num < number) ?                     pBootpParams->ircServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->ircServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->ircServers->num = limit;        }        /* Retrieve IP addresses of StreetTalk servers. */    if (pBootpParams->stServers != NULL &&         pBootpParams->stServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_ST_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->stServers->num < number) ?                     pBootpParams->stServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->stServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->stServers->num = limit;        }        /* Retrieve IP addresses of STDA servers. */    if (pBootpParams->stdaServers != NULL &&         pBootpParams->stdaServers->addrlist != NULL)        {        length = 0;        limit = 0;        cp = bootpTagFind (pBootpReply->bp_vend, TAG_STDA_SERVER, &length);        if (cp != NULL)            {            number = length / sizeof (struct in_addr);            limit = (pBootpParams->stdaServers->num < number) ?                     pBootpParams->stdaServers->num : number;            for (loop = 0; loop < limit; loop++)                {                bcopy ( (char *)cp,                       (char *)&pBootpParams->stdaServers->addrlist[loop],                        sizeof (struct in_addr));                cp += sizeof (struct in_addr);                }            }        pBootpParams->stdaServers->num = limit;        }    return;    }/******************************************************************************** bootpMsgGet - send a BOOTP request message and retrieve reply** This routine sends a BOOTP request using the network interface* specified by <pIf> and waits for any reply. The <pIpDest> argument* specifies the destination IP address.  It must be equal to either* the broadcast address (255.255.255.255) or the IP address of a specific* BOOTP server which is directly reachable using the given network interface.* The given interface must support broadcasting in the first case.** The <srcPort> and <dstPort> arguments support sending and receiving * BOOTP messages with arbitrary UDP ports. To receive replies, any BOOTP* server must send those responses to the source port from the request.*

⌨️ 快捷键说明

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