daemon/core/services/nrl.py
def generateconfig(cls, node, filename, services):
        ''' Generate a startup script for SMF. Because nrlsmf does not
        daemonize, it can cause problems in some situations when launched
        directly using vcmd.
        '''
        cfg = "#!/bin/sh\n"
        cfg += "# auto-generated by nrl.py:NrlSmf.generateconfig()\n"
        comments = ""
        cmd = "nrlsmf instance %s_smf" % (node.name)

        servicenames = map(lambda x: x._name,  services)
        netifs = filter(lambda x: not getattr(x, 'control', False), \
                        node.netifs())
        if len(netifs) == 0:
            return ()
                        
        if "arouted" in servicenames:
            comments += "# arouted service is enabled\n"
            cmd += " tap %s_tap" % (node.name,)
            cmd += " unicast %s" % cls.firstipv4prefix(node, 24)
            cmd += " push lo,%s resequence on" % netifs[0].name
        if len(netifs) > 0:
            if "NHDP" in servicenames:
                comments += "# NHDP service is enabled\n"
                cmd += " ecds "
            elif "OLSR" in servicenames:
                comments += "# OLSR service is enabled\n"
                cmd += " smpr "
            else:
                cmd += " cf "
            interfacenames = map(lambda x: x.name,  netifs)
            cmd += ",".join(interfacenames)
            
        cmd += " hash MD5"
        cmd += " log /var/log/nrlsmf.log"

        cfg += comments + cmd + " < /dev/null > /dev/null 2>&1 &\n\n"
        return cfg
 Generate a startup script for SMF. Because nrlsmf does not
        daemonize, it can cause problems in some situations when launched
        directly using vcmd.
        
Generate a startup script for SMF. Because nrlsmf does not
daemonize, it can cause problems in some situations when launched
directly using vcmd.
Generate a startup script for SMF . Because nrlsmf does not daemonize it can cause problems in some situations when launched directly using vcmd .
def generateconfig(cls, node, filename, services):
        cfg = "#!/bin/sh\n"
        cfg += "# auto-generated by nrl.py:NrlSmf.generateconfig()\n"
        comments = ""
        cmd = "nrlsmf instance %s_smf" % (node.name)
        servicenames = map(lambda x: x._name,  services)
        netifs = filter(lambda x: not getattr(x, 'control', False), \
                        node.netifs())
        if len(netifs) == 0:
            return ()
        if "arouted" in servicenames:
            comments += "# arouted service is enabled\n"
            cmd += " tap %s_tap" % (node.name,)
            cmd += " unicast %s" % cls.firstipv4prefix(node, 24)
            cmd += " push lo,%s resequence on" % netifs[0].name
        if len(netifs) > 0:
            if "NHDP" in servicenames:
                comments += "# NHDP service is enabled\n"
                cmd += " ecds "
            elif "OLSR" in servicenames:
                comments += "# OLSR service is enabled\n"
                cmd += " smpr "
            else:
                cmd += " cf "
            interfacenames = map(lambda x: x.name,  netifs)
            cmd += ",".join(interfacenames)
        cmd += " hash MD5"
        cmd += " log /var/log/nrlsmf.log"
        cfg += comments + cmd + " < /dev/null > /dev/null 2>&1 &\n\n"
        return cfg
def generateconfig ( cls , node , filename , services ) : cfg = "#!/bin/sh\n" cfg += "# auto-generated by nrl.py:NrlSmf.generateconfig()\n" comments = "" cmd = "nrlsmf instance %s_smf" % ( node . name ) servicenames = map ( lambda x : x . _name , services ) netifs = filter ( lambda x : not getattr ( x , 'control' , False ) , node . netifs ( ) ) if len ( netifs ) == 0 : return ( ) if "arouted" in servicenames : comments += "# arouted service is enabled\n" cmd += " tap %s_tap" % ( node . name , ) cmd += " unicast %s" % cls . firstipv4prefix ( node , 24 ) cmd += " push lo,%s resequence on" % netifs [ 0 ] . name if len ( netifs ) > 0 : if "NHDP" in servicenames : comments += "# NHDP service is enabled\n" cmd += " ecds " elif "OLSR" in servicenames : comments += "# OLSR service is enabled\n" cmd += " smpr " else : cmd += " cf " interfacenames = map ( lambda x : x . name , netifs ) cmd += "," . join ( interfacenames ) cmd += " hash MD5" cmd += " log /var/log/nrlsmf.log" cfg += comments + cmd + " < /dev/null > /dev/null 2>&1 &\n\n" return cfg
Generate a startup script for SMF.
Generate a startup script for SMF .
''' Generate a startup script for SMF. Because nrlsmf does not
        daemonize, it can cause problems in some situations when launched
        directly using vcmd.
        '''
cls
node
filename
services