Functions

RUNetConf Namespace Reference

Functions

static bool getCoreNodes (cModule *curMod, void *nullPointer)
 Callback method that is used by extractFromNetwork.
static bool getRouterLevelNodes (cModule *curMod, void *name)
 Callback method that is used by extractFromNetwork.

Function Documentation

bool RUNetConf::getCoreNodes ( cModule *  curMod,
void *  nullPointer 
) [static]

Callback method that is used by extractFromNetwork.

This method includes all nodes for which the callback method returns a non-zero value. The second argument is given to the callback method as second argument. Our callback method returns a topology consisting of all core nodes. It does so by searching for the CoreRouter property.

Returns:
Returns 1 for nodes that are included into the topology, 0 for nodes that are ignored

Definition at line 233 of file RUNetworkConfigurator.cc.

Referenced by RUNetworkConfigurator::extractTopology().

{
    //TODO: took some code from ctopology.cc to implement this, check if functionality is correct -Claus
    const char* property = "CoreRouter";
    cProperty *prop = curMod->getProperties()->get(property);
    if (!prop)
        return 0;
    const char *value = prop->getValue(cProperty::DEFAULTKEY, 0);
    return opp_strcmp(value, "false")!=0;
}

bool RUNetConf::getRouterLevelNodes ( cModule *  curMod,
void *  name 
) [static]

Callback method that is used by extractFromNetwork.

This method includes all nodes for which the callback method returns a non-zero value. The second argument is given to the callback method as second argument. Our callback method returns a topology consisting of all router-level nodes (core, gateway, edge, host, and servers) that belong to the given AS. It does so by searching for the RL property within the given AS.

Returns:
Returns 1 for nodes that are included into the topology, 0 for nodes that are ignored

Definition at line 213 of file RUNetworkConfigurator.cc.

Referenced by RUNetworkConfigurator::extractTopology().

{
    char *curName = (char*) name;
    if (curName == NULL)
        opp_error("Error while casting void* name to char*\n");

    string sCurName = curName;
    sCurName += ".";
    string curModPath = curMod->getFullPath();
    if (curModPath.find(sCurName) == string::npos)
        return 0;
    //TODO: took some code from ctopology.cc to implement this, check if functionality is correct -Claus
    const char* property = "RL";
    cProperty *prop = curMod->getProperties()->get(property);
    if (!prop)
        return 0;
    const char *value = prop->getValue(cProperty::DEFAULTKEY, 0);
    return opp_strcmp(value, "false")!=0;
}