def configure_request(self, msg):
        ''' Receive configuration message for configuring services.
            With a request flag set, a list of services has been requested.
            When the opaque field is present, a specific service is being
            configured or requested.
        '''
        objname = msg.gettlv(coreapi.CORE_TLV_CONF_OBJ)
        conftype = msg.gettlv(coreapi.CORE_TLV_CONF_TYPE)
        nodenum = msg.gettlv(coreapi.CORE_TLV_CONF_NODE)
        sessionnum = msg.gettlv(coreapi.CORE_TLV_CONF_SESSION)
        opaque = msg.gettlv(coreapi.CORE_TLV_CONF_OPAQUE)

        # send back a list of available services
        if opaque is None:
            global servicelist
            tf = coreapi.CONF_TYPE_FLAGS_NONE
            datatypes = tuple(repeat(coreapi.CONF_DATA_TYPE_BOOL,
                                            len(servicelist)))
            vals = "|".join(repeat('0', len(servicelist)))
            names = map(lambda x: x._name,  servicelist)
            captions = "|".join(names)
            possiblevals = ""
            for s in servicelist:
                if s._custom_needed:
                    possiblevals += '1'
                possiblevals += '|'
            groups = self.buildgroups(servicelist)
        # send back the properties for this service
        else:
            if nodenum is None:
                return None
            n = self.session.obj(nodenum)
            if n is None:
                self.session.warn("Request to configure service %s for " \
                    "unknown node %s" % (svc._name,  nodenum))
                return None
            servicesstring = opaque.split(':')
            services,unknown = self.servicesfromopaque(opaque, n.objid)
            for u in unknown:
                self.session.warn("Request for unknown service '%s'" % u)

            if len(services) < 1:
                return None
            if len(servicesstring) == 3:
                # a file request: e.g. "service:zebra:quagga.conf"
                return self.getservicefile(services, n, servicesstring[2])
            
            # the first service in the list is the one being configured
            svc = services[0]
            # send back:
            # dirs, configs, startindex, startup, shutdown, metadata, config
            tf = coreapi.CONF_TYPE_FLAGS_UPDATE
            datatypes = tuple(repeat(coreapi.CONF_DATA_TYPE_STRING,
                                     len(svc.keys)))
            vals = svc.tovaluelist(n, services)
            captions = None
            possiblevals = None
            groups = None
            
        tlvdata = ""
        if nodenum is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_NODE,
                                                nodenum)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_OBJ,
                                            self._name)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_TYPE, tf)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_DATA_TYPES,
                                            datatypes)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_VALUES,
                                            vals)
        if captions:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_CAPTIONS,
                                                captions)
        if possiblevals:
            tlvdata += coreapi.CoreConfTlv.pack(
                coreapi.CORE_TLV_CONF_POSSIBLE_VALUES, possiblevals)
        if groups:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_GROUPS,
                                                groups)
        if sessionnum is not None:
            tlvdata += coreapi.CoreConfTlv.pack(
                            coreapi.CORE_TLV_CONF_SESSION, sessionnum)
        if opaque:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_OPAQUE,
                                                opaque)
        return coreapi.CoreConfMessage.pack(0, tlvdata)
dataset/ETHPy150Open coreemu/core/daemon/core/service.py/CoreServices.configure_request/original