Debian Codegraph @

networking_l2gw/services/l2gateway/common/ovsdb_schema.py

raw
1 # Copyright (c) 2015 OpenStack Foundation.
2 # All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
15
16
17 class PhysicalLocator:
18 def __init__(self, uuid, dst_ip):
19 self.uuid = uuid
20 self.dst_ip = dst_ip
21
22
23 class PhysicalSwitch:
24 def __init__(self, uuid, name, tunnel_ip, switch_fault_status):
25 self.uuid = uuid
26 self.name = name
27 self.tunnel_ip = tunnel_ip
28 self.switch_fault_status = switch_fault_status
29
30
31 class PhysicalPort:
32 def __init__(self, uuid, name, phys_switch_id, vlan_binding_dicts,
33 port_fault_status):
34 self.uuid = uuid
35 self.name = name
36 self.physical_switch_id = phys_switch_id
37 self.vlan_bindings = []
38 self.port_fault_status = port_fault_status
39 if vlan_binding_dicts:
40 for vlan_binding in vlan_binding_dicts:
41 v_binding = VlanBinding(vlan_binding['vlan'],
42 vlan_binding['logical_switch_uuid'])
43 self.vlan_bindings.append(v_binding)
44
45
46 class LogicalSwitch:
47 def __init__(self, uuid, name, key, description):
48 self.uuid = uuid
49 self.name = name
50 self.key = key
51 self.description = description
52
53
54 class UcastMacsLocal:
55 def __init__(self, uuid, mac, logical_switch_id, physical_locator_id,
56 ip_address):
57 self.uuid = uuid
58 self.mac = mac
59 self.logical_switch_id = logical_switch_id
60 self.physical_locator_id = physical_locator_id
61 self.ip_address = ip_address
62
63
64 class UcastMacsRemote:
65 def __init__(self, uuid, mac, logical_switch_id, physical_locator_id,
66 ip_address):
67 self.uuid = uuid
68 self.mac = mac
69 self.logical_switch_id = logical_switch_id
70 self.physical_locator_id = physical_locator_id
71 self.ip_address = ip_address
72
73
74 class VlanBinding:
75 def __init__(self, vlan, logical_switch_uuid):
76 self.vlan = vlan
77 self.logical_switch_uuid = logical_switch_uuid
78
79
80 class McastMacsLocal:
81 def __init__(self, uuid, mac, logical_switch, locator_set,
82 ip_address):
83 self.uuid = uuid
84 self.mac = mac
85 self.logical_switch_id = logical_switch
86 self.locator_set = locator_set
87 self.ip_address = ip_address
88
89
90 class PhysicalLocatorSet:
91 def __init__(self, uuid, locators):
92 self.uuid = uuid
93 self.locators = locators