Esempio n. 1
0
static VOID  halNetInit (VOID)
{
    API_NetInit();                                                      /*  初始化网络系统              */

    /*
     *  初始化网络附加工具
     */
#if LW_CFG_NET_PING_EN > 0
    API_INetPingInit();
    API_INetPing6Init();
#endif                                                                  /*  LW_CFG_NET_PING_EN > 0      */

#if LW_CFG_NET_NETBIOS_EN > 0
    API_INetNetBiosInit();
    API_INetNetBiosNameSet("sylixos");
#endif                                                                  /*  LW_CFG_NET_NETBIOS_EN > 0   */

#if LW_CFG_NET_TFTP_EN > 0
    API_INetTftpServerInit("/tmp");
#endif                                                                  /*  LW_CFG_NET_TFTP_EN > 0      */

#if LW_CFG_NET_FTPD_EN > 0
    API_INetFtpServerInit("/");
#endif                                                                  /*  LW_CFG_NET_FTP_EN > 0       */

#if LW_CFG_NET_TELNET_EN > 0
    API_INetTelnetInit(LW_NULL);
#endif                                                                  /*  LW_CFG_NET_TELNET_EN > 0    */

#if LW_CFG_NET_NAT_EN > 0
    API_INetNatInit();
#endif                                                                  /*  LW_CFG_NET_NAT_EN > 0       */

#if LW_CFG_NET_NPF_EN > 0
    API_INetNpfInit();
#endif                                                                  /*  LW_CFG_NET_NPF_EN > 0       */

#if LW_CFG_NET_VPN_EN > 0
    API_INetVpnInit();
#endif                                                                  /*  LW_CFG_NET_VPN_EN > 0       */
}
Esempio n. 2
0
static int  __inetBiosNameSet (int  iArgC, char  *pcArgV[])
{
    ULONG  ulError;

    if (iArgC == 1) {
        printf("local host NetBIOS name is : %s\n", _G_cNetBiosLocalName);
        return  (ERROR_NONE);
        
    } else if (iArgC == 2) {
        ulError = API_INetNetBiosNameSet(pcArgV[1]);
        if (ulError) {
            fprintf(stderr, "fail. error : %s\n", lib_strerror(errno));
            return  (PX_ERROR);
        } else {
            return  (ERROR_NONE);
        }
        
    } else {
        fprintf(stderr, "argument error.\n");
        return  (PX_ERROR);
    }
}