# Path: ifcb/data/transfer/smb_utils.py
# def smb_connect(remote_server, username, password, netbios_name=None, timeout=DEFAULT_TIMEOUT):
# 
#     if netbios_name is None:
#         logging.debug('Querying NetBIOS for name of {}'.format(remote_server))
#         netbios_name = get_netbios_name(remote_server, timeout=timeout)
#         logging.debug('Name is {}'.format(netbios_name))
# 
#     logging.debug('Connecting to {}'.format(remote_server))
# 
#     c = SMBConnection(username, password, 'ignore', netbios_name)
#     c.connect(remote_server, timeout=timeout)
# 
#     return c
# 
# def get_netbios_name(remote_addr, timeout=DEFAULT_TIMEOUT):
#     nb = NetBIOS()
#     names = nb.queryIPForName(remote_addr, timeout=timeout)
#     nb.close()
#     if names is None or len(names) == 0:
#         raise NameError('No NetBIOS name found for {}'.format(remote_addr))
#     elif len(names) > 1:
#         logging.warn('More than one NetBIOS name for {}'.format(remote_addr))
#     return names[0]
# 
# class NameError(Exception):
#     pass


import os
from collections import defaultdict
from .smb_utils import smb_connect, get_netbios_name, NameError
from smb.base import SharedDevice



DEFAULT_TIMEOUT = 30
DEFAULT_SHARE = 'data'

class IfcbConnectionError(Exception):
    pass

def do_nothing(*args, **kw):
    pass

class RemoteIfcb(object):

# Path: ifcb/data/transfer/smb_utils.py
# def smb_connect(remote_server, username, password, netbios_name=None, timeout=DEFAULT_TIMEOUT):
# 
#     if netbios_name is None:
#         logging.debug('Querying NetBIOS for name of {}'.format(remote_server))
#         netbios_name = get_netbios_name(remote_server, timeout=timeout)
#         logging.debug('Name is {}'.format(netbios_name))
# 
#     logging.debug('Connecting to {}'.format(remote_server))
# 
#     c = SMBConnection(username, password, 'ignore', netbios_name)
#     c.connect(remote_server, timeout=timeout)
# 
#     return c
# 
# def get_netbios_name(remote_addr, timeout=DEFAULT_TIMEOUT):
#     nb = NetBIOS()
#     names = nb.queryIPForName(remote_addr, timeout=timeout)
#     nb.close()
#     if names is None or len(names) == 0:
#         raise NameError('No NetBIOS name found for {}'.format(remote_addr))
#     elif len(names) > 1:
#         logging.warn('More than one NetBIOS name for {}'.format(remote_addr))
#     return names[0]
# 
# class NameError(Exception):
#     pass


# Path: ifcb/data/transfer/remote.py
import os
from collections import defaultdict
from .smb_utils import smb_connect, get_netbios_name, NameError
from smb.base import SharedDevice




DEFAULT_TIMEOUT = 30
DEFAULT_SHARE = 'data'

class IfcbConnectionError(Exception):
    pass

def do_nothing(*args, **kw):
    pass

class RemoteIfcb(object):

    def __init__(self, addr, username, password, netbios_name=None, timeout=DEFAULT_TIMEOUT,