コード例 #1
0
ファイル: vlans.py プロジェクト: fp7-alien/C-BAS
def create_simple_slice_vlan_based(vlan_tag, slice):
    #create a simple flowspacerule containing only the vlans tags and the OF ports
    newfsrule = FlowSpaceRule(vlan_id_start=vlan_tag, vlan_id_end=vlan_tag)
    newfsrule.save()
    #attached ports
    for ofsliver in OpenFlowInterfaceSliver.objects.filter(slice=slice).distinct():
        newfsrule.slivers.add(ofsliver)
    newfsrule.save()  
コード例 #2
0
def create_slice_with_vlan_range(slice, vlan_range):
    if not isinstance(vlan_range,list):
         vlan_range = [vlan_range]
    #create a simple flowspacerule containing only the vlans tags and the OF ports
    newfsrule = FlowSpaceRule(vlan_id_start=vlan_range[0], vlan_id_end=vlan_range[-1])
    newfsrule.save()
    #attached ports
    for ofsliver in OpenFlowInterfaceSliver.objects.filter(slice=slice).distinct():
        newfsrule.slivers.add(ofsliver)
    newfsrule.save()
コード例 #3
0
def create_simple_slice_vlan_based(vlan_tag, slice):
    #create a simple flowspacerule containing only the vlans tags and the OF ports
    newfsrule = FlowSpaceRule(vlan_id_start=vlan_tag, vlan_id_end=vlan_tag)
    newfsrule.save()
    #attached ports
    for ofsliver in OpenFlowInterfaceSliver.objects.filter(
            slice=slice).distinct():
        newfsrule.slivers.add(ofsliver)
    newfsrule.save()
コード例 #4
0
ファイル: utils.py プロジェクト: pentikousis/C-BAS-framework
def create_slice_with_vlan_range(slice, vlan_range):
    if not isinstance(vlan_range, list):
        vlan_range = [vlan_range]
    #create a simple flowspacerule containing only the vlans tags and the OF ports
    newfsrule = FlowSpaceRule(vlan_id_start=vlan_range[0],
                              vlan_id_end=vlan_range[-1])
    newfsrule.save()
    #attached ports
    for ofsliver in OpenFlowInterfaceSliver.objects.filter(
            slice=slice).distinct():
        newfsrule.slivers.add(ofsliver)
    newfsrule.save()