Browse files

Updated to 1.3.2 hg rev 4afb9b02fdb6.

Removed ppc generation and udpated project base SDK to latest OS.
  • Loading branch information...
1 parent f0ee5c8 commit 6d2e511ad42cde2839140fd8d9ccacb565982e8d @mugginsoft committed Oct 1, 2012
Showing with 42,498 additions and 2,469 deletions.
  1. +123 −80 Port Map.xcodeproj/project.pbxproj
  2. +32 −0 TCMPortMapper 64 bit.patchfile
  3. +1 −1 createZip.sh
  4. +10,418 −1,136 framework/Ethernet-OUI.txt
  5. +9 −6 framework/IXSCNotificationManager.h
  6. +21 −17 framework/IXSCNotificationManager.m
  7. +10 −0 framework/OUI-FindAndReplaceRegexes.txt
  8. BIN framework/OUItoCompany.plist
  9. +25,302 −0 framework/OUItoCompanyXML.plist
  10. +4 −0 framework/TCMNATPMPPortMapper.h
  11. +61 −32 framework/TCMNATPMPPortMapper.m
  12. +2 −2 framework/TCMPortMapper-Info.plist
  13. +4 −0 framework/TCMPortMapper.h
  14. +68 −16 framework/TCMPortMapper.m
  15. +76 −18 framework/TCMUPNPPortMapper.m
  16. +34 −0 framework/libnatpmp/Changelog.txt
  17. +26 −0 framework/libnatpmp/LICENCE
  18. +75 −0 framework/libnatpmp/Makefile
  19. +17 −0 framework/libnatpmp/build.bat
  20. +15 −0 framework/libnatpmp/declspec.h
  21. +409 −0 framework/libnatpmp/getgateway.c
  22. +31 −0 framework/libnatpmp/getgateway.h
  23. +339 −0 framework/libnatpmp/natpmp.c
  24. +11 −0 framework/libnatpmp/natpmp.def
  25. +186 −0 framework/libnatpmp/natpmp.h
  26. +202 −0 framework/libnatpmp/natpmpc.c
  27. +42 −0 framework/libnatpmp/testgetgateway.c
  28. +25 −0 framework/libnatpmp/wingettimeofday.c
  29. +70 −1 framework/miniupnpc/Changelog.txt
  30. +1 −1 framework/miniupnpc/LICENCE
  31. +27 −17 framework/miniupnpc/Makefile
  32. +40 −6 framework/miniupnpc/Makefile.mingw
  33. +5 −3 framework/miniupnpc/README
  34. +24 −0 framework/miniupnpc/codelength.h
  35. +41 −47 framework/miniupnpc/igd_desc_parse.c
  36. +15 −6 framework/miniupnpc/igd_desc_parse.h
  37. +7 −2 framework/miniupnpc/man3/miniupnpc.3
  38. +6 −4 framework/miniupnpc/mingw32make.bat
  39. +21 −7 framework/miniupnpc/minisoap.c
  40. +10 −8 framework/miniupnpc/minissdpc.c
  41. +56 −42 framework/miniupnpc/miniupnpc.c
  42. +31 −0 framework/miniupnpc/miniupnpc.def
  43. +5 −3 framework/miniupnpc/miniupnpc.h
  44. +78 −31 framework/miniupnpc/miniupnpcmodule.c
  45. +15 −0 framework/miniupnpc/miniupnpcstrings.h
  46. +10 −3 framework/miniupnpc/miniwget.c
  47. +3 −1 framework/miniupnpc/pymoduletest.py
  48. +2 −2 framework/miniupnpc/setup.py
  49. +57 −0 framework/miniupnpc/testigddescparse.c
  50. +84 −0 framework/miniupnpc/testupnpigd.py
  51. +3 −1 framework/miniupnpc/testupnpreplyparse.c
  52. +36 −0 framework/miniupnpc/updateminiupnpcstrings.sh
  53. +13 −12 framework/miniupnpc/upnpc.c
  54. +76 −45 framework/miniupnpc/upnpcommands.c
  55. +54 −13 framework/miniupnpc/upnpcommands.h
  56. +12 −1 framework/miniupnpc/upnperrors.c
  57. +12 −2 framework/miniupnpc/upnperrors.h
  58. +3 −1 framework/miniupnpc/upnpreplyparse.c
  59. +3 −1 framework/miniupnpc/upnpreplyparse.h
  60. +1 −0 frameworks/Sparkle.framework/Headers
  61. +1 −0 frameworks/Sparkle.framework/Resources
  62. +1 −0 frameworks/Sparkle.framework/Sparkle
  63. +33 −0 frameworks/Sparkle.framework/Versions/A/Headers/SUAppcast.h
  64. +47 −0 frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h
  65. +118 −0 frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h
  66. +27 −0 frameworks/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h
  67. +21 −0 frameworks/Sparkle.framework/Versions/A/Headers/Sparkle.h
  68. +24 −0 frameworks/Sparkle.framework/Versions/A/Resources/Info.plist
  69. +7 −0 frameworks/Sparkle.framework/Versions/A/Resources/License.txt
  70. +174 −0 frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist
  71. +56 −0 frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/classes.nib
  72. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/info.nib
  73. BIN frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib
  74. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  75. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/info.nib
  76. BIN ...works/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  77. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/classes.nib
  78. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/info.nib
  79. BIN frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib
  80. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  81. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/info.nib
  82. BIN ...rks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  83. BIN frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings
  84. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  85. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/info.nib
  86. BIN ...works/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  87. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/classes.nib
  88. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/info.nib
  89. BIN frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib
  90. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  91. +21 −0 frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/info.nib
  92. BIN ...rks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  93. BIN frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings
  94. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  95. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/info.nib
  96. BIN ...works/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  97. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/classes.nib
  98. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/info.nib
  99. BIN frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib
  100. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  101. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/info.nib
  102. BIN ...rks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  103. BIN frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings
  104. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  105. +16 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/info.nib
  106. BIN ...works/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  107. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/classes.nib
  108. +16 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/info.nib
  109. BIN frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib
  110. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  111. +16 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/info.nib
  112. BIN ...rks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  113. BIN frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings
  114. +1 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/fr.lproj
  115. +1 −0 frameworks/Sparkle.framework/Versions/A/Resources/fr_CA.lproj
  116. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  117. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/info.nib
  118. BIN ...works/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  119. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/classes.nib
  120. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/info.nib
  121. BIN frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib
  122. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  123. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/info.nib
  124. BIN ...rks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  125. BIN frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings
  126. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  127. +18 −0 frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/info.nib
  128. BIN ...works/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  129. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/classes.nib
  130. +16 −0 frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/info.nib
  131. BIN frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib
  132. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  133. +16 −0 frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/info.nib
  134. BIN ...rks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  135. BIN frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings
  136. BIN frameworks/Sparkle.framework/Versions/A/Resources/relaunch
  137. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  138. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/info.nib
  139. BIN ...works/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  140. +67 −0 frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/classes.nib
  141. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/info.nib
  142. BIN frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib
  143. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  144. +18 −0 frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/info.nib
  145. BIN ...rks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  146. BIN frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings
  147. +50 −0 frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/classes.nib
  148. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/info.nib
  149. BIN ...works/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib
  150. +39 −0 frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/classes.nib
  151. +18 −0 frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/info.nib
  152. BIN frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib
  153. +59 −0 frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/classes.nib
  154. +20 −0 frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/info.nib
  155. BIN ...rks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
  156. BIN frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings
  157. BIN frameworks/Sparkle.framework/Versions/A/Sparkle
  158. +1 −0 frameworks/Sparkle.framework/Versions/Current
  159. +1 −0 portmap/AppController.h
  160. +37 −15 portmap/AppController.m
  161. BIN portmap/English.lproj/Localizable.strings
  162. +1,203 −882 portmap/English.lproj/MainMenu.nib/designable.nib
  163. BIN portmap/English.lproj/MainMenu.nib/keyedobjects.nib
  164. +5 −1 portmap/Info.plist
  165. +20 −0 portmap/dsa_pub.pem
  166. +17 −0 portmap/htdocs/appcast.rss
  167. +215 −0 portmap/htdocs/portmap_releasenotes.css
  168. +101 −0 portmap/htdocs/portmap_releasenotes.html
  169. +38 −0 portmap/htdocs/version_1_1.html
  170. +31 −0 portmap/htdocs/version_1_2.html
  171. +30 −0 portmap/htdocs/version_1_3.html
  172. +28 −0 portmap/htdocs/version_1_3_1.html
  173. +38 −0 ruby/mdnskiller.rb
  174. +1 −1 ruby/nat-pmp-ip-broadcaster.rb
  175. +2 −2 ruby/nat-pmp-listener.rb
View
203 Port Map.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 45;
objects = {
/* Begin PBXAggregateTarget section */
@@ -25,7 +25,6 @@
318011AC0D4DEE9500BE3B28 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; };
3180159D0D4E1B9200BE3B28 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3180154D0D4E08D900BE3B28 /* SystemConfiguration.framework */; };
31FAE7D40D672D410085867F /* miniupnpc-LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = 31FAE7D30D672D410085867F /* miniupnpc-LICENSE.txt */; };
- ABB7339610566D7B0042B4D0 /* libcrypto.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ABB7339310566D6D0042B4D0 /* libcrypto.0.9.7.dylib */; };
F214E5F80D5F626800A06962 /* DotGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = F214E5F50D5F626800A06962 /* DotGreen.png */; };
F214E5F90D5F626800A06962 /* DotRed.png in Resources */ = {isa = PBXBuildFile; fileRef = F214E5F60D5F626800A06962 /* DotRed.png */; };
F214E5FA0D5F626800A06962 /* DotYellow.png in Resources */ = {isa = PBXBuildFile; fileRef = F214E5F70D5F626800A06962 /* DotYellow.png */; };
@@ -59,14 +58,20 @@
F2482BA90D58A15F002DF811 /* TCMStatusImageFromMappingStatusValueTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = F2482BA80D58A15F002DF811 /* TCMStatusImageFromMappingStatusValueTransformer.m */; };
F2482BAC0D58A415002DF811 /* GenericQuestionMarkIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = F2482BAB0D58A415002DF811 /* GenericQuestionMarkIcon.icns */; };
F2482BBB0D58ABFA002DF811 /* TCMPortStringFromPublicPortValueTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = F2482BBA0D58ABFA002DF811 /* TCMPortStringFromPublicPortValueTransformer.m */; };
+ F27B83B60ED94616008E1983 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F27B83B40ED94616008E1983 /* Localizable.strings */; };
+ F290D6160EDAC1B200E643C0 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F290D6150EDAC1B200E643C0 /* Sparkle.framework */; };
+ F290D6210EDAC1C800E643C0 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = F290D6150EDAC1B200E643C0 /* Sparkle.framework */; };
+ F290D6340EDAC44000E643C0 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = F290D6330EDAC44000E643C0 /* dsa_pub.pem */; };
+ F290D63E0EDAEBFB00E643C0 /* portmap_releasenotes.css in Resources */ = {isa = PBXBuildFile; fileRef = F290D63C0EDAEBFB00E643C0 /* portmap_releasenotes.css */; };
+ F290D63F0EDAEBFB00E643C0 /* portmap_releasenotes.html in Resources */ = {isa = PBXBuildFile; fileRef = F290D63D0EDAEBFB00E643C0 /* portmap_releasenotes.html */; };
+ F29472930ED3091500DEBA97 /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = F29472890ED3091000DEBA97 /* getgateway.c */; };
+ F29472940ED3091800DEBA97 /* natpmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F294728D0ED3091000DEBA97 /* natpmp.c */; };
F2C65C2D0D50B2D800820CAE /* IXSCNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F2C65BE70D50B17B00820CAE /* IXSCNotificationManager.h */; };
F2C65C2E0D50B2D900820CAE /* IXSCNotificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BE60D50B17B00820CAE /* IXSCNotificationManager.m */; };
F2C65C2F0D50B2E000820CAE /* TCMNATPMPPortMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BE30D50B17B00820CAE /* TCMNATPMPPortMapper.m */; };
F2C65C310D50B2E400820CAE /* TCMPortMapper.h in Headers */ = {isa = PBXBuildFile; fileRef = F2C65BE10D50B17B00820CAE /* TCMPortMapper.h */; settings = {ATTRIBUTES = (Public, ); }; };
F2C65C320D50B2E500820CAE /* TCMPortMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BE00D50B17B00820CAE /* TCMPortMapper.m */; };
F2C65C330D50B2E900820CAE /* TCMUPNPPortMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BDE0D50B17B00820CAE /* TCMUPNPPortMapper.m */; };
- F2C65C340D50B2F300820CAE /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BF10D50B1AE00820CAE /* getgateway.c */; };
- F2C65C350D50B2F700820CAE /* natpmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BF40D50B1AE00820CAE /* natpmp.c */; };
F2C65C360D50B2F800820CAE /* NSNotificationCenterThreadingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C65BE50D50B17B00820CAE /* NSNotificationCenterThreadingAdditions.m */; };
F2C6602B0D50C58800820CAE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C6602A0D50C58800820CAE /* main.m */; };
F2C6602E0D50C58F00820CAE /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C6602C0D50C58F00820CAE /* AppController.m */; };
@@ -154,6 +159,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ F290D6210EDAC1C800E643C0 /* Sparkle.framework in Copy Frameworks */,
F2C660510D50C69A00820CAE /* TCMPortMapper.framework in Copy Frameworks */,
);
name = "Copy Frameworks";
@@ -169,9 +175,6 @@
3180119F0D4DEC8400BE3B28 /* TCMPortMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TCMPortMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3180154D0D4E08D900BE3B28 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
31FAE7D30D672D410085867F /* miniupnpc-LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "miniupnpc-LICENSE.txt"; path = "portmap/miniupnpc-LICENSE.txt"; sourceTree = "<group>"; };
- ABB7339310566D6D0042B4D0 /* libcrypto.0.9.7.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libcrypto.0.9.7.dylib; sourceTree = "<group>"; };
- ABB7339410566D6D0042B4D0 /* libcrypto.0.9.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o"; path = libcrypto.0.9.dylib; sourceTree = "<group>"; };
- ABB7339510566D6D0042B4D0 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libcrypto.dylib; sourceTree = "<group>"; };
F2143AD90D881D9D00C91B69 /* libssl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.dylib; path = /usr/lib/libssl.dylib; sourceTree = "<absolute>"; };
F214E5DB0D5F5FE600A06962 /* NATEcho.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NATEcho.app; sourceTree = BUILT_PRODUCTS_DIR; };
F214E5DD0D5F5FE600A06962 /* NATEcho-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "NATEcho-Info.plist"; path = "natecho/NATEcho-Info.plist"; sourceTree = "<group>"; };
@@ -229,6 +232,24 @@
F2482BAB0D58A415002DF811 /* GenericQuestionMarkIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = GenericQuestionMarkIcon.icns; path = portmap/artwork/GenericQuestionMarkIcon.icns; sourceTree = "<group>"; };
F2482BB90D58ABFA002DF811 /* TCMPortStringFromPublicPortValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TCMPortStringFromPublicPortValueTransformer.h; path = portmap/TCMPortStringFromPublicPortValueTransformer.h; sourceTree = "<group>"; };
F2482BBA0D58ABFA002DF811 /* TCMPortStringFromPublicPortValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TCMPortStringFromPublicPortValueTransformer.m; path = portmap/TCMPortStringFromPublicPortValueTransformer.m; sourceTree = "<group>"; };
+ F27B83B50ED94616008E1983 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = portmap/English.lproj/Localizable.strings; sourceTree = "<group>"; };
+ F290D6150EDAC1B200E643C0 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = frameworks/Sparkle.framework; sourceTree = "<group>"; };
+ F290D6330EDAC44000E643C0 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = portmap/dsa_pub.pem; sourceTree = "<group>"; };
+ F290D63C0EDAEBFB00E643C0 /* portmap_releasenotes.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = portmap_releasenotes.css; path = portmap/htdocs/portmap_releasenotes.css; sourceTree = "<group>"; };
+ F290D63D0EDAEBFB00E643C0 /* portmap_releasenotes.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = portmap_releasenotes.html; path = portmap/htdocs/portmap_releasenotes.html; sourceTree = "<group>"; };
+ F29472860ED3091000DEBA97 /* build.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = build.bat; sourceTree = "<group>"; };
+ F29472870ED3091000DEBA97 /* Changelog.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changelog.txt; sourceTree = "<group>"; };
+ F29472880ED3091000DEBA97 /* declspec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = declspec.h; sourceTree = "<group>"; };
+ F29472890ED3091000DEBA97 /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getgateway.c; sourceTree = "<group>"; };
+ F294728A0ED3091000DEBA97 /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgateway.h; sourceTree = "<group>"; };
+ F294728B0ED3091000DEBA97 /* LICENCE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENCE; sourceTree = "<group>"; };
+ F294728C0ED3091000DEBA97 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
+ F294728D0ED3091000DEBA97 /* natpmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = natpmp.c; sourceTree = "<group>"; };
+ F294728E0ED3091000DEBA97 /* natpmp.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = natpmp.def; sourceTree = "<group>"; };
+ F294728F0ED3091000DEBA97 /* natpmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = natpmp.h; sourceTree = "<group>"; };
+ F29472900ED3091000DEBA97 /* natpmpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = natpmpc.c; sourceTree = "<group>"; };
+ F29472910ED3091000DEBA97 /* testgetgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgetgateway.c; sourceTree = "<group>"; };
+ F29472920ED3091000DEBA97 /* wingettimeofday.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wingettimeofday.c; sourceTree = "<group>"; };
F2C65BDE0D50B17B00820CAE /* TCMUPNPPortMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TCMUPNPPortMapper.m; path = framework/TCMUPNPPortMapper.m; sourceTree = "<group>"; };
F2C65BDF0D50B17B00820CAE /* TCMUPNPPortMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TCMUPNPPortMapper.h; path = framework/TCMUPNPPortMapper.h; sourceTree = "<group>"; };
F2C65BE00D50B17B00820CAE /* TCMPortMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TCMPortMapper.m; path = framework/TCMPortMapper.m; sourceTree = "<group>"; };
@@ -240,14 +261,6 @@
F2C65BE60D50B17B00820CAE /* IXSCNotificationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IXSCNotificationManager.m; path = framework/IXSCNotificationManager.m; sourceTree = "<group>"; };
F2C65BE70D50B17B00820CAE /* IXSCNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IXSCNotificationManager.h; path = framework/IXSCNotificationManager.h; sourceTree = "<group>"; };
F2C65BE80D50B17B00820CAE /* NSNotificationCenterThreadingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSNotificationCenterThreadingAdditions.h; path = framework/NSNotificationCenterThreadingAdditions.h; sourceTree = "<group>"; };
- F2C65BF00D50B1AE00820CAE /* Changelog.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changelog.txt; sourceTree = "<group>"; };
- F2C65BF10D50B1AE00820CAE /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getgateway.c; sourceTree = "<group>"; };
- F2C65BF20D50B1AE00820CAE /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgateway.h; sourceTree = "<group>"; };
- F2C65BF30D50B1AE00820CAE /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
- F2C65BF40D50B1AE00820CAE /* natpmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = natpmp.c; sourceTree = "<group>"; };
- F2C65BF50D50B1AE00820CAE /* natpmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = natpmp.h; sourceTree = "<group>"; };
- F2C65BF60D50B1AE00820CAE /* natpmpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = natpmpc.c; sourceTree = "<group>"; };
- F2C65BF70D50B1AE00820CAE /* testgetgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgetgateway.c; sourceTree = "<group>"; };
F2C65FFF0D50C2D100820CAE /* Port Map.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Port Map.app"; sourceTree = BUILT_PRODUCTS_DIR; };
F2C660290D50C58800820CAE /* PortMapper_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PortMapper_Prefix.pch; path = portmap/PortMapper_Prefix.pch; sourceTree = "<group>"; };
F2C6602A0D50C58800820CAE /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = portmap/main.m; sourceTree = "<group>"; };
@@ -260,7 +273,7 @@
F2C660330D50C59B00820CAE /* DotGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DotGreen.png; path = general_artwork/DotGreen.png; sourceTree = "<group>"; };
F2C660340D50C59B00820CAE /* DotYellow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DotYellow.png; path = general_artwork/DotYellow.png; sourceTree = "<group>"; };
F2C6603C0D50C62F00820CAE /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = portmap/English.lproj/MainMenu.nib; sourceTree = "<group>"; };
- F2C6603E0D50C62F00820CAE /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = portmap/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ F2C6603E0D50C62F00820CAE /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = portmap/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F2CDB8C50D65BF2200B6A4E7 /* NSAddTemplate.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = NSAddTemplate.tiff; path = portmap/artwork/NSAddTemplate.tiff; sourceTree = "<group>"; };
F2CDB8C60D65BF2200B6A4E7 /* NSRefreshTemplate.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = NSRefreshTemplate.tiff; path = portmap/artwork/NSRefreshTemplate.tiff; sourceTree = "<group>"; };
F2CDB8C70D65BF2200B6A4E7 /* NSRemoveTemplate.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = NSRemoveTemplate.tiff; path = portmap/artwork/NSRemoveTemplate.tiff; sourceTree = "<group>"; };
@@ -275,7 +288,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- ABB7339610566D7B0042B4D0 /* libcrypto.0.9.7.dylib in Frameworks */,
318011AC0D4DEE9500BE3B28 /* Foundation.framework in Frameworks */,
3180159D0D4E1B9200BE3B28 /* SystemConfiguration.framework in Frameworks */,
);
@@ -301,6 +313,7 @@
buildActionMask = 2147483647;
files = (
F2C660480D50C68400820CAE /* TCMPortMapper.framework in Frameworks */,
+ F290D6160EDAC1B200E643C0 /* Sparkle.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -310,6 +323,7 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
+ F290D6150EDAC1B200E643C0 /* Sparkle.framework */,
3180154D0D4E08D900BE3B28 /* SystemConfiguration.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
@@ -340,9 +354,6 @@
29B97314FDCFA39411CA2CEA /* PortMapper */ = {
isa = PBXGroup;
children = (
- ABB7339310566D6D0042B4D0 /* libcrypto.0.9.7.dylib */,
- ABB7339410566D6D0042B4D0 /* libcrypto.0.9.dylib */,
- ABB7339510566D6D0042B4D0 /* libcrypto.dylib */,
F2143AD90D881D9D00C91B69 /* libssl.dylib */,
F214E5F10D5F600B00A06962 /* NATEcho.app */,
F2C6600B0D50C34500820CAE /* Port Map */,
@@ -471,10 +482,31 @@
name = Artwork;
sourceTree = "<group>";
};
+ F29472850ED3091000DEBA97 /* libnatpmp */ = {
+ isa = PBXGroup;
+ children = (
+ F29472860ED3091000DEBA97 /* build.bat */,
+ F29472870ED3091000DEBA97 /* Changelog.txt */,
+ F29472880ED3091000DEBA97 /* declspec.h */,
+ F29472890ED3091000DEBA97 /* getgateway.c */,
+ F294728A0ED3091000DEBA97 /* getgateway.h */,
+ F294728B0ED3091000DEBA97 /* LICENCE */,
+ F294728C0ED3091000DEBA97 /* Makefile */,
+ F294728D0ED3091000DEBA97 /* natpmp.c */,
+ F294728E0ED3091000DEBA97 /* natpmp.def */,
+ F294728F0ED3091000DEBA97 /* natpmp.h */,
+ F29472900ED3091000DEBA97 /* natpmpc.c */,
+ F29472910ED3091000DEBA97 /* testgetgateway.c */,
+ F29472920ED3091000DEBA97 /* wingettimeofday.c */,
+ );
+ name = libnatpmp;
+ path = framework/libnatpmp;
+ sourceTree = "<group>";
+ };
F2C65BDD0D50B16100820CAE /* TCMPortMapper.framework */ = {
isa = PBXGroup;
children = (
- F2C65BEF0D50B1AE00820CAE /* libnatpmp-20071213 */,
+ F29472850ED3091000DEBA97 /* libnatpmp */,
F2301B000D685C1B00728699 /* miniupnpc */,
F2C65BE10D50B17B00820CAE /* TCMPortMapper.h */,
F2C65BE00D50B17B00820CAE /* TCMPortMapper.m */,
@@ -491,22 +523,6 @@
name = TCMPortMapper.framework;
sourceTree = "<group>";
};
- F2C65BEF0D50B1AE00820CAE /* libnatpmp-20071213 */ = {
- isa = PBXGroup;
- children = (
- F2C65BF00D50B1AE00820CAE /* Changelog.txt */,
- F2C65BF20D50B1AE00820CAE /* getgateway.h */,
- F2C65BF10D50B1AE00820CAE /* getgateway.c */,
- F2C65BF30D50B1AE00820CAE /* Makefile */,
- F2C65BF40D50B1AE00820CAE /* natpmp.c */,
- F2C65BF50D50B1AE00820CAE /* natpmp.h */,
- F2C65BF60D50B1AE00820CAE /* natpmpc.c */,
- F2C65BF70D50B1AE00820CAE /* testgetgateway.c */,
- );
- name = "libnatpmp-20071213";
- path = "framework/libnatpmp-20071213";
- sourceTree = "<group>";
- };
F2C65C2C0D50B2B700820CAE /* Resources */ = {
isa = PBXGroup;
children = (
@@ -538,7 +554,11 @@
F2C660130D50C36700820CAE /* Resources */ = {
isa = PBXGroup;
children = (
+ F290D63C0EDAEBFB00E643C0 /* portmap_releasenotes.css */,
+ F290D63D0EDAEBFB00E643C0 /* portmap_releasenotes.html */,
+ F27B83B40ED94616008E1983 /* Localizable.strings */,
F24603880DB4B63A00C509E9 /* Artwork */,
+ F290D6330EDAC44000E643C0 /* dsa_pub.pem */,
F24603850DB4B61E00C509E9 /* Info.plist */,
F2C6603B0D50C62F00820CAE /* MainMenu.nib */,
F2C6603D0D50C62F00820CAE /* InfoPlist.strings */,
@@ -691,11 +711,8 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0440;
- };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Port Map" */;
- compatibilityVersion = "Xcode 3.2";
+ compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -758,6 +775,10 @@
F2CDB8D00D65C0B000B6A4E7 /* NSRefreshTemplate.tiff in Resources */,
F2CDB8D10D65C0B100B6A4E7 /* NSAddTemplate.tiff in Resources */,
31FAE7D40D672D410085867F /* miniupnpc-LICENSE.txt in Resources */,
+ F27B83B60ED94616008E1983 /* Localizable.strings in Resources */,
+ F290D6340EDAC44000E643C0 /* dsa_pub.pem in Resources */,
+ F290D63E0EDAEBFB00E643C0 /* portmap_releasenotes.css in Resources */,
+ F290D63F0EDAEBFB00E643C0 /* portmap_releasenotes.html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -802,8 +823,6 @@
F2C65C2F0D50B2E000820CAE /* TCMNATPMPPortMapper.m in Sources */,
F2C65C320D50B2E500820CAE /* TCMPortMapper.m in Sources */,
F2C65C330D50B2E900820CAE /* TCMUPNPPortMapper.m in Sources */,
- F2C65C340D50B2F300820CAE /* getgateway.c in Sources */,
- F2C65C350D50B2F700820CAE /* natpmp.c in Sources */,
F2C65C360D50B2F800820CAE /* NSNotificationCenterThreadingAdditions.m in Sources */,
F2301B5B0D685C2700728699 /* igd_desc_parse.c in Sources */,
F2301B5C0D685C2A00728699 /* minisoap.c in Sources */,
@@ -814,6 +833,8 @@
F2301B630D685C4B00728699 /* upnpcommands.c in Sources */,
F2301B640D685C4F00728699 /* upnperrors.c in Sources */,
F2301B650D685C5300728699 /* upnpreplyparse.c in Sources */,
+ F29472930ED3091500DEBA97 /* getgateway.c in Sources */,
+ F29472940ED3091800DEBA97 /* natpmp.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -901,6 +922,14 @@
name = MainMenu.nib;
sourceTree = "<group>";
};
+ F27B83B40ED94616008E1983 /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ F27B83B50ED94616008E1983 /* English */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
F2C6603B0D50C62F00820CAE /* MainMenu.nib */ = {
isa = PBXVariantGroup;
children = (
@@ -923,7 +952,6 @@
318011A10D4DEC8500BE3B28 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -933,47 +961,39 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = framework/TCMPortMapper_Prefix.pch;
- GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
HEADER_SEARCH_PATHS = framework;
INFOPLIST_FILE = "framework/TCMPortMapper-Info.plist";
INSTALL_PATH = "@executable_path/../Frameworks";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)\"",
- );
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-DDEBUG";
OTHER_LDFLAGS = (
"-framework",
Foundation,
"-framework",
AppKit,
+ "-lssl",
+ "-lcrypto",
);
+ PREBINDING = NO;
PRODUCT_NAME = TCMPortMapper;
USER_HEADER_SEARCH_PATHS = framework;
- ZERO_LINK = YES;
};
name = Debug;
};
318011A20D4DEC8500BE3B28 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = framework/TCMPortMapper_Prefix.pch;
- GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
HEADER_SEARCH_PATHS = framework;
INFOPLIST_FILE = "framework/TCMPortMapper-Info.plist";
INSTALL_PATH = "@executable_path/../Frameworks";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)\"",
- );
OTHER_CFLAGS = (
"-DNDEBUG",
"-DNS_BLOCK_ASSERTIONS",
@@ -983,7 +1003,10 @@
Foundation,
"-framework",
AppKit,
+ "-lssl",
+ "-lcrypto",
);
+ PREBINDING = NO;
PRODUCT_NAME = TCMPortMapper;
USER_HEADER_SEARCH_PATHS = framework;
ZERO_LINK = NO;
@@ -993,38 +1016,43 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- GCC_ENABLE_OBJC_GC = required;
+ GCC_VERSION = "";
+ "GCC_VERSION[sdk=macosx10.4]" = "";
+ "GCC_VERSION[sdk=macosx10.5][arch=x86_64]" = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- SDKROOT = "";
- WARNING_CFLAGS = "-Wall";
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ PREBINDING = NO;
+ SDKROOT = macosx;
+ "SDKROOT[arch=i386]" = macosx;
+ "SDKROOT[arch=x86_64]" = macosx;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEPLOYMENT_POSTPROCESSING = YES;
- GCC_ENABLE_OBJC_GC = required;
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ GCC_VERSION = "";
+ "GCC_VERSION[sdk=macosx10.4]" = "";
+ "GCC_VERSION[sdk=macosx10.5][arch=x86_64]" = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- SDKROOT = "";
- SEPARATE_STRIP = YES;
- WARNING_CFLAGS = "-Wall";
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.5][arch=x86_64]" = 10.5;
+ PREBINDING = NO;
+ SDKROOT = macosx;
+ "SDKROOT[arch=i386]" = macosx;
+ "SDKROOT[arch=x86_64]" = macosx;
};
name = Release;
};
F214E5DE0D5F5FE800A06962 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1042,6 +1070,7 @@
"-framework",
AppKit,
);
+ PREBINDING = NO;
PRODUCT_NAME = NATEcho;
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
@@ -1051,9 +1080,9 @@
F214E5DF0D5F5FE800A06962 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = natecho/natecho_prefix.pch;
@@ -1070,6 +1099,7 @@
"-framework",
AppKit,
);
+ PREBINDING = NO;
PRODUCT_NAME = NATEcho;
WRAPPER_EXTENSION = app;
ZERO_LINK = NO;
@@ -1083,9 +1113,12 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = /usr/local/bin;
+ OTHER_CFLAGS = "-DDEBUG";
+ PREBINDING = NO;
PRODUCT_NAME = "upnpc-static";
};
name = Debug;
@@ -1097,8 +1130,11 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = /usr/local/bin;
+ OTHER_CFLAGS = "-DNDEBUG";
+ PREBINDING = NO;
PRODUCT_NAME = "upnpc-static";
ZERO_LINK = NO;
};
@@ -1107,7 +1143,6 @@
F24603520DB4B19100C509E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -1118,9 +1153,9 @@
F24603530DB4B19100C509E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = "Create Port Map Release Zip";
ZERO_LINK = NO;
ZipName = PortMap;
@@ -1131,7 +1166,6 @@
F246036B0DB4B45A00C509E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -1142,9 +1176,9 @@
F246036C0DB4B45A00C509E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = "Create TCMPortMapper Release Zip";
ZERO_LINK = NO;
ZipName = TCMPortMapper;
@@ -1155,7 +1189,6 @@
F24603730DB4B4B700C509E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -1166,9 +1199,9 @@
F24603740DB4B4B700C509E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = "Create Release Zips";
ZERO_LINK = NO;
};
@@ -1177,9 +1210,13 @@
F2C660040D50C2D200820CAE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/frameworks\"",
+ );
GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1192,6 +1229,7 @@
"-framework",
AppKit,
);
+ PREBINDING = NO;
PRODUCT_NAME = "Port Map";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
@@ -1201,9 +1239,13 @@
F2C660050D50C2D200820CAE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/frameworks\"",
+ );
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = portmap/PortMapper_Prefix.pch;
@@ -1215,6 +1257,7 @@
"-framework",
AppKit,
);
+ PREBINDING = NO;
PRODUCT_NAME = "Port Map";
WRAPPER_EXTENSION = app;
ZERO_LINK = NO;
View
32 TCMPortMapper 64 bit.patchfile
@@ -0,0 +1,32 @@
+Index: Port Map.xcodeproj/project.pbxproj
+===================================================================
+--- Port Map.xcodeproj/project.pbxproj (revision 46)
++++ Port Map.xcodeproj/project.pbxproj (working copy)
+@@ -1018,22 +1018,20 @@
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ PREBINDING = NO;
+- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
++ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+- ARCHS = (
+- ppc,
+- i386,
+- );
++ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
++ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64";
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+- MACOSX_DEPLOYMENT_TARGET = 10.4;
++ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
++ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Release;
+ };
View
2 createZip.sh
@@ -24,7 +24,7 @@ zip -9 -r -y "${ZipName}.zip" "${ZipProduct}"
echo "...done"
echo "Adding Revision Number to Zip file ${zipBasePath}.zip ..."
-REV=`/usr/local/bin/svnversion -n "${SRCROOT}"`
+REV=`/usr/bin/env svnversion -n "${SRCROOT}"`
cd "${BUILT_PRODUCTS_DIR}"
cp "${ZipName}.zip" "${ZipName}-${REV}.zip"
echo "...done"
View
11,554 framework/Ethernet-OUI.txt
10,418 additions, 1,136 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
15 framework/IXSCNotificationManager.h
@@ -1,6 +1,7 @@
/*
* Written by Theo Hultberg (theo@iconara.net) 2004-03-09 with help from Boaz Stuller.
* This code is in the public domain, provided that this notice remains.
+ * Fixes and additions in Nov 2008 by Dominik Wagner
*/
#import <Foundation/Foundation.h>
@@ -25,12 +26,14 @@
CFRunLoopSourceRef rlSrc;
}
-@end
-
/*!
- * @function _IXSCNotificationCallback
- * @abstract Callback for the dynamic store, just calls keysChanged: on
- * the notification center.
+ * @method setObservedKeys:regExes:
+ * @abstract An optimisation method that restricts the keys that are observed
+ and for which Notification are posted to the Notification Center
+ * @discussion Default Value is inKeys:nil inRegExArray:[@".*"] which is in fact a
+ observe all
*/
-void _IXSCNotificationCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info);
+- (void)setObservedKeys:(NSArray *)inKeyArray regExes:(NSArray *)inRegExeArray;
+
+@end
View
38 framework/IXSCNotificationManager.m
@@ -1,29 +1,43 @@
/*
* Written by Theo Hultberg (theo@iconara.net) 2004-03-09 with help from Boaz Stuller.
* This code is in the public domain, provided that this notice remains.
+ * Fixes and additions in Nov 2008 by Dominik Wagner
*/
#import "IXSCNotificationManager.h"
+/*!
+ * @function _IXSCNotificationCallback
+ * @abstract Callback for the dynamic store, just calls keysChanged: on
+ * the notification center.
+ */
void _IXSCNotificationCallback( SCDynamicStoreRef store, CFArrayRef changedKeys, void *info ) {
NSEnumerator *keysE = [(NSArray *)changedKeys objectEnumerator];
NSString *key = nil;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
-
- while ( (key = [keysE nextObject]) ) {
+ while ( key = [keysE nextObject] ) {
[nc postNotificationName:key
- object:(id)info
- userInfo:[(NSDictionary *)SCDynamicStoreCopyValue(store, (CFStringRef) key) autorelease]];
+ object:(id)info
+ userInfo:[(NSDictionary *)SCDynamicStoreCopyValue(store, (CFStringRef) key) autorelease]];
}
}
@implementation IXSCNotificationManager
+- (void)setObservedKeys:(NSArray *)inKeyArray regExes:(NSArray *)inRegExeArray {
+ BOOL success = SCDynamicStoreSetNotificationKeys(
+ dynStore,
+ (CFArrayRef)inKeyArray,
+ (CFArrayRef)inRegExeArray
+ );
+ if (!success) NSLog(@"%s desired keys could not be observed.",__FUNCTION__);
+}
+
+
- (id)init {
self = [super init];
-
if ( self ) {
SCDynamicStoreContext context = { 0, (void *)self, NULL, NULL, NULL };
@@ -34,27 +48,17 @@ - (id)init {
&context
);
-
- // I have no idea what this code does, or why it's needed
- // <magic>
rlSrc = SCDynamicStoreCreateRunLoopSource(NULL,dynStore,0);
CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop], rlSrc, kCFRunLoopCommonModes);
- // </magic>
-
- SCDynamicStoreSetNotificationKeys(
- dynStore,
- // more ugly hacks... unintelligible oneliners are cool
- (CFArrayRef) [(NSArray *)SCDynamicStoreCopyKeyList(dynStore, CFSTR(".*")) autorelease],
- NULL
- );
+
+ [self setObservedKeys:nil regExes:[NSArray arrayWithObject:@".*"]];
}
return self;
}
- (void)dealloc {
CFRunLoopRemoveSource([[NSRunLoop currentRunLoop] getCFRunLoop], rlSrc, kCFRunLoopCommonModes);
-
CFRelease(rlSrc);
CFRelease(dynStore);
View
10 framework/OUI-FindAndReplaceRegexes.txt
@@ -0,0 +1,10 @@
+Regex:
+^(\h\h)\-(\h\h)\-(\h\h)[^\t]+\t\t([^\n]+)
+
+select and copy all from find all window
+
+Replace:
+<key>\1:\2:\3</key><string>\4</string>
+
+finally replace & with &amp;
+
View
BIN framework/OUItoCompany.plist
Binary file not shown.
View
25,302 framework/OUItoCompanyXML.plist
25,302 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 framework/TCMNATPMPPortMapper.h
@@ -32,11 +32,15 @@ typedef enum {
NSTimeInterval _updateInterval;
NSString *_lastExternalIPSenderAddress;
NSString *_lastBroadcastedExternalIP;
+ CFSocketRef _externalAddressChangeListeningSocket;
}
- (void)refresh;
- (void)stop;
- (void)updatePortMappings;
- (void)stopBlocking;
+- (void)ensureListeningToExternalIPAddressChanges;
+- (void)stopListeningToExternalIPAddressChanges;
+
@end
View
93 framework/TCMNATPMPPortMapper.m
@@ -1,6 +1,7 @@
#import "TCMNATPMPPortMapper.h"
#import "NSNotificationCenterThreadingAdditions.h"
+#import "natpmp.h"
#import <netinet/in.h>
#import <netinet6/in6.h>
@@ -92,6 +93,17 @@ - (id)init {
natPMPThreadIsRunningLock = [NSLock new];
if ([natPMPThreadIsRunningLock respondsToSelector:@selector(setName:)])
[(id)natPMPThreadIsRunningLock performSelector:@selector(setName:) withObject:@"NATPMPThreadRunningLock"];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [natPMPThreadIsRunningLock release];
+ [super dealloc];
+}
+
+- (void)ensureListeningToExternalIPAddressChanges {
+ if (!_externalAddressChangeListeningSocket) {
// add UDP listener for public ip update packets
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
@@ -105,21 +117,15 @@ - (id)init {
CFSocketContext socketContext;
bzero(&socketContext, sizeof(CFSocketContext));
socketContext.info = self;
- CFSocketRef listeningSocket = NULL;
- listeningSocket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM, IPPROTO_UDP,
+ _externalAddressChangeListeningSocket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM, IPPROTO_UDP,
kCFSocketDataCallBack, readData, &socketContext);
- if (listeningSocket) {
+ if (_externalAddressChangeListeningSocket) {
+ // SO_REUSEPORT is enough for allowing multiple clients to listen to the same address/port combination
int yes = 1;
- int result = setsockopt(CFSocketGetNative(listeningSocket), SOL_SOCKET,
- SO_REUSEADDR, &yes, sizeof(int));
- if (result == -1) {
- NSLog(@"Could not setsockopt to reuseaddr: %d / %s", errno, strerror(errno));
- }
-
- result = setsockopt(CFSocketGetNative(listeningSocket), SOL_SOCKET,
- SO_REUSEPORT, &yes, sizeof(int));
+ int result = setsockopt(CFSocketGetNative(_externalAddressChangeListeningSocket), SOL_SOCKET,
+ SO_REUSEPORT, &yes, sizeof(yes));
if (result == -1) {
- NSLog(@"Could not setsockopt to reuseport: %d / %s", errno, strerror(errno));
+ NSLog(@"Could not setsockopt to SO_REUSEPORT: %d / %s", errno, strerror(errno));
}
CFDataRef addressData = NULL;
@@ -128,47 +134,58 @@ - (id)init {
bzero(&socketAddress, sizeof(struct sockaddr_in));
socketAddress.sin_len = sizeof(struct sockaddr_in);
socketAddress.sin_family = PF_INET;
- socketAddress.sin_port = htons(5351);
+ socketAddress.sin_port = htons(5350);
socketAddress.sin_addr.s_addr = inet_addr("224.0.0.1");
addressData = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&socketAddress, sizeof(struct sockaddr_in));
if (addressData == NULL) {
- NSLog(@"Could not create addressData");
+ NSLog(@"Could not create addressData for NAT-PMP external ip address change notification listening");
} else {
- CFSocketError err = CFSocketSetAddress(listeningSocket, addressData);
+ CFSocketError err = CFSocketSetAddress(_externalAddressChangeListeningSocket, addressData);
if (err != kCFSocketSuccess) {
NSLog(@"%s could not set address on socket",__FUNCTION__);
} else {
CFRunLoopRef currentRunLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
- CFRunLoopSourceRef runLoopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, listeningSocket, 0);
- CFRunLoopAddSource(currentRunLoop, runLoopSource, kCFRunLoopCommonModes);
- CFRelease(runLoopSource);
+ CFRunLoopSourceRef runLoopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, _externalAddressChangeListeningSocket, 0);
+ if (runLoopSource) {
+ CFRunLoopAddSource(currentRunLoop, runLoopSource, kCFRunLoopCommonModes);
+ CFRelease(runLoopSource);
+ }
}
CFRelease(addressData);
}
addressData = NULL;
} else {
- NSLog(@"Could not create listening socket for IPv4");
+ NSLog(@"Could not create listening socket for NAT-PMP external ip address change notifications (UDP 224.0.0.1:5350)");
}
- }
- return self;
+ }
}
-- (void)dealloc {
- [natPMPThreadIsRunningLock release];
- [super dealloc];
+- (void)stopListeningToExternalIPAddressChanges {
+#ifdef DEBUG
+ NSLog(@"%s, socket:%p",__FUNCTION__,_externalAddressChangeListeningSocket);
+#endif
+ if (_externalAddressChangeListeningSocket) {
+ CFSocketInvalidate(_externalAddressChangeListeningSocket);
+ CFRelease(_externalAddressChangeListeningSocket);
+ _externalAddressChangeListeningSocket = NULL;
+ }
}
+
- (void)stop {
if ([_updateTimer isValid]) {
[_updateTimer invalidate];
[_updateTimer release];
_updateTimer = nil;
}
+
+ [self stopListeningToExternalIPAddressChanges];
+
if (![natPMPThreadIsRunningLock tryLock] && (runningThreadID == TCMExternalIPThreadID)) {
// stop that one
IPAddressThreadShouldQuitAndRestart = PORTMAPREFRESHSHOULDNOTRESTART;
@@ -180,6 +197,9 @@ - (void)stop {
}
- (void)refresh {
+ // ensure running of external ip address change listener
+ [self ensureListeningToExternalIPAddressChanges];
+
// Run externalipAddress in Thread
if ([natPMPThreadIsRunningLock tryLock]) {
_updateInterval = 3600 / 2.;
@@ -269,12 +289,12 @@ - (BOOL)applyPortMapping:(TCMPortMapping *)aPortMapping remove:(BOOL)shouldRemov
if (shouldRemove) {
[aPortMapping setMappingStatus:TCMPortMappingStatusUnmapped];
} else {
- _updateInterval = MIN(_updateInterval,response.newportmapping.lifetime/2.);
+ _updateInterval = MIN(_updateInterval,response.pnu.newportmapping.lifetime/2.);
if (_updateInterval < 60.) {
- NSLog(@"%s caution - new port mapping had a lifetime < 120. : %u - %@",__FUNCTION__,response.newportmapping.lifetime, aPortMapping);
+ NSLog(@"%s caution - new port mapping had a lifetime < 120. : %u - %@",__FUNCTION__,response.pnu.newportmapping.lifetime, aPortMapping);
_updateInterval = 60.;
}
- [aPortMapping setExternalPort:response.newportmapping.mappedpublicport];
+ [aPortMapping setExternalPort:response.pnu.newportmapping.mappedpublicport];
[aPortMapping setMappingStatus:TCMPortMappingStatusMapped];
}
@@ -367,10 +387,9 @@ - (void)updatePortMappingsInThread {
[natPMPThreadIsRunningLock unlock];
if (UpdatePortMappingsThreadShouldQuit) {
- NSLog(@"%s scheduled refresh",__FUNCTION__);
[self performSelectorOnMainThread:@selector(refresh) withObject:nil waitUntilDone:NO];
} else if (UpdatePortMappingsThreadShouldRestart) {
- [self performSelectorOnMainThread:@selector(updatePortMapping) withObject:nil waitUntilDone:NO];
+ [self performSelectorOnMainThread:@selector(updatePortMappings) withObject:nil waitUntilDone:NO];
} else {
if ([pm isRunning]) {
[self performSelectorOnMainThread:@selector(adjustUpdateTimer) withObject:nil waitUntilDone:NO];
@@ -425,15 +444,23 @@ - (void)refreshExternalIPInThread {
}
} while(r==NATPMP_TRYAGAIN);
- if(r<0) {
+ if(r<0 && r != NATPMP_ERR_NETWORKFAILURE) {
didFail = YES;
#ifndef NDEBUG
- NSLog(@"NAT-PMP: IP refresh did time out");
+ NSLog(@"%s NAT-PMP: IP refresh did fail: %d",__FUNCTION__,r);
#endif
} else {
+ NSString *ipString = [NSString stringWithFormat:@"%s", inet_ntoa(response.pnu.publicaddress.addr)];
+ if (r == NATPMP_ERR_NETWORKFAILURE) {
+ ipString = @"0.0.0.0"; // citing the RFC:
+// If the result code is non-zero, the value of External IP
+// Address is undefined (MUST be set to zero on transmission, and MUST
+// be ignored on reception).
+ // so we use 0.0.0.0 at this stage. also because that is what the airport is broadcasting.
+ // we externally can savely display 0.0.0.0 as not having an external ip
+ }
/* TODO : check that response.type == 0 */
- NSString *ipString = [NSString stringWithFormat:@"%s", inet_ntoa(response.publicaddress.addr)];
#ifndef NDEBUG
NSLog(@"NAT-PMP: found IP:%@",ipString);
#endif
@@ -452,6 +479,7 @@ - (void)refreshExternalIPInThread {
}
} else {
if (didFail) {
+ [self performSelectorOnMainThread:@selector(stopListeningToExternalIPAddressChanges) withObject:nil waitUntilDone:NO];
[[NSNotificationCenter defaultCenter] postNotificationOnMainThread:[NSNotification notificationWithName:TCMNATPMPPortMapperDidFailNotification object:self]];
} else {
[self performSelectorOnMainThread:@selector(updatePortMappings) withObject:nil waitUntilDone:0];
@@ -464,6 +492,7 @@ - (void)refreshExternalIPInThread {
- (void)stopBlocking {
UpdatePortMappingsThreadShouldQuit = YES;
IPAddressThreadShouldQuitAndRestart = YES;
+ [self stopListeningToExternalIPAddressChanges];
[natPMPThreadIsRunningLock lock];
NSSet *mappingsToStop = [[TCMPortMapper sharedInstance] portMappings];
natpmp_t natpmp;
View
4 framework/TCMPortMapper-Info.plist
@@ -15,8 +15,8 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>1.3.2</string>
<key>BuildRevision</key>
- <string>1.0</string>
+ <string>1</string>
</dict>
</plist>
View
4 framework/TCMPortMapper.h
@@ -85,10 +85,14 @@ typedef enum {
BOOL _sendUPNPMappingTableNotification;
NSString *_userID;
NSMutableSet *_upnpPortMappingsToRemove;
+ NSTimer *_upnpPortMapperTimer;
+ BOOL _ignoreNetworkChanges;
+ BOOL _refreshIsScheduled;
}
+ (TCMPortMapper *)sharedInstance;
+ (NSString *)manufacturerForHardwareAddress:(NSString *)aMACAddress;
++ (NSString *)sizereducableHashOfString:(NSString *)inString;
- (NSSet *)portMappings;
- (NSMutableSet *)removeMappingQueue;
View
84 framework/TCMPortMapper.m
@@ -13,7 +13,9 @@
#import <netinet/if_ether.h>
#import <net/if_dl.h>
#import <openssl/md5.h>
-#import <err.h>
+
+// update port mappings all 30 minutes as a default
+#define UPNP_REFRESH_INTERVAL (30.*60.)
NSString * const TCMPortMapperExternalIPAddressDidChange = @"TCMPortMapperExternalIPAddressDidChange";
NSString * const TCMPortMapperWillStartSearchForRouterNotification = @"TCMPortMapperWillStartSearchForRouterNotification";
@@ -143,11 +145,12 @@ - (NSString *)description {
@end
@interface TCMPortMapper (Private)
-
+- (void)cleanupUPNPPortMapperTimer;
- (void)setExternalIPAddress:(NSString *)anAddress;
- (void)setLocalIPAddress:(NSString *)anAddress;
- (void)increaseWorkCount:(NSNotification *)aNotification;
- (void)decreaseWorkCount:(NSNotification *)aNotification;
+- (void)scheduleRefresh;
@end
@implementation TCMPortMapper
@@ -167,7 +170,11 @@ - (id)init {
}
if ((self=[super init])) {
_systemConfigNotificationManager = [IXSCNotificationManager new];
+ // since we are only interested in this specific key, let us configure it so.
+ [_systemConfigNotificationManager setObservedKeys:[NSArray arrayWithObject:@"State:/Network/Global/IPv4"] regExes:nil];
_isRunning = NO;
+ _ignoreNetworkChanges = NO;
+ _refreshIsScheduled = NO;
_NATPMPPortMapper = [[TCMNATPMPPortMapper alloc] init];
_UPNPPortMapper = [[TCMUPNPPortMapper alloc] init];
_portMappings = [NSMutableSet new];
@@ -197,6 +204,7 @@ - (id)init {
}
- (void)dealloc {
+ [self cleanupUPNPPortMapperTimer];
[_systemConfigNotificationManager release];
[_NATPMPPortMapper release];
[_UPNPPortMapper release];
@@ -217,8 +225,12 @@ - (BOOL)networkReachable {
}
- (void)networkDidChange:(NSNotification *)aNotification {
+#ifndef NDEBUG
NSLog(@"%s %@",__FUNCTION__,aNotification);
- [self refresh];
+#endif
+ if (!_ignoreNetworkChanges) {
+ [self scheduleRefresh];
+ }
}
- (NSString *)externalIPAddress {
@@ -294,17 +306,22 @@ - (NSString *)userID {
return [[_userID retain] autorelease];
}
-- (void)hashUserID:(NSString *)aUserIDToHash {
- // md5 has the username and take the first 8 bytes as hex
++ (NSString *)sizereducableHashOfString:(NSString *)inString {
unsigned char digest[16];
- char hashstring[32];
+ char hashstring[16*2+1];
int i;
- NSData *userNameData = [aUserIDToHash dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
- MD5([userNameData bytes],[userNameData length],digest);
- for(i=0;i<8;i++) sprintf(hashstring+i*2,"%02x",digest[i]);
+ NSData *dataToHash = [inString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
+ MD5([dataToHash bytes],[dataToHash length],digest);
+ for(i=0;i<16;i++) sprintf(hashstring+i*2,"%02x",digest[i]);
hashstring[i*2]=0;
- [self setUserID:[NSString stringWithUTF8String:hashstring]];
+ return [NSString stringWithUTF8String:hashstring];
+}
+
+- (void)hashUserID:(NSString *)aUserIDToHash {
+ NSString *hashString = [TCMPortMapper sizereducableHashOfString:aUserIDToHash];
+ if ([hashString length] > 16) hashString = [hashString substringToIndex:16];
+ [self setUserID:hashString];
}
- (void)setUserID:(NSString *)aUserID {
@@ -358,6 +375,13 @@ - (void)removePortMapping:(TCMPortMapping *)aMapping {
}
}
+// add some delay to the refresh caused by network changes so mDNSResponer has a little time to grab its port before us
+- (void)scheduleRefresh {
+ if (!_refreshIsScheduled) {
+ [self performSelector:@selector(refresh) withObject:nil afterDelay:0.5];
+ }
+}
+
- (void)refresh {
[self increaseWorkCount:nil];
@@ -413,12 +437,14 @@ - (void)refresh {
[[NSNotificationCenter defaultCenter] postNotificationName:TCMPortMapperDidFinishSearchForRouterNotification object:self];
}
} else {
+ [_NATPMPPortMapper stopListeningToExternalIPAddressChanges];
[[NSNotificationCenter defaultCenter] postNotificationName:TCMPortMapperDidFinishSearchForRouterNotification object:self];
}
// add the delay to bridge the gap between the thread starting and this method returning
[self performSelector:@selector(decreaseWorkCount:) withObject:nil afterDelay:1.0];
-
+ // make way for further refresh schedulings
+ _refreshIsScheduled = NO;
}
- (void)setExternalIPAddress:(NSString *)anIPAddress {
@@ -591,6 +617,9 @@ - (void)UPNPPortMapperDidGetExternalIPAddress:(NSNotification *)aNotification {
if (shouldNotify) {
[[NSNotificationCenter defaultCenter] postNotificationName:TCMPortMapperDidFinishSearchForRouterNotification object:self];
}
+ if (!_upnpPortMapperTimer) {
+ _upnpPortMapperTimer = [[NSTimer scheduledTimerWithTimeInterval:UPNP_REFRESH_INTERVAL target:self selector:@selector(refresh) userInfo:nil repeats:YES] retain];
+ }
}
- (void)UPNPPortMapperDidFail:(NSNotification *)aNotification {
@@ -599,6 +628,7 @@ - (void)UPNPPortMapperDidFail:(NSNotification *)aNotification {
} else if (_UPNPStatus==TCMPortMapProtocolWorks) {
[self setExternalIPAddress:nil];
}
+ [self cleanupUPNPPortMapperTimer];
// also mark all port mappings as unmapped if NATPMP failed too
if (_NATPMPStatus == TCMPortMapProtocolFailed) {
[[NSNotificationCenter defaultCenter] postNotificationName:TCMPortMapperDidFinishSearchForRouterNotification object:self];
@@ -609,6 +639,14 @@ - (void)printNotification:(NSNotification *)aNotification {
NSLog(@"TCMPortMapper received notification: %@", aNotification);
}
+- (void)cleanupUPNPPortMapperTimer {
+ if (_upnpPortMapperTimer) {
+ [_upnpPortMapperTimer invalidate];
+ [_upnpPortMapperTimer release];
+ _upnpPortMapperTimer = nil;
+ }
+}
+
- (void)internalStop {
NSNotificationCenter *center=[NSNotificationCenter defaultCenter];
[center removeObserver:self name:@"State:/Network/Global/IPv4" object:_systemConfigNotificationManager];
@@ -618,6 +656,9 @@ - (void)internalStop {
[center removeObserver:self name:TCMUPNPPortMapperDidGetExternalIPAddressNotification object:_UPNPPortMapper];
[center removeObserver:self name:TCMUPNPPortMapperDidFailNotification object:_UPNPPortMapper];
+
+ [self cleanupUPNPPortMapperTimer];
+
}
- (void)stop {
@@ -737,14 +778,25 @@ - (void)decreaseWorkCount:(NSNotification *)aNotification {
}
}
-- (void)didWake:(NSNotification *)aNotification {
+- (void)postWakeAction {
+ _ignoreNetworkChanges = NO;
if (_isRunning) {
// take some time because on the moment of awakening e.g. airport isn't yet connected
- [self performSelector:@selector(refresh) withObject:nil afterDelay:1.];
- }
+ [self refresh];
+ }
}
-- (void)willSleep:(NSNotification *)aNotificaiton {
+
+- (void)didWake:(NSNotification *)aNotification {
+ // postpone the action because we need to wait for some delay until stuff is up. moreover we need to give the buggy mdnsresponder a chance to grab his nat-pmp port so we can do so later
+ [self performSelector:@selector(postWakeAction) withObject:nil afterDelay:2.];
+}
+
+- (void)willSleep:(NSNotification *)aNotification {
+#ifdef DEBUG
+ NSLog(@"%s, pmp:%d, upnp:%d",__FUNCTION__,_NATPMPStatus,_UPNPStatus);
+#endif
+ _ignoreNetworkChanges = YES;
if (_isRunning) {
if (_NATPMPStatus == TCMPortMapProtocolWorks) {
[_NATPMPPortMapper stopBlocking];
@@ -763,7 +815,7 @@ - (void)NATPMPPortMapperDidReceiveBroadcastedExternalIPChange:(NSNotification *)
// we have to check if the sender is actually our router - if not disregard
if ([senderIPAddress isEqualToString:[self routerIPAddress]]) {
if (![[self externalIPAddress] isEqualToString:[userInfo objectForKey:@"externalIPAddress"]]) {
- NSLog(@"Refreshing because of NAT-PMP-Device external IP broadcast:%@",userInfo);
+// NSLog(@"Refreshing because of NAT-PMP-Device external IP broadcast:%@",userInfo);
[self refresh];
}
} else {
View
94 framework/TCMUPNPPortMapper.m
@@ -4,6 +4,8 @@
#import <SystemConfiguration/SCSchemaDefinitions.h>
#import "NSNotificationCenterThreadingAdditions.h"
+#define PREFIX_MATCH_MIN_LENGTH 6
+
//static void PrintHeader(void)
// // Prints an explanation of the flag coding.
//{
@@ -79,16 +81,60 @@ - (void)refresh {
- (NSString *)portMappingDescription {
static NSString *description = nil;
if (!description) {
- NSMutableArray *descriptionComponents=[NSMutableArray arrayWithObject:@"TCMPM"];
+ NSString *prefix = @"cPM";
+ NSMutableArray *descriptionComponents=[NSMutableArray array];
NSString *component = [[[[NSBundle mainBundle] bundlePath] lastPathComponent] stringByDeletingPathExtension];
- if (component) [descriptionComponents addObject:component];
NSString *userID = [[TCMPortMapper sharedInstance] userID];
- if (userID) [descriptionComponents addObject:userID];
- description = [[descriptionComponents componentsJoinedByString:@"/"] retain];
+ if (component) {
+ // make sure _ and . are the only non alphanumeric characters in the name so we don't run into problems with routers which change the description (eg. avm routers)
+ NSCharacterSet *saveSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"];
+ NSScanner *scanner = [NSScanner scannerWithString:component];
+ [scanner setCharactersToBeSkipped:[saveSet invertedSet]];
+ NSString *scannedString = nil;
+ while ([scanner scanCharactersFromSet:saveSet intoString:&scannedString]) {
+ [descriptionComponents addObject:scannedString];
+ }
+ }
+
+ NSString *appComponent = [descriptionComponents componentsJoinedByString:@"."];
+ [descriptionComponents removeAllObjects];
+ // there seems to be a hard limit of 40 characters at in the vigor routers - so length is of essence
+ // however since there seems to be a hard limit of 11 at at least one other router we need to take further action
+ int maxLength = 40;
+ maxLength -= [prefix length];
+ maxLength -= [userID length];
+ maxLength -= 2;
+ if ([appComponent length] > maxLength) {
+ appComponent = [appComponent substringToIndex:maxLength];
+ }
+
+ [descriptionComponents addObject:prefix];
+ if (appComponent) [descriptionComponents addObject:appComponent];
+ if (userID) {
+ [descriptionComponents addObject:userID];
+ }
+
+ if (!description) {
+ // hash all that stuff again and put it up in front (at least 6 characters) so wen can rely on prefix matches for routers that are bad bad boys and support only very few characters as description. but keep the rest to stay descriptive for debugging.
+ NSString *preliminaryDescription = [descriptionComponents componentsJoinedByString:@"."];
+ NSString *hashString = [TCMPortMapper sizereducableHashOfString:preliminaryDescription];
+ if ([hashString length] > PREFIX_MATCH_MIN_LENGTH) hashString = [hashString substringToIndex:PREFIX_MATCH_MIN_LENGTH];
+ [descriptionComponents insertObject:hashString atIndex:0];
+ description = [[descriptionComponents componentsJoinedByString:@"."] retain];
+// NSLog(@"%s description: %@",__FUNCTION__,description);
+ }
}
return description;
}
+- (BOOL)doesPortMappingDescriptionBelongToMe:(NSString *)inDescription {
+ NSString *myDescription = [self portMappingDescription];
+ BOOL result = ([inDescription length] >= PREFIX_MATCH_MIN_LENGTH &&
+ ([myDescription hasPrefix:inDescription] || [inDescription isEqualToString:[myDescription substringFromIndex:PREFIX_MATCH_MIN_LENGTH +1]])); // second part of the OR is for backwards compatibility only
+// NSLog(@"%s %@ vs %@ : %@ (%@)",__FUNCTION__,myDescription,inDescription,result?@"YES":@"NO",[myDescription substringFromIndex:PREFIX_MATCH_MIN_LENGTH +1]);
+ return result;
+}
+
- (void)postDidEndWorkingNotification {
[[NSNotificationCenter defaultCenter] postNotificationName:TCMUPNPPortMapperDidEndWorkingNotification object:self];
}
@@ -112,7 +158,7 @@ - (void)refreshInThread {
char externalIPAddress[16];
BOOL didFail=NO;
NSString *errorString = nil;
- if (( devlist = upnpDiscover(2000, multicastif, minissdpdpath) )) {
+ if (( devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0) )) {
if(devlist) {
// let us check all of the devices for reachability
@@ -126,7 +172,6 @@ - (void)refreshInThread {
for(device = devlist; device && !foundIDGDevice; device = device->pNext) {
NSURL *descURL = [NSURL URLWithString:[NSString stringWithUTF8String:device->descURL]];
SCNetworkConnectionFlags status;
- // TODO: SCNetworkCheckReachabilityByName is deprctaed in 10.6
Boolean success = SCNetworkCheckReachabilityByName([[descURL host] UTF8String], &status);
#ifndef NDEBUG
NSLog(@"UPnP: %@ %c%c%c%c%c%c%c host:%s st:%s",
@@ -160,6 +205,9 @@ - (void)refreshInThread {
#ifndef NDEBUG
NSLog(@"UPnP: trying URL:%@",descURL);
#endif
+ // freeing the url still seems like a good idea - why isn't it?
+ if (_urls.controlURL) FreeUPNPUrls(&_urls);
+ // get the new control URLs - this call mallocs the control URLs
if (UPNP_GetIGDFromUrl([[descURL absoluteString] UTF8String],&_urls,&_igddata,lanaddr,sizeof(lanaddr))) {
int r = UPNP_GetExternalIPAddress(_urls.controlURL,
_igddata.servicetype,
@@ -240,10 +288,10 @@ - (BOOL)applyPortMapping:(TCMPortMapping *)aPortMapping remove:(BOOL)shouldRemov
[aPortMapping setMappingStatus:TCMPortMappingStatusTrying];
if (shouldRemove) {
if ([aPortMapping transportProtocol] & TCMPortMappingTransportProtocolTCP) {
- UPNP_DeletePortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",[aPortMapping externalPort]] UTF8String], "TCP");
+ UPNP_DeletePortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",[aPortMapping externalPort]] UTF8String], "TCP",NULL);
}
if ([aPortMapping transportProtocol] & TCMPortMappingTransportProtocolUDP) {
- UPNP_DeletePortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",[aPortMapping externalPort]] UTF8String], "UDP");
+ UPNP_DeletePortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",[aPortMapping externalPort]] UTF8String], "UDP",NULL);
}
[aPortMapping setMappingStatus:TCMPortMappingStatusUnmapped];
return YES;
@@ -257,7 +305,7 @@ - (BOOL)applyPortMapping:(TCMPortMapping *)aPortMapping remove:(BOOL)shouldRemov
while ([aExternalPortSet containsIndex:mappedPort] && mappedPort<[aPortMapping desiredExternalPort]+40) {
mappedPort++;
}
- r = UPNP_AddPortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",mappedPort] UTF8String],[[NSString stringWithFormat:@"%d",[aPortMapping localPort]] UTF8String], [[[TCMPortMapper sharedInstance] localIPAddress] UTF8String], [[self portMappingDescription] UTF8String], protocol==TCMPortMappingTransportProtocolUDP?"UDP":"TCP");
+ r = UPNP_AddPortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",mappedPort] UTF8String],[[NSString stringWithFormat:@"%d",[aPortMapping localPort]] UTF8String], [[[TCMPortMapper sharedInstance] localIPAddress] UTF8String], [[self portMappingDescription] UTF8String], protocol==TCMPortMappingTransportProtocolUDP?"UDP":"TCP",NULL);
if (r!=UPNPCOMMAND_SUCCESS) {
NSString *errorString = [NSString stringWithFormat:@"%d",r];
switch (r) {
@@ -267,7 +315,7 @@ - (BOOL)applyPortMapping:(TCMPortMapping *)aPortMapping remove:(BOOL)shouldRemov
NSLog(@"%s mapping of external port %d failed, trying %d next",__FUNCTION__,mappedPort,mappedPort+1);
#endif
if (protocol == TCMPortMappingTransportProtocolTCP && ([aPortMapping transportProtocol] & TCMPortMappingTransportProtocolUDP)) {
- UPNP_DeletePortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",mappedPort] UTF8String], "UDP");
+ UPNP_DeletePortMapping(aURLs->controlURL, aIGDData->servicetype,[[NSString stringWithFormat:@"%d",mappedPort] UTF8String], "UDP",NULL);
protocol = TCMPortMappingTransportProtocolUDP;
}
mappedPort++;
@@ -358,7 +406,7 @@ - (void)updatePortMappingsInThread {
portMappingDescription,@"description",
nil]
];
- if ([portMappingDescription isEqualToString:[self portMappingDescription]] &&
+ if ([self doesPortMappingDescriptionBelongToMe:portMappingDescription] &&
[ipAddress isEqualToString:[pm localIPAddress]]) {
NSString *transportProtocol = [NSString stringWithUTF8String:protocol];
// check if we want this mapping, if not remove it, if yes set mapping status
@@ -375,14 +423,15 @@ - (void)updatePortMappingsInThread {
if ([mapping mappingStatus]!=TCMPortMappingStatusMapped &&
[mapping transportProtocol]!=TCMPortMappingTransportProtocolBoth) {
[mapping setMappingStatus:TCMPortMappingStatusMapped];
+ [reservedPortNumbers addIndex:publicPort];
}
- [reservedPortNumbers addIndex:publicPort];
break;
}
}
}
+// NSLog(@"%s -------------> about to %@ port mapping %@",__FUNCTION__,isWanted?@"KEEP":@"DELETE",portMappingDescription);
if (!isWanted) {
- r=UPNP_DeletePortMapping(_urls.controlURL, _igddata.servicetype,extPort,protocol);
+ r=UPNP_DeletePortMapping(_urls.controlURL, _igddata.servicetype,extPort,protocol,NULL);
if (r==UPNPCOMMAND_SUCCESS) i--;
}
} else {
@@ -433,7 +482,7 @@ - (void)updatePortMappingsInThread {
char *publicPort = (char *)[[NSString stringWithFormat:@"%d",[[mappingToRemove objectForKey:@"publicPort"] intValue]] UTF8String];
char *protocol = (char *)[[mappingToRemove objectForKey:@"protocol"] UTF8String];
- UPNP_DeletePortMapping(_urls.controlURL,_igddata.servicetype,publicPort,protocol);
+ UPNP_DeletePortMapping(_urls.controlURL,_igddata.servicetype,publicPort,protocol,NULL);
@synchronized (upnpRemoveSet) {
[upnpRemoveSet removeObject:mappingToRemove];
@@ -488,21 +537,30 @@ - (void)stop {
- (void)stopBlocking {
refreshThreadShouldQuit=YES;
UpdatePortMappingsThreadShouldQuit = YES;
+ UpdatePortMappingsThreadShouldRestart=NO;
[_threadIsRunningLock lock];
NSSet *mappingsToStop = [[TCMPortMapper sharedInstance] portMappings];
@synchronized (mappingsToStop) {
NSEnumerator *mappings = [mappingsToStop objectEnumerator];
TCMPortMapping *mapping = nil;
while ((mapping = [mappings nextObject])) {
if ([mapping mappingStatus] == TCMPortMappingStatusMapped) {
- UPNP_DeletePortMapping(_urls.controlURL, _igddata.servicetype,
- [[NSString stringWithFormat:@"%d",[mapping externalPort]] UTF8String],
- ([mapping transportProtocol]==TCMPortMappingTransportProtocolUDP)?"UDP":"TCP");
- [mapping setMappingStatus:TCMPortMappingStatusUnmapped];
+ int protocol = TCMPortMappingTransportProtocolUDP;
+ for (protocol = TCMPortMappingTransportProtocolUDP; protocol <= TCMPortMappingTransportProtocolTCP; protocol++) {
+ if (protocol & [mapping transportProtocol]) {
+ UPNP_DeletePortMapping(_urls.controlURL, _igddata.servicetype,
+ [[NSString stringWithFormat:@"%d",[mapping externalPort]] UTF8String],
+ (protocol==TCMPortMappingTransportProtocolUDP)?"UDP":"TCP",NULL);
+ }
+ }
+ [mapping setMappingStatus:TCMPortMappingStatusUnmapped];
}
}
}
[_threadIsRunningLock unlock];
+ refreshThreadShouldQuit=YES;
+ UpdatePortMappingsThreadShouldQuit = YES;
+ UpdatePortMappingsThreadShouldRestart=NO;
}
View
34 framework/libnatpmp/Changelog.txt
@@ -0,0 +1,34 @@
+$Id: Changelog.txt,v 1.11 2008/10/06 10:04:16 nanard Exp $
+
+2008/10/06:
+ Fixed a memory leak in getdefaultgateway() (USE_SYSCTL_NET_ROUTE)
+
+2008/07/03:
+ Adding WIN32 code from Robbie Hanson
+
+2008/06/30:
+ added a Solaris implementation for getgateway().
+ added a LICENCE file to the distribution
+
+2008/05/29:
+ Anonymous unions are forbidden in ANSI C. That was causing problems with
+ non-GCC compilers.
+
+2008/04/28:
+ introduced strnatpmperr()
+ improved natpmpc.c sample
+ make install now install the binary
+
+2007/12/13:
+ Fixed getgateway.c for working under OS X ;)
+ Fixed values for NATPMP_PROTOCOL_TCP and NATPMP_PROTOCOL_UDP
+
+2007/12/11:
+ Fixed getgateway.c for compilation under Mac OS X
+
+2007/12/01:
+ added some comments in .h
+
+2007/11/30:
+ implemented almost everything
+
View
26 framework/libnatpmp/LICENCE
@@ -0,0 +1,26 @@
+Copyright (c) 2007-2008, Thomas BERNARD
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
View
75 framework/libnatpmp/Makefile
@@ -0,0 +1,75 @@
+# $Id: Makefile,v 1.6 2008/04/28 02:58:33 nanard Exp $
+# This Makefile is designed for use with GNU make
+# libnatpmp
+# (c) 2007-2008 Thomas Bernard
+# http://miniupnp.free.fr/libnatpmp.html
+
+CC = gcc
+INSTALL = install
+
+# APIVERSION is used in soname
+APIVERSION = 0
+CFLAGS = -O -fPIC -Wall -DENABLE_STRNATPMPERR
+
+LIBOBJS = natpmp.o getgateway.o
+
+OBJS = $(LIBOBJS) testgetgateway.o natpmpc.o
+
+STATICLIB = natpmp.a
+SHAREDLIB = natpmp.so
+SONAME = $(SHAREDLIB).$(APIVERSION)
+
+HEADERS = natpmp.h
+
+EXECUTABLES = testgetgateway natpmpc-shared natpmpc-static
+
+INSTALLPREFIX ?= $(PREFIX)/usr
+INSTALLDIRINC = $(INSTALLPREFIX)/include
+INSTALLDIRLIB = $(INSTALLPREFIX)/lib
+INSTALLDIRBIN = $(INSTALLPREFIX)/bin
+
+.PHONY: all clean depend install cleaninstall
+
+all: $(STATICLIB) $(SHAREDLIB) $(EXECUTABLES)
+
+clean:
+ $(RM) $(OBJS) $(EXECUTABLES) $(STATICLIB) $(SHAREDLIB)
+
+depend:
+ makedepend -f$(MAKEFILE_LIST) -Y $(OBJS:.o=.c) 2>/dev/null
+
+install: $(HEADERS) $(STATICLIB) $(SHAREDLIB)
+ $(INSTALL) -d $(INSTALLDIRINC)
+ $(INSTALL) --mode=644 $(HEADERS) $(INSTALLDIRINC)
+ $(INSTALL) -d $(INSTALLDIRLIB)
+ $(INSTALL) --mode=644 $(STATICLIB) $(INSTALLDIRLIB)
+ $(INSTALL) --mode=644 $(SHAREDLIB) $(INSTALLDIRLIB)/$(SONAME)
+ $(INSTALL) --mode=755 natpmpc-shared $(INSTALLDIRBIN)/natpmpc
+ ln --symbolic --force $(SONAME) $(INSTALLDIRLIB)/$(SHAREDLIB)
+
+cleaninstall:
+ $(RM) $(addprefix $(INSTALLDIRINC), $(HEADERS))
+ $(RM) $(INSTALLDIRLIB)/$(SONAME)
+ $(RM) $(INSTALLDIRLIB)/$(SHAREDLIB)
+ $(RM) $(INSTALLDIRLIB)/$(STATICLIB)
+
+testgetgateway: testgetgateway.o getgateway.o
+
+natpmpc-static: natpmpc.o $(STATICLIB)
+ $(CC) -o $@ $^
+
+natpmpc-shared: natpmpc.o $(SHAREDLIB)
+ $(CC) -o $@ $^
+
+$(STATICLIB): $(LIBOBJS)
+ $(AR) crs $@ $?
+
+$(SHAREDLIB): $(LIBOBJS)
+ $(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^
+
+# DO NOT DELETE
+
+natpmp.o: natpmp.h getgateway.h
+getgateway.o: getgateway.h
+testgetgateway.o: getgateway.h
+natpmpc.o: natpmp.h
View
17 framework/libnatpmp/build.bat
@@ -0,0 +1,17 @@
+@echo Compile getgateway
+gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR getgateway.c
+gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR testgetgateway.c
+gcc -o testgetgateway getgateway.o testgetgateway.o -lws2_32
+
+@echo Compile natpmp:
+gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR getgateway.c
+gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR natpmp.c
+gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR natpmpc.c
+gcc -c -Wall -Os -DWIN32 wingettimeofday.c
+gcc -o natpmpc getgateway.o natpmp.o natpmpc.o wingettimeofday.o -lws2_32
+
+@echo Create natpmp.dll:
+gcc -c -Wall -Os -DWIN32 -DENABLE_STRNATPMPERR -DNATPMP_EXPORTS getgateway.c
+gcc -c -Wall -Os -DWIN32 -DENABLE_STRNATPMPERR -DNATPMP_EXPORTS natpmp.c
+dllwrap -k --driver-name gcc --def natpmp.def --output-def natpmp.dll.def --implib natpmp.lib -o natpmp.dll getgateway.o natpmp.o wingettimeofday.o -lws2_32
+
View
15 framework/libnatpmp/declspec.h
@@ -0,0 +1,15 @@
+#ifndef __DECLSPEC_H__
+#define __DECLSPEC_H__
+
+#if defined(WIN32) && !defined(STATICLIB)
+ #ifdef NATPMP_EXPORTS
+ #define LIBSPEC __declspec(dllexport)
+ #else
+ #define LIBSPEC __declspec(dllimport)
+ #endif
+#else
+ #define LIBSPEC
+#endif
+
+#endif
+
View
409 framework/libnatpmp/getgateway.c
@@ -0,0 +1,409 @@
+/* $Id: getgateway.c,v 1.12 2008/10/06 10:04:16 nanard Exp $ */
+/* libnatpmp
+ * Copyright (c) 2007-2008, Thomas BERNARD <miniupnp@free.fr>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+#include <stdio.h>
+#include <ctype.h>
+#ifndef WIN32
+#include <netinet/in.h>
+#endif
+#include <sys/param.h>
+/* There is no portable method to get the default route gateway.
+ * So below are three differents functions implementing this.
+ * Parsing /proc/net/route is for linux.
+ * sysctl is the way to access such informations on BSD systems.
+ * Many systems should provide route information through raw PF_ROUTE
+ * sockets. */
+#ifdef __linux__
+#define USE_PROC_NET_ROUTE
+#undef USE_SOCKET_ROUTE
+#undef USE_SYSCTL_NET_ROUTE
+#endif
+
+#ifdef BSD
+#undef USE_PROC_NET_ROUTE
+#define USE_SOCKET_ROUTE
+#undef USE_SYSCTL_NET_ROUTE
+#endif
+
+#ifdef __APPLE__
+#undef USE_PROC_NET_ROUTE
+#undef USE_SOCKET_ROUTE
+#define USE_SYSCTL_NET_ROUTE
+#endif
+
+#if (defined(sun) && defined(__SVR4))
+#undef USE_PROC_NET_ROUTE
+#define USE_SOCKET_ROUTE
+#undef USE_SYSCTL_NET_ROUTE
+#endif
+
+#ifdef WIN32
+#undef USE_PROC_NET_ROUTE
+#undef USE_SOCKET_ROUTE
+#undef USE_SYSCTL_NET_ROUTE
+#define USE_WIN32_CODE
+#endif
+
+#ifdef USE_SYSCTL_NET_ROUTE
+#include <stdlib.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <net/route.h>
+#endif
+#ifdef USE_SOCKET_ROUTE
+#include <unistd.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <net/route.h>
+#endif
+#ifdef WIN32
+#include <unknwn.h>
+#include <winreg.h>
+#define MAX_KEY_LENGTH 255
+#define MAX_VALUE_LENGTH 16383
+#endif
+#include "getgateway.h"
+
+#ifndef WIN32
+#define SUCCESS (0)
+#define FAILED (-1)
+#endif
+
+#ifdef USE_PROC_NET_ROUTE
+int getdefaultgateway(in_addr_t * addr)
+{
+ long d, g;
+ char buf[256];
+ int line = 0;
+ FILE * f;
+ char * p;
+ f = fopen("/proc/net/route", "r");
+ if(!f)
+ return FAILED;
+ while(fgets(buf, sizeof(buf), f)) {
+ if(line > 0) {
+ p = buf;
+ while(*p && !isspace(*p))
+ p++;
+ while(*p && isspace(*p))
+ p++;
+ if(sscanf(p, "%lx%lx", &d, &g)==2) {
+ if(d == 0) { /* default */
+ *addr = g;
+ fclose(f);
+ return SUCCESS;
+ }
+ }
+ }
+ line++;
+ }
+ /* default route not found ! */
+ if(f)
+ fclose(f);
+ return FAILED;
+}
+#endif /* #ifdef USE_PROC_NET_ROUTE */
+
+
+#ifdef USE_SYSCTL_NET_ROUTE
+
+#define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+
+int getdefaultgateway(in_addr_t * addr)
+{
+#if 0
+ /* net.route.0.inet.dump.0.0 ? */
+ int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET,
+ NET_RT_DUMP, 0, 0/*tableid*/};
+#endif
+ /* net.route.0.inet.flags.gateway */
+ int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET,
+ NET_RT_FLAGS, RTF_GATEWAY};
+ size_t l;
+ char * buf, * p;
+ struct rt_msghdr * rt;
+ struct sockaddr * sa;
+ struct sockaddr * sa_tab[RTAX_MAX];
+ int i;
+ int r = FAILED;
+ if(sysctl(mib, sizeof(mib)/sizeof(int), 0, &l, 0, 0) < 0) {
+ return FAILED;
+ }
+ if(l>0) {
+ buf = malloc(l);
+ if(sysctl(mib, sizeof(mib)/sizeof(int), buf, &l, 0, 0) < 0) {
+ free(buf);
+ return FAILED;
+ }
+ for(p=buf; p<buf+l; p+=rt->rtm_msglen) {
+ rt = (struct rt_msghdr *)p;
+ sa = (struct sockaddr *)(rt + 1);
+ for(i=0; i<RTAX_MAX; i++) {
+ if(rt->rtm_addrs & (1 << i)) {
+ sa_tab[i] = sa;
+ sa = (struct sockaddr *)((char *)sa + ROUNDUP(sa->sa_len));
+ } else {
+ sa_tab[i] = NULL;
+ }
+ }
+ if( ((rt->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY))
+ && sa_tab[RTAX_DST]->sa_family == AF_INET
+ && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET) {
+ if(((struct sockaddr_in *)sa_tab[RTAX_DST])->sin_addr.s_addr == 0) {
+ *addr = ((struct sockaddr_in *)(sa_tab[RTAX_GATEWAY]))->sin_addr.s_addr;
+ r = SUCCESS;
+ }
+ }
+ }
+ free(buf);
+ }
+ return r;
+}
+#endif /* #ifdef USE_SYSCTL_NET_ROUTE */
+
+