示例#1
0
文件: xinui.py 项目: John-Lin/XinUI
def dpid_policy(dpid):
    sw_dpid_list = Rest.get_switch_list()

    if sw_dpid_list is False or int(dpid) not in sw_dpid_list:
        abort(404)

    flow_table = None
    flow_table = Rest.get_flow_table(dpid)
    global global_flow_table
    global_flow_table = flow_table
    port = Rest.get_switch_port(dpid)

    return render_template("policy.html", sw_dpid_list=sw_dpid_list, dpid=dpid, port=port, flow_table=flow_table)
示例#2
0
def dpid_policy(dpid):
    sw_dpid_list = Rest.get_switch_list()

    if sw_dpid_list is False or int(dpid) not in sw_dpid_list:
        abort(404)

    flow_table = None
    flow_table = Rest.get_flow_table(dpid)
    global global_flow_table
    global_flow_table = flow_table
    port = Rest.get_switch_port(dpid)

    return render_template("policy.html",
                           sw_dpid_list=sw_dpid_list,
                           dpid=dpid,
                           port=port,
                           flow_table=flow_table)
示例#3
0
文件: main.py 项目: O4siang/SDN_GUI
def main():
    print "test"
    sw_desc = Rest.get_switch_desc()
    print sw_desc
    sw_dpid_list = Rest.get_switch_list()
    print sw_dpid_list
    
    #if sw_desc is False  or int(dpid) not in sw_dpid_list:     
     #   sw_desc = "not connected"
    for dpid in sw_dpid_list:
        print dpid
        dpid_t = dpid
        flow_table = None
        flow_table = Rest.get_flow_table(dpid)
        global global_flow_table
        global_flow_table = flow_table
        port = Rest.get_switch_port(dpid)
        print "test"
    return render_template("index.html",sw_desc=sw_desc,dpid=dpid_t, port=port, flow_table=flow_table)
示例#4
0
def query_port():
    dpid = request.args.get("dpid")
    port = Rest.get_switch_port(dpid)

    return jsonify(port)
示例#5
0
文件: xinui.py 项目: John-Lin/XinUI
def query_port():
    dpid = request.args.get("dpid")
    port = Rest.get_switch_port(dpid)

    return jsonify(port)