daemon/core/emane/emane.py
def distributedctrlnet(self,  ctrlnet):
        ''' Distributed EMANE requires multiple control network prefixes to
            be configured. This generates configuration for slave control nets
            using the default list of prefixes.
        '''
        session = self.session
        if not session.master:
            return  # slave server
        servers = session.broker.getserverlist()
        if len(servers) < 2:
            return  # not distributed
        prefix = session.cfg.get('controlnet')
        prefix = getattr(session.options, 'controlnet', prefix)
        prefixes = prefix.split()
        if len(prefixes) >= len(servers):
            return  # normal Config messaging will distribute controlnets
        # this generates a config message having controlnet prefix assignments
        self.info("Setting up default controlnet prefixes for distributed " \
                  "(%d configured)" % len(prefixes))
        prefixes = ctrlnet.DEFAULT_PREFIX_LIST[0]
        vals = "controlnet='%s'" % prefixes
        tlvdata = ""
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_OBJ,
                                            "session")
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_TYPE, 0)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_VALUES, vals)
        rawmsg = coreapi.CoreConfMessage.pack(0, tlvdata)
        msghdr = rawmsg[:coreapi.CoreMessage.hdrsiz]
        msg = coreapi.CoreConfMessage(flags=0, hdr=msghdr,
                                      data=rawmsg[coreapi.CoreMessage.hdrsiz:])
        self.session.broker.handlemsg(msg)
 Distributed EMANE requires multiple control network prefixes to
            be configured. This generates configuration for slave control nets
            using the default list of prefixes.
        
Distributed EMANE requires multiple control network prefixes to
be configured. This generates configuration for slave control nets
using the default list of prefixes.
Distributed EMANE requires multiple control network prefixes to be configured . This generates configuration for slave control nets using the default list of prefixes .
def distributedctrlnet(self,  ctrlnet):
        session = self.session
        if not session.master:
            return  
        servers = session.broker.getserverlist()
        if len(servers) < 2:
            return  
        prefix = session.cfg.get('controlnet')
        prefix = getattr(session.options, 'controlnet', prefix)
        prefixes = prefix.split()
        if len(prefixes) >= len(servers):
            return  
        self.info("Setting up default controlnet prefixes for distributed " \
                  "(%d configured)" % len(prefixes))
        prefixes = ctrlnet.DEFAULT_PREFIX_LIST[0]
        vals = "controlnet='%s'" % prefixes
        tlvdata = ""
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_OBJ,
                                            "session")
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_TYPE, 0)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_VALUES, vals)
        rawmsg = coreapi.CoreConfMessage.pack(0, tlvdata)
        msghdr = rawmsg[:coreapi.CoreMessage.hdrsiz]
        msg = coreapi.CoreConfMessage(flags=0, hdr=msghdr,
                                      data=rawmsg[coreapi.CoreMessage.hdrsiz:])
        self.session.broker.handlemsg(msg)
def distributedctrlnet ( self , ctrlnet ) : session = self . session if not session . master : return servers = session . broker . getserverlist ( ) if len ( servers ) < 2 : return prefix = session . cfg . get ( 'controlnet' ) prefix = getattr ( session . options , 'controlnet' , prefix ) prefixes = prefix . split ( ) if len ( prefixes ) >= len ( servers ) : return self . info ( "Setting up default controlnet prefixes for distributed " "(%d configured)" % len ( prefixes ) ) prefixes = ctrlnet . DEFAULT_PREFIX_LIST [ 0 ] vals = "controlnet='%s'" % prefixes tlvdata = "" tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_OBJ , "session" ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_TYPE , 0 ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_VALUES , vals ) rawmsg = coreapi . CoreConfMessage . pack ( 0 , tlvdata ) msghdr = rawmsg [ : coreapi . CoreMessage . hdrsiz ] msg = coreapi . CoreConfMessage ( flags = 0 , hdr = msghdr , data = rawmsg [ coreapi . CoreMessage . hdrsiz : ] ) self . session . broker . handlemsg ( msg )
Distributed EMANE requires multiple control network prefixes to
be configured.
Distributed EMANE requires multiple control network prefixes to be configured .
''' Distributed EMANE requires multiple control network prefixes to
            be configured. This generates configuration for slave control nets
            using the default list of prefixes.
        ''' # slave server # not distributed # normal Config messaging will distribute controlnets # this generates a config message having controlnet prefix assignments
self
ctrlnet