./arfcncalc/0000755000175000017500000000000012130372764012504 5ustar dexterdexter./arfcncalc/calc.c0000644000175000017500000000522411540640501013544 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Calculator # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #include #include "band.h" #include "lookup.h" /* #################################################################################### */ /* ## CALCULATOR ###################################################################### */ /* Calc frequency from ARFCN */ void calcFreqnencyFromArfcn(int arfcn, int band, int *fuplink, int *fdownlink) { int offset = arfcn2offset(arfcn); int difference = arfcn2rxtxdiff(arfcn,band); int startfreq = arfcn2startfreq(arfcn,band); *fuplink = startfreq + (arfcn - offset) * 200; *fdownlink = *fuplink + difference; return; } /* #################################################################################### */ ./arfcncalc/provider.h0000644000175000017500000000577211540640501014511 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Provider names # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #ifndef PROVIDER_H #define PROVIDER_H #define PROVIDER_GERMANY_TMOBILE "T-Mobile (262 01)" #define PROVIDER_GERMANY_VODAFONE "Vodafone (262 02)" #define PROVIDER_GERMANY_EPLUS "E-Plus (262 03)" #define PROVIDER_GERMANY_O2 "o2 (262 07)" #define PROVIDER_GERMANY_DEUTSCHEBAHN "DB-Telematik (262 10)" #define PROVIDER_AUSTRIA_ONE "One (232 05)" #define PROVIDER_AUSTRIA_MOBILKOM "Mobilkom (232 01)" #define PROVIDER_AUSTRIA_TMOBILE "T-Mobile Aaustria (232 03)" #define PROVIDER_SWISS_ORANGE "Orange (228 03)" #define PROVIDER_SWISS_SUNRISE "Sunrise (228 02)" #define PROVIDER_SWISS_SWISSCOM "Swisscom (228 01)" #define PROVIDER_SWISS_TELE2 "Tele2 (228 08)" #define PROVIDER_SWISS_INPHONE "Inphone (228 07)" #define PROVIDER_ENGLAND_VODAFONE "Vodafone (234 91)" #define PROVIDER_ENGLAND_O2 "o2 (234 10)" #define PROVIDER_ENGLAND_TMOBILE "T-Mobile UK (234 32)" #define PROVIDER_ENGLAND_ORANGE "Orange (234 33/34)" #endif /*PROVIDER_H*/ /* #################################################################################### */ ./arfcncalc/main.o0000664000175000017500000003751011753674162013627 0ustar dexterdexterELF>@@ UHH0dH%(HE1HΉHHǸLHHHǸ;~HEdH3%(tUH%T2R|ul*]UHH0}uUMDE܋EEHMHUuE}UuEd;E~mEd;E}bEr}DuEd;E~LEd;E}AEQ}u6Ed;E~Ed;E}E0Ed;E~Ed;E}EEE;E]UHH }uU}ZUEAй%E}tEwUEAйT2E}tEGUEAйRE}tEUEAй|E}tEUEAйE}tEUEAйuE}tEUEAйl*E}tEWM}u$UEAй% }u$UEAйT2}Ru$UEAйR}udUEAй|E}tEUEAйE}tE`Y}u!UEAйu/}lu!UEAйl*UHHǸHǸHǸHǸHǸ]UHHǸHǸHǸHǸHǸHǸUHH0dH%(HE1HHHǸHǸHǸ։¸HǸ¸HǸHƿDuHHHǸHƿAuHHHǸHƿSuHHHǸHƿEuHHHǸHH։tbHHHǸHΉuHHHǸHH։tHHHǸHEdH3%(tUHH }uHMHUuEUHǸUHH }uHMHUuEUHǸUHHP}HuHEHHHƿ}uEEEEEEEEEE?7HEkHHEEPHHEE5E,E#EHHEEHMEHΉE}D}t}t}@EԉEȋEȉu$UȾHǸ}tEE9EԉE̋Eԉ=tEԉ=lu }t0+G\ PWX> pfXx  "  +:AX]nP~&3 <A <Q4 Velsxmain.cprogramNamegenerateFrequencyTablearfn2bandetailprintfcalcFreqnencyFromArfcnputs__stack_chk_failgenerateCompleteFrequencyTabletestFrequencyInBandtestFrequencyInCompleteBandprintHeadlineprintHelpexitdisplayArfcnInfoarfcn2rxtxdiffarfcn2offsetfrequency2providerband2stringband2countrydisplayUplinkdisplayDownlinkmain__xpg_basenamestrcpyoptargatoigetoptarfcn2bandD I e  0 b  - A U i }  FvCp h& + 8 = J O *\ a 0fk pu z *    p b    0    X  b  #( -2 7< AF PKP xUZ b_d in s      X   b        8   bb g |           7 PY 0p  P  x    6  ? V  [ b` w    b         .  N V [  f     ! " ! "0 !8 "O Y #q v    $    $ $ $  % $8 H @ M  W l v      p  + J c q  y   $          G G G  G  G  G G ( G 0 G 8 G @ G H G P G X G ` G h G p G x G G G G G G G G G G G G G G G G  -  G    G  ( G 0  8 G @ G H G P G X G ` G h G p  x G G G G  $ @`P  <4 ./arfcncalc/lookup.h0000644000175000017500000000706411540640501014164 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Lookup tables # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #ifndef LOOKUP_H #define LOOKUP_H /* Lookup functions: */ /* Transform a given band to to a human readable band description string */ int band2string(int band, char *string); /* Find out the country for a given band */ int band2country(int band, char *string); /* Get a more detailed information about the band */ int arfn2bandetail(int arfcn, int band, char *string); /* Try to find out the band for a given arfcn */ int arfcn2band(int arfcn); /* Find out the offset for a given arfcn */ int arfcn2offset(int arfcn); /* Find out difference between rx and tx for a given arfcn */ int arfcn2rxtxdiff(int arfcn, int band); /* Find out start frequency */ int arfcn2startfreq(int arfcn, int band); /* Try to find out to which provider the frequency is allocated */ int frequency2provider(int country, int frequency, char *provider); #if 0 /* Reverse-lookup functions: */ /* Find the offset for a given uplink frequency */ int fuplink2offset(int frequency); /* Find the offset for a given downlink frequency */ int fdownlink2offset(int frequency); /* Find the startfrequency for a given uplink frequency */ int fuplink2startfreq(int frequency); /* Find the startfrequency for a given downlink frequency */ int fdownlink2startfreq(int frequency); /* Find the difference between rx and tx for a given uplink frequency */ int fuplink2rxtxdiff(int frequency); /* Find the difference between rx and tx for a given downlink frequency */ int fdownlink2rxtxdiff(int frequency); #endif #endif /*LOOKUP_H*/ /* #################################################################################### */ ./arfcncalc/arfcncalc0000755000175000017500000006342712130372764014362 0ustar dexterdexterELF>p@@R@8 @@@@@@88@8@@@DJDJ NN`N`` (N(N`(N`TT@T@DDPtdFF@F@QtdRtdNN`N`/lib64/ld-linux-x86-64.so.2GNUGNUuL {//x>  )5:Ke R`0YP`__gmon_start__libc.so.6__xpg_basenamestrcpyexitputs__stack_chk_failprintfgetoptoptargatoi__libc_start_mainGLIBC_2.4GLIBC_2.2.5ii wui O`P` P` P`(P`0P`8P`@P`HP`PP` XP` HH52J %4J @%2J h%*J h%"J h%J h%J h% J h%J h%I hp%I h`1I^HHPTI:@HP:@H|6@fHHQI HtHf.wP`UH-pP`HHw]øHt]pP`pP`UH-pP`HHHH?HHHu]úHt]pP`=QI uUH~]>I @H=F tHtU N`H]{vfUHH0}uHUHM؋EEUE։8EUE։EEU)iUHEHEUHE؉ÐUH}HuHEE=Rt]=R=t#=t2=th=ltt=tD~HEGSM4f@50@oHEGSM4f@80@YHEGSM8f@50@CHEGSM9f@00@-HEGSM1@800HEGSM1@900]UH}uHUHE}~}% ]}1~}T A}~} (}u-HE(E-G@SM o@r R-@ GSM)@}~=}|7HE(P-G@SM, @E-GS@ M or@ R-G@SM)}~3}*HE(E-G@SM o@r R-@ GSM)@v}~4}*+}lu"HE(PCS@ 190f@0)@ 9}~+}u"HE(DCS@ 180f@0)@ ]UH}HuHEE=R=R=t6==R=l=HENORD@IC, @BENE@ LUX,@ ALP@INE,@ RUS@SIA,@ EAS@$TERN@( EUR@,OPE,@0 TAN@4ZANIf@8A\HENOT @IN U@SE ?@ ;HEUSA,@ CAN@ADA,@ BRA@ZIL,@ GUA@TEMA@LA, @ EL S@$ALVA@(DORHEEURO@PE, @BRAZ@ IL, @GUAT@EMAL@A, E@L SA@ LVADf@$OR@&HEEURO@PE, @COST@ A RI@CA, @BRAZ@IL, @HONG@ -KONf@$GKHEUSA,@ CAN@ADA,@ GUA@TEMA@LA, @EL S@ALVA@ DOR]UH}}~}% }1~}Ty}~}Rc}x }|P}~}7}~}u}~}*l]UH}}~}%y}1~}T2`}~}J}x }|7}~}}~}u]UH}u}~}% '}1~}T '}~}ȯl}x }|ȯY}~}ȯ@}~}*}lu8}~}us]UH}u}~}% (}1~}T O}~} l}x }| Y}~} @}~}*}luX;}~}ux]UH}uHU}D#}^ ~?}m 6HEDB-T@elem@atik@ (26@2 10f@)t}m ~2}l )HEE-Pl@us (@262 @ 03)9}k ~+} "HEo2 (@262 @07)}W ~8} /HEVoda@fone@ (26@ 2 02f@)} ~8}غ /HET-Mo@bile@ (26@ 2 01f@)} ~8} /HEVoda@fone@ (26@ 2 02f@)B} ~8}@ /HET-Mo@bile@ (26@ 2 01f@)} ~8} /HEVoda@fone@ (26@ 2 02f@)}o~?}H6HEDB-T@elem@atik@ (26@2 10f@)x}~2}41)HEE-Pl@us (@262 @ 03)=}31~+}D"HEo2 (@262 @07) }E~8}M/HEVoda@fone@ (26@ 2 02f@)}N~8}j/HET-Mo@bile@ (26@ 2 01f@)}gk~8}؂/HEVoda@fone@ (26@ 2 02f@)F}~8}/HET-Mo@bile@ (26@ 2 01f@)}ϔ~8}/HEVoda@fone@ (26@ 2 02f@)}~8}8/HET-Mo@bile@ (26@ 2 01f@)}S~8}e/HET-Mo@bile@ (26@ 2 01f@)B}f~+}P"HEo2 (@262 @07)}߾~8}0/HEVoda@fone@ (26@ 2 02f@)}~2}*)HEE-Pl@us (@262 @ 03)}'~8}/HET-Mo@bile@ (26@ 2 01f@)Q}~+}h0"HEo2 (@262 @07)}1~8}HF/HEVoda@fone@ (26@ 2 02f@)}G}ȝHEE-Pl@us (@262 @ 03)}A }Gn ~/}z &HEOne @(232@ 05)@ W}{ ~8}ȓ /HEMobi@lkom@ (23@ 2 01f@)}G ~J} AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@} ~8}H /HEMobi@lkom@ (23@ 2 01f@)} ~J} AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@/}~/})&HEOne @(232@ 05)@ }W+~8}C/HEMobi@lkom@ (23@ 2 01f@)}P~J}bAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@c}_d~8}/HEMobi@lkom@ (23@ 2 01f@)"}~J}PAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}w~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@|}!~8} H/HEMobi@lkom@ (23@ 2 01f@);}I~J}jAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}l~8}t/HEMobi@lkom@ (23@ 2 01f@)}7v~/}P&HEOne @(232@ 05)@ o}ߌ~J}ȐAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}W~8}@/HEMobi@lkom@ (23@ 2 01f@)}ϗ~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}G~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@5}~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}G~J}xAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}~8}/HEMobi@lkom@ (23@ 2 01f@)N}~J}hAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}~/}.&HEOne @(232@ 05)@ }~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@p}'~8}8/HEMobi@lkom@ (23@ 2 01f@)/}Ǽ~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}'~8}/HEMobi@lkom@ (23@ 2 01f@)}O~/}h&HEOne @(232@ 05)@ c}~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}o~8}X /HEMobi@lkom@ (23@ 2 01f@) } ~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@| }_~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@) }7~J}'AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@ }_)~J}:AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@ }<~8}@/HEMobi@lkom@ (23@ 2 01f@)B }A~J}EAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@ }G } HEOne @(232@ 05)@ }S}m ~2}dz )HEOran@ge (@228 @ 03)j }+{ ~6}, -HESunr@ise @(228@ 02)@+ } ~8} /HESwis@scom@ (22@ 8 01f@) }c ~6}$ -HESunr@ise @(228@ 02)@ } ~8}d /HESwis@scom@ (22@ 8 01f@)j }+ ~6} -HESunr@ise @(228@ 02)@+ }~2},*)HEOran@ge (@228 @ 03) }*~6}C-HESunr@ise @(228@ 02)@ }D~8}dt/HESwis@scom@ (22@ 8 01f@)p }+u~6}-HESunr@ise @(228@ 02)@1 }~8},/HESwis@scom@ (22@ 8 01f@)}~6}-HESunr@ise @(228@ 02)@}~2}l~)HEOran@ge (@228 @ 03)v}3~8}/HESwis@scom@ (22@ 8 01f@)5}[~6},-HESunr@ise @(228@ 02)@}~2}t)HEOran@ge (@228 @ 03)};~6}-HESunr@ise @(228@ 02)@|}~5}T,HETele@2 (2@28 0f@ 8)@>}~6}/-HEInph@one @(228@ 07)@}0~6}$9-HESunr@ise @(228@ 02)@}+~2})HEOran@ge (@228 @ 03)}K~8}-/HESwis@scom@ (22@ 8 01f@)D}s.~6}DO-HESunr@ise @(228@ 02)@} P~2}\)HEOran@ge (@228 @ 03)}S]~6} i-HESunr@ise @(228@ 02)@}i~5}l,HETele@2 (2@28 0f@ 8)@M}3~6}ܢ-HEInph@one @(228@ 07)@}}<HESunr@ise @(228@ 02)@}E}m ~8}l /HEVoda@fone@ (23@ 4 91f@)|}k ~+} "HEo2 (@234 @10)H} ~8} /HEVoda@fone@ (23@ 4 91f@)} ~+} "HEo2 (@234 @10)} ~8}L /HEVoda@fone@ (23@ 4 91f@)}K ~+} "HEo2 (@234 @10)^}~8}41/HEVoda@fone@ (23@ 4 91f@)}31~+}D"HEo2 (@234 @10)}D~8}V/HEVoda@fone@ (23@ 4 91f@)}V~+}s"HEo2 (@234 @10)t}s~8}/HEVoda@fone@ (23@ 4 91f@)3}~+}"HEo2 (@234 @10)}~+}."HEo2 (@234 @10)}.~8}dE/HEVoda@fone@ (23@ 4 91f@)}cE~=}4HET-Mo@bile@ UK @ (234@ 32)@D}~<}/3HEOran@ge (@234 @ 33/3f@4)@}+~+}ԡ"HEo2 (@234 @10)}ӡ~8}|/HEVoda@fone@ (23@ 4 91f@)}{~:}-1HET-Mo@bile@ UK @ (234@ 32)@G}-~9}ܢ0HEOran@ge (@234 @ 33/3f@4)@]UHH0dH%(HE1HΉ=:@HHǸ_LHH(;@HǸ ;~Z;@HEdH3%(tUH%T2R|ul*]UHH0}uUMDE܋EEHMHUuEy}UuEd;E~mEd;E}bEr}DuEd;E~LEd;E}AEQ}u6Ed;E~Ed;E}E0Ed;E~Ed;E}EEE;E]UHH }uU}ZUEAй%E}tEwUEAйT2E}tEGUEAйRE}tEUEAй|iE}tEUEAй9E}tEUEAйu E}tEUEAйl*E}tEWM}u$UEAй% }u$UEAйT2i}Ru$UEAйR<}udUEAй|E}tEUEAйE}tE`Y}u!UEAйu/}lu!UEAйl*xUH`;@HǸ;@HǸ;@HǸz"<@HǸh(<@>x<@4<@*"<@HǸ8]UHy=@h=@Z;@=@=@>@(>@x>@>@?@P?@Z;@?@?@?@w?@m@@cH@@Yp@@OZ;@E@@;@@P`HǸDA@P`HǸ-PA@P`HǸZ;@A@A@P`HǸA@P`HǸ0B@P`HǸZ;@UHH0dH%(HE1HH{B@HǸHB@HǸ.B@HǸ։¸B@HǸ¸B@HǸHƿDuC@HHHǸHƿAu(C@HHHǸTHƿSuHC@HHHǸHƿEdupC@HHHǸHH։tbC@HHHǸHΉKuC@HHHǸnZ;@DHH։tC@HHHǸ,Z;@HEdH3%(tUHH }uHMHUuEUUC@HǸUHH }uHMHUuEUC@HǸUHHP}HuHEHHHƿP`9}u(EEEEEEEEEE?7HD@EkHU HEEPH: HEE5E,E#EH HEEHMEC@HΉE}D}tw}t}@EԉEȋEȉu$C@UȾP`HǸF}tEE9EԉbE̋EԉU=tEԉD=lu C@}t}u EȉẼ}tŰEȉ։cRD@UȉHǸ1D@P`HǸHl$Ld$H- L% Ll$Lt$L|$H\$H8L)AIHI+Ht1@LLDAHH9uH\$Hl$Ld$Ll$ Lt$(L|$0H8fHH * Frequency table for the GSM%i %s Band: Arfcn: %i Uplink: %i000Hz Downlink: %i000Hz _______________________________________________________________________________ ArfcnCalc - GSM frequency calculation tool V.1.0 Copyright(c) 2010 Philipp Fabian Benedikt Maier CAUTION: This is a very early version of this program. It might still contain some bugs that might cause wrong calculation results. If you find a bug, please email to: philipp.maier@runningserver.com - Thanks! This is a tool for calculating the resulting frequency from a given ARFCN and can be used easyly in shellscripts for doing arfcn calculations The following options are available -h or -? ........ Print this screen. -v .............. Verbose output. -u .............. Calculate uplink frequency / Treat frequency as uplink -d .............. Calculate downlink frequency / Treat frequency as downlik -b .............. Specify band (optional, needed with GSM1900/1800). -p .............. Generate a bandplan with all known arfcns. -f .............. Find an Arfcn for a given frequency The following bands can be handled (option -b): 450 ............. GSM450 480 ............. GSM480 850 ............. GSM850 900 ............. GSM900 (P-GSM, E-GSM and R-GSM) 1800 ............ GSM1800 \__Caution: 1900 ............ GSM1900 / Conflicting ARFCN-Numbers! Usage: %s -a arfcen [-udv -b band] ..... Calculate the frequency for an arfcn %s -f frequency [-udv -b band] .. Calculate arfcn for a frequency %s -p ........................... Generate bandplan Examples: %s -a 512 -b 1900 -d ... Calc downlink frequency (GSM1900) of Arfcn 512 %s -a 123 -v ........... Get verbose information about Arfcn 123 %s -f 959600000 -d ..... Get an arfcn for the dnlink frequency 959.6Mhz * Arfn: %i * Downlink frequency is: %i000 Hz * Uplink frequency is: %i000 Hz * Distance: %i000 Hz * Offset: %i * Licensed to %s in Germany * Licensed to %s in Austria * Licensed to %s in Swissland * Licensed to %s in England * Band: %s %s * Country(s): %s %i000 ph?a:duvb:f:%s: %i: Invalid arfcn * Warning: GSM1800 and GSM1900 share comman ARFCNs, you should specify a band. %s: GSM%i: Band does not fit to arfcn %s: No output method selected %s: %i: Frequency is not part of an GSM-Band %i %s: You must spefify an ARFCN 7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@$7@u7@7@Z7@7@?7@7@7@7@7@7@7@7@7@7@7@7@7@7@7@c7@l7@;0T -@`F  @+`:d @`@zRx $PFJ w?;*3$"DԿwAC r d,AC  AC  U7AC 2 lAC  AC  ~AC  $$AC  DAC  dAC  QAC  AC  pAC  ~AC y rAC $AC  D\<AC w dx<AC w AC $HQ_@XP@0@ @ :@N`N`o@@@ P`@@0 o@oon@(N`@@@@&@6@F@V@f@GCC: (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2GCC: (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1GCC: (Ubuntu/Linaro 4.6.3-10ubuntu1) 4.6.3 20120918 (prerelease).symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.dynamic.got.got.plt.data.bss.comment8@8#T@T 1t@t$Do@$N @ V@^on@nko@0z@0@ @@p@pt4:@: :@: F@F`G@`GN`NN`N N` N(N`(NO`OP`P``P``PP`pP  0pPQY 1 b8@T@t@@@@n@@ @ @ @ @ p@:@:@F@`G@N`N` N`(N`O`P``P`P`D @T_ N`l @ @ 0@P`N` P@N` T"@J@0 N`<N`M(N`VN`iP` :@ 1@ |@w  `P`P`  @pP` H,@3:@9Ui 6@<w K @ @`P` @6@<P` \1@~ hP` :@4 r@G -@[ P:@kQ`p p@wpP` |6@ @ .@  g3@pP` @, 9-@K e ] @7r @ @/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.ocall_gmon_startcrtstuff.c__JCR_LIST__deregister_tm_clonesregister_tm_clones__do_global_dtors_auxcompleted.6744__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrycalc.clookup.cmain.c__FRAME_END____JCR_END____init_array_end_DYNAMIC__init_array_start_GLOBAL_OFFSET_TABLE___libc_csu_finiprintHelpcalcFreqnencyFromArfcn_ITM_deregisterTMCloneTabledata_startprogramNamestrcpy@@GLIBC_2.2.5puts@@GLIBC_2.2.5band2string_edatagenerateFrequencyTable_fini__stack_chk_fail@@GLIBC_2.4printf@@GLIBC_2.2.5displayUplinkarfcn2offset__libc_start_main@@GLIBC_2.2.5arfcn2band__data_startdisplayDownlinkoptarg@@GLIBC_2.2.5printHeadline__gmon_start____dso_handle_IO_stdin_used__xpg_basename@@GLIBC_2.2.5frequency2providertestFrequencyInBand__libc_csu_init_end_start__bss_startmainarfcn2rxtxdifftestFrequencyInCompleteBand_Jv_RegisterClassesgetopt@@GLIBC_2.2.5displayArfcnInfoatoi@@GLIBC_2.2.5exit@@GLIBC_2.2.5__TMC_END__arfcn2startfreqgenerateCompleteFrequencyTable_ITM_registerTMCloneTableband2countryarfn2bandetail_init./arfcncalc/main.c0000644000175000017500000003611511753674122013605 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Main program # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #include #include #include #include #include #include "band.h" #include "arfcn.h" #include "lookup.h" #include "calc.h" #include "country.h" char programName[255]; #define UPLINK 'U' #define DOWNLINK 'D' /* #################################################################################### */ /* #################################################################################### */ /* Generate a frequency allocation table */ void generateFrequencyTable(int startArfcn, int endArfcn, int band) { int arfcn; int fuplink; int fdownlink; char banddetail[255]; arfn2bandetail(startArfcn, band, banddetail); printf(" * Frequency table for the GSM%i %s Band:\r\n",band,banddetail); for(arfcn=startArfcn;arfcn<=endArfcn;arfcn++) { calcFreqnencyFromArfcn(arfcn,band,&fuplink,&fdownlink); printf("Arfcn: %i Uplink: %i000Hz Downlink: %i000Hz\r\n",arfcn,fuplink,fdownlink); } printf("\r\n"); return; } /* Generate a frequency allocation table for all known bands */ void generateCompleteFrequencyTable(void) { generateFrequencyTable(ARFCN_GSM450_START,ARFCN_GSM450_END,BAND_GSM450); generateFrequencyTable(ARFCN_GSM480_START,ARFCN_GSM480_END,BAND_GSM480); generateFrequencyTable(ARFCN_GSM850_START,ARFCN_GSM850_END,BAND_GSM850); generateFrequencyTable(ARFCN_GSM900_START,ARFCN_GSM900_END,BAND_GSM900); generateFrequencyTable(ARFCN_REGSM900_START,ARFCN_REGSM900_END,BAND_GSM900); generateFrequencyTable(ARFCN_GSM1800_START,ARFCN_GSM1800_END,BAND_GSM1800); generateFrequencyTable(ARFCN_GSM1900_START,ARFCN_GSM1900_END,BAND_GSM1900); } /* Try to find an arfcn for a given frequency in a given band */ int testFrequencyInBand(int frequency, int startArfcn, int endArfcn, int band, int upOrDownlink) { int arfcn; int fuplink; int fdownlink; for(arfcn=startArfcn;arfcn<=endArfcn;arfcn++) { calcFreqnencyFromArfcn(arfcn,band,&fuplink,&fdownlink); if(upOrDownlink == UPLINK) { if((frequency < fuplink + 100)&&(frequency > fuplink - 100)) return arfcn; } else if(upOrDownlink == DOWNLINK) { if((frequency < fdownlink + 100)&&(frequency > fdownlink - 100)) return arfcn; } else if(upOrDownlink == 0) { if((frequency < fdownlink + 100)&&(frequency > fdownlink - 100)) return arfcn; if((frequency < fuplink + 100)&&(frequency > fuplink - 100)) return arfcn; } } return -1; } /* Try to find an arfcn for a given frequency in all bands */ int testFrequencyInCompleteBand(int frequency, int preferedBand, int upOrDownlink) { int arfcn; /* When the band is not speciefied, just go through all frequencys and find the first best suitable arfcn */ if(preferedBand == 0) { arfcn = testFrequencyInBand(frequency, ARFCN_GSM450_START,ARFCN_GSM450_END,BAND_GSM450,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_GSM480_START,ARFCN_GSM480_END,BAND_GSM480,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_GSM850_START,ARFCN_GSM850_END,BAND_GSM850,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_GSM900_START,ARFCN_GSM900_END,BAND_GSM900,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_REGSM900_START,ARFCN_REGSM900_END,BAND_GSM900,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_GSM1800_START,ARFCN_GSM1800_END,BAND_GSM1800,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_GSM1900_START,ARFCN_GSM1900_END,BAND_GSM1900,upOrDownlink); if(arfcn != -1) return arfcn; return -1; } else { if(preferedBand == BAND_GSM450) return testFrequencyInBand(frequency, ARFCN_GSM450_START,ARFCN_GSM450_END,BAND_GSM450,upOrDownlink); if(preferedBand == BAND_GSM480) return testFrequencyInBand(frequency, ARFCN_GSM480_START,ARFCN_GSM480_END,BAND_GSM480,upOrDownlink); if(preferedBand == BAND_GSM850) return testFrequencyInBand(frequency, ARFCN_GSM850_START,ARFCN_GSM850_END,BAND_GSM850,upOrDownlink); if(preferedBand == BAND_GSM900) { arfcn = testFrequencyInBand(frequency, ARFCN_GSM900_START,ARFCN_GSM900_END,BAND_GSM900,upOrDownlink); if(arfcn != -1) return arfcn; arfcn = testFrequencyInBand(frequency, ARFCN_REGSM900_START,ARFCN_REGSM900_END,BAND_GSM900,upOrDownlink); if(arfcn != -1) return arfcn; return -1; } if(preferedBand == BAND_GSM1800) return testFrequencyInBand(frequency, ARFCN_GSM1800_START,ARFCN_GSM1800_END,BAND_GSM1800,upOrDownlink); if(preferedBand == BAND_GSM1900) return testFrequencyInBand(frequency, ARFCN_GSM1900_START,ARFCN_GSM1900_END,BAND_GSM1900,upOrDownlink); } return -1; } /* Print copyright/programname headline */ void printHeadline(void) { printf("_______________________________________________________________________________\n\r"); printf("ArfcnCalc - GSM frequency calculation tool V.1.0\n\r"); printf("Copyright(c) 2010 Philipp Fabian Benedikt Maier\n\r"); printf("\n\r"); printf("CAUTION: This is a very early version of this program. It might still contain\r\n"); printf(" some bugs that might cause wrong calculation results. If you find a\r\n"); printf(" bug, please email to: philipp.maier@runningserver.com - Thanks!\r\n"); printf("\n\r"); return; } /* Print online help */ void printHelp(void) { printHeadline(); printf("This is a tool for calculating the resulting frequency from a given ARFCN\r\n"); printf("and can be used easyly in shellscripts for doing arfcn calculations\r\n"); printf("\r\n"); printf("The following options are available\r\n"); printf(" -h or -? ........ Print this screen.\r\n"); printf(" -v .............. Verbose output.\r\n"); printf(" -u .............. Calculate uplink frequency / Treat frequency as uplink\r\n"); printf(" -d .............. Calculate downlink frequency / Treat frequency as downlik\r\n"); printf(" -b .............. Specify band (optional, needed with GSM1900/1800).\r\n"); printf(" -p .............. Generate a bandplan with all known arfcns.\r\n"); printf(" -f .............. Find an Arfcn for a given frequency\r\n"); printf("\r\n"); printf("The following bands can be handled (option -b):\r\n"); printf(" 450 ............. GSM450\r\n"); printf(" 480 ............. GSM480\r\n"); printf(" 850 ............. GSM850\r\n"); printf(" 900 ............. GSM900 (P-GSM, E-GSM and R-GSM)\r\n"); printf(" 1800 ............ GSM1800 \\__Caution:\r\n"); printf(" 1900 ............ GSM1900 / Conflicting ARFCN-Numbers!\r\n"); printf("\r\n"); printf("Usage:\r\n"); printf(" %s -a arfcen [-udv -b band] ..... Calculate the frequency for an arfcn\r\n",programName); printf(" %s -f frequency [-udv -b band] .. Calculate arfcn for a frequency\r\n",programName); printf(" %s -p ........................... Generate bandplan\r\n",programName); printf("\r\n"); printf("Examples:\r\n"); printf(" %s -a 512 -b 1900 -d ... Calc downlink frequency (GSM1900) of Arfcn 512\r\n",programName); printf(" %s -a 123 -v ........... Get verbose information about Arfcn 123\r\n",programName); printf(" %s -f 959600000 -d ..... Get an arfcn for the dnlink frequency 959.6Mhz\r\n",programName); printf("\r\n"); exit(0); } /* Display verbose arfcn info */ void displayArfcnInfo(int arfcn, int band) { int fuplink; int fdownlink; char bandstring[255]; char banddetailstring[255]; char countrystring[255]; char providerstring[255]; calcFreqnencyFromArfcn(arfcn,band,&fuplink,&fdownlink); /* Display ARFCN */ printf(" * Arfn: %i\r\n",arfcn); /* Display up and downlink frequency */ printf(" * Downlink frequency is: %i000 Hz\r\n",fdownlink); printf(" * Uplink frequency is: %i000 Hz\r\n",fuplink); printf(" * Distance: %i000 Hz\r\n",arfcn2rxtxdiff(arfcn,band)); printf(" * Offset: %i\r\n",arfcn2offset(arfcn)); if(frequency2provider(COUNTRY_GERMANY, fdownlink, providerstring) == 0) printf(" * Licensed to %s in Germany\r\n",providerstring); if(frequency2provider(COUNTRY_AUSTRIA, fdownlink, providerstring) == 0) printf(" * Licensed to %s in Austria\r\n",providerstring); if(frequency2provider(COUNTRY_SWISS, fdownlink, providerstring) == 0) printf(" * Licensed to %s in Swissland\r\n",providerstring); if(frequency2provider(COUNTRY_ENGLAND, fdownlink, providerstring) == 0) printf(" * Licensed to %s in England\r\n",providerstring); /* Display in which band the arfcn is located */ if(band2string(band, bandstring) != -1) { printf(" * Band: %s",bandstring); if(arfn2bandetail(arfcn, band, banddetailstring) == 0) printf(" %s",banddetailstring); printf("\r\n"); } /* Try to find out the country where the band is operated in */ if(band2country(band,countrystring) != -1) printf(" * Country(s): %s\r\n",countrystring); printf("\r\n"); return; } /* Display uplink frequency in short form */ void displayUplink(int arfcn, int band) { int fuplink; int fdownlink; calcFreqnencyFromArfcn(arfcn,band,&fuplink,&fdownlink); printf("%i000\r\n",fuplink); } /* Display downlink frequency in short form */ void displayDownlink(int arfcn, int band) { int fuplink; int fdownlink; calcFreqnencyFromArfcn(arfcn,band,&fuplink,&fdownlink); printf("%i000\r\n",fdownlink); } /* ## MAIN PROGRAM #################################################################### */ int main(int argc, char *argv[]) { /* Calculation results */ int arfcn; int band; int frequency; /* Global var with program name */ strcpy(programName,basename(argv[0])); /* No arguments will trigger help screen */ if(argc == 1) printHelp(); /* Getopt stuff */ int getoptOption; int getoptArfcnSet = 0; int getoptArfcn; int getoptDownlinkSet = 0; int getoptUplinkSet = 0; int getoptVerboseSet = 0; int getoptBandSet = 0; int getoptBand = 0; int getoptPlanSet = 0; int getoptFrequencySet = 0; int getoptFrequency = 0; while ((getoptOption = getopt (argc, argv, "ph?a:duvb:f:")) != -1) switch (getoptOption) { case 'h':printHelp(); case '?':printHelp(); case 'p': getoptPlanSet = 1; break; case 'a': getoptArfcn = atoi(optarg); getoptArfcnSet = 1; break; case 'f': getoptFrequency = atoi(optarg); getoptFrequencySet = 1; break; case 'd': getoptDownlinkSet = 1; break; case 'u': getoptUplinkSet = 1; break; case 'v': getoptVerboseSet = 1; break; case 'b': getoptBand = atoi(optarg); getoptBandSet = 1; break; } /* Generate a complete bandplan */ if(getoptPlanSet) { printHeadline(); generateCompleteFrequencyTable(); exit(0); } /* In verbose mode, display copyright headline */ if(getoptVerboseSet) printHeadline(); /* When an arfcn is given, determine the band the arfcn belongs to: */ if(getoptArfcnSet) { arfcn = getoptArfcn; /* Check whether the arfcn belongs to any band. If not it must be invalid */ if(arfcn2band(arfcn) == -1) { printf("%s: %i: Invalid arfcn\r\n",programName,arfcn); exit(1); } if(getoptBandSet) band = getoptBand; /* Band is supplyed as argument */ else { band = arfcn2band(getoptArfcn); /* Try to derive the band from the given arfcn */ /* Display warning when ARFCN is in GSM1800 or GSM1900 */ if((arfcn2band(getoptArfcn) == BAND_GSM1800)||(arfcn2band(getoptArfcn) == BAND_GSM1900)) printf(" * Warning: GSM1800 and GSM1900 share comman ARFCNs, you\r\n" " should specify a band.\r\n"); } /* Make sure that band and arfcn fit together */ if(getoptBandSet) if(arfcn2band(getoptArfcn) != getoptBand) if(getoptBand != BAND_GSM1900) { printf("%s: GSM%i: Band does not fit to arfcn\r\n",programName,getoptBand); exit(1); } /* Display verbose information */ if(getoptVerboseSet) { displayArfcnInfo(arfcn,band); exit(0); } /* Display short finformation (more suitable for shellscripts) */ else { /* Downlink frequency */ if(getoptDownlinkSet) { displayDownlink(arfcn, band); exit(0); } /* Uplink frequency */ else if(getoptUplinkSet) { displayUplink(arfcn, band); exit(0); } /* Nothing */ else { printf("%s: No output method selected\r\n",programName); exit(1); } } } else if(getoptFrequencySet) { if(getoptBandSet) band = getoptBand; else band = BAND_ALLOTHERS; frequency = getoptFrequency / 1000; if(getoptDownlinkSet) arfcn = testFrequencyInCompleteBand(frequency,getoptBand,DOWNLINK); else if(getoptUplinkSet) arfcn = testFrequencyInCompleteBand(frequency,getoptBand,UPLINK); else arfcn = testFrequencyInCompleteBand(frequency,getoptBand,0); if(arfcn == -1) { printf("%s: %i: Frequency is not part of an GSM-Band\r\n",programName,frequency); exit(1); } /* Try to find the band if it is not given */; if(!(getoptBandSet)) band = arfcn2band(arfcn); /* Display verbose information */ if(getoptVerboseSet) { displayArfcnInfo(arfcn,band); exit(0); } /* Display short finformation (more suitable for shellscripts) */ else { /* Arfcn */ printf("%i\n",arfcn); exit(0); } } else { printf("%s: You must spefify an ARFCN\r\n",programName); exit(1); } return 0; } /* #################################################################################### */ ./arfcncalc/lookup.c0000644000175000017500000006665612130372733014200 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Lookup tables # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #include #include #include "band.h" #include "arfcn.h" #include "lookup.h" #include "country.h" #include "provider.h" /* #################################################################################### */ /* ## LOOKUP TABLES ################################################################### */ /* Transform a given band to to a human readable band description string */ int band2string(int band, char *string) { string[0] = 0; switch(band) { case BAND_GSM450: strcpy(string,"GSM450"); break; case BAND_GSM480: strcpy(string,"GSM480"); break; case BAND_GSM850: strcpy(string,"GSM850"); break; case BAND_GSM900: strcpy(string,"GSM900"); break; case BAND_GSM1800: strcpy(string,"GSM1800"); break; case BAND_GSM1900: strcpy(string,"GSM1900"); break; default: return -1; } return 0; } /* Get a more detailed information about the band */ int arfn2bandetail(int arfcn, int band, char *string) { string[0] = 0; if((arfcn >= ARFCN_GSM450_START)&&(arfcn <= ARFCN_GSM450_END)) /* GSM 450 */ return -1; /* No details available */ else if((arfcn >= ARFCN_GSM480_START)&&(arfcn <= ARFCN_GSM480_END)) /* GSM 480 */ return -1; /* No details available */ else if((arfcn >= ARFCN_GSM850_START)&&(arfcn <= ARFCN_GSM850_END)) /* GSM 850 */ return -1; /* No details available */ else if(arfcn == ARFCN_GSM900_START) /* GSM 900, E-GSM or R-GSM */ { strcpy(string,"(E-GSM or R-GSM)"); return 0; } else if((arfcn >= ARFCN_GSM900_START+1)&&(arfcn <= ARFCN_GSM900_END)) /* GSM 900 E-GSM, R-GSM or P-GSM */ { strcpy(string,"(P-GSM, E-GSM or R-GSM)"); return 0; } else if((arfcn >= ARFCN_REGSM900_START)&&(arfcn <= ARFCN_REGSM900_END)) /* R-GSM 900 */ { strcpy(string,"(E-GSM or R-GSM)"); return 0; } else if((arfcn >= ARFCN_GSM1900_START)&&(arfcn <= ARFCN_GSM1900_END)&&(band == BAND_GSM1900)) /* PCS 1900 (GSM 1900) */ { strcpy(string,"(PCS 1900)"); return 0; } else if((arfcn >= ARFCN_GSM1800_START)&&(arfcn <= ARFCN_GSM1800_END)) /* DCS 1800 (GSM 1800) */ { strcpy(string,"(DCS 1800)"); return 0; } else return -1; } /* Find out the country for a given band */ int band2country(int band, char *string) { string[0] = 0; switch(band) { case BAND_GSM450: strcpy(string,"NORDIC, BENELUX, ALPINE, RUSSIA, EASTERN EUROPE, TANZANIA"); break; case BAND_GSM480: strcpy(string,"NOT IN USE ?"); break; case BAND_GSM850: strcpy(string,"USA, CANADA, BRAZIL, GUATEMALA, EL SALVADOR"); break; case BAND_GSM900: strcpy(string,"EUROPE, BRAZIL, GUATEMALA, EL SALVADOR"); break; case BAND_GSM1800: strcpy(string,"EUROPE, COSTA RICA, BRAZIL, HONG-KONG"); break; case BAND_GSM1900: strcpy(string,"USA, CANADA, GUATEMALA, EL SALVADOR"); break; default: return -1; } return 0; } /* Try to find out the band for a given arfcn */ int arfcn2band(int arfcn) { if((arfcn >= ARFCN_GSM450_START)&&(arfcn <= ARFCN_GSM450_END)) /* GSM 450 */ return BAND_GSM450; else if((arfcn >= ARFCN_GSM480_START)&&(arfcn <= ARFCN_GSM480_END)) /* GSM 480 */ return BAND_GSM480; else if((arfcn >= ARFCN_GSM850_START)&&(arfcn <= ARFCN_GSM850_END)) /* GSM 850 */ return BAND_GSM850; else if((arfcn >= ARFCN_GSM900_START)&&(arfcn <= ARFCN_GSM900_END)) /* E-GSM, R-GSM or P-GSM */ return BAND_GSM900; else if((arfcn >= ARFCN_REGSM900_START)&&(arfcn <= ARFCN_REGSM900_END)) /* R-GSM 900 */ return BAND_GSM900; else if((arfcn >= ARFCN_GSM1800_START)&&(arfcn <= ARFCN_GSM1800_END)) /* DCS 1800 (GSM 1800) */ return BAND_GSM1800; else if((arfcn >= ARFCN_GSM1900_START)&&(arfcn <= ARFCN_GSM1900_END)) /* DCS 1800 (GSM 1800) and PCS 1900 (GSM 1900) */ return BAND_GSM1900; else return -1; } /* Find out the offset for a given arfcn */ int arfcn2offset(int arfcn) { if((arfcn >= ARFCN_GSM450_START)&&(arfcn <= ARFCN_GSM450_END)) /* GSM 450 */ return 259; else if((arfcn >= ARFCN_GSM480_START)&&(arfcn <= ARFCN_GSM480_END)) /* GSM 480 */ return 306; else if((arfcn >= ARFCN_GSM850_START)&&(arfcn <= ARFCN_GSM850_END)) /* GSM 850 */ return 128; else if((arfcn >= ARFCN_GSM900_START)&&(arfcn <= ARFCN_GSM900_END)) /* E-GSM, R-GSM or P-GSM */ return 0; else if((arfcn >= ARFCN_REGSM900_START)&&(arfcn <= ARFCN_REGSM900_END)) /* R-GSM 900 */ return 1024; else if((arfcn >= ARFCN_GSM1800_START)&&(arfcn <= ARFCN_GSM1800_END)) /* DCS 1800 (GSM 1800) and PCS 1900 (GSM 1900) */ return 512; else return -1; } /* Find out difference between rx and tx for a given arfcn */ int arfcn2rxtxdiff(int arfcn, int band) { if((arfcn >= ARFCN_GSM450_START)&&(arfcn <= ARFCN_GSM450_END)) /* GSM 450 */ return 10000; else if((arfcn >= ARFCN_GSM480_START)&&(arfcn <= ARFCN_GSM480_END)) /* GSM 480 */ return 10000; else if((arfcn >= ARFCN_GSM850_START)&&(arfcn <= ARFCN_GSM850_END)) /* GSM 850 */ return 45000; else if((arfcn >= ARFCN_GSM900_START)&&(arfcn <= ARFCN_GSM900_END)) /* E-GSM, R-GSM or P-GSM */ return 45000; else if((arfcn >= ARFCN_REGSM900_START)&&(arfcn <= ARFCN_REGSM900_END)) /* R-GSM 900 */ return 45000; else if((arfcn >= ARFCN_GSM1900_START)&&(arfcn <= ARFCN_GSM1900_END)&&(band == BAND_GSM1900)) /* PCS 1900 (GSM 1900) */ return 80000; else if((arfcn >= ARFCN_GSM1800_START)&&(arfcn <= ARFCN_GSM1800_END)) /* DCS 1800 (GSM 1800) */ return 95000; else return -1; } /* Find out start frequency */ int arfcn2startfreq(int arfcn, int band) { if((arfcn >= ARFCN_GSM450_START)&&(arfcn <= ARFCN_GSM450_END)) /* GSM 450 */ return 450600; else if((arfcn >= ARFCN_GSM480_START)&&(arfcn <= ARFCN_GSM480_END)) /* GSM 480 */ return 479000; else if((arfcn >= ARFCN_GSM850_START)&&(arfcn <= ARFCN_GSM850_END)) /* GSM 850 */ return 824200; else if((arfcn >= ARFCN_GSM900_START)&&(arfcn <= ARFCN_GSM900_END)) /* E-GSM, R-GSM or P-GSM */ return 890000; else if((arfcn >= ARFCN_REGSM900_START)&&(arfcn <= ARFCN_REGSM900_END)) /* R-GSM 900 */ return 890000; else if((arfcn >= ARFCN_GSM1900_START)&&(arfcn <= 810)&&(band == BAND_GSM1900)) /* PCS 1900 (GSM 1900) */ return 1850200; else if((arfcn >= ARFCN_GSM1800_START)&&(arfcn <= ARFCN_GSM1800_END)) /* DCS 1800 (GSM 1800) */ return 1710200; else return -1; } /* Try to find out to which provider the frequency is allocated */ int frequency2provider(int country, int frequency, char *provider) { if(country == COUNTRY_GERMANY) { /* GSM900 */ if((frequency >= 876200)&&(frequency <= 880000)) { strcpy(provider,PROVIDER_GERMANY_DEUTSCHEBAHN); return 0; } else if((frequency >= 880100)&&(frequency <= 885100)) { strcpy(provider,PROVIDER_GERMANY_EPLUS); return 0; } else if((frequency >= 885100)&&(frequency <= 890100)) { strcpy(provider,PROVIDER_GERMANY_O2); return 0; } else if((frequency >= 890200)&&(frequency <= 892400)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 892600)&&(frequency <= 899800)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } else if((frequency >= 900000)&&(frequency <= 906000)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 906200)&&(frequency <= 910400)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } else if((frequency >= 910600)&&(frequency <= 914200)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 921200)&&(frequency <= 925000)) { strcpy(provider,PROVIDER_GERMANY_DEUTSCHEBAHN); return 0; } else if((frequency >= 925100)&&(frequency <= 930100)) { strcpy(provider,PROVIDER_GERMANY_EPLUS); return 0; } else if((frequency >= 930100)&&(frequency <= 935100)) { strcpy(provider,PROVIDER_GERMANY_O2); return 0; } else if((frequency >= 935200)&&(frequency <= 937400)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 937600)&&(frequency <= 944800)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } else if((frequency >= 945000)&&(frequency <= 951000)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 951200)&&(frequency <= 955400)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } else if((frequency >= 955600)&&(frequency <= 959200)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 959400)&&(frequency <= 959800)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } /* GSM1800 */ else if((frequency >= 1725200)&&(frequency <= 1730000)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } else if((frequency >= 1730200)&&(frequency <= 1752400)) { strcpy(provider,PROVIDER_GERMANY_O2); return 0; } else if((frequency >= 1752800)&&(frequency <= 1758000)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 1758200)&&(frequency <= 1780400)) { strcpy(provider,PROVIDER_GERMANY_EPLUS); return 0; } else if((frequency >= 1820200)&&(frequency <= 1825000)) { strcpy(provider,PROVIDER_GERMANY_TMOBILE); return 0; } else if((frequency >= 1825000)&&(frequency <= 1847400)) { strcpy(provider,PROVIDER_GERMANY_O2); return 0; } else if((frequency >= 1847800)&&(frequency <= 1853000)) { strcpy(provider,PROVIDER_GERMANY_VODAFONE); return 0; } else if((frequency >= 1853200)&&(frequency <= 1875400)) { strcpy(provider,PROVIDER_GERMANY_EPLUS); return 0; } } else if(country == COUNTRY_AUSTRIA) { /* GSM900 */ if((frequency >= 880200)&&(frequency <= 883200)) { strcpy(provider, PROVIDER_AUSTRIA_ONE); return 0; } else if((frequency >= 883600)&&(frequency <= 889800)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 893000)&&(frequency <= 897800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 898200)&&(frequency <= 905800)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 906200)&&(frequency <= 913800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 925200)&&(frequency <= 928200)) { strcpy(provider, PROVIDER_AUSTRIA_ONE); return 0; } else if((frequency >= 928600)&&(frequency <= 934800)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 938000)&&(frequency <= 942800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 943200)&&(frequency <= 950800)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 951200)&&(frequency <= 958800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } /* GSM1800 */ else if((frequency >= 1710200)&&(frequency <= 1712000)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1712400)&&(frequency <= 1722400)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1722800)&&(frequency <= 1731200)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1731600)&&(frequency <= 1733800)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1734200)&&(frequency <= 1739600)) { strcpy(provider, PROVIDER_AUSTRIA_ONE); return 0; } else if((frequency >= 1740000)&&(frequency <= 1741000)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1741400)&&(frequency <= 1742400)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1742800)&&(frequency <= 1743800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1744200)&&(frequency <= 1747600)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1748000)&&(frequency <= 1750200)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1750600)&&(frequency <= 1755000)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1755400)&&(frequency <= 1756400)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1756800)&&(frequency <= 1757800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1758200)&&(frequency <= 1781400)) { strcpy(provider, PROVIDER_AUSTRIA_ONE); return 0; } else if((frequency >= 1805200)&&(frequency <= 1807000)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1807400)&&(frequency <= 1817400)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1817800)&&(frequency <= 1826200)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1826600)&&(frequency <= 1828800)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1829200)&&(frequency <= 1834600)) { strcpy(provider, PROVIDER_AUSTRIA_ONE); return 0; } else if((frequency >= 1835000)&&(frequency <= 1836000)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1836400)&&(frequency <= 1837400)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1837800)&&(frequency <= 1838800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1839200)&&(frequency <= 1842600)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1843000)&&(frequency <= 1845200)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1845600)&&(frequency <= 1850000)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1850400)&&(frequency <= 1851400)) { strcpy(provider, PROVIDER_AUSTRIA_MOBILKOM); return 0; } else if((frequency >= 1851800)&&(frequency <= 1852800)) { strcpy(provider, PROVIDER_AUSTRIA_TMOBILE); return 0; } else if((frequency >= 1853200)&&(frequency <= 1876400)) { strcpy(provider, PROVIDER_AUSTRIA_ONE); return 0; } } else if(country == COUNTRY_SWISS) { /* GSM900 */ if((frequency >= 880100)&&(frequency <= 883300)) { strcpy(provider, PROVIDER_SWISS_ORANGE); return 0; } else if((frequency >= 883500)&&(frequency <= 889900)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 890100)&&(frequency <= 902300)) { strcpy(provider, PROVIDER_SWISS_SWISSCOM); return 0; } else if((frequency >= 902500)&&(frequency <= 907300)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 907500)&&(frequency <= 908900)) { strcpy(provider, PROVIDER_SWISS_SWISSCOM); return 0; } else if((frequency >= 909100)&&(frequency <= 914900)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 925100)&&(frequency <= 928300)) { strcpy(provider, PROVIDER_SWISS_ORANGE); return 0; } else if((frequency >= 928500)&&(frequency <= 934900)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 935100)&&(frequency <= 947300)) { strcpy(provider, PROVIDER_SWISS_SWISSCOM); return 0; } else if((frequency >= 947500)&&(frequency <= 952300)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 952500)&&(frequency <= 953900)) { strcpy(provider, PROVIDER_SWISS_SWISSCOM); return 0; } else if((frequency >= 954100)&&(frequency <= 959900)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } /* GSM1800 */ else if((frequency >= 1710100)&&(frequency <= 1736300)) { strcpy(provider, PROVIDER_SWISS_ORANGE); return 0; } else if((frequency >= 1736500)&&(frequency <= 1751700)) { strcpy(provider, PROVIDER_SWISS_SWISSCOM); return 0; } else if((frequency >= 1751900)&&(frequency <= 1760300)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 1760500)&&(frequency <= 1763700)) { strcpy(provider, PROVIDER_SWISS_ORANGE); return 0; } else if((frequency >= 1763900)&&(frequency <= 1766900)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 1767100)&&(frequency <= 1775700)) { strcpy(provider, PROVIDER_SWISS_TELE2); return 0; } else if((frequency >= 1775900)&&(frequency <= 1781700)) { strcpy(provider, PROVIDER_SWISS_INPHONE); return 0; } else if((frequency >= 1781900)&&(frequency <= 1784100)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 1805100)&&(frequency <= 1831300)) { strcpy(provider, PROVIDER_SWISS_ORANGE); return 0; } else if((frequency >= 1831500)&&(frequency <= 1846700)) { strcpy(provider, PROVIDER_SWISS_SWISSCOM); return 0; } else if((frequency >= 1846900)&&(frequency <= 1855300)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 1855500)&&(frequency <= 1858700)) { strcpy(provider, PROVIDER_SWISS_ORANGE); return 0; } else if((frequency >= 1858900)&&(frequency <= 1861900)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } else if((frequency >= 1862100)&&(frequency <= 1870700)) { strcpy(provider, PROVIDER_SWISS_TELE2); return 0; } else if((frequency >= 1870900)&&(frequency <= 1876700)) { strcpy(provider, PROVIDER_SWISS_INPHONE); return 0; } else if((frequency >= 1876900)&&(frequency <= 1879100)) { strcpy(provider, PROVIDER_SWISS_SUNRISE); return 0; } } else if(country == COUNTRY_ENGLAND) { /* GSM900 */ if((frequency >= 880100)&&(frequency <= 885100)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 885100)&&(frequency <= 890100)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 890100)&&(frequency <= 894700)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 894700)&&(frequency <= 902100)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 902100)&&(frequency <= 909900)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 909900)&&(frequency <= 914900)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 925100)&&(frequency <= 930100)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 930100)&&(frequency <= 935100)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 935100)&&(frequency <= 939700)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 939700)&&(frequency <= 947100)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 947100)&&(frequency <= 954900)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 954900)&&(frequency <= 959900)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } /* GSM1800 */ else if((frequency >= 1710100)&&(frequency <= 1715900)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 1715900)&&(frequency <= 1721700)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 1721700)&&(frequency <= 1751700)) { strcpy(provider, PROVIDER_ENGLAND_TMOBILE); return 0; } else if((frequency >= 1751700)&&(frequency <= 1781700)) { strcpy(provider, PROVIDER_ENGLAND_ORANGE); return 0; } else if((frequency >= 1805100)&&(frequency <= 1810900)) { strcpy(provider, PROVIDER_ENGLAND_O2); return 0; } else if((frequency >= 1810900)&&(frequency <= 1816700)) { strcpy(provider, PROVIDER_ENGLAND_VODAFONE); return 0; } else if((frequency >= 1816700)&&(frequency <= 1846700)) { strcpy(provider, PROVIDER_ENGLAND_TMOBILE); return 0; } else if((frequency >= 1846700)&&(frequency <= 1876700)) { strcpy(provider, PROVIDER_ENGLAND_ORANGE); return 0; } } return -1; } /* #################################################################################### */ /* ## REVERSE LOOKUP TABLES ########################################################### */ #if 0 /* Find the offset for a given uplink frequency */ int fuplink2offset(int frequency) { if((frequency >= 450600)&&(frequency <= 457400)) /* GSM 450 */ return 259; else if((frequency >= 479000)&&(frequency <= 485800)) /* GSM 480 */ return 306; else if((frequency >= 824200)&&(frequency <= 848800)) /* GSM 850 */ return 128; else if((frequency >= 890000)&&(frequency <= 914800)) /* E-GSM, R-GSM or P-GSM */ return 0; else if((frequency >= 876200)&&(frequency <= 889800)) /* R-GSM or E-GSM */ return 1024; else if((frequency >= 1850200)&&(frequency <= 1909800)) /* PCS 1900 (GSM 1900) */ return 512; else if((frequency >= 1710200)&&(frequency <= 1784800)) /* DCS 1800 (GSM 1800) */ return ARFCN_GSM1800_START; else return -1; } /* Find the offset for a given downlink frequency */ int fdownlink2offset(int frequency) { if((frequency >= 460600)&&(frequency <= 467400)) /* GSM 450 */ return 259; else if((frequency >= 489000)&&(frequency <= 495800)) /* GSM 480 */ return 306; else if((frequency >= 896200)&&(frequency <= 893800)) /* GSM 850 */ return 128; else if((frequency >= 935000)&&(frequency <= 959800)) /* E-GSM, R-GSM or P-GSM */ return 0; else if((frequency >= 921200)&&(frequency <= 934800)) /* R-GSM or E-GSM */ return 1024; else if((frequency >= 1930200)&&(frequency <= 1989800)) /* PCS 1900 (GSM 1900) */ return 512; else if((frequency >= 1805200)&&(frequency <= 1879800)) /* DCS 1800 (GSM 1800) */ return ARFCN_GSM1800_START; else return -1; } /* Find the startfrequency for a given uplink frequency */ int fuplink2startfreq(int frequency) { if((frequency >= 450600)&&(frequency <= 457400)) /* GSM 450 */ return 450600; else if((frequency >= 479000)&&(frequency <= 485800)) /* GSM 480 */ return 479000; else if((frequency >= 824200)&&(frequency <= 848800)) /* GSM 850 */ return 824200; else if((frequency >= 890000)&&(frequency <= 914800)) /* E-GSM, R-GSM or P-GSM */ return 890000; else if((frequency >= 876200)&&(frequency <= 889800)) /* R-GSM or E-GSM */ return 890000; else if((frequency >= 1850200)&&(frequency <= 1909800)) /* PCS 1900 (GSM 1900) */ return 1850200; else if((frequency >= 1710200)&&(frequency <= 1784800)) /* DCS 1800 (GSM 1800) */ return 1710200; else return -1; } /* Find the startfrequency for a given downlink frequency */ int fdownlink2startfreq(int frequency) { if((frequency >= 460600)&&(frequency <= 467400)) /* GSM 450 */ return 450600; else if((frequency >= 489000)&&(frequency <= 495800)) /* GSM 480 */ return 479000; else if((frequency >= 896200)&&(frequency <= 893800)) /* GSM 850 */ return 824200; else if((frequency >= 935000)&&(frequency <= 959800)) /* E-GSM, R-GSM or P-GSM */ return 890000; else if((frequency >= 921200)&&(frequency <= 934800)) /* R-GSM or E-GSM */ return 890000; else if((frequency >= 1930200)&&(frequency <= 1989800)) /* PCS 1900 (GSM 1900) */ return 1850200; else if((frequency >= 1805200)&&(frequency <= 1879800)) /* DCS 1800 (GSM 1800) */ return 1710200; else return -1; } /* Find the difference between rx and tx for a given uplink frequency */ int fuplink2rxtxdiff(int frequency) { if((frequency >= 450600)&&(frequency <= 457400)) /* GSM 450 */ return 10000; else if((frequency >= 479000)&&(frequency <= 485800)) /* GSM 480 */ return 10000; else if((frequency >= 824200)&&(frequency <= 848800)) /* GSM 850 */ return 45000; else if((frequency >= 890000)&&(frequency <= 914800)) /* E-GSM, R-GSM or P-GSM */ return 45000; else if((frequency >= 876200)&&(frequency <= 889800)) /* R-GSM or E-GSM */ return 45000; else if((frequency >= 1850200)&&(frequency <= 1909800)) /* PCS 1900 (GSM 1900) */ return 80000; else if((frequency >= 1710200)&&(frequency <= 1784800)) /* DCS 1800 (GSM 1800) */ return 95000; else return -1; } /* Find the difference between rx and tx for a given downlink frequency */ int fdownlink2rxtxdiff(int frequency) { if((frequency >= 460600)&&(frequency <= 467400)) /* GSM 450 */ return 10000; else if((frequency >= 489000)&&(frequency <= 495800)) /* GSM 480 */ return 10000; else if((frequency >= 896200)&&(frequency <= 893800)) /* GSM 850 */ return 45000; else if((frequency >= 935000)&&(frequency <= 959800)) /* E-GSM, R-GSM or P-GSM */ return 45000; else if((frequency >= 921200)&&(frequency <= 934800)) /* R-GSM or E-GSM */ return 45000; else if((frequency >= 1930200)&&(frequency <= 1989800)) /* PCS 1900 (GSM 1900) */ return 80000; else if((frequency >= 1805200)&&(frequency <= 1879800)) /* DCS 1800 (GSM 1800) */ return 95000; else return -1; } #endif /* #################################################################################### */ ./arfcncalc/calc.c~0000644000175000017500000000522411540640501013742 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Calculator # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #include #include "band.h" #include "lookup.h" /* #################################################################################### */ /* ## CALCULATOR ###################################################################### */ /* Calc frequency from ARFCN */ void calcFreqnencyFromArfcn(int arfcn, int band, int *fuplink, int *fdownlink) { int offset = arfcn2offset(arfcn); int difference = arfcn2rxtxdiff(arfcn,band); int startfreq = arfcn2startfreq(arfcn,band); *fuplink = startfreq + (arfcn - offset) * 200; *fdownlink = *fuplink + difference; return; } /* #################################################################################### */ ./arfcncalc/calc.o0000664000175000017500000000312011753674162013573 0ustar dexterdexterELF>@@ UHH0}uHUHM؋EEUE։EUE։EEU)iUHEHEUHE؉GCC: (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1zRx wAC r .symtab.strtab.shstrtab.rela.text.data.bss.comment.note.GNU-stack.rela.eh_frame @wH &,10+:O8J8  Y   Kw,;calc.ccalcFreqnencyFromArfcnarfcn2offsetarfcn2rxtxdiffarfcn2startfreq . @ ./arfcncalc/Makefile0000644000175000017500000000043211540640501014132 0ustar dexterdexterall: main.o lookup.o calc.o gcc -std=c99 ./*.o -o arfcncalc main.o: main.c gcc -std=c99 -Wall -c main.c lookup.o: lookup.c gcc -std=c99 -Wall -c lookup.c calc.o: calc.c gcc -std=c99 -Wall -c calc.c clean: rm ./*.o rm ./arfcncalc install: cp ./arfcncalc /usr/local/bin/ ./arfcncalc/arfcn.h0000644000175000017500000000505611540640501013743 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # GSM-Arfns # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #ifndef ARFCN_H #define ARFCN_H #define ARFCN_GSM450_START 259 #define ARFCN_GSM450_END 293 #define ARFCN_GSM480_START 306 #define ARFCN_GSM480_END 340 #define ARFCN_GSM850_START 128 #define ARFCN_GSM850_END 251 #define ARFCN_GSM900_START 0 #define ARFCN_GSM900_END 124 #define ARFCN_REGSM900_START 955 #define ARFCN_REGSM900_END 1023 #define ARFCN_GSM1800_START 512 #define ARFCN_GSM1800_END 885 #define ARFCN_GSM1900_START 512 #define ARFCN_GSM1900_END 810 #endif /*ARFCN_H*/ /* #################################################################################### */ ./arfcncalc/lookup.o0000644000175000017500000002566012130372764014206 0ustar dexterdexterELF>0&@@ UH}HuHEE=Rt]=R=t#=t2=th=ltt=tD~HEGSM4f@50@oHEGSM4f@80@YHEGSM8f@50@CHEGSM9f@00@-HEGSM1@800HEGSM1@900]UH}uHUHE}~}% ]}1~}T A}~} (}u-HE(E-G@SM o@r R-@ GSM)@}~=}|7HE(P-G@SM, @E-GS@ M or@ R-G@SM)}~3}*HE(E-G@SM o@r R-@ GSM)@v}~4}*+}lu"HE(PCS@ 190f@0)@ 9}~+}u"HE(DCS@ 180f@0)@ ]UH}HuHEE=R=R=t6==R=l=HENORD@IC, @BENE@ LUX,@ ALP@INE,@ RUS@SIA,@ EAS@$TERN@( EUR@,OPE,@0 TAN@4ZANIf@8A\HENOT @IN U@SE ?@ ;HEUSA,@ CAN@ADA,@ BRA@ZIL,@ GUA@TEMA@LA, @ EL S@$ALVA@(DORHEEURO@PE, @BRAZ@ IL, @GUAT@EMAL@A, E@L SA@ LVADf@$OR@&HEEURO@PE, @COST@ A RI@CA, @BRAZ@IL, @HONG@ -KONf@$GKHEUSA,@ CAN@ADA,@ GUA@TEMA@LA, @EL S@ALVA@ DOR]UH}}~}% }1~}Ty}~}Rc}x }|P}~}7}~}u}~}*l]UH}}~}%y}1~}T2`}~}J}x }|7}~}}~}u]UH}u}~}% '}1~}T '}~}ȯl}x }|ȯY}~}ȯ@}~}*}lu8}~}us]UH}u}~}% (}1~}T O}~} l}x }| Y}~} @}~}*}luX;}~}ux]UH}uHU}D#}^ ~?}m 6HEDB-T@elem@atik@ (26@2 10f@)t}m ~2}l )HEE-Pl@us (@262 @ 03)9}k ~+} "HEo2 (@262 @07)}W ~8} /HEVoda@fone@ (26@ 2 02f@)} ~8}غ /HET-Mo@bile@ (26@ 2 01f@)} ~8} /HEVoda@fone@ (26@ 2 02f@)B} ~8}@ /HET-Mo@bile@ (26@ 2 01f@)} ~8} /HEVoda@fone@ (26@ 2 02f@)}o~?}H6HEDB-T@elem@atik@ (26@2 10f@)x}~2}41)HEE-Pl@us (@262 @ 03)=}31~+}D"HEo2 (@262 @07) }E~8}M/HEVoda@fone@ (26@ 2 02f@)}N~8}j/HET-Mo@bile@ (26@ 2 01f@)}gk~8}؂/HEVoda@fone@ (26@ 2 02f@)F}~8}/HET-Mo@bile@ (26@ 2 01f@)}ϔ~8}/HEVoda@fone@ (26@ 2 02f@)}~8}8/HET-Mo@bile@ (26@ 2 01f@)}S~8}e/HET-Mo@bile@ (26@ 2 01f@)B}f~+}P"HEo2 (@262 @07)}߾~8}0/HEVoda@fone@ (26@ 2 02f@)}~2}*)HEE-Pl@us (@262 @ 03)}'~8}/HET-Mo@bile@ (26@ 2 01f@)Q}~+}h0"HEo2 (@262 @07)}1~8}HF/HEVoda@fone@ (26@ 2 02f@)}G}ȝHEE-Pl@us (@262 @ 03)}A }Gn ~/}z &HEOne @(232@ 05)@ W}{ ~8}ȓ /HEMobi@lkom@ (23@ 2 01f@)}G ~J} AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@} ~8}H /HEMobi@lkom@ (23@ 2 01f@)} ~J} AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@/}~/})&HEOne @(232@ 05)@ }W+~8}C/HEMobi@lkom@ (23@ 2 01f@)}P~J}bAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@c}_d~8}/HEMobi@lkom@ (23@ 2 01f@)"}~J}PAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}w~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@|}!~8} H/HEMobi@lkom@ (23@ 2 01f@);}I~J}jAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}l~8}t/HEMobi@lkom@ (23@ 2 01f@)}7v~/}P&HEOne @(232@ 05)@ o}ߌ~J}ȐAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}W~8}@/HEMobi@lkom@ (23@ 2 01f@)}ϗ~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}G~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@5}~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}G~J}xAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}~8}/HEMobi@lkom@ (23@ 2 01f@)N}~J}hAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}~/}.&HEOne @(232@ 05)@ }~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@p}'~8}8/HEMobi@lkom@ (23@ 2 01f@)/}Ǽ~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}'~8}/HEMobi@lkom@ (23@ 2 01f@)}O~/}h&HEOne @(232@ 05)@ c}~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@}o~8}X /HEMobi@lkom@ (23@ 2 01f@) } ~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@| }_~J}AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@) }7~J}'AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@ }_)~J}:AHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@ }<~8}@/HEMobi@lkom@ (23@ 2 01f@)B }A~J}EAHET-Mo@bile@ Aau@ stri@a (2@32 0f@3)@ }G } HEOne @(232@ 05)@ }S}m ~2}dz )HEOran@ge (@228 @ 03)j }+{ ~6}, -HESunr@ise @(228@ 02)@+ } ~8} /HESwis@scom@ (22@ 8 01f@) }c ~6}$ -HESunr@ise @(228@ 02)@ } ~8}d /HESwis@scom@ (22@ 8 01f@)j }+ ~6} -HESunr@ise @(228@ 02)@+ }~2},*)HEOran@ge (@228 @ 03) }*~6}C-HESunr@ise @(228@ 02)@ }D~8}dt/HESwis@scom@ (22@ 8 01f@)p }+u~6}-HESunr@ise @(228@ 02)@1 }~8},/HESwis@scom@ (22@ 8 01f@)}~6}-HESunr@ise @(228@ 02)@}~2}l~)HEOran@ge (@228 @ 03)v}3~8}/HESwis@scom@ (22@ 8 01f@)5}[~6},-HESunr@ise @(228@ 02)@}~2}t)HEOran@ge (@228 @ 03)};~6}-HESunr@ise @(228@ 02)@|}~5}T,HETele@2 (2@28 0f@ 8)@>}~6}/-HEInph@one @(228@ 07)@}0~6}$9-HESunr@ise @(228@ 02)@}+~2})HEOran@ge (@228 @ 03)}K~8}-/HESwis@scom@ (22@ 8 01f@)D}s.~6}DO-HESunr@ise @(228@ 02)@} P~2}\)HEOran@ge (@228 @ 03)}S]~6} i-HESunr@ise @(228@ 02)@}i~5}l,HETele@2 (2@28 0f@ 8)@M}3~6}ܢ-HEInph@one @(228@ 07)@}}<HESunr@ise @(228@ 02)@}E}m ~8}l /HEVoda@fone@ (23@ 4 91f@)|}k ~+} "HEo2 (@234 @10)H} ~8} /HEVoda@fone@ (23@ 4 91f@)} ~+} "HEo2 (@234 @10)} ~8}L /HEVoda@fone@ (23@ 4 91f@)}K ~+} "HEo2 (@234 @10)^}~8}41/HEVoda@fone@ (23@ 4 91f@)}31~+}D"HEo2 (@234 @10)}D~8}V/HEVoda@fone@ (23@ 4 91f@)}V~+}s"HEo2 (@234 @10)t}s~8}/HEVoda@fone@ (23@ 4 91f@)3}~+}"HEo2 (@234 @10)}~+}."HEo2 (@234 @10)}.~8}dE/HEVoda@fone@ (23@ 4 91f@)}cE~=}4HET-Mo@bile@ UK @ (234@ 32)@D}~<}/3HEOran@ge (@234 @ 33/3f@4)@}+~+}ԡ"HEo2 (@234 @10)}ӡ~8}|/HEVoda@fone@ (23@ 4 91f@)}{~:}-1HET-Mo@bile@ UK @ (234@ 32)@G}-~9}ܢ0HEOran@ge (@234 @ 33/3f@4)@]GCC: (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2zRx AC  <AC  \7AC 2 |AC  AC  AC  AC  AC  .symtab.strtab.shstrtab.text.data.bss.comment.note.GNU-stack.rela.eh_frame@T$!$'$,0$+5$J$E* %T(  p*| %i72=WJYi~lookup.cband2stringarfn2bandetailband2countryarfcn2bandarfcn2offsetarfcn2rxtxdiffarfcn2startfreqfrequency2provider @`iW~./arfcncalc/country.h0000644000175000017500000000436711540640501014361 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Countrys # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #ifndef COUNTRY_H #define COUNTRY_H #define COUNTRY_GERMANY 'D' #define COUNTRY_AUSTRIA 'A' #define COUNTRY_SWISS 'S' #define COUNTRY_ENGLAND 'E' #endif /*COUNTRY_H*/ /* #################################################################################### */ ./arfcncalc/band.h0000644000175000017500000000457711540640501013565 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # GSM-Bands # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #ifndef BAND_H #define BAND_H #define BAND_GSM450 450 #define BAND_GSM480 480 #define BAND_GSM850 850 #define BAND_GSM900 900 /* E-GSM, R-GSM or P-GSM */ #define BAND_GSM1800 1800 #define BAND_GSM1900 1900 #define BAND_ALLOTHERS 0 /* No band specified, use the first best what fits */ #endif /*BAND_H*/ /* #################################################################################### */ ./arfcncalc/license.txt0000644000175000017500000004313311540640501014662 0ustar dexterdexter GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ./arfcncalc/calc.h0000644000175000017500000000436011540640501013551 0ustar dexterdexter/* #################################################################################### # # # Arfcncalc - GSM Arfcn frequency calculation tool V1.0.0 # # Calculator # # # # Copyright (C) 2008 Philipp Fabian Benedikt Maier (aka. Dexter) # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program 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 General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # # #################################################################################### */ /* ## HEADER ########################################################################## */ #ifndef CALC_H #define CALC_H /* Calc frequency from ARFCN */ void calcFreqnencyFromArfcn(int arfcn, int band, int *fuplink, int *fdownlink); #endif /*CALC_H*/ /* #################################################################################### */