├── DerivedData └── LAN Scan │ ├── Index │ └── Debug │ │ └── iphonesimulator7.0-i386 │ │ └── LAN Scan.xcindex │ │ ├── db.xcindexdb │ │ ├── db.xcindexdb-shm │ │ ├── db.xcindexdb-wal │ │ ├── db.xcindexdb.strings-cmp │ │ ├── db.xcindexdb.strings-dir │ │ ├── db.xcindexdb.strings-file │ │ ├── db.xcindexdb.strings-res │ │ └── db.xcindexdb.strings-sym │ ├── info.plist │ └── scm.plist ├── LAN Scan.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── iMac1.xcuserdatad │ └── xcschemes │ ├── LAN Scan.xcscheme │ └── xcschememanagement.plist ├── LAN Scan ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── Main_iPad.storyboard │ └── Main_iPhone.storyboard ├── Device.h ├── Device.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── LAN Scan-Info.plist ├── LAN Scan-Prefix.pch ├── ScanLAN.h ├── ScanLAN.m ├── SimplePing.h ├── SimplePing.m ├── SimplePingHelper.h ├── SimplePingHelper.m ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings ├── main.m └── screenshot.png ├── LAN ScanTests ├── LAN ScanTests-Info.plist ├── LAN_ScanTests.m └── en.lproj │ └── InfoPlist.strings ├── LICENSE.md └── README.md /DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongizaidi/LAN-Scan/1ae9257bcb16b51d3b769f85c6e02a968e13dbc3/DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb -------------------------------------------------------------------------------- /DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongizaidi/LAN-Scan/1ae9257bcb16b51d3b769f85c6e02a968e13dbc3/DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb-shm -------------------------------------------------------------------------------- /DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongizaidi/LAN-Scan/1ae9257bcb16b51d3b769f85c6e02a968e13dbc3/DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb-wal -------------------------------------------------------------------------------- /DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb.strings-cmp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb.strings-dir: -------------------------------------------------------------------------------- 1 | /Users/iMac1/Mongi/LAN Scan/LAN Scan.xcodeproj/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Library/Frameworks/XCTest.framework/Versions/A/Headers/Users/iMac1/Mongi/LAN Scan/LAN ScanTests/Users/iMac1/Mongi/LAN Scan/LAN Scan/en.lproj/Users/iMac1/Mongi/LAN Scan/LAN Scan/Base.lproj/Applications/Xcode 3.app/Contents/Developer/Library/Frameworks/XCTest.framework/Versions/A/Users/iMac1/Mongi/LAN Scan/LAN Scan/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Applications/Xcode 3.app/Contents/Developer/Library/Frameworks/Users/iMac1/Mongi/LAN Scan/Users/iMac1/Mongi/LAN Scan/LAN ScanTests/en.lproj/Users/iMac1/Mongi/LAN Scan/DerivedData/LAN Scan/Index/PrecompiledHeaders/LAN Scan-Prefix-gqjcwqjxjaecbldxutjtqkouwnld_ast/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Users/iMac1/Mongi/LAN Scan/DerivedData/ModuleCache/2XY4EO676G2BK/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks/XCTest.framework/Headers/Users/iMac1/Mongi/LAN Scan/DerivedData/LAN Scan/Index/PrecompiledHeaders/LAN Scan-Prefix-gcngjtyarwebkedxpqgelmtuhpab_ast/Users/iMac1/Mongi/LAN Scan/DerivedData/ModuleCache/5IA4DIS925IF/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/objc/Applications/Xcode 3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.0/include/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/Security.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/uuid/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/sys/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/machine/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/i386/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/sys/_types/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/_types/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/mach/i386/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/secure/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/libkern/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/libkern/i386/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/arpa/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/netinet/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/netinet6/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/net/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/mach/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/mach/machine/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/mach_debug/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/malloc/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/architecture/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/bsm/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/mach-o/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/dispatch/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/os/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/Users/iMac1/Mongi/LAN Scan/DerivedData/LAN Scan/Index/PrecompiledHeaders/LAN Scan-Prefix-dodvwmffrgopjvbrydsyexkoynxp_ast/Users/iMac1/Mongi/LAN Scan/DerivedData/ModuleCache/11JF9SP88WU90/Users/iMac1/Mongi/LAN Scan/LAN-Scan/LAN Scan.xcodeproj/Users/iMac1/Mongi/LAN Scan/LAN-Scan/LAN Scan/Users/iMac1/Mongi/LAN Scan/LAN-Scan/LAN ScanTests/Users/iMac1/Mongi/LAN Scan/LAN-Scan/LAN Scan/en.lproj/Users/iMac1/Mongi/LAN Scan/LAN-Scan/Users/iMac1/Mongi/LAN Scan/LAN-Scan/LAN ScanTests/en.lproj/Users/iMac1/Mongi/LAN Scan/LAN-Scan/LAN Scan/Base.lproj/Users/iMac1/Mongi/LAN Scan/LAN-Scan/DerivedData/LAN Scan/Index/PrecompiledHeaders/LAN Scan-Prefix-doeqsvejdrcrxkdqwfxjtgtnslmd_ast/Users/iMac1/Mongi/LAN Scan/LAN-Scan/DerivedData/ModuleCache/2XY4EO676G2BK/Users/iMac1/Mongi/LAN Scan/LAN-Scan/DerivedData/LAN Scan/Index/PrecompiledHeaders/LAN Scan-Prefix-faakbjpumqoasidobgonjtcpuuoq_ast/Users/iMac1/Mongi/LAN Scan/LAN-Scan/DerivedData/ModuleCache/5IA4DIS925IF/Users/iMac1/Mongi/LAN Scan/LAN-Scan/DerivedData/LAN Scan/Index/PrecompiledHeaders/LAN Scan-Prefix-fqxtycyodczyalfqivvhtotroufx_ast/Users/iMac1/Mongi/LAN Scan/LAN-Scan/DerivedData/ModuleCache/11JF9SP88WU90 -------------------------------------------------------------------------------- /DerivedData/LAN Scan/Index/Debug/iphonesimulator7.0-i386/LAN Scan.xcindex/db.xcindexdb.strings-file: -------------------------------------------------------------------------------- 1 | project.xcworkspaceUIAccessibilityElement.huiaccessibilityelement.hNSCalendar.hnscalendar.hCGPDFContentStream.hcgpdfcontentstream.hUIPanGestureRecognizer.huipangesturerecognizer.hUIActivity.huiactivity.hNSNumberFormatter.hnsnumberformatter.hNSIndexPath.hnsindexpath.hXCTestCase.hxctestcase.hNSURLSession.hnsurlsession.hNSStream.hnsstream.hUINibDeclarations.huinibdeclarations.hUISwipeGestureRecognizer.huiswipegesturerecognizer.hNSURLCredentialStorage.hnsurlcredentialstorage.hNSLayoutConstraint.hnslayoutconstraint.hNSURLConnection.hnsurlconnection.hUINavigationBar.huinavigationbar.hCGPath.hcgpath.hUIStepper.huistepper.hCGShading.hcgshading.hUISplitViewController.huisplitviewcontroller.hUIPrintPaper.huiprintpaper.hUIProgressView.huiprogressview.hUILongPressGestureRecognizer.huilongpressgesturerecognizer.hNSArray.hnsarray.hUICollectionViewTransitionLayout.huicollectionviewtransitionlayout.hXCTestCaseRun.hxctestcaserun.hCGPDFString.hcgpdfstring.hUINibLoading.huinibloading.hNSProcessInfo.hnsprocessinfo.hNSPointerFunctions.hnspointerfunctions.hLAN ScanTests-Info.plistlan scantests-info.plistUISnapBehavior.huisnapbehavior.hXCTest.hxctest.hNSJSONSerialization.hnsjsonserialization.hNSURLError.hnsurlerror.hUITextField.huitextfield.hNSHashTable.hnshashtable.hUIStoryboard.huistoryboard.hUITapGestureRecognizer.huitapgesturerecognizer.hNSURLCredential.hnsurlcredential.hNSExpression.hnsexpression.hUIFont.huifont.hNSError.hnserror.hXCTestSuiteRun.hxctestsuiterun.hUIAccessibilityAdditions.huiaccessibilityadditions.hUITabBar.huitabbar.hUIGeometry.huigeometry.hUIButton.huibutton.hUIManagedDocument.huimanageddocument.hNSFileManager.hnsfilemanager.hUIAccessibilityIdentification.huiaccessibilityidentification.hXCTestAssertionsImpl.hxctestassertionsimpl.hNSOrderedSet.hnsorderedset.hNSString.hnsstring.hCGImage.hcgimage.hUISegmentedControl.huisegmentedcontrol.hUIReferenceLibraryViewController.huireferencelibraryviewcontroller.hNSUUID.hnsuuid.hUILocalNotification.huilocalnotification.hInfoPlist.stringsinfoplist.stringsUIMotionEffect.huimotioneffect.hCoreGraphics.hcoregraphics.hNSProgress.hnsprogress.hNSMetadata.hnsmetadata.hCGFunction.hcgfunction.hCGPDFPage.hcgpdfpage.hNSRange.hnsrange.hUIDynamicBehavior.huidynamicbehavior.hUIView.huiview.hXCTestObserver.hxctestobserver.hNSPathUtilities.hnspathutilities.hUIInterface.huiinterface.hNSShadow.hnsshadow.hMain_iPad.storyboardmain_ipad.storyboardHeadersheadersNSMethodSignature.hnsmethodsignature.hNSComparisonPredicate.hnscomparisonpredicate.hLAN_ScanTests.mlan_scantests.mUIColor.huicolor.hUIScreenEdgePanGestureRecognizer.huiscreenedgepangesturerecognizer.hUIGestureRecognizer.huigesturerecognizer.hUIAlertView.huialertview.hmain.mNSNotificationQueue.hnsnotificationqueue.hNSByteOrder.hnsbyteorder.hCoreGraphics.frameworkcoregraphics.frameworkNSDate.hnsdate.hNSFileCoordinator.hnsfilecoordinator.hNSSet.hnsset.hCGColor.hcgcolor.hUIStringDrawing.huistringdrawing.hUIStoryboardSegue.huistoryboardsegue.hUIPageViewController.huipageviewcontroller.hUIKit.frameworkuikit.frameworkNSURLRequest.hnsurlrequest.hCGPDFStream.hcgpdfstream.hNSXMLParser.hnsxmlparser.hUIDynamicAnimator.huidynamicanimator.hUIGraphics.huigraphics.hUIAlert.huialert.hNSOperation.hnsoperation.hUICollectionView.huicollectionview.hNSException.hnsexception.hNSTimeZone.hnstimezone.hUIGravityBehavior.huigravitybehavior.hXCAbstractTest.hxcabstracttest.hNSUserDefaults.hnsuserdefaults.hNSURLProtectionSpace.hnsurlprotectionspace.hCGBase.hcgbase.hNSHTTPCookieStorage.hnshttpcookiestorage.hUIPrintFormatter.huiprintformatter.hUITextChecker.huitextchecker.hUIRotationGestureRecognizer.huirotationgesturerecognizer.hNSLayoutManager.hnslayoutmanager.hNSFileHandle.hnsfilehandle.hNSNotification.hnsnotification.hUISearchDisplayController.huisearchdisplaycontroller.hUIAccessibilityZoom.huiaccessibilityzoom.hNSUndoManager.hnsundomanager.hNSKeyValueObserving.hnskeyvalueobserving.hCGDataProvider.hcgdataprovider.hCGGradient.hcggradient.hUIAccelerometer.huiaccelerometer.hUITabBarItem.huitabbaritem.hUIScreenMode.huiscreenmode.hCGFont.hcgfont.hUICollectionViewLayout.huicollectionviewlayout.hUICollectionViewFlowLayout.huicollectionviewflowlayout.hUIDataDetectors.huidatadetectors.hUIDocument.huidocument.hUIPickerView.huipickerview.hCGPDFArray.hcgpdfarray.hNSCompoundPredicate.hnscompoundpredicate.hUIWindow.huiwindow.hNSTimer.hnstimer.hCGError.hcgerror.hUIAccessibility.huiaccessibility.hCGPDFDictionary.hcgpdfdictionary.hFoundationErrors.hfoundationerrors.hUIGestureRecognizerSubclass.huigesturerecognizersubclass.hXCTestSuite.hxctestsuite.hUIPopoverController.huipopovercontroller.hUIPrintError.huiprinterror.hNSUbiquitousKeyValueStore.hnsubiquitouskeyvaluestore.hCGPDFObject.hcgpdfobject.hNSThread.hnsthread.hUITabBarController.huitabbarcontroller.hNSCache.hnscache.hUIInputView.huiinputview.hNSKeyValueCoding.hnskeyvaluecoding.hUIScreen.huiscreen.hUIActionSheet.huiactionsheet.hXCTestProbe.hxctestprobe.hUIPushBehavior.huipushbehavior.hCGContext.hcgcontext.hNSTextCheckingResult.hnstextcheckingresult.hNSAttributedString.hnsattributedstring.hXCTestAssertions.hxctestassertions.hNSURLProtocol.hnsurlprotocol.hNSDictionary.hnsdictionary.hUIDatePicker.huidatepicker.hUIPrintInfo.huiprintinfo.hNSEnumerator.hnsenumerator.hUIGuidedAccessRestrictions.huiguidedaccessrestrictions.hXCTest.frameworkxctest.frameworkUIVideoEditorController.huivideoeditorcontroller.hNSPredicate.hnspredicate.hNSRegularExpression.hnsregularexpression.hUINib.huinib.hUIBarCommon.huibarcommon.hUIStateRestoration.huistaterestoration.hUIImagePickerController.huiimagepickercontroller.hUITableView.huitableview.hNSMapTable.hnsmaptable.hUIActivityIndicatorView.huiactivityindicatorview.hUICollisionBehavior.huicollisionbehavior.hUIBarItem.huibaritem.hCGLayer.hcglayer.hNSURLResponse.hnsurlresponse.hCGBitmapContext.hcgbitmapcontext.hCGGeometry.hcggeometry.hNSAutoreleasePool.hnsautoreleasepool.hUIResponder.huiresponder.hNSDecimalNumber.hnsdecimalnumber.hUIImageView.huiimageview.hUIKitDefines.huikitdefines.hNSZone.hnszone.hNSPort.hnsport.hNSURLAuthenticationChallenge.hnsurlauthenticationchallenge.hCGPDFScanner.hcgpdfscanner.hNSDecimal.hnsdecimal.hUIControl.huicontrol.hUISlider.huislider.hNSObjCRuntime.hnsobjcruntime.hLAN Scan-Prefix.pchlan scan-prefix.pchNSCoder.hnscoder.hNSLocale.hnslocale.hNSObject.hnsobject.hUITableViewHeaderFooterView.huitableviewheaderfooterview.hUILocalizedIndexedCollation.huilocalizedindexedcollation.hUIWebView.huiwebview.hCGPattern.hcgpattern.hNSFilePresenter.hnsfilepresenter.hViewController.hviewcontroller.hUIActivityViewController.huiactivityviewcontroller.hUINavigationController.huinavigationcontroller.hUIPinchGestureRecognizer.huipinchgesturerecognizer.hNSScanner.hnsscanner.hNSURLCache.hnsurlcache.hUISwitch.huiswitch.hNSNetServices.hnsnetservices.hNSURL.hnsurl.hCGColorSpace.hcgcolorspace.hUIDynamicItemBehavior.huidynamicitembehavior.hNSByteCountFormatter.hnsbytecountformatter.hNSTextContainer.hnstextcontainer.hCGAffineTransform.hcgaffinetransform.hNSParagraphStyle.hnsparagraphstyle.hNSText.hnstext.hNSTextAttachment.hnstextattachment.hUIPrintInteractionController.huiprintinteractioncontroller.hUICollectionViewCell.huicollectionviewcell.hAppDelegate.mappdelegate.mUIViewControllerTransitionCoordinator.huiviewcontrollertransitioncoordinator.hUIApplication.huiapplication.hUIMenuController.huimenucontroller.hUIDevice.huidevice.hNSDateFormatter.hnsdateformatter.hCGPDFContext.hcgpdfcontext.hLAN Scan.xcodeprojlan scan.xcodeprojUITouch.huitouch.hUITableViewCell.huitableviewcell.hNSLinguisticTagger.hnslinguistictagger.hUIStoryboardPopoverSegue.huistoryboardpopoversegue.hUIFontDescriptor.huifontdescriptor.hNSKeyedArchiver.hnskeyedarchiver.hUITextView.huitextview.hUITextInputTraits.huitextinputtraits.hXCTestLog.hxctestlog.hAppDelegate.happdelegate.hNSRunLoop.hnsrunloop.hUIScrollView.huiscrollview.hUIBezierPath.huibezierpath.hNSValueTransformer.hnsvaluetransformer.hUITableViewController.huitableviewcontroller.hLAN Scan-Info.plistlan scan-info.plistNSMetadataAttributes.hnsmetadataattributes.hXCTestRun.hxctestrun.hUIViewControllerTransitioning.huiviewcontrollertransitioning.hNSProxy.hnsproxy.hNSFileWrapper.hnsfilewrapper.hXCTestDefines.hxctestdefines.hUIAppearance.huiappearance.hUIBarButtonItem.huibarbuttonitem.hNSFormatter.hnsformatter.hNSBundle.hnsbundle.hUIActivityItemProvider.huiactivityitemprovider.hFoundation.frameworkfoundation.frameworkNSIndexSet.hnsindexset.hNSHTTPCookie.hnshttpcookie.hUIKit.huikit.hNSTextStorage.hnstextstorage.hNSSortDescriptor.hnssortdescriptor.hUITextInput.huitextinput.hUIViewController.huiviewcontroller.hNSFileVersion.hnsfileversion.hNSPropertyList.hnspropertylist.hImages.xcassetsimages.xcassetsNSStringDrawing.hnsstringdrawing.hNSLock.hnslock.hUILabel.huilabel.hNSInvocation.hnsinvocation.hUICollectionViewController.huicollectionviewcontroller.hNSPointerArray.hnspointerarray.hNSData.hnsdata.hUIAccessibilityConstants.huiaccessibilityconstants.hNSOrthography.hnsorthography.hUISearchBar.huisearchbar.hNSValue.hnsvalue.hUIDocumentInteractionController.huidocumentinteractioncontroller.hUIImage.huiimage.hFoundation.hfoundation.hUIPageControl.huipagecontrol.hUIToolbar.huitoolbar.hUIPasteboard.huipasteboard.hUIRefreshControl.huirefreshcontrol.hUIPopoverBackgroundView.huipopoverbackgroundview.hUIEvent.huievent.hCGPDFDocument.hcgpdfdocument.hCGDataConsumer.hcgdataconsumer.hUIPrintPageRenderer.huiprintpagerenderer.hViewController.mviewcontroller.mNSNull.hnsnull.hUIAttachmentBehavior.huiattachmentbehavior.hMain_iPhone.storyboardmain_iphone.storyboardCGPDFOperatorTable.hcgpdfoperatortable.hNSCharacterSet.hnscharacterset.hLAN Scan-Prefix.pch.pchlan scan-prefix.pch.pchAvailability.havailability.hDarwin.pcmdarwin.pcmUIKit.pcmuikit.pcmFoundation.pcmfoundation.pcmXCTest.pcmxctest.pcmCoreFoundation.hcorefoundation.hTargetConditionals.htargetconditionals.hstdarg.hstdint.hlimits.hAvailabilityMacros.havailabilitymacros.hCFAvailability.hcfavailability.hCFBase.hcfbase.hCFByteOrder.hcfbyteorder.hCFCalendar.hcfcalendar.hCFCharacterSet.hcfcharacterset.hCFDateFormatter.hcfdateformatter.hsetjmp.hstdbool.hCFPropertyList.hcfpropertylist.hCFLocale.hcflocale.hCFNumberFormatter.hcfnumberformatter.hCFRunLoop.hcfrunloop.hSecurity.hsecurity.hCFNetwork.hcfnetwork.hSecureTransport.hsecuretransport.hCFUUID.hcfuuid.huuid.hSecurity.pcmsecurity.pcmCoreFoundation.pcmcorefoundation.pcmObjectiveC.pcmobjectivec.pcmCFNetwork.pcmcfnetwork.pcmSecBase.hsecbase.hcdefs.hSecCertificate.hseccertificate.hCFData.hcfdata.hSecIdentity.hsecidentity.hSecImportExport.hsecimportexport.hCFArray.hcfarray.hCFDictionary.hcfdictionary.hSecItem.hsecitem.hSecKey.hseckey.htypes.hSecPolicy.hsecpolicy.hSecRandom.hsecrandom.hSecTrust.hsectrust.hCipherSuite.hciphersuite.h_symbol_aliasing.h_posix_availability.hcomplex.hctype.hrunetype.h_types.h_size_t.h_ct_rune_t.h_rune_t.h_wchar_t.h_wint_t.herrno.h_errno_t.hfenv.hfloat.h_int8_t.h_int16_t.h_int32_t.h_int64_t.h_uint8_t.h_uint16_t.h_uint32_t.h_uint64_t.h_intptr_t.h_uintptr_t.h_intmax_t.h_uintmax_t.hinttypes.hiso646.h_limits.hsyslimits.hlocale.h_locale.h_null.hmath.hAvailabilityInternal.havailabilityinternal.hsignal.happleapiopts.h_mcontext.h_structs.h_sigaltstack.h_ucontext.h_pid_t.h_pthread_attr_t.h_sigset_t.h_uid_t.h_pthread_t.hstddef.h_ptrdiff_t.h_rsize_t.hstdio.h_va_list.h_off_t.h_ssize_t.h_stdio.h_common.hstdlib.hwait.h_id_t.hresource.h_timeval.hendian.h_endian.h_OSByteOrder.h_osbyteorder.halloca.h___offsetof.h_dev_t.h_mode_t.hstring.hstrings.h_string.htgmath.htime.h_timespec.h_clock_t.h_time_t.hwchar.h_mbstate_t.h_wctype.h_wctype_t.hwctype.h_wctrans_t.haio.h_o_sync.h_o_dsync.hinet.hin.h_in_addr_t.h_in_port_t.hsocket.h_blkcnt_t.h_blksize_t.h_gid_t.h_ino_t.h_ino64_t.h_key_t.h_nlink_t.h_useconds_t.h_suseconds_t.h_fd_def.h_fd_setsize.h_fd_set.h_fd_clr.h_fd_zero.h_fd_isset.h_fd_copy.h_pthread_cond_t.h_pthread_condattr_t.h_pthread_mutex_t.h_pthread_mutexattr_t.h_pthread_once_t.h_pthread_rwlock_t.h_pthread_rwlockattr_t.h_pthread_key_t.h_fsblkcnt_t.h_fsfilcnt_t.h_param.h_sa_family_t.h_socklen_t.h_iovec_t.hin6.hcpio.hdirent.hdir.hdlfcn.hfcntl.h_seek_set.h_s_ifmt.h_filesec_t.hfmtmsg.hfnmatch.hftw.hstat.hglob.hgrp.h_uuid_t.hiconv.hioctl.httycom.hioccom.hfilio.hsockio.hlanginfo.h_nl_item.hlibgen.hmonetary.hndbm.hnetdb.hif.hif_var.h_select.hqueue.htcp.hnl_types.hpoll.hpthread.hpthread_impl.hsched.h_mach_port_t.hpwd.hregex.hsearch.hsemaphore.hposix_sem.hproc.hselect.hlock.hparam.hevent.hboolean.hspawn.hexception_types.hexception.hport.hvm_types.hvm_param.hthread_status.hmessage.hkern_return.hfp_reg.hthread_state.heflags.hmachine.hipc.hmman.hmsg.hsem.hshm.hposix_shm.hstatvfs.htimes.h_guid_t.h_os_inline.h_posix_vdisable.h_timeval32.h_ucontext64.huio.hun.hutsname.hsyslog.htar.htermios.httydefaults.hulimit.hunistd.hgethostuuid.hutime.hutmpx.hwordexp.hConditionalMacros.hconditionalmacros.hgetopt.hAssertMacros.hassertmacros.hMacTypes.hmactypes.hmach.hstd_types.hmach_types.hhost_info.hvm_statistics.htime_value.hhost_notify.hhost_special_ports.hmemory_object_types.hvm_prot.hvm_sync.hprocessor_info.htask_info.hpolicy.htask_policy.htask_special_ports.hthread_info.hthread_policy.hthread_special_ports.hclock_types.hvm_attributes.hvm_inherit.hvm_purgable.hvm_behavior.hvm_region.hkmod.hmach_interface.hclock_priv.hndr.hOSByteOrder.hosbyteorder.hnotify.hmig_errors.hmig.hhost_priv.hmach_debug_types.hipc_info.hvm_info.hzone_info.hpage_info.hhash_info.hlockgroup_info.hhost_security.hlock_set.hprocessor.hprocessor_set.hsync_policy.htask.hthread_act.hvm_map.hmach_port.hmach_init.hmach_traps.hmach_host.hthread_switch.hrpc.hmach_error.herror.hbootstrap.hclock.hclock_reply.hexc.hhost_reboot.hmach_param.hmach_syscalls.hmach_time.hport_obj.hsync.hvm_task.hsdt.hsdt_isa.hmach_debug.hOSAtomic.hosatomic.hmalloc.hbyte_order.hfasttrap_isa.hprofile.hvmparam.hBlock.hblock.hlibbsm.haudit.haudit_record.hcurses.hncurses_dll.hunctrl.hif_media.hroute.hacct.hacl.hkauth.hattr.hucred.hbuf.hkernel_types.hconf.hdisk.hdkstat.hdomain.hev.hfile.hfiledesc.hgmon.hlctx.hsyscall.hkern_control.hmbuf.hmount.hmsgbuf.hnetport.hpaths.hpipe.hproc_info.hquota.hrandom.hrbtree.hreboot.hresourcevar.hsbuf.hsignalvar.hsocketvar.hsysctl.hvm.hsys_domain.htimeb.htrace.htty.hucontext.hunpcb.huser.hutfconv.hvcmd.hlibc.hsysexits.hQuartzCore.pcmquartzcore.pcmCAAnimation.hcaanimation.hCALayer.hcalayer.hCAMediaTiming.hcamediatiming.hCABase.hcabase.hobjc.hCATransform3D.hcatransform3d.hCADisplayLink.hcadisplaylink.hCAEAGLLayer.hcaeagllayer.hEAGLDrawable.heagldrawable.hCAEmitterBehavior.hcaemitterbehavior.hCAEmitterCell.hcaemittercell.hCAEmitterLayer.hcaemitterlayer.hCAGradientLayer.hcagradientlayer.hCAMediaTimingFunction.hcamediatimingfunction.hCAReplicatorLayer.hcareplicatorlayer.hCAScrollLayer.hcascrolllayer.hCAShapeLayer.hcashapelayer.hCATextLayer.hcatextlayer.hCATiledLayer.hcatiledlayer.hCATransaction.hcatransaction.hCATransformLayer.hcatransformlayer.hCAValueFunction.hcavaluefunction.hCoreAnimation.hcoreanimation.hQuartzCore.hquartzcore.hCoreGraphics.pcmcoregraphics.pcmOpenGLES.pcmopengles.pcmList.hlist.hobjc-api.hruntime.hobjc-auto.hobjc-class.hobjc-exception.hobjc-load.hloader.hobjc-runtime.hobjc-sync.hObject.hobject.hProtocol.hprotocol.hMachO.pcmmacho.pcmarch.hcompact_unwind_encoding.hdyld.hdyld_images.hfat.hgetsect.hldsyms.hnlist.hranlib.hreloc.hstab.hswap.hCFNetworkDefs.hcfnetworkdefs.hCFNetworkErrors.hcfnetworkerrors.hCFString.hcfstring.hCFSocketStream.hcfsocketstream.hCFStream.hcfstream.hCFHost.hcfhost.hCFNetServices.hcfnetservices.hCFFTPStream.hcfftpstream.hCFHTTPMessage.hcfhttpmessage.hCFURL.hcfurl.hCFHTTPStream.hcfhttpstream.hCFHTTPAuthentication.hcfhttpauthentication.hCFNetDiagnostics.hcfnetdiagnostics.hCFProxySupport.hcfproxysupport.hCFError.hcferror.hCoreImage.hcoreimage.hCTParagraphStyle.hctparagraphstyle.hCoreImage.pcmcoreimage.pcmCoreText.pcmcoretext.pcmassert.hCFBag.hcfbag.hCFBinaryHeap.hcfbinaryheap.hCFBitVector.hcfbitvector.hCFDate.hcfdate.hCFTimeZone.hcftimezone.hCFNumber.hcfnumber.hCFPreferences.hcfpreferences.hCFSocket.hcfsocket.hdispatch.hCFSet.hcfset.hCFStringEncodingExt.hcfstringencodingext.hCFTree.hcftree.hCFURLAccess.hcfurlaccess.hCFUtilities.hcfutilities.hCFBundle.hcfbundle.hCFMessagePort.hcfmessageport.hCFPlugIn.hcfplugin.hCFAttributedString.hcfattributedstring.hCFNotificationCenter.hcfnotificationcenter.hCFURLEnumerator.hcfurlenumerator.hCFFileSecurity.hcffilesecurity.hCFMachPort.hcfmachport.hCFStringTokenizer.hcfstringtokenizer.hCFFileDescriptor.hcffiledescriptor.hCFPlugInCOM.hcfplugincom.hDispatch.pcmdispatch.pcmbase.hsource.hgroup.honce.hdata.hio.hintrospection.hos.pcmCoreText.hcoretext.hCTDefines.hctdefines.hCTFont.hctfont.hCTFontDescriptor.hctfontdescriptor.hCTFontTraits.hctfonttraits.hCTFontCollection.hctfontcollection.hCTFontManager.hctfontmanager.hCTFontManagerErrors.hctfontmanagererrors.hCTFrame.hctframe.hCTFramesetter.hctframesetter.hCTTypesetter.hcttypesetter.hCTLine.hctline.hCTGlyphInfo.hctglyphinfo.hCTRun.hctrun.hCTRunDelegate.hctrundelegate.hCTStringAttributes.hctstringattributes.hCTTextTab.hcttexttab.hSFNTLayoutTypes.hsfntlayouttypes.hSFNTTypes.hsfnttypes.hCIColor.hcicolor.hCoreImageDefines.hcoreimagedefines.hCIContext.hcicontext.hCIImage.hciimage.hCoreVideo.hcorevideo.hEAGL.heagl.hCIFilter.hcifilter.hCIVector.hcivector.hCIDetector.hcidetector.hCIFeature.hcifeature.hCoreVideo.pcmcorevideo.pcmCVReturn.hcvreturn.hCVBase.hcvbase.hCVBuffer.hcvbuffer.hCVPixelBuffer.hcvpixelbuffer.hCVImageBuffer.hcvimagebuffer.hCVPixelBufferPool.hcvpixelbufferpool.hCVOpenGLESTexture.hcvopenglestexture.hgl.hglext.hCVOpenGLESTextureCache.hcvopenglestexturecache.hCVPixelFormatDescription.hcvpixelformatdescription.hCVHostTime.hcvhosttime.hScanLAN.hscanlan.hScanLAN.mscanlan.mSimplePing.msimpleping.mSimplePingHelper.hsimplepinghelper.hSimplePingHelper.msimplepinghelper.mSimplePing.hsimpleping.hifaddrs.hDevice.mdevice.mDevice.hdevice.hscreenshot.png -------------------------------------------------------------------------------- /DerivedData/LAN Scan/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WorkspacePath 6 | /Users/iMac1/Mongi/LAN Scan/LAN Scan.xcodeproj 7 | 8 | 9 | -------------------------------------------------------------------------------- /DerivedData/LAN Scan/scm.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Version 6 | 5 7 | 8 | 9 | -------------------------------------------------------------------------------- /LAN Scan.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 39352B7E18BB936D00F68217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39352B7D18BB936D00F68217 /* Foundation.framework */; }; 11 | 39352B8018BB936D00F68217 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39352B7F18BB936D00F68217 /* CoreGraphics.framework */; }; 12 | 39352B8218BB936D00F68217 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39352B8118BB936D00F68217 /* UIKit.framework */; }; 13 | 39352B8818BB936D00F68217 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 39352B8618BB936D00F68217 /* InfoPlist.strings */; }; 14 | 39352B8A18BB936D00F68217 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352B8918BB936D00F68217 /* main.m */; }; 15 | 39352B8E18BB936D00F68217 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352B8D18BB936D00F68217 /* AppDelegate.m */; }; 16 | 39352B9118BB936D00F68217 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 39352B8F18BB936D00F68217 /* Main_iPhone.storyboard */; }; 17 | 39352B9418BB936D00F68217 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 39352B9218BB936D00F68217 /* Main_iPad.storyboard */; }; 18 | 39352B9718BB936D00F68217 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352B9618BB936D00F68217 /* ViewController.m */; }; 19 | 39352B9918BB936D00F68217 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 39352B9818BB936D00F68217 /* Images.xcassets */; }; 20 | 39352BA018BB936D00F68217 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39352B9F18BB936D00F68217 /* XCTest.framework */; }; 21 | 39352BA118BB936D00F68217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39352B7D18BB936D00F68217 /* Foundation.framework */; }; 22 | 39352BA218BB936D00F68217 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39352B8118BB936D00F68217 /* UIKit.framework */; }; 23 | 39352BAA18BB936D00F68217 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 39352BA818BB936D00F68217 /* InfoPlist.strings */; }; 24 | 39352BAC18BB936D00F68217 /* LAN_ScanTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352BAB18BB936D00F68217 /* LAN_ScanTests.m */; }; 25 | 39352BBB18BB939B00F68217 /* ScanLAN.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352BB618BB939B00F68217 /* ScanLAN.m */; }; 26 | 39352BBC18BB939B00F68217 /* SimplePing.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352BB818BB939B00F68217 /* SimplePing.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 27 | 39352BBD18BB939B00F68217 /* SimplePingHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352BBA18BB939B00F68217 /* SimplePingHelper.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 28 | 39352BC018BB93CD00F68217 /* Device.m in Sources */ = {isa = PBXBuildFile; fileRef = 39352BBF18BB93CD00F68217 /* Device.m */; }; 29 | 39DAC71C18BBA73D005B6BC7 /* screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = 39DAC71B18BBA73D005B6BC7 /* screenshot.png */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 39352BA318BB936D00F68217 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 39352B7218BB936D00F68217 /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 39352B7918BB936D00F68217; 38 | remoteInfo = "LAN Scan"; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 39352B7A18BB936D00F68217 /* LAN Scan.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "LAN Scan.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 39352B7D18BB936D00F68217 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 45 | 39352B7F18BB936D00F68217 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 46 | 39352B8118BB936D00F68217 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 47 | 39352B8518BB936D00F68217 /* LAN Scan-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LAN Scan-Info.plist"; sourceTree = ""; }; 48 | 39352B8718BB936D00F68217 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 49 | 39352B8918BB936D00F68217 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | 39352B8B18BB936D00F68217 /* LAN Scan-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LAN Scan-Prefix.pch"; sourceTree = ""; }; 51 | 39352B8C18BB936D00F68217 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 52 | 39352B8D18BB936D00F68217 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 53 | 39352B9018BB936D00F68217 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 54 | 39352B9318BB936D00F68217 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 55 | 39352B9518BB936D00F68217 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 56 | 39352B9618BB936D00F68217 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 57 | 39352B9818BB936D00F68217 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 58 | 39352B9E18BB936D00F68217 /* LAN ScanTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "LAN ScanTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 39352B9F18BB936D00F68217 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 60 | 39352BA718BB936D00F68217 /* LAN ScanTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LAN ScanTests-Info.plist"; sourceTree = ""; }; 61 | 39352BA918BB936D00F68217 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 62 | 39352BAB18BB936D00F68217 /* LAN_ScanTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LAN_ScanTests.m; sourceTree = ""; }; 63 | 39352BB518BB939B00F68217 /* ScanLAN.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanLAN.h; sourceTree = ""; }; 64 | 39352BB618BB939B00F68217 /* ScanLAN.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanLAN.m; sourceTree = ""; }; 65 | 39352BB718BB939B00F68217 /* SimplePing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimplePing.h; sourceTree = ""; }; 66 | 39352BB818BB939B00F68217 /* SimplePing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimplePing.m; sourceTree = ""; }; 67 | 39352BB918BB939B00F68217 /* SimplePingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimplePingHelper.h; sourceTree = ""; }; 68 | 39352BBA18BB939B00F68217 /* SimplePingHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimplePingHelper.m; sourceTree = ""; }; 69 | 39352BBE18BB93CD00F68217 /* Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Device.h; sourceTree = ""; }; 70 | 39352BBF18BB93CD00F68217 /* Device.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Device.m; sourceTree = ""; }; 71 | 39DAC71B18BBA73D005B6BC7 /* screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screenshot.png; sourceTree = ""; }; 72 | /* End PBXFileReference section */ 73 | 74 | /* Begin PBXFrameworksBuildPhase section */ 75 | 39352B7718BB936D00F68217 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 39352B8018BB936D00F68217 /* CoreGraphics.framework in Frameworks */, 80 | 39352B8218BB936D00F68217 /* UIKit.framework in Frameworks */, 81 | 39352B7E18BB936D00F68217 /* Foundation.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | 39352B9B18BB936D00F68217 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | 39352BA018BB936D00F68217 /* XCTest.framework in Frameworks */, 90 | 39352BA218BB936D00F68217 /* UIKit.framework in Frameworks */, 91 | 39352BA118BB936D00F68217 /* Foundation.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 39352B7118BB936D00F68217 = { 99 | isa = PBXGroup; 100 | children = ( 101 | 39352B8318BB936D00F68217 /* LAN Scan */, 102 | 39352BA518BB936D00F68217 /* LAN ScanTests */, 103 | 39352B7C18BB936D00F68217 /* Frameworks */, 104 | 39352B7B18BB936D00F68217 /* Products */, 105 | ); 106 | sourceTree = ""; 107 | }; 108 | 39352B7B18BB936D00F68217 /* Products */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 39352B7A18BB936D00F68217 /* LAN Scan.app */, 112 | 39352B9E18BB936D00F68217 /* LAN ScanTests.xctest */, 113 | ); 114 | name = Products; 115 | sourceTree = ""; 116 | }; 117 | 39352B7C18BB936D00F68217 /* Frameworks */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 39352B7D18BB936D00F68217 /* Foundation.framework */, 121 | 39352B7F18BB936D00F68217 /* CoreGraphics.framework */, 122 | 39352B8118BB936D00F68217 /* UIKit.framework */, 123 | 39352B9F18BB936D00F68217 /* XCTest.framework */, 124 | ); 125 | name = Frameworks; 126 | sourceTree = ""; 127 | }; 128 | 39352B8318BB936D00F68217 /* LAN Scan */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 39352BB518BB939B00F68217 /* ScanLAN.h */, 132 | 39352BB618BB939B00F68217 /* ScanLAN.m */, 133 | 39352BB718BB939B00F68217 /* SimplePing.h */, 134 | 39352BB818BB939B00F68217 /* SimplePing.m */, 135 | 39352BB918BB939B00F68217 /* SimplePingHelper.h */, 136 | 39352BBA18BB939B00F68217 /* SimplePingHelper.m */, 137 | 39352BBE18BB93CD00F68217 /* Device.h */, 138 | 39352BBF18BB93CD00F68217 /* Device.m */, 139 | 39352B8C18BB936D00F68217 /* AppDelegate.h */, 140 | 39352B8D18BB936D00F68217 /* AppDelegate.m */, 141 | 39352B8F18BB936D00F68217 /* Main_iPhone.storyboard */, 142 | 39352B9218BB936D00F68217 /* Main_iPad.storyboard */, 143 | 39352B9518BB936D00F68217 /* ViewController.h */, 144 | 39352B9618BB936D00F68217 /* ViewController.m */, 145 | 39352B9818BB936D00F68217 /* Images.xcassets */, 146 | 39352B8418BB936D00F68217 /* Supporting Files */, 147 | ); 148 | path = "LAN Scan"; 149 | sourceTree = ""; 150 | }; 151 | 39352B8418BB936D00F68217 /* Supporting Files */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 39DAC71B18BBA73D005B6BC7 /* screenshot.png */, 155 | 39352B8518BB936D00F68217 /* LAN Scan-Info.plist */, 156 | 39352B8618BB936D00F68217 /* InfoPlist.strings */, 157 | 39352B8918BB936D00F68217 /* main.m */, 158 | 39352B8B18BB936D00F68217 /* LAN Scan-Prefix.pch */, 159 | ); 160 | name = "Supporting Files"; 161 | sourceTree = ""; 162 | }; 163 | 39352BA518BB936D00F68217 /* LAN ScanTests */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 39352BAB18BB936D00F68217 /* LAN_ScanTests.m */, 167 | 39352BA618BB936D00F68217 /* Supporting Files */, 168 | ); 169 | path = "LAN ScanTests"; 170 | sourceTree = ""; 171 | }; 172 | 39352BA618BB936D00F68217 /* Supporting Files */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 39352BA718BB936D00F68217 /* LAN ScanTests-Info.plist */, 176 | 39352BA818BB936D00F68217 /* InfoPlist.strings */, 177 | ); 178 | name = "Supporting Files"; 179 | sourceTree = ""; 180 | }; 181 | /* End PBXGroup section */ 182 | 183 | /* Begin PBXNativeTarget section */ 184 | 39352B7918BB936D00F68217 /* LAN Scan */ = { 185 | isa = PBXNativeTarget; 186 | buildConfigurationList = 39352BAF18BB936D00F68217 /* Build configuration list for PBXNativeTarget "LAN Scan" */; 187 | buildPhases = ( 188 | 39352B7618BB936D00F68217 /* Sources */, 189 | 39352B7718BB936D00F68217 /* Frameworks */, 190 | 39352B7818BB936D00F68217 /* Resources */, 191 | ); 192 | buildRules = ( 193 | ); 194 | dependencies = ( 195 | ); 196 | name = "LAN Scan"; 197 | productName = "LAN Scan"; 198 | productReference = 39352B7A18BB936D00F68217 /* LAN Scan.app */; 199 | productType = "com.apple.product-type.application"; 200 | }; 201 | 39352B9D18BB936D00F68217 /* LAN ScanTests */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 39352BB218BB936D00F68217 /* Build configuration list for PBXNativeTarget "LAN ScanTests" */; 204 | buildPhases = ( 205 | 39352B9A18BB936D00F68217 /* Sources */, 206 | 39352B9B18BB936D00F68217 /* Frameworks */, 207 | 39352B9C18BB936D00F68217 /* Resources */, 208 | ); 209 | buildRules = ( 210 | ); 211 | dependencies = ( 212 | 39352BA418BB936D00F68217 /* PBXTargetDependency */, 213 | ); 214 | name = "LAN ScanTests"; 215 | productName = "LAN ScanTests"; 216 | productReference = 39352B9E18BB936D00F68217 /* LAN ScanTests.xctest */; 217 | productType = "com.apple.product-type.bundle.unit-test"; 218 | }; 219 | /* End PBXNativeTarget section */ 220 | 221 | /* Begin PBXProject section */ 222 | 39352B7218BB936D00F68217 /* Project object */ = { 223 | isa = PBXProject; 224 | attributes = { 225 | LastUpgradeCheck = 0500; 226 | ORGANIZATIONNAME = "Smart Touch"; 227 | TargetAttributes = { 228 | 39352B9D18BB936D00F68217 = { 229 | TestTargetID = 39352B7918BB936D00F68217; 230 | }; 231 | }; 232 | }; 233 | buildConfigurationList = 39352B7518BB936D00F68217 /* Build configuration list for PBXProject "LAN Scan" */; 234 | compatibilityVersion = "Xcode 3.2"; 235 | developmentRegion = English; 236 | hasScannedForEncodings = 0; 237 | knownRegions = ( 238 | en, 239 | Base, 240 | ); 241 | mainGroup = 39352B7118BB936D00F68217; 242 | productRefGroup = 39352B7B18BB936D00F68217 /* Products */; 243 | projectDirPath = ""; 244 | projectRoot = ""; 245 | targets = ( 246 | 39352B7918BB936D00F68217 /* LAN Scan */, 247 | 39352B9D18BB936D00F68217 /* LAN ScanTests */, 248 | ); 249 | }; 250 | /* End PBXProject section */ 251 | 252 | /* Begin PBXResourcesBuildPhase section */ 253 | 39352B7818BB936D00F68217 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 39352B9418BB936D00F68217 /* Main_iPad.storyboard in Resources */, 258 | 39352B9918BB936D00F68217 /* Images.xcassets in Resources */, 259 | 39352B9118BB936D00F68217 /* Main_iPhone.storyboard in Resources */, 260 | 39352B8818BB936D00F68217 /* InfoPlist.strings in Resources */, 261 | 39DAC71C18BBA73D005B6BC7 /* screenshot.png in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | 39352B9C18BB936D00F68217 /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | 39352BAA18BB936D00F68217 /* InfoPlist.strings in Resources */, 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | /* End PBXResourcesBuildPhase section */ 274 | 275 | /* Begin PBXSourcesBuildPhase section */ 276 | 39352B7618BB936D00F68217 /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 39352BBB18BB939B00F68217 /* ScanLAN.m in Sources */, 281 | 39352B9718BB936D00F68217 /* ViewController.m in Sources */, 282 | 39352B8E18BB936D00F68217 /* AppDelegate.m in Sources */, 283 | 39352BBC18BB939B00F68217 /* SimplePing.m in Sources */, 284 | 39352B8A18BB936D00F68217 /* main.m in Sources */, 285 | 39352BC018BB93CD00F68217 /* Device.m in Sources */, 286 | 39352BBD18BB939B00F68217 /* SimplePingHelper.m in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | 39352B9A18BB936D00F68217 /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | 39352BAC18BB936D00F68217 /* LAN_ScanTests.m in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXTargetDependency section */ 301 | 39352BA418BB936D00F68217 /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = 39352B7918BB936D00F68217 /* LAN Scan */; 304 | targetProxy = 39352BA318BB936D00F68217 /* PBXContainerItemProxy */; 305 | }; 306 | /* End PBXTargetDependency section */ 307 | 308 | /* Begin PBXVariantGroup section */ 309 | 39352B8618BB936D00F68217 /* InfoPlist.strings */ = { 310 | isa = PBXVariantGroup; 311 | children = ( 312 | 39352B8718BB936D00F68217 /* en */, 313 | ); 314 | name = InfoPlist.strings; 315 | sourceTree = ""; 316 | }; 317 | 39352B8F18BB936D00F68217 /* Main_iPhone.storyboard */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | 39352B9018BB936D00F68217 /* Base */, 321 | ); 322 | name = Main_iPhone.storyboard; 323 | sourceTree = ""; 324 | }; 325 | 39352B9218BB936D00F68217 /* Main_iPad.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 39352B9318BB936D00F68217 /* Base */, 329 | ); 330 | name = Main_iPad.storyboard; 331 | sourceTree = ""; 332 | }; 333 | 39352BA818BB936D00F68217 /* InfoPlist.strings */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | 39352BA918BB936D00F68217 /* en */, 337 | ); 338 | name = InfoPlist.strings; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 39352BAD18BB936D00F68217 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ALWAYS_SEARCH_USER_PATHS = NO; 348 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | GCC_C_LANGUAGE_STANDARD = gnu99; 364 | GCC_DYNAMIC_NO_PIC = NO; 365 | GCC_OPTIMIZATION_LEVEL = 0; 366 | GCC_PREPROCESSOR_DEFINITIONS = ( 367 | "DEBUG=1", 368 | "$(inherited)", 369 | ); 370 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 373 | GCC_WARN_UNDECLARED_SELECTOR = YES; 374 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 375 | GCC_WARN_UNUSED_FUNCTION = YES; 376 | GCC_WARN_UNUSED_VARIABLE = YES; 377 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 378 | ONLY_ACTIVE_ARCH = YES; 379 | SDKROOT = iphoneos; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | }; 382 | name = Debug; 383 | }; 384 | 39352BAE18BB936D00F68217 /* Release */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | ALWAYS_SEARCH_USER_PATHS = NO; 388 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_MODULES = YES; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | CLANG_WARN_BOOL_CONVERSION = YES; 394 | CLANG_WARN_CONSTANT_CONVERSION = YES; 395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 396 | CLANG_WARN_EMPTY_BODY = YES; 397 | CLANG_WARN_ENUM_CONVERSION = YES; 398 | CLANG_WARN_INT_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 402 | COPY_PHASE_STRIP = YES; 403 | ENABLE_NS_ASSERTIONS = NO; 404 | GCC_C_LANGUAGE_STANDARD = gnu99; 405 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 406 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 407 | GCC_WARN_UNDECLARED_SELECTOR = YES; 408 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 409 | GCC_WARN_UNUSED_FUNCTION = YES; 410 | GCC_WARN_UNUSED_VARIABLE = YES; 411 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 412 | SDKROOT = iphoneos; 413 | TARGETED_DEVICE_FAMILY = "1,2"; 414 | VALIDATE_PRODUCT = YES; 415 | }; 416 | name = Release; 417 | }; 418 | 39352BB018BB936D00F68217 /* Debug */ = { 419 | isa = XCBuildConfiguration; 420 | buildSettings = { 421 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 422 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 423 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 424 | GCC_PREFIX_HEADER = "LAN Scan/LAN Scan-Prefix.pch"; 425 | INFOPLIST_FILE = "LAN Scan/LAN Scan-Info.plist"; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | WRAPPER_EXTENSION = app; 428 | }; 429 | name = Debug; 430 | }; 431 | 39352BB118BB936D00F68217 /* Release */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 435 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 436 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 437 | GCC_PREFIX_HEADER = "LAN Scan/LAN Scan-Prefix.pch"; 438 | INFOPLIST_FILE = "LAN Scan/LAN Scan-Info.plist"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | WRAPPER_EXTENSION = app; 441 | }; 442 | name = Release; 443 | }; 444 | 39352BB318BB936D00F68217 /* Debug */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 448 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LAN Scan.app/LAN Scan"; 449 | FRAMEWORK_SEARCH_PATHS = ( 450 | "$(SDKROOT)/Developer/Library/Frameworks", 451 | "$(inherited)", 452 | "$(DEVELOPER_FRAMEWORKS_DIR)", 453 | ); 454 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 455 | GCC_PREFIX_HEADER = "LAN Scan/LAN Scan-Prefix.pch"; 456 | GCC_PREPROCESSOR_DEFINITIONS = ( 457 | "DEBUG=1", 458 | "$(inherited)", 459 | ); 460 | INFOPLIST_FILE = "LAN ScanTests/LAN ScanTests-Info.plist"; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | TEST_HOST = "$(BUNDLE_LOADER)"; 463 | WRAPPER_EXTENSION = xctest; 464 | }; 465 | name = Debug; 466 | }; 467 | 39352BB418BB936D00F68217 /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 471 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LAN Scan.app/LAN Scan"; 472 | FRAMEWORK_SEARCH_PATHS = ( 473 | "$(SDKROOT)/Developer/Library/Frameworks", 474 | "$(inherited)", 475 | "$(DEVELOPER_FRAMEWORKS_DIR)", 476 | ); 477 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 478 | GCC_PREFIX_HEADER = "LAN Scan/LAN Scan-Prefix.pch"; 479 | INFOPLIST_FILE = "LAN ScanTests/LAN ScanTests-Info.plist"; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | TEST_HOST = "$(BUNDLE_LOADER)"; 482 | WRAPPER_EXTENSION = xctest; 483 | }; 484 | name = Release; 485 | }; 486 | /* End XCBuildConfiguration section */ 487 | 488 | /* Begin XCConfigurationList section */ 489 | 39352B7518BB936D00F68217 /* Build configuration list for PBXProject "LAN Scan" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 39352BAD18BB936D00F68217 /* Debug */, 493 | 39352BAE18BB936D00F68217 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | 39352BAF18BB936D00F68217 /* Build configuration list for PBXNativeTarget "LAN Scan" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | 39352BB018BB936D00F68217 /* Debug */, 502 | 39352BB118BB936D00F68217 /* Release */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | 39352BB218BB936D00F68217 /* Build configuration list for PBXNativeTarget "LAN ScanTests" */ = { 508 | isa = XCConfigurationList; 509 | buildConfigurations = ( 510 | 39352BB318BB936D00F68217 /* Debug */, 511 | 39352BB418BB936D00F68217 /* Release */, 512 | ); 513 | defaultConfigurationIsVisible = 0; 514 | defaultConfigurationName = Release; 515 | }; 516 | /* End XCConfigurationList section */ 517 | }; 518 | rootObject = 39352B7218BB936D00F68217 /* Project object */; 519 | } 520 | -------------------------------------------------------------------------------- /LAN Scan.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LAN Scan.xcodeproj/xcuserdata/iMac1.xcuserdatad/xcschemes/LAN Scan.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /LAN Scan.xcodeproj/xcuserdata/iMac1.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LAN Scan.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 39352B7918BB936D00F68217 16 | 17 | primary 18 | 19 | 20 | 39352B9D18BB936D00F68217 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LAN Scan/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /LAN Scan/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /LAN Scan/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 38 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /LAN Scan/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 38 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /LAN Scan/Device.h: -------------------------------------------------------------------------------- 1 | // 2 | // Device.h 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Device : NSObject 12 | 13 | @property NSString *name; 14 | @property NSString *address; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /LAN Scan/Device.m: -------------------------------------------------------------------------------- 1 | // 2 | // Device.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import "Device.h" 10 | 11 | @implementation Device 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LAN Scan/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /LAN Scan/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /LAN Scan/LAN Scan-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | smarttouch.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /LAN Scan/LAN Scan-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /LAN Scan/ScanLAN.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScanLAN.h 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ScanLANDelegate 12 | 13 | @optional 14 | - (void)scanLANDidFindNewAdrress:(NSString *)address havingHostName:(NSString *)hostName; 15 | - (void)scanLANDidFinishScanning; 16 | @end 17 | 18 | @interface ScanLAN : NSObject 19 | 20 | @property(nonatomic,weak) id delegate; 21 | 22 | - (id)initWithDelegate:(id)delegate; 23 | - (void)startScan; 24 | - (void)stopScan; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /LAN Scan/ScanLAN.m: -------------------------------------------------------------------------------- 1 | // 2 | // ScanLAN.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import "ScanLAN.h" 10 | #import 11 | #import 12 | #include 13 | #import "SimplePingHelper.h" 14 | 15 | @interface ScanLAN () 16 | 17 | @property NSString *localAddress; 18 | @property NSString *baseAddress; 19 | @property NSInteger currentHostAddress; 20 | @property NSTimer *timer; 21 | @property NSString *netMask; 22 | @property NSInteger baseAddressEnd; 23 | @property NSInteger timerIterationNumber; 24 | 25 | @end 26 | 27 | @implementation ScanLAN 28 | 29 | - (id)initWithDelegate:(id)delegate { 30 | NSLog(@"init scanner"); 31 | self = [super init]; 32 | if(self) 33 | { 34 | self.delegate = delegate; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)startScan { 40 | NSLog(@"start scan"); 41 | self.localAddress = [self localIPAddress]; 42 | //This is used to test on the simulator 43 | //self.localAddress = @"192.168.1.8"; 44 | //self.netMask = @"255.255.255.0"; 45 | NSArray *a = [self.localAddress componentsSeparatedByString:@"."]; 46 | NSArray *b = [self.netMask componentsSeparatedByString:@"."]; 47 | if ([self isIpAddressValid:self.localAddress] && (a.count == 4) && (b.count == 4)) { 48 | for (int i = 0; i<4; i++) { 49 | int and = [[a objectAtIndex:i] integerValue] & [[b objectAtIndex:i] integerValue]; 50 | if (!self.baseAddress.length) { 51 | self.baseAddress = [NSString stringWithFormat:@"%d", and]; 52 | } 53 | else { 54 | self.baseAddress = [NSString stringWithFormat:@"%@.%d", self.baseAddress, and]; 55 | self.currentHostAddress = and; 56 | self.baseAddressEnd = and; 57 | } 58 | } 59 | self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(pingAddress) userInfo:nil repeats:YES]; 60 | } 61 | } 62 | 63 | - (void)stopScan { 64 | NSLog(@"stop scan"); 65 | [self.timer invalidate]; 66 | } 67 | 68 | - (void)pingAddress{ 69 | self.currentHostAddress++; 70 | NSString *address = [NSString stringWithFormat:@"%@%d", self.baseAddress, self.currentHostAddress]; 71 | [SimplePingHelper ping:address target:self sel:@selector(pingResult:)]; 72 | if (self.currentHostAddress>=254) { 73 | [self.timer invalidate]; 74 | } 75 | } 76 | /* 77 | - (void)pingAddress:(NSString *)address{ 78 | [SimplePingHelper ping:address target:self sel:@selector(pingResult:)]; 79 | } 80 | */ 81 | - (void)pingResult:(NSNumber*)success { 82 | self.timerIterationNumber++; 83 | if (success.boolValue) { 84 | NSLog(@"SUCCESS"); 85 | NSString *deviceIPAddress = [[[[NSString stringWithFormat:@"%@%d", self.baseAddress, self.currentHostAddress] stringByReplacingOccurrencesOfString:@".0" withString:@"."] stringByReplacingOccurrencesOfString:@".00" withString:@"."] stringByReplacingOccurrencesOfString:@".." withString:@".0."]; 86 | NSString *deviceName = [self getHostFromIPAddress:[[NSString stringWithFormat:@"%@%d", self.baseAddress, self.currentHostAddress] cStringUsingEncoding:NSASCIIStringEncoding]]; 87 | [self.delegate scanLANDidFindNewAdrress:deviceIPAddress havingHostName:deviceName]; 88 | } 89 | else { 90 | NSLog(@"FAILURE"); 91 | } 92 | if (self.timerIterationNumber+self.baseAddressEnd>=254) { 93 | [self.delegate scanLANDidFinishScanning]; 94 | } 95 | } 96 | 97 | - (NSString *)getHostFromIPAddress:(const char*)ipAddress { 98 | NSString *hostName = nil; 99 | int error; 100 | struct addrinfo *results = NULL; 101 | 102 | error = getaddrinfo(ipAddress, NULL, NULL, &results); 103 | if (error != 0) 104 | { 105 | NSLog (@"Could not get any info for the address"); 106 | return nil; // or exit(1); 107 | } 108 | 109 | for (struct addrinfo *r = results; r; r = r->ai_next) 110 | { 111 | char hostname[NI_MAXHOST] = {0}; 112 | error = getnameinfo(r->ai_addr, r->ai_addrlen, hostname, sizeof hostname, NULL, 0 , 0); 113 | if (error != 0) 114 | { 115 | continue; // try next one 116 | } 117 | else 118 | { 119 | NSLog (@"Found hostname: %s", hostname); 120 | hostName = [NSString stringWithFormat:@"%s", hostname]; 121 | break; 122 | } 123 | freeaddrinfo(results); 124 | } 125 | return hostName; 126 | } 127 | 128 | // Get IP Address 129 | - (NSString *)getIPAddress 130 | { 131 | struct ifaddrs *interfaces = NULL; 132 | struct ifaddrs *temp_addr = NULL; 133 | NSString *wifiAddress = nil; 134 | NSString *cellAddress = nil; 135 | 136 | // retrieve the current interfaces - returns 0 on success 137 | if(!getifaddrs(&interfaces)) { 138 | // Loop through linked list of interfaces 139 | temp_addr = interfaces; 140 | while(temp_addr != NULL) { 141 | sa_family_t sa_type = temp_addr->ifa_addr->sa_family; 142 | if(sa_type == AF_INET || sa_type == AF_INET6) { 143 | NSString *name = [NSString stringWithUTF8String:temp_addr->ifa_name]; 144 | NSString *addr = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)]; // pdp_ip0 145 | //NSLog(@"NAME: \"%@\" addr: %@", name, addr); // see for yourself 146 | 147 | if([name isEqualToString:@"en0"]) { 148 | // Interface is the wifi connection on the iPhone 149 | wifiAddress = addr; 150 | } else 151 | if([name isEqualToString:@"pdp_ip0"]) { 152 | // Interface is the cell connection on the iPhone 153 | cellAddress = addr; 154 | } 155 | } 156 | temp_addr = temp_addr->ifa_next; 157 | } 158 | // Free memory 159 | freeifaddrs(interfaces); 160 | } 161 | NSString *addr = wifiAddress ? wifiAddress : cellAddress; 162 | return addr ? addr : @"0.0.0.0"; 163 | } 164 | 165 | - (NSString *) localIPAddress 166 | { 167 | NSString *address = @"error"; 168 | struct ifaddrs *interfaces = NULL; 169 | struct ifaddrs *temp_addr = NULL; 170 | int success = 0; 171 | 172 | // retrieve the current interfaces - returns 0 on success 173 | success = getifaddrs(&interfaces); 174 | 175 | if (success == 0) 176 | { 177 | temp_addr = interfaces; 178 | 179 | while(temp_addr != NULL) 180 | { 181 | // check if interface is en0 which is the wifi connection on the iPhone 182 | if(temp_addr->ifa_addr->sa_family == AF_INET) 183 | { 184 | if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) 185 | { 186 | address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)]; 187 | self.netMask = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_netmask)->sin_addr)]; 188 | } 189 | } 190 | 191 | temp_addr = temp_addr->ifa_next; 192 | } 193 | } 194 | 195 | freeifaddrs(interfaces); 196 | 197 | return address; 198 | } 199 | 200 | - (BOOL) isIpAddressValid:(NSString *)ipAddress{ 201 | struct in_addr pin; 202 | int success = inet_aton([ipAddress UTF8String],&pin); 203 | if (success == 1) return TRUE; 204 | return FALSE; 205 | } 206 | 207 | @end 208 | -------------------------------------------------------------------------------- /LAN Scan/SimplePing.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: SimplePing.h 3 | 4 | Contains: Implements ping. 5 | 6 | Written by: DTS 7 | 8 | Copyright: Copyright (c) 2010 Apple Inc. All Rights Reserved. 9 | 10 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. 11 | ("Apple") in consideration of your agreement to the following 12 | terms, and your use, installation, modification or 13 | redistribution of this Apple software constitutes acceptance of 14 | these terms. If you do not agree with these terms, please do 15 | not use, install, modify or redistribute this Apple software. 16 | 17 | In consideration of your agreement to abide by the following 18 | terms, and subject to these terms, Apple grants you a personal, 19 | non-exclusive license, under Apple's copyrights in this 20 | original Apple software (the "Apple Software"), to use, 21 | reproduce, modify and redistribute the Apple Software, with or 22 | without modifications, in source and/or binary forms; provided 23 | that if you redistribute the Apple Software in its entirety and 24 | without modifications, you must retain this notice and the 25 | following text and disclaimers in all such redistributions of 26 | the Apple Software. Neither the name, trademarks, service marks 27 | or logos of Apple Inc. may be used to endorse or promote 28 | products derived from the Apple Software without specific prior 29 | written permission from Apple. Except as expressly stated in 30 | this notice, no other rights or licenses, express or implied, 31 | are granted by Apple herein, including but not limited to any 32 | patent rights that may be infringed by your derivative works or 33 | by other works in which the Apple Software may be incorporated. 34 | 35 | The Apple Software is provided by Apple on an "AS IS" basis. 36 | APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 37 | WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, 38 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING 39 | THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 40 | COMBINATION WITH YOUR PRODUCTS. 41 | 42 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 43 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 44 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 45 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY 46 | OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 47 | OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY 48 | OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR 49 | OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF 50 | SUCH DAMAGE. 51 | 52 | */ 53 | 54 | #import 55 | 56 | #if TARGET_OS_EMBEDDED || TARGET_IPHONE_SIMULATOR 57 | #import 58 | #else 59 | #import 60 | #endif 61 | 62 | #include 63 | 64 | #pragma mark * SimplePing 65 | 66 | // The SimplePing class is a very simple class that lets you send and receive pings. 67 | 68 | @protocol SimplePingDelegate; 69 | 70 | @interface SimplePing : NSObject 71 | { 72 | NSString * _hostName; 73 | NSData * _hostAddress; 74 | CFHostRef _host; 75 | CFSocketRef _socket; 76 | 77 | id _delegate; 78 | uint16_t _identifier; // host byte order 79 | uint16_t _nextSequenceNumber; // host byte order 80 | } 81 | 82 | + (SimplePing *)simplePingWithHostName:(NSString *)hostName; // chooses first IPv4 address 83 | + (SimplePing *)simplePingWithHostAddress:(NSData *)hostAddress; // contains (struct sockaddr) 84 | 85 | @property (nonatomic, assign, readwrite) id delegate; 86 | 87 | @property (nonatomic, copy, readonly) NSString * hostName; 88 | @property (nonatomic, copy, readonly) NSData * hostAddress; 89 | @property (nonatomic, assign, readonly) uint16_t identifier; 90 | @property (nonatomic, assign, readonly) uint16_t nextSequenceNumber; 91 | 92 | - (void)start; 93 | // Starts the pinger object pinging. You should call this after 94 | // you've setup the delegate and any ping parameters. 95 | 96 | - (void)sendPingWithData:(NSData *)data; 97 | // Sends an actual ping. Pass nil for data to use a standard 56 byte payload (resulting in a 98 | // standard 64 byte ping). Otherwise pass a non-nil value and it will be appended to the 99 | // ICMP header. 100 | // 101 | // Do not try to send a ping before you receive the -simplePing:didStartWithAddress: delegate 102 | // callback. 103 | 104 | - (void)stop; 105 | // Stops the pinger object. You should call this when you're done 106 | // pinging. 107 | 108 | + (const struct ICMPHeader *)icmpInPacket:(NSData *)packet; 109 | // Given a valid IP packet contains an ICMP , returns the address of the ICMP header that 110 | // follows the IP header. This doesn't do any significant validation of the packet. 111 | 112 | @end 113 | 114 | @protocol SimplePingDelegate 115 | 116 | @optional 117 | 118 | - (void)simplePing:(SimplePing *)pinger didStartWithAddress:(NSData *)address; 119 | // Called after the SimplePing has successfully started up. After this callback, you 120 | // can start sending pings via -sendPingWithData: 121 | 122 | - (void)simplePing:(SimplePing *)pinger didFailWithError:(NSError *)error; 123 | // If this is called, the SimplePing object has failed. By the time this callback is 124 | // called, the object has stopped (that is, you don't need to call -stop yourself). 125 | 126 | // IMPORTANT: On the send side the packet does not include an IP header. 127 | // On the receive side, it does. In that case, use +[SimplePing icmpInPacket:] 128 | // to find the ICMP header within the packet. 129 | 130 | - (void)simplePing:(SimplePing *)pinger didSendPacket:(NSData *)packet; 131 | // Called whenever the SimplePing object has successfully sent a ping packet. 132 | 133 | - (void)simplePing:(SimplePing *)pinger didFailToSendPacket:(NSData *)packet error:(NSError *)error; 134 | // Called whenever the SimplePing object tries and fails to send a ping packet. 135 | 136 | - (void)simplePing:(SimplePing *)pinger didReceivePingResponsePacket:(NSData *)packet; 137 | // Called whenever the SimplePing object receives an ICMP packet that looks like 138 | // a response to one of our pings (that is, has a valid ICMP checksum, has 139 | // an identifier that matches our identifier, and has a sequence number in 140 | // the range of sequence numbers that we've sent out). 141 | 142 | - (void)simplePing:(SimplePing *)pinger didReceiveUnexpectedPacket:(NSData *)packet; 143 | // Called whenever the SimplePing object receives an ICMP packet that does not 144 | // look like a response to one of our pings. 145 | 146 | @end 147 | 148 | #pragma mark * IP and ICMP On-The-Wire Format 149 | 150 | // The following declarations specify the structure of ping packets on the wire. 151 | 152 | // IP header structure: 153 | 154 | struct IPHeader { 155 | uint8_t versionAndHeaderLength; 156 | uint8_t differentiatedServices; 157 | uint16_t totalLength; 158 | uint16_t identification; 159 | uint16_t flagsAndFragmentOffset; 160 | uint8_t timeToLive; 161 | uint8_t protocol; 162 | uint16_t headerChecksum; 163 | uint8_t sourceAddress[4]; 164 | uint8_t destinationAddress[4]; 165 | // options... 166 | // data... 167 | }; 168 | typedef struct IPHeader IPHeader; 169 | 170 | check_compile_time(sizeof(IPHeader) == 20); 171 | check_compile_time(offsetof(IPHeader, versionAndHeaderLength) == 0); 172 | check_compile_time(offsetof(IPHeader, differentiatedServices) == 1); 173 | check_compile_time(offsetof(IPHeader, totalLength) == 2); 174 | check_compile_time(offsetof(IPHeader, identification) == 4); 175 | check_compile_time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); 176 | check_compile_time(offsetof(IPHeader, timeToLive) == 8); 177 | check_compile_time(offsetof(IPHeader, protocol) == 9); 178 | check_compile_time(offsetof(IPHeader, headerChecksum) == 10); 179 | check_compile_time(offsetof(IPHeader, sourceAddress) == 12); 180 | check_compile_time(offsetof(IPHeader, destinationAddress) == 16); 181 | 182 | // ICMP type and code combinations: 183 | 184 | enum { 185 | kICMPTypeEchoReply = 0, // code is always 0 186 | kICMPTypeEchoRequest = 8 // code is always 0 187 | }; 188 | 189 | // ICMP header structure: 190 | 191 | struct ICMPHeader { 192 | uint8_t type; 193 | uint8_t code; 194 | uint16_t checksum; 195 | uint16_t identifier; 196 | uint16_t sequenceNumber; 197 | // data... 198 | }; 199 | typedef struct ICMPHeader ICMPHeader; 200 | 201 | check_compile_time(sizeof(ICMPHeader) == 8); 202 | check_compile_time(offsetof(ICMPHeader, type) == 0); 203 | check_compile_time(offsetof(ICMPHeader, code) == 1); 204 | check_compile_time(offsetof(ICMPHeader, checksum) == 2); 205 | check_compile_time(offsetof(ICMPHeader, identifier) == 4); 206 | check_compile_time(offsetof(ICMPHeader, sequenceNumber) == 6); 207 | -------------------------------------------------------------------------------- /LAN Scan/SimplePing.m: -------------------------------------------------------------------------------- 1 | /* 2 | File: SimplePing.m 3 | 4 | Contains: Implements ping. 5 | 6 | Written by: DTS 7 | 8 | Copyright: Copyright (c) 2010 Apple Inc. All Rights Reserved. 9 | 10 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. 11 | ("Apple") in consideration of your agreement to the following 12 | terms, and your use, installation, modification or 13 | redistribution of this Apple software constitutes acceptance of 14 | these terms. If you do not agree with these terms, please do 15 | not use, install, modify or redistribute this Apple software. 16 | 17 | In consideration of your agreement to abide by the following 18 | terms, and subject to these terms, Apple grants you a personal, 19 | non-exclusive license, under Apple's copyrights in this 20 | original Apple software (the "Apple Software"), to use, 21 | reproduce, modify and redistribute the Apple Software, with or 22 | without modifications, in source and/or binary forms; provided 23 | that if you redistribute the Apple Software in its entirety and 24 | without modifications, you must retain this notice and the 25 | following text and disclaimers in all such redistributions of 26 | the Apple Software. Neither the name, trademarks, service marks 27 | or logos of Apple Inc. may be used to endorse or promote 28 | products derived from the Apple Software without specific prior 29 | written permission from Apple. Except as expressly stated in 30 | this notice, no other rights or licenses, express or implied, 31 | are granted by Apple herein, including but not limited to any 32 | patent rights that may be infringed by your derivative works or 33 | by other works in which the Apple Software may be incorporated. 34 | 35 | The Apple Software is provided by Apple on an "AS IS" basis. 36 | APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 37 | WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, 38 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING 39 | THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 40 | COMBINATION WITH YOUR PRODUCTS. 41 | 42 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 43 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 44 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 45 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY 46 | OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 47 | OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY 48 | OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR 49 | OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF 50 | SUCH DAMAGE. 51 | 52 | */ 53 | 54 | #import "SimplePing.h" 55 | 56 | #include 57 | #include 58 | #include 59 | 60 | #pragma mark * ICMP On-The-Wire Format 61 | 62 | static uint16_t in_cksum(const void *buffer, size_t bufferLen) 63 | // This is the standard BSD checksum code, modified to use modern types. 64 | { 65 | size_t bytesLeft; 66 | int32_t sum; 67 | const uint16_t * cursor; 68 | union { 69 | uint16_t us; 70 | uint8_t uc[2]; 71 | } last; 72 | uint16_t answer; 73 | 74 | bytesLeft = bufferLen; 75 | sum = 0; 76 | cursor = buffer; 77 | 78 | /* 79 | * Our algorithm is simple, using a 32 bit accumulator (sum), we add 80 | * sequential 16 bit words to it, and at the end, fold back all the 81 | * carry bits from the top 16 bits into the lower 16 bits. 82 | */ 83 | while (bytesLeft > 1) { 84 | sum += *cursor; 85 | cursor += 1; 86 | bytesLeft -= 2; 87 | } 88 | 89 | /* mop up an odd byte, if necessary */ 90 | if (bytesLeft == 1) { 91 | last.uc[0] = * (const uint8_t *) cursor; 92 | last.uc[1] = 0; 93 | sum += last.us; 94 | } 95 | 96 | /* add back carry outs from top 16 bits to low 16 bits */ 97 | sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ 98 | sum += (sum >> 16); /* add carry */ 99 | answer = ~sum; /* truncate to 16 bits */ 100 | 101 | return answer; 102 | } 103 | 104 | #pragma mark * SimplePing 105 | 106 | @interface SimplePing () 107 | 108 | @property (nonatomic, copy, readwrite) NSData * hostAddress; 109 | @property (nonatomic, assign, readwrite) uint16_t nextSequenceNumber; 110 | 111 | - (void)_stopHostResolution; 112 | - (void)_stopDataTransfer; 113 | 114 | @end 115 | 116 | @implementation SimplePing 117 | 118 | - (id)initWithHostName:(NSString *)hostName address:(NSData *)hostAddress 119 | // The initialiser common to both of our construction class methods. 120 | { 121 | assert( (hostName != nil) == (hostAddress == nil) ); 122 | self = [super init]; 123 | if (self != nil) { 124 | self->_hostName = [hostName copy]; 125 | self->_hostAddress = [hostAddress copy]; 126 | self->_identifier = (uint16_t) arc4random(); 127 | } 128 | return self; 129 | } 130 | 131 | - (void)dealloc { 132 | // -stop takes care of _host and _socket. 133 | 134 | [self stop]; 135 | assert(self->_host == NULL); 136 | assert(self->_socket == NULL); 137 | 138 | [self->_hostName release]; 139 | [self->_hostAddress release]; 140 | 141 | [super dealloc]; 142 | } 143 | 144 | + (SimplePing *)simplePingWithHostName:(NSString *)hostName 145 | // See comment in header. 146 | { 147 | return [[[SimplePing alloc] initWithHostName:hostName address:nil] autorelease]; 148 | } 149 | 150 | + (SimplePing *)simplePingWithHostAddress:(NSData *)hostAddress 151 | // See comment in header. 152 | { 153 | return [[[SimplePing alloc] initWithHostName:NULL address:hostAddress] autorelease]; 154 | } 155 | 156 | @synthesize hostName = _hostName; 157 | @synthesize hostAddress = _hostAddress; 158 | 159 | @synthesize delegate = _delegate; 160 | @synthesize identifier = _identifier; 161 | @synthesize nextSequenceNumber = _nextSequenceNumber; 162 | 163 | - (void)_didFailWithError:(NSError *)error 164 | // Shut down the pinger object and tell the delegate about the error. 165 | { 166 | assert(error != nil); 167 | 168 | // We retain ourselves temporarily because it's common for the delegate method 169 | // to release its last reference to use, which causes -dealloc to be called here. 170 | // If we then reference self on the return path, things go badly. I don't think 171 | // that happens currently, but I've got into the habit of doing this as a 172 | // defensive measure. 173 | 174 | [[self retain] autorelease]; 175 | 176 | [self stop]; 177 | if ( (self.delegate != nil) && [self.delegate respondsToSelector:@selector(simplePing:didFailWithError:)] ) { 178 | [self.delegate simplePing:self didFailWithError:error]; 179 | } 180 | } 181 | 182 | - (void)_didFailWithHostStreamError:(CFStreamError)streamError 183 | // Convert the CFStreamError to an NSError and then call through to 184 | // -_didFailWithError: to shut down the pinger object and tell the 185 | // delegate about the error. 186 | { 187 | NSDictionary * userInfo; 188 | NSError * error; 189 | 190 | if (streamError.domain == kCFStreamErrorDomainNetDB) { 191 | userInfo = [NSDictionary dictionaryWithObjectsAndKeys: 192 | [NSNumber numberWithInteger:streamError.error], kCFGetAddrInfoFailureKey, 193 | nil 194 | ]; 195 | } else { 196 | userInfo = nil; 197 | } 198 | error = [NSError errorWithDomain:(NSString *)kCFErrorDomainCFNetwork code:kCFHostErrorUnknown userInfo:userInfo]; 199 | assert(error != nil); 200 | 201 | [self _didFailWithError:error]; 202 | } 203 | 204 | - (void)sendPingWithData:(NSData *)data 205 | // See comment in header. 206 | { 207 | int err; 208 | NSData * payload; 209 | NSMutableData * packet; 210 | ICMPHeader * icmpPtr; 211 | ssize_t bytesSent; 212 | 213 | // Construct the ping packet. 214 | 215 | payload = data; 216 | if (payload == nil) { 217 | payload = [[NSString stringWithFormat:@"%28zd bottles of beer on the wall", (ssize_t) 99 - (size_t) (self.nextSequenceNumber % 100) ] dataUsingEncoding:NSASCIIStringEncoding]; 218 | assert(payload != nil); 219 | 220 | assert([payload length] == 56); 221 | } 222 | 223 | packet = [NSMutableData dataWithLength:sizeof(*icmpPtr) + [payload length]]; 224 | assert(packet != nil); 225 | 226 | icmpPtr = [packet mutableBytes]; 227 | icmpPtr->type = kICMPTypeEchoRequest; 228 | icmpPtr->code = 0; 229 | icmpPtr->checksum = 0; 230 | icmpPtr->identifier = OSSwapHostToBigInt16(self.identifier); 231 | icmpPtr->sequenceNumber = OSSwapHostToBigInt16(self.nextSequenceNumber); 232 | memcpy(&icmpPtr[1], [payload bytes], [payload length]); 233 | 234 | // The IP checksum returns a 16-bit number that's already in correct byte order 235 | // (due to wacky 1's complement maths), so we just put it into the packet as a 236 | // 16-bit unit. 237 | 238 | icmpPtr->checksum = in_cksum([packet bytes], [packet length]); 239 | 240 | // Send the packet. 241 | 242 | if (self->_socket == NULL) { 243 | bytesSent = -1; 244 | err = EBADF; 245 | } else { 246 | bytesSent = sendto( 247 | CFSocketGetNative(self->_socket), 248 | [packet bytes], 249 | [packet length], 250 | 0, 251 | (struct sockaddr *) [self.hostAddress bytes], 252 | (socklen_t) [self.hostAddress length] 253 | ); 254 | err = 0; 255 | if (bytesSent < 0) { 256 | err = errno; 257 | } 258 | } 259 | 260 | // Handle the results of the send. 261 | 262 | if ( (bytesSent > 0) && (((NSUInteger) bytesSent) == [packet length]) ) { 263 | 264 | // Complete success. Tell the client. 265 | 266 | if ( (self.delegate != nil) && [self.delegate respondsToSelector:@selector(simplePing:didSendPacket:)] ) { 267 | [self.delegate simplePing:self didSendPacket:packet]; 268 | } 269 | } else { 270 | NSError * error; 271 | 272 | // Some sort of failure. Tell the client. 273 | 274 | if (err == 0) { 275 | err = ENOBUFS; // This is not a hugely descriptor error, alas. 276 | } 277 | error = [NSError errorWithDomain:NSPOSIXErrorDomain code:err userInfo:nil]; 278 | if ( (self.delegate != nil) && [self.delegate respondsToSelector:@selector(simplePing:didFailToSendPacket:error:)] ) { 279 | [self.delegate simplePing:self didFailToSendPacket:packet error:error]; 280 | } 281 | } 282 | 283 | self.nextSequenceNumber += 1; 284 | } 285 | 286 | + (NSUInteger)_icmpHeaderOffsetInPacket:(NSData *)packet 287 | // Returns the offset of the ICMPHeader within an IP packet. 288 | { 289 | NSUInteger result; 290 | const struct IPHeader * ipPtr; 291 | size_t ipHeaderLength; 292 | 293 | result = NSNotFound; 294 | if ([packet length] >= (sizeof(IPHeader) + sizeof(ICMPHeader))) { 295 | ipPtr = (const IPHeader *) [packet bytes]; 296 | assert((ipPtr->versionAndHeaderLength & 0xF0) == 0x40); // IPv4 297 | assert(ipPtr->protocol == 1); // ICMP 298 | ipHeaderLength = (ipPtr->versionAndHeaderLength & 0x0F) * sizeof(uint32_t); 299 | if ([packet length] >= (ipHeaderLength + sizeof(ICMPHeader))) { 300 | result = ipHeaderLength; 301 | } 302 | } 303 | return result; 304 | } 305 | 306 | + (const struct ICMPHeader *)icmpInPacket:(NSData *)packet 307 | // See comment in header. 308 | { 309 | const struct ICMPHeader * result; 310 | NSUInteger icmpHeaderOffset; 311 | 312 | result = nil; 313 | icmpHeaderOffset = [self _icmpHeaderOffsetInPacket:packet]; 314 | if (icmpHeaderOffset != NSNotFound) { 315 | result = (const struct ICMPHeader *) (((const uint8_t *)[packet bytes]) + icmpHeaderOffset); 316 | } 317 | return result; 318 | } 319 | 320 | - (BOOL)_isValidPingResponsePacket:(NSMutableData *)packet 321 | // Returns true if the packet looks like a valid ping response packet destined 322 | // for us. 323 | { 324 | BOOL result; 325 | NSUInteger icmpHeaderOffset; 326 | ICMPHeader * icmpPtr; 327 | uint16_t receivedChecksum; 328 | uint16_t calculatedChecksum; 329 | 330 | result = NO; 331 | 332 | icmpHeaderOffset = [[self class] _icmpHeaderOffsetInPacket:packet]; 333 | if (icmpHeaderOffset != NSNotFound) { 334 | icmpPtr = (struct ICMPHeader *) (((uint8_t *)[packet mutableBytes]) + icmpHeaderOffset); 335 | 336 | receivedChecksum = icmpPtr->checksum; 337 | icmpPtr->checksum = 0; 338 | calculatedChecksum = in_cksum(icmpPtr, [packet length] - icmpHeaderOffset); 339 | icmpPtr->checksum = receivedChecksum; 340 | 341 | if (receivedChecksum == calculatedChecksum) { 342 | if ( (icmpPtr->type == kICMPTypeEchoReply) && (icmpPtr->code == 0) ) { 343 | if ( OSSwapBigToHostInt16(icmpPtr->identifier) == self.identifier ) { 344 | if ( OSSwapBigToHostInt16(icmpPtr->sequenceNumber) < self.nextSequenceNumber ) { 345 | result = YES; 346 | } 347 | } 348 | } 349 | } 350 | } 351 | 352 | return result; 353 | } 354 | 355 | - (void)_readData 356 | // Called by the socket handling code (SocketReadCallback) to process an ICMP 357 | // messages waiting on the socket. 358 | { 359 | int err; 360 | struct sockaddr_storage addr; 361 | socklen_t addrLen; 362 | ssize_t bytesRead; 363 | void * buffer; 364 | enum { kBufferSize = 65535 }; 365 | 366 | // 65535 is the maximum IP packet size, which seems like a reasonable bound 367 | // here (plus it's what uses). 368 | 369 | buffer = malloc(kBufferSize); 370 | assert(buffer != NULL); 371 | 372 | // Actually read the data. 373 | 374 | addrLen = sizeof(addr); 375 | bytesRead = recvfrom(CFSocketGetNative(self->_socket), buffer, kBufferSize, 0, (struct sockaddr *) &addr, &addrLen); 376 | err = 0; 377 | if (bytesRead < 0) { 378 | err = errno; 379 | } 380 | 381 | // Process the data we read. 382 | 383 | if (bytesRead > 0) { 384 | NSMutableData * packet; 385 | 386 | packet = [NSMutableData dataWithBytes:buffer length:bytesRead]; 387 | assert(packet != nil); 388 | 389 | // We got some data, pass it up to our client. 390 | 391 | if ( [self _isValidPingResponsePacket:packet] ) { 392 | if ( (self.delegate != nil) && [self.delegate respondsToSelector:@selector(simplePing:didReceivePingResponsePacket:)] ) { 393 | [self.delegate simplePing:self didReceivePingResponsePacket:packet]; 394 | } 395 | } else { 396 | if ( (self.delegate != nil) && [self.delegate respondsToSelector:@selector(simplePing:didReceiveUnexpectedPacket:)] ) { 397 | [self.delegate simplePing:self didReceiveUnexpectedPacket:packet]; 398 | } 399 | } 400 | } else { 401 | 402 | // We failed to read the data, so shut everything down. 403 | 404 | if (err == 0) { 405 | err = EPIPE; 406 | } 407 | [self _didFailWithError:[NSError errorWithDomain:NSPOSIXErrorDomain code:err userInfo:nil]]; 408 | } 409 | 410 | free(buffer); 411 | 412 | // Note that we don't loop back trying to read more data. Rather, we just 413 | // let CFSocket call us again. 414 | } 415 | 416 | static void SocketReadCallback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) 417 | // This C routine is called by CFSocket when there's data waiting on our 418 | // ICMP socket. It just redirects the call to Objective-C code. 419 | { 420 | SimplePing * obj; 421 | 422 | obj = (SimplePing *) info; 423 | assert([obj isKindOfClass:[SimplePing class]]); 424 | 425 | #pragma unused(s) 426 | assert(s == obj->_socket); 427 | #pragma unused(type) 428 | assert(type == kCFSocketReadCallBack); 429 | #pragma unused(address) 430 | assert(address == nil); 431 | #pragma unused(data) 432 | assert(data == nil); 433 | 434 | [obj _readData]; 435 | } 436 | 437 | - (void)_startWithHostAddress 438 | // We have a host address, so let's actually start pinging it. 439 | { 440 | int err; 441 | int fd; 442 | const struct sockaddr * addrPtr; 443 | 444 | assert(self.hostAddress != nil); 445 | 446 | // Open the socket. 447 | 448 | addrPtr = (const struct sockaddr *) [self.hostAddress bytes]; 449 | 450 | fd = -1; 451 | err = 0; 452 | switch (addrPtr->sa_family) { 453 | case AF_INET: { 454 | fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP); 455 | if (fd < 0) { 456 | err = errno; 457 | } 458 | } break; 459 | case AF_INET6: 460 | assert(NO); 461 | // fall through 462 | default: { 463 | err = EPROTONOSUPPORT; 464 | } break; 465 | } 466 | 467 | if (err != 0) { 468 | [self _didFailWithError:[NSError errorWithDomain:NSPOSIXErrorDomain code:err userInfo:nil]]; 469 | } else { 470 | CFSocketContext context = {0, self, NULL, NULL, NULL}; 471 | CFRunLoopSourceRef rls; 472 | 473 | // Wrap it in a CFSocket and schedule it on the runloop. 474 | 475 | self->_socket = CFSocketCreateWithNative(NULL, fd, kCFSocketReadCallBack, SocketReadCallback, &context); 476 | assert(self->_socket != NULL); 477 | 478 | // The socket will now take care of clean up our file descriptor. 479 | 480 | assert( CFSocketGetSocketFlags(self->_socket) & kCFSocketCloseOnInvalidate ); 481 | fd = -1; 482 | 483 | rls = CFSocketCreateRunLoopSource(NULL, self->_socket, 0); 484 | assert(rls != NULL); 485 | 486 | CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode); 487 | 488 | CFRelease(rls); 489 | 490 | if ( (self.delegate != nil) && [self.delegate respondsToSelector:@selector(simplePing:didStartWithAddress:)] ) { 491 | [self.delegate simplePing:self didStartWithAddress:self.hostAddress]; 492 | } 493 | } 494 | assert(fd == -1); 495 | } 496 | 497 | - (void)_hostResolutionDone 498 | // Called by our CFHost resolution callback (HostResolveCallback) when host 499 | // resolution is complete. We just latch the first IPv4 address and kick 500 | // off the pinging process. 501 | { 502 | Boolean resolved; 503 | NSArray * addresses; 504 | 505 | // Find the first IPv4 address. 506 | 507 | addresses = (NSArray *) CFHostGetAddressing(self->_host, &resolved); 508 | if ( resolved && (addresses != nil) ) { 509 | resolved = false; 510 | for (NSData * address in addresses) { 511 | const struct sockaddr * addrPtr; 512 | 513 | addrPtr = (const struct sockaddr *) [address bytes]; 514 | if ( [address length] >= sizeof(struct sockaddr) && addrPtr->sa_family == AF_INET) { 515 | self.hostAddress = address; 516 | resolved = true; 517 | break; 518 | } 519 | } 520 | } 521 | 522 | // We're done resolving, so shut that down. 523 | 524 | [self _stopHostResolution]; 525 | 526 | // If all is OK, start pinging, otherwise shut down the pinger completely. 527 | 528 | if (resolved) { 529 | [self _startWithHostAddress]; 530 | } else { 531 | [self _didFailWithError:[NSError errorWithDomain:(NSString *)kCFErrorDomainCFNetwork code:kCFHostErrorHostNotFound userInfo:nil]]; 532 | } 533 | } 534 | 535 | static void HostResolveCallback(CFHostRef theHost, CFHostInfoType typeInfo, const CFStreamError *error, void *info) 536 | // This C routine is called by CFHost when the host resolution is complete. 537 | // It just redirects the call to the appropriate Objective-C method. 538 | { 539 | SimplePing * obj; 540 | 541 | obj = (SimplePing *) info; 542 | assert([obj isKindOfClass:[SimplePing class]]); 543 | 544 | #pragma unused(theHost) 545 | assert(theHost == obj->_host); 546 | #pragma unused(typeInfo) 547 | assert(typeInfo == kCFHostAddresses); 548 | 549 | if ( (error != NULL) && (error->domain != 0) ) { 550 | [obj _didFailWithHostStreamError:*error]; 551 | } else { 552 | [obj _hostResolutionDone]; 553 | } 554 | } 555 | 556 | - (void)start 557 | // See comment in header. 558 | { 559 | // If the user supplied us with an address, just start pinging that. Otherwise 560 | // start a host resolution. 561 | 562 | if (self->_hostAddress != nil) { 563 | [self _startWithHostAddress]; 564 | } else { 565 | Boolean success; 566 | CFHostClientContext context = {0, self, NULL, NULL, NULL}; 567 | CFStreamError streamError; 568 | 569 | assert(self->_host == NULL); 570 | 571 | self->_host = CFHostCreateWithName(NULL, (CFStringRef) self.hostName); 572 | assert(self->_host != NULL); 573 | 574 | CFHostSetClient(self->_host, HostResolveCallback, &context); 575 | 576 | CFHostScheduleWithRunLoop(self->_host, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 577 | 578 | success = CFHostStartInfoResolution(self->_host, kCFHostAddresses, &streamError); 579 | if ( ! success ) { 580 | [self _didFailWithHostStreamError:streamError]; 581 | } 582 | } 583 | } 584 | 585 | - (void)_stopHostResolution 586 | // Shut down the CFHost. 587 | { 588 | if (self->_host != NULL) { 589 | CFHostSetClient(self->_host, NULL, NULL); 590 | CFHostUnscheduleFromRunLoop(self->_host, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 591 | CFRelease(self->_host); 592 | self->_host = NULL; 593 | } 594 | } 595 | 596 | - (void)_stopDataTransfer 597 | // Shut down anything to do with sending and receiving pings. 598 | { 599 | if (self->_socket != NULL) { 600 | CFSocketInvalidate(self->_socket); 601 | CFRelease(self->_socket); 602 | self->_socket = NULL; 603 | } 604 | } 605 | 606 | - (void)stop 607 | // See comment in header. 608 | { 609 | [self _stopHostResolution]; 610 | [self _stopDataTransfer]; 611 | 612 | // If we were started with a host name, junk the host address on stop. If the 613 | // client calls -start again, we'll re-resolve the host name. 614 | 615 | if (self.hostName != nil) { 616 | self.hostAddress = NULL; 617 | } 618 | } 619 | 620 | @end 621 | -------------------------------------------------------------------------------- /LAN Scan/SimplePingHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimplePingHelper.h 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SimplePing.h" 11 | 12 | @interface SimplePingHelper : NSObject 13 | 14 | + (void)ping:(NSString*)address target:(id)target sel:(SEL)sel; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /LAN Scan/SimplePingHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimplePingHelper.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import "SimplePingHelper.h" 10 | 11 | @interface SimplePingHelper() 12 | @property(nonatomic,retain) SimplePing* simplePing; 13 | @property(nonatomic,retain) id target; 14 | @property(nonatomic,assign) SEL sel; 15 | - (id)initWithAddress:(NSString*)address target:(id)_target sel:(SEL)_sel; 16 | - (void)go; 17 | @end 18 | 19 | @implementation SimplePingHelper 20 | @synthesize simplePing, target, sel; 21 | 22 | #pragma mark - Run it 23 | 24 | // Pings the address, and calls the selector when done. Selector must take a NSnumber which is a bool for success 25 | + (void)ping:(NSString*)address target:(id)target sel:(SEL)sel { 26 | // The helper retains itself through the timeout function 27 | [[[[SimplePingHelper alloc] initWithAddress:address target:target sel:sel] autorelease] go]; 28 | } 29 | 30 | #pragma mark - Init/dealloc 31 | 32 | - (void)dealloc { 33 | self.simplePing = nil; 34 | self.target = nil; 35 | [super dealloc]; 36 | } 37 | 38 | - (id)initWithAddress:(NSString*)address target:(id)_target sel:(SEL)_sel { 39 | if (self = [self init]) { 40 | self.simplePing = [SimplePing simplePingWithHostName:address]; 41 | self.simplePing.delegate = self; 42 | self.target = _target; 43 | self.sel = _sel; 44 | } 45 | return self; 46 | } 47 | 48 | #pragma mark - Go 49 | 50 | - (void)go { 51 | [self.simplePing start]; 52 | [self performSelector:@selector(endTime) withObject:nil afterDelay:1]; // This timeout is what retains the ping helper 53 | } 54 | 55 | #pragma mark - Finishing and timing out 56 | 57 | // Called on success or failure to clean up 58 | - (void)killPing { 59 | [self.simplePing stop]; 60 | [[self.simplePing retain] autorelease]; // In case, higher up the call stack, this got called by the simpleping object itself 61 | self.simplePing = nil; 62 | } 63 | 64 | - (void)successPing { 65 | [self killPing]; 66 | [target performSelector:sel withObject:[NSNumber numberWithBool:YES]]; 67 | } 68 | 69 | - (void)failPing:(NSString*)reason { 70 | [self killPing]; 71 | [target performSelector:sel withObject:[NSNumber numberWithBool:NO]]; 72 | } 73 | 74 | // Called 1s after ping start, to check if it timed out 75 | - (void)endTime { 76 | if (self.simplePing) { // If it hasn't already been killed, then it's timed out 77 | [self failPing:@"timeout"]; 78 | } 79 | } 80 | 81 | #pragma mark - Pinger delegate 82 | 83 | // When the pinger starts, send the ping immediately 84 | - (void)simplePing:(SimplePing *)pinger didStartWithAddress:(NSData *)address { 85 | [self.simplePing sendPingWithData:nil]; 86 | } 87 | 88 | - (void)simplePing:(SimplePing *)pinger didFailWithError:(NSError *)error { 89 | [self failPing:@"didFailWithError"]; 90 | } 91 | 92 | - (void)simplePing:(SimplePing *)pinger didFailToSendPacket:(NSData *)packet error:(NSError *)error { 93 | // Eg they're not connected to any network 94 | [self failPing:@"didFailToSendPacket"]; 95 | } 96 | 97 | - (void)simplePing:(SimplePing *)pinger didReceivePingResponsePacket:(NSData *)packet { 98 | [self successPing]; 99 | } 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /LAN Scan/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ScanLAN.h" 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LAN Scan/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "Device.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 15 | @property NSMutableArray *connctedDevices; 16 | @property ScanLAN *lanScanner; 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | - (void)viewDidLoad 23 | { 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view, typically from a nib. 26 | UIBarButtonItem *refreshBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(startScanningLAN)]; 27 | self.navigationItem.rightBarButtonItem = refreshBarButton; 28 | } 29 | 30 | - (void)viewDidAppear:(BOOL)animated { 31 | [self startScanningLAN]; 32 | } 33 | 34 | - (void)viewWillDisappear:(BOOL)animated { 35 | [self.lanScanner stopScan]; 36 | } 37 | 38 | - (void)didReceiveMemoryWarning 39 | { 40 | [super didReceiveMemoryWarning]; 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | - (void)startScanningLAN { 45 | [self.lanScanner stopScan]; 46 | self.lanScanner = [[ScanLAN alloc] initWithDelegate:self]; 47 | self.connctedDevices = [[NSMutableArray alloc] init]; 48 | [self.lanScanner startScan]; 49 | } 50 | 51 | #pragma mark - Table view data source 52 | 53 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 54 | { 55 | // Return the number of sections. 56 | return 1; 57 | } 58 | 59 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 60 | { 61 | // Return the number of rows in the section. 62 | return self.connctedDevices.count; 63 | } 64 | 65 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 66 | { 67 | static NSString *CellIdentifier = @"Cell"; 68 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 69 | Device *device = [self.connctedDevices objectAtIndex:indexPath.row]; 70 | cell.textLabel.text = device.name; 71 | cell.detailTextLabel.text = device.address; 72 | 73 | return cell; 74 | } 75 | 76 | /* 77 | // Override to support conditional editing of the table view. 78 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 79 | { 80 | // Return NO if you do not want the specified item to be editable. 81 | return YES; 82 | } 83 | */ 84 | 85 | /* 86 | // Override to support editing the table view. 87 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 88 | { 89 | if (editingStyle == UITableViewCellEditingStyleDelete) { 90 | // Delete the row from the data source 91 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 92 | } 93 | else if (editingStyle == UITableViewCellEditingStyleInsert) { 94 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 95 | } 96 | } 97 | */ 98 | 99 | /* 100 | // Override to support rearranging the table view. 101 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath 102 | { 103 | } 104 | */ 105 | 106 | /* 107 | // Override to support conditional rearranging of the table view. 108 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath 109 | { 110 | // Return NO if you do not want the item to be re-orderable. 111 | return YES; 112 | } 113 | */ 114 | 115 | /* 116 | #pragma mark - Navigation 117 | 118 | // In a story board-based application, you will often want to do a little preparation before navigation 119 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 120 | { 121 | // Get the new view controller using [segue destinationViewController]. 122 | // Pass the selected object to the new view controller. 123 | } 124 | 125 | */ 126 | #pragma mark LAN Scanner delegate method 127 | - (void)scanLANDidFindNewAdrress:(NSString *)address havingHostName:(NSString *)hostName { 128 | NSLog(@"found %@", address); 129 | Device *device = [[Device alloc] init]; 130 | device.name = hostName; 131 | device.address = address; 132 | [self.connctedDevices addObject:device]; 133 | [self.tableView reloadData]; 134 | } 135 | 136 | - (void)scanLANDidFinishScanning { 137 | NSLog(@"Scan finished"); 138 | [[[UIAlertView alloc] initWithTitle:@"Scan Finished" message:[NSString stringWithFormat:@"Number of devices connected to the Local Area Network : %d", self.connctedDevices.count] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show]; 139 | } 140 | @end 141 | -------------------------------------------------------------------------------- /LAN Scan/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LAN Scan/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LAN Scan/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongizaidi/LAN-Scan/1ae9257bcb16b51d3b769f85c6e02a968e13dbc3/LAN Scan/screenshot.png -------------------------------------------------------------------------------- /LAN ScanTests/LAN ScanTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | smarttouch.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LAN ScanTests/LAN_ScanTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LAN_ScanTests.m 3 | // LAN Scan 4 | // 5 | // Created by Mongi Zaidi on 24 February 2014. 6 | // Copyright (c) 2014 Smart Touch. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LAN_ScanTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LAN_ScanTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /LAN ScanTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Mongi Zaidi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LAN-Scan 2 | ======== 3 | 4 | An iOS Local Area Network / wifi Scanner 5 | 6 | ![](https://raw.github.com/mongizaidi/LAN-Scan/master/LAN%20Scan/screenshot.png) 7 | --------------------------------------------------------------------------------