Esempio n. 1
0
def connectremoteplane(switch,
                       host,
                       hostvlan,
                       remotehost_port,
                       remotehost,
                       remotehost_vlan,
                       remotehwport_tocore,
                       corevlan,
                       gri,
                       meter=3,
                       dobroadcast=False,
                       host_rewitemac = None):
    global default_controller
    hostmac = getdatapaths(host)[0]['mac']
    translated_hostmac = hostmac
    if host_rewitemac != None:
        translated_hostmac = host_rewitemac

    baseid = host['name'] + ":"+str(hostvlan)+"-"+gri.getName()
    if dobroadcast:
        flowid = baseid + "-broadcast-out"
        broadcast = "FF:FF:FF:FF:FF:FF"
    flowid = baseid + "to-remote-host"

    corsaforward (switch,
                  flowid,
                  remotehost_port,
                  hostmac,
                  remotehost_vlan,
                  remotehwport_tocore,
                  translated_hostmac,
                  corevlan,
                  meter,
                  controller=default_controller)
Esempio n. 2
0
def connectdataplane(switch,
                     host,
                     hostport,
                     hostvlan,
                     sw,
                     tohostport,
                     tocoreport,
                     tocorevlan,
                     gri,
                     meter=3,
                     dobroadcast=False,
                     host_rewitemac = None):
    global default_controller
    baseid = host['name'] +":"+hostport+":"+str(hostvlan)+"-"+gri.getName()
    hostmac = getdatapaths(host)[0]['mac']
    translated_hostmac = hostmac
    if host_rewitemac != None:
        translated_hostmac = host_rewitemac
    if dobroadcast:
        broadcast = "FF:FF:FF:FF:FF:FF"
        flowid = baseid + "-broadcast-out"
        corsaforward (switch,
                      flowid,
                      tohostport,
                      broadcast,
                      hostvlan,
                      tocoreport,
                      broadcast,
                      tocorevlan,
                      meter,
                      controller=default_controller)

        flowid = baseid + "-broadcast-in"
        corsaforward (sw,
                      flowid,
                      tocoreport,
                      broadcast,
                      tocorevlan,
                      tohostport,
                      broadcast,
                      hostvlan,
                      meter,
                      controller=default_controller)

    flowid = baseid + "-to-host"
    corsaforward (sw,
                  flowid,
                  tocoreport,
                  translated_hostmac,
                  tocorevlan,
                  tohostport,
                  hostmac,
                  hostvlan,
                  meter,
                  controller=default_controller)