コード例 #1
0
ファイル: relocate.py プロジェクト: andreiw/xen3-arm-tegra
def listenRelocation():
    xroot = XendRoot.instance()
    if xroot.get_xend_unix_server():
        path = '/var/lib/xend/relocation-socket'
        unix.UnixListener(path, RelocationProtocol)
    if xroot.get_xend_relocation_server():
        port = xroot.get_xend_relocation_port()
        interface = xroot.get_xend_relocation_address()

        hosts_allow = xroot.get_xend_relocation_hosts_allow()
        if hosts_allow == '':
            hosts_allow = None
        else:
            hosts_allow = map(re.compile, hosts_allow.split(" "))

        tcp.TCPListener(RelocationProtocol, port, interface = interface,
                        hosts_allow = hosts_allow)
コード例 #2
0
ファイル: netif.py プロジェクト: andreiw/xen3-arm-tegra

"""Support for virtual network interfaces.
"""

import os
import random
import re

from xen.xend import sxp
from xen.xend import XendRoot

from xen.xend.server.DevController import DevController


xroot = XendRoot.instance()


def randomMAC():
    """Generate a random MAC address.

    Uses OUI (Organizationally Unique Identifier) 00-16-3E, allocated to
    Xensource, Inc. The OUI list is available at
    http://standards.ieee.org/regauth/oui/oui.txt.

    The remaining 3 fields are random, with the first bit of the first
    random field set 0.

    @return: MAC address string
    """
    mac = [ 0x00, 0x16, 0x3e,
コード例 #3
0
ファイル: netif.py プロジェクト: bjzhang/xen_arm_pv
# Copyright (C) 2004, 2005 Mike Wray <*****@*****.**>
# Copyright (C) 2005 XenSource Ltd
#============================================================================
"""Support for virtual network interfaces.
"""

import os
import random
import re

from xen.xend import sxp
from xen.xend import XendRoot

from xen.xend.server.DevController import DevController

xroot = XendRoot.instance()


def randomMAC():
    """Generate a random MAC address.

    Uses OUI (Organizationally Unique Identifier) 00-16-3E, allocated to
    Xensource, Inc. The OUI list is available at
    http://standards.ieee.org/regauth/oui/oui.txt.

    The remaining 3 fields are random, with the first bit of the first
    random field set 0.

    @return: MAC address string
    """
    mac = [