Exemplo n.º 1
0
UINT32 cnetcard_clean(CNETCARD *cnetcard)
{
    cstring_clean(CNETCARD_NAME(cnetcard));
    cstring_clean(CNETCARD_IPV4STR(cnetcard));
    cstring_clean(CNETCARD_MACSTR(cnetcard));
    BSET(CNETCARD_MACADDR(cnetcard), 0, 6);
    CNETCARD_IPV4VAL(cnetcard) = 0;
    CNETCARD_STATE(cnetcard)   = CNETCARD_ERR_STATE;

    return (0);
}
Exemplo n.º 2
0
EC_BOOL chfsnp_mgr_load(CHFSNP_MGR *chfsnp_mgr, const CSTRING *chfsnp_db_root_dir)
{
    cstring_clean(CHFSNP_MGR_DB_ROOT_DIR(chfsnp_mgr));
    cstring_clone(chfsnp_db_root_dir, CHFSNP_MGR_DB_ROOT_DIR(chfsnp_mgr));

    if(EC_FALSE == chfsnp_mgr_load_db(chfsnp_mgr))
    {
        sys_log(LOGSTDOUT, "error:chfsnp_mgr_load: load cfg db failed from dir %s\n", (char *)cstring_get_str(chfsnp_db_root_dir));
        return (EC_FALSE);
    }

    return (EC_TRUE);
}
Exemplo n.º 3
0
EC_BOOL chfsnp_mgr_clean(CHFSNP_MGR *chfsnp_mgr)
{
    CHFSNP_MGR_CRWLOCK_CLEAN(chfsnp_mgr, LOC_CHFSNPMGR_0006);
    CHFSNP_MGR_CMUTEX_CLEAN(chfsnp_mgr, LOC_CHFSNPMGR_0007);
    
    cstring_clean(CHFSNP_MGR_DB_ROOT_DIR(chfsnp_mgr));    

    CHFSNP_MGR_NP_MODEL(chfsnp_mgr) = CHFSNP_ERR_MODEL;
    CHFSNP_MGR_NP_1ST_CHASH_ALGO_ID(chfsnp_mgr) = (uint8_t)CHASH_ERR_ALGO_ID;
    CHFSNP_MGR_NP_2ND_CHASH_ALGO_ID(chfsnp_mgr) = (uint8_t)CHASH_ERR_ALGO_ID;
    CHFSNP_MGR_NP_ITEM_MAX_NUM(chfsnp_mgr)      = 0;
    CHFSNP_MGR_NP_MAX_NUM(chfsnp_mgr)           = 0;

    cvector_clean(CHFSNP_MGR_NP_HOME_DIR_VEC(chfsnp_mgr), (CVECTOR_DATA_CLEANER)cstring_free, LOC_CHFSNPMGR_0008);
    cvector_clean(CHFSNP_MGR_NP_VEC(chfsnp_mgr), (CVECTOR_DATA_CLEANER)chfsnp_free, LOC_CHFSNPMGR_0009);       

    return (EC_TRUE);
}