# File lib/geoip.rb, line 259 def isp(hostname) ip = lookup_ip(hostname) # Convert numeric IP address to an integer ipnum = iptonum(ip) if (@database_type != GEOIP_ISP_EDITION && @database_type != GEOIP_ORG_EDITION) throw "Invalid GeoIP database type, can't look up Organization/ISP by IP" end pos = seek_record(ipnum) off = pos + (2*@record_length - 1) * @database_segments[0] record = atomic_read(MAX_ORG_RECORD_LENGTH, off) record = record.sub(/\000.*/n, '') record end