Ejemplo n.º 1
0
def create_buckets(dp, config):
    LOG.debug('BUCKETS:')
    buckets = []
    '''
    Buckets config is a list
    '''
    LOG.debug('buckets config: %s', config)
    for entry in config:
        LOG.debug('entry: %s ', entry)

        actions = Actions.create_actions(dp, entry['actions'])

        bucket = dp.ofproto_parser.OFPBucket(
            weight=int(entry['weight'], 0),
            watch_port=Utils.get_mod_port(dp, entry['watch_port']),
            watch_group=Utils.get_mod_group(dp, entry['watch_group']),
            actions=actions)
        LOG.debug('bucket: %s', bucket)
        buckets.append(bucket)
        LOG.debug('buckets: %s', buckets)
    return buckets
Ejemplo n.º 2
0
def create_buckets(dp, config):
    LOG.debug('BUCKETS:')
    buckets = []
    '''
    Buckets config is a list
    '''
    LOG.debug('buckets config: %s', config)
    for entry in config:
        LOG.debug('entry: %s ', entry)
        
        actions = Actions.create_actions(dp, entry['actions'])

        bucket = dp.ofproto_parser.OFPBucket(
            weight = int(entry['weight'], 0),
            watch_port = Utils.get_mod_port(dp,entry['watch_port']),
            watch_group = Utils.get_mod_group(dp,entry['watch_group']),
            actions = actions
        ) 
        LOG.debug('bucket: %s', bucket)
        buckets.append(bucket)
        LOG.debug('buckets: %s', buckets)
    return buckets
Ejemplo n.º 3
0
def process_clear(dp, config):
    act_type = dp.ofproto.OFPIT_CLEAR_ACTIONS
    for entry in config:
        actions = Actions.create_actions(dp, entry['actions'])
    return dp.ofproto_parser.OFPInstructionActions(act_type, actions)
Ejemplo n.º 4
0
def process_clear(dp,config):
    act_type = dp.ofproto.OFPIT_CLEAR_ACTIONS
    for entry in config:
        actions = Actions.create_actions(dp, entry['actions'])
    return dp.ofproto_parser.OFPInstructionActions(act_type, actions)