BuildTools
Qt
Src
Agave
Components
Elevator
Mastering
Plugins
DSP
dsp_sc
dsp_sps
sc_serv3
GeoIP
apps
conf
data
libGeoIP
man
test
Makefile.am
Makefile.in
Makefile.vc
benchmark.c
city_test.txt
country_test.txt
country_test2.txt
country_test_name.txt
region_test.txt
test-geoip-asnum.c
test-geoip-city.c
test-geoip-isp.c
test-geoip-netspeed.c
test-geoip-org.c
test-geoip-region.c
test-geoip.c
AUTHORS
COPYING
ChangeLog
GeoIP.spec.in
GeoIPWinDLL.patch
INSTALL
Makefile.am
Makefile.in
Makefile.netware
Makefile.vc
Makefile.win32
NEWS
README
README.MinGW
README.OSX
READMEwin32.txt
READMEwin32static.txt
TODO
aclocal.m4
bootstrap
config.guess
config.sub
configure
configure.in
depcomp
geoip.ico
get_ver.awk
install-sh
ltmain.sh
missing
aolxml
deps
libs
nmrCommon
webNet
ADTSHeader.cpp
ADTSHeader.h
FLV.cpp
FLV.h
GNUmakefile
ID3miniParsers.cpp
ID3miniParsers.h
MP3Header.cpp
MP3Header.h
MSG00001.bin
adminList.cpp
adminList.h
agentList.cpp
agentList.h
amf.cpp
amf.h
auth.cpp
auth.h
banList.cpp
banList.h
bandwidth.cpp
bandwidth.h
base64.cpp
base64.h
cache.cpp
cache.h
config.cpp
config.h
cpucount.cpp
cpucount.h
filenameMetadata.cpp
filenameMetadata.h
global.cpp
global.h
icy.ico
libcurl_building.txt
main.cpp
manifest.xml
manifest64.xml
messagefile.h
messagefile.mc
metadata.cpp
metadata.h
metrics.cpp
metrics.h
protocol_FlashPolicyServer.cpp
protocol_FlashPolicyServer.h
protocol_HTTPClient.cpp
protocol_HTTPClient.h
protocol_HTTPSource.cpp
protocol_HTTPSource.h
protocol_HTTPStyle.cpp
protocol_HTTPStyle.h
protocol_RTMPClient.cpp
protocol_RTMPClient.h
protocol_admincgi.cpp
protocol_admincgi.h
protocol_backup.cpp
protocol_backup.h
protocol_flvClient.cpp
protocol_flvClient.h
protocol_m4aClient.cpp
protocol_m4aClient.h
protocol_relay.cpp
protocol_relay.h
protocol_relay_shoutcast.cpp
protocol_relay_shoutcast.h
protocol_relay_uvox.cpp
protocol_relay_uvox.h
protocol_shoutcast1Client.cpp
protocol_shoutcast1Client.h
protocol_shoutcast2Client.cpp
protocol_shoutcast2Client.h
protocol_shoutcastClient.cpp
protocol_shoutcastClient.h
protocol_shoutcastSource.cpp
protocol_shoutcastSource.h
protocol_uvox2Source.cpp
protocol_uvox2Source.h
readme.txt
resource.h
ripList.cpp
ripList.h
sc_serv.rc
sc_serv.vcxproj
sc_serv.vcxproj.filters
stats.cpp
stats.h
streamData.cpp
streamData.h
threadedRunner.cpp
threadedRunner.h
updater.cpp
updater.h
uvox2Common.cpp
uvox2Common.h
versions.h
w3cLog.cpp
w3cLog.h
webClient.cpp
webClient.h
yp2.cpp
yp2.h
Encoder
General
Input
Library
Output
Portable
SDK
Visualization
ReplayGainAnalysis
WAT
Wasabi
Wasabi2
Winamp
aacPlus
aacdec
aacdec-mft
adpcm
alac
albumart
apev2
auth
bmp
burnlib
codesign
config
devices
external_dependencies
f263
filereader
freetypewac
gif
gracenote
h264
h264dec
id3v2
ie_plugin
installer
jpeg
libvp6
libvpShared
mp3-mpg123
mp4v
mpeg4dec
nde
nprt_plugin
ns-eel
ns-eel2
nsavi
nsmkv
nsutil
nsv
nsvdec_vp3
nsvdec_vp5
nsvdec_vp6
nswasabi
nu
omBrowser
pcm
pfc
playlist
plist
png
replicant
resources
tagz
tataki
theora
timer
vlb
vp32
vp6
vp8x
wbm
winampAll
winampa
xml
xspf
vcpkg-ports
.gitignore
LICENSE.md
README.md
automate-git.py
cef_x86.bat
install-packages.cmd
vcpkg_version_finder.py
winampAll_2019.sln
60 lines
1.7 KiB
C
60 lines
1.7 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
|
|
/* test-geoip-netspeed.c
|
|
*
|
|
* Copyright (C) 2006 MaxMind LLC
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include "GeoIP.h"
|
|
|
|
int main (int argc, char* argv[]) {
|
|
FILE *f;
|
|
GeoIP * gi;
|
|
int netspeed;
|
|
char host[50];
|
|
|
|
gi = GeoIP_open("../data/GeoIPNetSpeed.dat", GEOIP_STANDARD);
|
|
|
|
if (gi == NULL) {
|
|
fprintf(stderr, "Error opening database\n");
|
|
exit(1);
|
|
}
|
|
|
|
f = fopen("netspeed_test.txt","r");
|
|
|
|
if (f == NULL) {
|
|
fprintf(stderr, "Error opening netspeed_test.txt\n");
|
|
exit(1);
|
|
}
|
|
|
|
while (fscanf(f, "%s", host) != EOF) {
|
|
netspeed = GeoIP_id_by_name (gi, (const char *)host);
|
|
if (netspeed == GEOIP_UNKNOWN_SPEED) {
|
|
printf("%s\tUnknown\n", host);
|
|
} else if (netspeed == GEOIP_DIALUP_SPEED) {
|
|
printf("%s\tDialup\n", host);
|
|
} else if (netspeed == GEOIP_CABLEDSL_SPEED) {
|
|
printf("%s\tCable/DSL\n", host);
|
|
} else if (netspeed == GEOIP_CORPORATE_SPEED) {
|
|
printf("%s\tCorporate\n", host);
|
|
}
|
|
}
|
|
fclose(f);
|
|
GeoIP_delete(gi);
|
|
|
|
return 0;
|
|
}
|