/*
 *===========================================================================
 *                    ipcom_drv_ppp_create
 *===========================================================================
 * Description:
 * Parameters:
 * Returns:
 *
 */
IP_PUBLIC Ip_err
ipcom_drv_ppp_create(void)
{
    (void)ipcom_sysvar_for_each("ipcom.if.",
                                ipcom_drv_ppp_create_cb,
                                IP_NULL);
    return IPCOM_SUCCESS;
}
Beispiel #2
0
/*
 *===========================================================================
 *                    ipcom_sysvar_unset
 *===========================================================================
 * Description:
 * Parameters:
 * Returns:
 */
IP_PUBLIC Ip_err
ipcom_sysvar_unset(const char *name)
{
    Ipcom_sysvar_entry *sysvar;
    Ip_err              retval;
    Ip_size_t           namelen;
    Ipcom_sysvar_tree   *tree;

    retval = ipcom_once(&ipcom_sysvar_once, ipcom_sysvar_init, IP_NULL);
    if (retval != IPCOM_SUCCESS)
        return retval;

    namelen = ipcom_strlen(name);
    if (name[namelen-1] == '*')
        return ipcom_sysvar_for_each(name, ipcom_sysvar_unset_cb, IP_NULL);

    IPCOM_CODE_LOCK();

    tree = ipcom_sysvar_tree_get(-1);
    if (tree == IP_NULL)
    {
        retval = IPCOM_ERR_NO_MEMORY;
        goto leave;
    }

    retval = IPCOM_ERR_NOT_FOUND;
    sysvar = ipcom_hash_get(tree->sysvars, name);
    if (sysvar)
    {
        if(IP_BIT_ISSET(sysvar->flags, IPCOM_SYSVAR_FLAG_READONLY))
            retval = IPCOM_ERR_READONLY;
        else
        {
            ipcom_sysvar_release(tree, sysvar);
            retval = IPCOM_SUCCESS;
        }
    }

 leave:
    ipcom_sysvar_tree_done(tree);
    IPCOM_CODE_UNLOCK();
    return retval;
}