_connection = {} config = require "config" ident = require "ident" arpcache = require "arpcache" function _connection.auth(serv, localport, remoteport) local user = config.map_ip(serv) local mac = nil if not user then mac = arpcache.get_mac(serv) if mac then user = config.map_mac(mac) end end if user == "*ident" then user = ident.resolve(serv,localport,config.map_port(remoteport)) end return user end return _connection