{"id":1639,"url":"https://github.com/mavris/MMLanScan","last_synced_at":"2025-08-02T04:32:15.709Z","repository":{"id":41066963,"uuid":"65507162","full_name":"mavris/MMLanScan","owner":"mavris","description":"An iOS LAN  Network Scanner library","archived":false,"fork":false,"pushed_at":"2021-04-21T20:27:30.000Z","size":6092,"stargazers_count":480,"open_issues_count":21,"forks_count":120,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-04-24T19:04:54.632Z","etag":null,"topics":["hostname","ios","lan-scan","network-scanner","oui"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mavris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-11T23:04:29.000Z","updated_at":"2024-04-24T19:04:54.633Z","dependencies_parsed_at":"2022-08-26T08:31:56.754Z","dependency_job_id":null,"html_url":"https://github.com/mavris/MMLanScan","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavris%2FMMLanScan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavris%2FMMLanScan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavris%2FMMLanScan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavris%2FMMLanScan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mavris","download_url":"https://codeload.github.com/mavris/MMLanScan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439074,"owners_count":17920017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hostname","ios","lan-scan","network-scanner","oui"],"created_at":"2024-01-05T20:15:52.045Z","updated_at":"2024-12-06T08:31:25.169Z","avatar_url":"https://github.com/mavris.png","language":"Objective-C","funding_links":[],"categories":["Networking"],"sub_categories":["Video","Other free courses"],"readme":"\nMMLanScan\n======\n\nMMLanScan is an open source project for iOS that helps you scan your network and shows the available devices and their MAC Address, hostname and Brand name.\n\n\n### Important for iOS 11\niOS 11 is breaking the MAC address retrieval from ARP table so MAC Addresses and Brands won't work on MMLanScan with iOS 11.\nWe still using MacFinder since it's helpful in order to discover online devices that won't reply to pings.\n\n### Note\nYou can find a NativeScript wrapper of MMLanScan [here!](https://www.npmjs.com/package/nativescript-lan-scan)\n\n### Screenshot\n![image](LanScan.gif)\n\n### Features\n+ Scans and finds available hosts in your network\n+ Shows IP Address\n+ Shows MAC Address (iOS 10 and below)\n+ Shows Brand of device based on MAC Address (iOS 10 and below)\n+ Shows hostname (if available)\n+ Scan any subnet (not only /24)\n+ Gives you the ability to update the OUI (MAC-Brand mappings) plist file. Check in MainPresenter.m for more details\n\n### Manual Installation\n- Drag n Drop the MMLanScan folder in your project.\n\n### CocoaPods Installation\nTo install using CocoaPods, simply add the following line to your Podfile:\n\n```ruby\npod 'MMLanScan'\n```\n### How to use it (Objective C)\n\nImport MMLANScanner in your controller\n```\n#import \"MMLANScanner.h\"\n```\n\nAdd the MMLANScannerDelegate (Protocol) to your controller\n```\n@interface YourViewController () \u003cMMLANScannerDelegate\u003e\n```\n\nDeclare a property\n```\n@property(nonatomic,strong)MMLANScanner *lanScanner;\n```\n\nInitialize with delegate\n```\nself.lanScanner = [[MMLANScanner alloc] initWithDelegate:self];\n```\n\nStart the scan\n```\n[self.lanScanner start];\n```\n\nImplement the delegates methods to receive events\n```\n- (void)lanScanDidFindNewDevice:(MMDevice*)device;\n- (void)lanScanDidFinishScanningWithStatus:(MMLanScannerStatus)status;\n- (void)lanScanProgressPinged:(NSInteger)pingedHosts from:(NSInteger)overallHosts;\n- (void)lanScanDidFailedToScan;\n```\n\n### How to use it (Swift)\nAfter Drag n Drop the MMLanScan folder in your Swift project Xcode will ask you to create a bridging header. Create the bridging header and copy paste the following between `#define` and `#endif`:\n```\n#import \"MMLANScanner.h\"\n#import \"LANProperties.h\"\n#import \"PingOperation.h\"\n#import \"MMLANScanner.h\"\n#import \"MACOperation.h\"\n#import \"MacFinder.h\"\n#import \"MMDevice.h\"\n```\nAdd the MMLANSCannerDelegate (Protocol) to your controller\n```\nclass MyVC: NSObject, MMLANScannerDelegate \n```\n\nDeclare the variable for the MMLanScanner\n```\nvar lanScanner : MMLANScanner!\n```\n\nInitialise the MMLanScanner (after self is initialised)\n```\nself.lanScanner = MMLANScanner(delegate:self)\n```\n\nAnd finally start the scan:\n```\nself.lanScanner.start()\n```\n\nOr stop the scan\n```\nself.lanScanner.stop()\n```\n\nImplement the delegates methods to receive events\n```\nfunc lanScanDidFindNewDevice(_ device: MMDevice!)\nfunc lanScanDidFinishScanning(with status: MMLanScannerStatus)\nfunc lanScanProgressPinged(_ pingedHosts: Float, from overallHosts: Int)\nfunc lanScanDidFailedToScan()\n```\n\n### Project Demo\nYou can find project demos available in Swift or Objective-C. Feel free to copy/use them for your product.\nNote: Project demos are written using software design pattern [MVVM](https://www.objc.io/issues/13-architecture/mvvm/)\n\n### How it works\nMMLanScan works like the classic network scanner. It first ping every host in the network in order to built the ARP table and then is trying to get the MAC Address for each host. If a MAC Address is found then it's considered that the host exist in the network.\n\n### Libraries used to built MMLanScan\n- Apples [SimplePing](https://developer.apple.com/library/mac/samplecode/SimplePing/Introduction/Intro.html) \n- My [MacFinder](https://github.com/mavris/MacFinder)\n\n### Technical Stuff\nMMLanScan V2.0 is now using NSOperation and NSOperationQueueManager. Scanning time, and UI interactions are improved compared to V1.0. Also V1.0 was ignoring hosts that didn't replied to pings. V2.0 is not and the result is now accurate.\n\n### TODO\nIf anyone would like to help:\n- ~~Convert the [OUI]~~ (https://standards.ieee.org/develop/regauth/oui/oui.txt) ~~text in a dictionary so we can map MAC Address with vendor (Hint: The Regex to catch the first line with MAC Address and vendor: ```[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}\\s*\\(hex\\)\\s*[A-Za-z\\.\\, \\-]+```)~~\n- ~~Make it work in a background thread. Apple's SimplePing has issues when it comes to GCD (it's built on C libraries and it seems their callbacks won't work with GCD)~~\n- ~~Get hostname from IP address method is not working~~\n- Anything that you feel that will improve this library.\n\n### More Details\n\nVisit my [article](https://medium.com/rocknnull/ios-a-new-lan-network-scanner-library-has-been-born-f218f1a416a5#.sryxaq3b1) for MMLanScan for more details\n\n### Authors\n* Michael Mavris\n\n### Credits\n + Thanks [@jpalten](https://github.com/jpalten) for several tweeks and features\n + Issue for MAC Addresses on iOS 10.2 has been resolved thanks to [@mochasoft] (https://github.com/mochasoft)\n + Wrapper for [NativeScript](https://www.npmjs.com/package/nativescript-lan-scan) developed by [@toddanglin](https://github.com/toddanglin)\n\n### License\nCopyright Miksoft 2017\n\nLicensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmavris%2FMMLanScan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmavris%2FMMLanScan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmavris%2FMMLanScan/lists"}