mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-11-01 18:04:12 +08:00
Add support for setting pvid to non existant vlans
This commit is contained in:
1 parent
e83ff4d095
commit
69dd977708
1 file changed
+7
-1
+7
-1
@@ -296,6 +296,9 @@ class Handler(SimpleHTTPRequestHandler):
|
|||||||
"pvid": self._parse_pvid
|
"pvid": self._parse_pvid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def newVlan(self, name):
|
||||||
|
return {"active":True, "name":name, "untagged":[], "tagged":[], "pvid":[]}
|
||||||
|
|
||||||
def _parse_vlan(self, pieces):
|
def _parse_vlan(self, pieces):
|
||||||
global state
|
global state
|
||||||
vid = int(pieces[1]);
|
vid = int(pieces[1]);
|
||||||
@@ -307,7 +310,7 @@ class Handler(SimpleHTTPRequestHandler):
|
|||||||
name = pieces[2]
|
name = pieces[2]
|
||||||
startIndex=3
|
startIndex=3
|
||||||
|
|
||||||
state["vlans"][vid] = {"active":True, "name":name, "untagged":[], "tagged":[], "pvid":[]}
|
state["vlans"][vid] = self.newVlan(name)
|
||||||
|
|
||||||
for i in pieces[startIndex:]:
|
for i in pieces[startIndex:]:
|
||||||
if i[-1] == "t":
|
if i[-1] == "t":
|
||||||
@@ -319,7 +322,10 @@ class Handler(SimpleHTTPRequestHandler):
|
|||||||
global state
|
global state
|
||||||
port = int(pieces[1])
|
port = int(pieces[1])
|
||||||
vid = int(pieces[2])
|
vid = int(pieces[2])
|
||||||
|
if(vid in state["vlans"]):
|
||||||
state["vlans"][vid]["pvid"].append(phys_to_log_port[port-1])
|
state["vlans"][vid]["pvid"].append(phys_to_log_port[port-1])
|
||||||
|
else :
|
||||||
|
state["vlans"][vid] = self.newVlan("")
|
||||||
|
|
||||||
def _parse_lldp(self, pieces):
|
def _parse_lldp(self, pieces):
|
||||||
global state
|
global state
|
||||||
|
|||||||
Reference in new issue
Block a user