# Global parameters
MAXTCPBUF = 16777216
-DEFAULT_TCPBUF = 8388608
-DEFAULT_PORT = 988
#
# Maximum number of devices to search for.
# (the /dev/loop* nodes need to be created beforehand)
def __init__(self, port, net_type):
DaemonHandler.__init__(self, "acceptor")
self.port = port
+ self.net_type = net_type
self.flags = ''
def pidfile(self):
return
for port in acceptors.keys():
daemon = acceptors[port]
- if not daemon.running():
+ if daemon.net_type == 'tcp' and not daemon.running():
daemon.start()
def run_one_acceptor(port):
return
if acceptors.has_key(port):
daemon = acceptors[port]
- if not daemon.running():
+ if daemon.net_type == 'tcp' and not daemon.running():
daemon.start()
else:
panic("run_one_acceptor: No acceptor defined for port:", port)
def stop_acceptor(port):
if acceptors.has_key(port):
daemon = acceptors[port]
- if daemon.running():
+ if daemon.net_type == 'tcp' and daemon.running():
daemon.stop()
self.run(cmds)
def add_peer(self, net_type, nid, hostaddr, port):
- if net_type in ('tcp','ra') and not config.lctl_dump:
+ if net_type in ('tcp','openib','ra') and not config.lctl_dump:
cmds = """
network %s
add_peer %s %s %d
quit""" % (net_type,
nid, hostaddr, port )
self.run(cmds)
- elif net_type in ('openib','iib',) and not config.lctl_dump:
+ elif net_type in ('iib','vib') and not config.lctl_dump:
cmds = """
network %s
add_peer %s
def connect(self, srv):
self.add_uuid(srv.net_type, srv.nid_uuid, srv.nid)
- if srv.net_type in ('tcp','openib','iib',) and not config.lctl_dump:
+ if srv.net_type in ('tcp','openib','iib','vib') and not config.lctl_dump:
if srv.hostaddr[0]:
hostaddr = string.split(srv.hostaddr[0], '/')[0]
self.add_peer(srv.net_type, srv.nid, hostaddr, srv.port)
quit""" % (net_type,
nid, hostaddr)
self.run(cmds)
- elif net_type in ('openib','iib','ra') and not config.lctl_dump:
+ elif net_type in ('openib','iib','vib','ra') and not config.lctl_dump:
cmds = """
ignore_errors
network %s
# disconnect one connection
def disconnect(self, srv):
self.del_uuid(srv.nid_uuid)
- if srv.net_type in ('tcp','openib','iib','ra') and not config.lctl_dump:
+ if srv.net_type in ('tcp','openib','iib','vib','ra') and not config.lctl_dump:
if srv.hostaddr[0]:
hostaddr = string.split(srv.hostaddr[0], '/')[0]
self.del_peer(srv.net_type, srv.nid, hostaddr)
def sys_get_local_address(net_type, wildcard, cluster_id):
"""Return the local address for the network type."""
local = ""
- if net_type in ('tcp','openib','iib','ra'):
+ if net_type in ('tcp','openib','iib','vib','ra'):
if ':' in wildcard:
iface, star = string.split(wildcard, ':')
local = if2addr(iface)
self.add_portals_module("knals/openibnal", 'kopenibnal')
if self.net_type == 'iib':
self.add_portals_module("knals/iibnal", 'kiibnal')
+ if self.net_type == 'vib':
+ self.add_portals_module("knals/vibnal", 'kvibnal')
if self.net_type == 'lo':
self.add_portals_module("knals/lonal", 'klonal')
if self.net_type == 'ra':
lctl.add_interface(self.net_type, ip, netmask)
if self.net_type == 'elan':
sys_optimize_elan()
+ if self.net_type == 'openib':
+ if self.port == 0:
+ panic("no port set for", self.net_type, self.hostaddr[0])
+ sysctl('/proc/sys/openibnal/port', self.port)
+ if self.net_type == 'ra':
+ if self.port == 0:
+ panic("no port set for", self.net_type, self.hostaddr[0])
+ sysctl('/proc/sys/ranal/port', self.port)
if self.port and node_is_router():
run_one_acceptor(self.port)
self.connect_peer_gateways()
def server_for_route(self, net_type, gw, gw_cluster_id, tgt_cluster_id,
lo, hi):
- # only setup connections for tcp, openib, and iib NALs
+ # only setup connections for tcp, ib, and ra NALs
srvdb = None
- if not net_type in ('tcp','openib','iib','ra'):
+ if not net_type in ('tcp','openib','iib','vib','ra'):
return None
# connect to target if route is to single node and this node is the gw