From b93b4e4515dbb07eeb2d70e72fe9da106a5e02f3 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 29 Sep 2017 20:23:58 +0300 Subject: [PATCH] Fixed issues with Xcode 9 compatibility --- MMLanScan.podspec | 9 +- MMLanScan/External Libs/MacFinder/MacFinder.h | 2 +- .../MacFinder/Network Headers/route.h | 291 +++++++++--------- .../External Libs/SimplePing/SimplePing.h | 34 +- MMLanScan/Misc/MACOperation.m | 3 +- .../MMLanScanDemo.xcodeproj/project.pbxproj | 25 +- .../xcshareddata/MMLanScanDemo.xcscmblueprint | 30 -- .../MMLanScanDemo/Base.lproj/Main.storyboard | 21 +- MMLanScanDemo/MMLanScanDemo/MainVC.m | 6 +- .../project.pbxproj | 25 +- .../Base.lproj/Main.storyboard | 12 +- .../MMLanScanSwiftDemo/MainVC.swift | 6 +- README.md | 9 +- 13 files changed, 240 insertions(+), 233 deletions(-) delete mode 100644 MMLanScanDemo/MMLanScanDemo.xcworkspace/xcshareddata/MMLanScanDemo.xcscmblueprint diff --git a/MMLanScan.podspec b/MMLanScan.podspec index 6b82b27..bee0961 100644 --- a/MMLanScan.podspec +++ b/MMLanScan.podspec @@ -1,16 +1,17 @@ Pod::Spec.new do |s| s.name = 'MMLanScan' - s.version = '2.2.0' + s.version = '3.0.0' s.summary = 'MMLanScan is an open source project for iOS that helps you scan your network and shows the available devices.' s.description = <<-DESC - MMLanScan 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. For those updating from 2.1.2 please note that "Device" class has been renamed to "MMDevice". + MMLanScan 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. For those updating from 2.1.2 please note that "Device" class has been renamed to "MMDevice". + For those updating from 2.2.0 to 3.0.0 please note that you won't be able to see MAC Addresses and Brands because of a restriction of iOS 11. Features + Scans and finds available hosts in your network + Shows IP Address -+ Shows MAC Address -+ Shows Brand of device based on MAC Address ++ Shows MAC Address (iOS 10 and below) ++ Shows Brand of device based on MAC Address (iOS 10 and below) + Shows hostname (if available) + Scan any subnet (not only /24) + Gives you the ability to update the OUI (MAC-Brand mappings) plist file. Check in MainPresenter.m for more details diff --git a/MMLanScan/External Libs/MacFinder/MacFinder.h b/MMLanScan/External Libs/MacFinder/MacFinder.h index d640190..1400705 100644 --- a/MMLanScan/External Libs/MacFinder/MacFinder.h +++ b/MMLanScan/External Libs/MacFinder/MacFinder.h @@ -9,7 +9,7 @@ #import #if TARGET_IPHONE_SIMULATOR -#include +#include "route.h" #else #include "route.h" #endif diff --git a/MMLanScan/External Libs/MacFinder/Network Headers/route.h b/MMLanScan/External Libs/MacFinder/Network Headers/route.h index 0bd7965..06f63ea 100644 --- a/MMLanScan/External Libs/MacFinder/Network Headers/route.h +++ b/MMLanScan/External Libs/MacFinder/Network Headers/route.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2015 Apple Inc. All rights reserved. + * Copyright (c) 2000-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -27,7 +27,7 @@ */ /* * Copyright (c) 1980, 1986, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -39,8 +39,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * This product includes software developed by the University of + * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -57,12 +57,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)route.h 8.3 (Berkeley) 4/19/94 + * @(#)route.h 8.3 (Berkeley) 4/19/94 * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $ */ #ifndef _NET_ROUTE_H_ -#define _NET_ROUTE_H_ +#define _NET_ROUTE_H_ #include #include #include @@ -72,194 +72,179 @@ * These numbers are used by reliable protocols for determining * retransmission behavior and are included in the routing structure. */ - -#if TARGET_IPHONE_SIMULATOR -#else struct rt_metrics { - u_int32_t rmx_locks; /* Kernel leaves these values alone */ - u_int32_t rmx_mtu; /* MTU for this path */ - u_int32_t rmx_hopcount; /* max hops expected */ - int32_t rmx_expire; /* lifetime for route, e.g. redirect */ - u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ - u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ - u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ - u_int32_t rmx_rtt; /* estimated round trip time */ - u_int32_t rmx_rttvar; /* estimated rtt variance */ - u_int32_t rmx_pksent; /* packets sent using this route */ - u_int32_t rmx_filler[4]; /* will be used for T/TCP later */ + u_int32_t rmx_locks; /* Kernel leaves these values alone */ + u_int32_t rmx_mtu; /* MTU for this path */ + u_int32_t rmx_hopcount; /* max hops expected */ + int32_t rmx_expire; /* lifetime for route, e.g. redirect */ + u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ + u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ + u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ + u_int32_t rmx_rtt; /* estimated round trip time */ + u_int32_t rmx_rttvar; /* estimated rtt variance */ + u_int32_t rmx_pksent; /* packets sent using this route */ + u_int32_t rmx_filler[4]; /* will be used for T/TCP later */ }; -#endif /* * rmx_rtt and rmx_rttvar are stored as microseconds; */ -#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ - - - -#define RTF_UP 0x1 /* route usable */ -#define RTF_GATEWAY 0x2 /* destination is a gateway */ -#define RTF_HOST 0x4 /* host entry (net otherwise) */ -#define RTF_REJECT 0x8 /* host or net unreachable */ -#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ -#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ -#define RTF_DONE 0x40 /* message confirmed */ -#define RTF_DELCLONE 0x80 /* delete cloned route */ -#define RTF_CLONING 0x100 /* generate new routes on use */ -#define RTF_XRESOLVE 0x200 /* external daemon resolves name */ -#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */ -#define RTF_STATIC 0x800 /* manually added */ -#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ -#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ -#define RTF_PROTO2 0x4000 /* protocol specific routing flag */ -#define RTF_PROTO1 0x8000 /* protocol specific routing flag */ - -#define RTF_PRCLONING 0x10000 /* protocol requires cloning */ -#define RTF_WASCLONED 0x20000 /* route generated through cloning */ -#define RTF_PROTO3 0x40000 /* protocol specific routing flag */ - /* 0x80000 unused */ -#define RTF_PINNED 0x100000 /* future use */ -#define RTF_LOCAL 0x200000 /* route represents a local address */ -#define RTF_BROADCAST 0x400000 /* route represents a bcast address */ -#define RTF_MULTICAST 0x800000 /* route represents a mcast address */ -#define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ -#define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ -#define RTF_IFREF 0x4000000 /* route holds a ref to interface */ -#define RTF_PROXY 0x8000000 /* proxying, no interface scope */ -#define RTF_ROUTER 0x10000000 /* host is a router */ - /* 0x20000000 and up unassigned */ - -#define RTF_BITS \ - "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ - "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ - "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ - "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \ - "\33IFREF\34PROXY\35ROUTER" +#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ + + + +#define RTF_UP 0x1 /* route usable */ +#define RTF_GATEWAY 0x2 /* destination is a gateway */ +#define RTF_HOST 0x4 /* host entry (net otherwise) */ +#define RTF_REJECT 0x8 /* host or net unreachable */ +#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ +#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ +#define RTF_DONE 0x40 /* message confirmed */ +#define RTF_DELCLONE 0x80 /* delete cloned route */ +#define RTF_CLONING 0x100 /* generate new routes on use */ +#define RTF_XRESOLVE 0x200 /* external daemon resolves name */ +#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */ +#define RTF_STATIC 0x800 /* manually added */ +#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ +#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ +#define RTF_PROTO2 0x4000 /* protocol specific routing flag */ +#define RTF_PROTO1 0x8000 /* protocol specific routing flag */ + +#define RTF_PRCLONING 0x10000 /* protocol requires cloning */ +#define RTF_WASCLONED 0x20000 /* route generated through cloning */ +#define RTF_PROTO3 0x40000 /* protocol specific routing flag */ +/* 0x80000 unused */ +#define RTF_PINNED 0x100000 /* future use */ +#define RTF_LOCAL 0x200000 /* route represents a local address */ +#define RTF_BROADCAST 0x400000 /* route represents a bcast address */ +#define RTF_MULTICAST 0x800000 /* route represents a mcast address */ +#define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ +#define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ +#define RTF_IFREF 0x4000000 /* route holds a ref to interface */ +#define RTF_PROXY 0x8000000 /* proxying, no interface scope */ +#define RTF_ROUTER 0x10000000 /* host is a router */ +/* 0x20000000 and up unassigned */ + +#define RTF_BITS \ +"\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ +"\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ +"\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ +"\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \ +"\33IFREF\34PROXY\35ROUTER" /* * Routing statistics. */ -#if TARGET_IPHONE_SIMULATOR -#else -struct rtstat { - short rts_badredirect; /* bogus redirect calls */ - short rts_dynamic; /* routes created by redirects */ - short rts_newgateway; /* routes modified by redirects */ - short rts_unreach; /* lookups which failed */ - short rts_wildcard; /* lookups satisfied by a wildcard */ +struct rtstat { + short rts_badredirect; /* bogus redirect calls */ + short rts_dynamic; /* routes created by redirects */ + short rts_newgateway; /* routes modified by redirects */ + short rts_unreach; /* lookups which failed */ + short rts_wildcard; /* lookups satisfied by a wildcard */ }; -#endif /* * Structures for routing messages. */ -#if TARGET_IPHONE_SIMULATOR -#else struct rt_msghdr { - u_short rtm_msglen; /* to skip over non-understood messages */ - u_char rtm_version; /* future binary compatibility */ - u_char rtm_type; /* message type */ - u_short rtm_index; /* index for associated ifp */ - int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ - int rtm_addrs; /* bitmask identifying sockaddrs in msg */ - pid_t rtm_pid; /* identify sender */ - int rtm_seq; /* for sender to identify action */ - int rtm_errno; /* why failed */ - int rtm_use; /* from rtentry */ - u_int32_t rtm_inits; /* which metrics we are initializing */ - struct rt_metrics rtm_rmx; /* metrics themselves */ + u_short rtm_msglen; /* to skip over non-understood messages */ + u_char rtm_version; /* future binary compatibility */ + u_char rtm_type; /* message type */ + u_short rtm_index; /* index for associated ifp */ + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ + int rtm_addrs; /* bitmask identifying sockaddrs in msg */ + pid_t rtm_pid; /* identify sender */ + int rtm_seq; /* for sender to identify action */ + int rtm_errno; /* why failed */ + int rtm_use; /* from rtentry */ + u_int32_t rtm_inits; /* which metrics we are initializing */ + struct rt_metrics rtm_rmx; /* metrics themselves */ }; -#endif -#if TARGET_IPHONE_SIMULATOR -#else struct rt_msghdr2 { - u_short rtm_msglen; /* to skip over non-understood messages */ - u_char rtm_version; /* future binary compatibility */ - u_char rtm_type; /* message type */ - u_short rtm_index; /* index for associated ifp */ - int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ - int rtm_addrs; /* bitmask identifying sockaddrs in msg */ - int32_t rtm_refcnt; /* reference count */ - int rtm_parentflags; /* flags of the parent route */ - int rtm_reserved; /* reserved field set to 0 */ - int rtm_use; /* from rtentry */ - u_int32_t rtm_inits; /* which metrics we are initializing */ - struct rt_metrics rtm_rmx; /* metrics themselves */ + u_short rtm_msglen; /* to skip over non-understood messages */ + u_char rtm_version; /* future binary compatibility */ + u_char rtm_type; /* message type */ + u_short rtm_index; /* index for associated ifp */ + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ + int rtm_addrs; /* bitmask identifying sockaddrs in msg */ + int32_t rtm_refcnt; /* reference count */ + int rtm_parentflags; /* flags of the parent route */ + int rtm_reserved; /* reserved field set to 0 */ + int rtm_use; /* from rtentry */ + u_int32_t rtm_inits; /* which metrics we are initializing */ + struct rt_metrics rtm_rmx; /* metrics themselves */ }; -#endif -#define RTM_VERSION 5 /* Up the ante and ignore older versions */ +#define RTM_VERSION 5 /* Up the ante and ignore older versions */ /* * Message types. */ -#define RTM_ADD 0x1 /* Add Route */ -#define RTM_DELETE 0x2 /* Delete Route */ -#define RTM_CHANGE 0x3 /* Change Metrics or flags */ -#define RTM_GET 0x4 /* Report Metrics */ -#define RTM_LOSING 0x5 /* RTM_LOSING is no longer generated by xnu - and is deprecated */ -#define RTM_REDIRECT 0x6 /* Told to use different route */ -#define RTM_MISS 0x7 /* Lookup failed on this address */ -#define RTM_LOCK 0x8 /* fix specified metrics */ -#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ -#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ -#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ -#define RTM_NEWADDR 0xc /* address being added to iface */ -#define RTM_DELADDR 0xd /* address being removed from iface */ -#define RTM_IFINFO 0xe /* iface going up/down etc. */ -#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ -#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ -#define RTM_IFINFO2 0x12 /* */ -#define RTM_NEWMADDR2 0x13 /* */ -#define RTM_GET2 0x14 /* */ +#define RTM_ADD 0x1 /* Add Route */ +#define RTM_DELETE 0x2 /* Delete Route */ +#define RTM_CHANGE 0x3 /* Change Metrics or flags */ +#define RTM_GET 0x4 /* Report Metrics */ +#define RTM_LOSING 0x5 /* RTM_LOSING is no longer generated by xnu +and is deprecated */ +#define RTM_REDIRECT 0x6 /* Told to use different route */ +#define RTM_MISS 0x7 /* Lookup failed on this address */ +#define RTM_LOCK 0x8 /* fix specified metrics */ +#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ +#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ +#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ +#define RTM_NEWADDR 0xc /* address being added to iface */ +#define RTM_DELADDR 0xd /* address being removed from iface */ +#define RTM_IFINFO 0xe /* iface going up/down etc. */ +#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ +#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ +#define RTM_IFINFO2 0x12 /* */ +#define RTM_NEWMADDR2 0x13 /* */ +#define RTM_GET2 0x14 /* */ /* * Bitmask values for rtm_inits and rmx_locks. */ -#define RTV_MTU 0x1 /* init or lock _mtu */ -#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ -#define RTV_EXPIRE 0x4 /* init or lock _expire */ -#define RTV_RPIPE 0x8 /* init or lock _recvpipe */ -#define RTV_SPIPE 0x10 /* init or lock _sendpipe */ -#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ -#define RTV_RTT 0x40 /* init or lock _rtt */ -#define RTV_RTTVAR 0x80 /* init or lock _rttvar */ +#define RTV_MTU 0x1 /* init or lock _mtu */ +#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ +#define RTV_EXPIRE 0x4 /* init or lock _expire */ +#define RTV_RPIPE 0x8 /* init or lock _recvpipe */ +#define RTV_SPIPE 0x10 /* init or lock _sendpipe */ +#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ +#define RTV_RTT 0x40 /* init or lock _rtt */ +#define RTV_RTTVAR 0x80 /* init or lock _rttvar */ /* * Bitmask values for rtm_addrs. */ -#define RTA_DST 0x1 /* destination sockaddr present */ -#define RTA_GATEWAY 0x2 /* gateway sockaddr present */ -#define RTA_NETMASK 0x4 /* netmask sockaddr present */ -#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ -#define RTA_IFP 0x10 /* interface name sockaddr present */ -#define RTA_IFA 0x20 /* interface addr sockaddr present */ -#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ -#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ +#define RTA_DST 0x1 /* destination sockaddr present */ +#define RTA_GATEWAY 0x2 /* gateway sockaddr present */ +#define RTA_NETMASK 0x4 /* netmask sockaddr present */ +#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ +#define RTA_IFP 0x10 /* interface name sockaddr present */ +#define RTA_IFA 0x20 /* interface addr sockaddr present */ +#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ +#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ /* * Index offsets for sockaddr array for alternate internal encoding. */ -#define RTAX_DST 0 /* destination sockaddr present */ -#define RTAX_GATEWAY 1 /* gateway sockaddr present */ -#define RTAX_NETMASK 2 /* netmask sockaddr present */ -#define RTAX_GENMASK 3 /* cloning mask sockaddr present */ -#define RTAX_IFP 4 /* interface name sockaddr present */ -#define RTAX_IFA 5 /* interface addr sockaddr present */ -#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ -#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ -#define RTAX_MAX 8 /* size of array to allocate */ +#define RTAX_DST 0 /* destination sockaddr present */ +#define RTAX_GATEWAY 1 /* gateway sockaddr present */ +#define RTAX_NETMASK 2 /* netmask sockaddr present */ +#define RTAX_GENMASK 3 /* cloning mask sockaddr present */ +#define RTAX_IFP 4 /* interface name sockaddr present */ +#define RTAX_IFA 5 /* interface addr sockaddr present */ +#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ +#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ +#define RTAX_MAX 8 /* size of array to allocate */ -#if TARGET_IPHONE_SIMULATOR -#else struct rt_addrinfo { - int rti_addrs; - struct sockaddr *rti_info[RTAX_MAX]; + int rti_addrs; + struct sockaddr *rti_info[RTAX_MAX]; }; -#endif #endif /* _NET_ROUTE_H_ */ + diff --git a/MMLanScan/External Libs/SimplePing/SimplePing.h b/MMLanScan/External Libs/SimplePing/SimplePing.h index b4576c7..3b623ea 100755 --- a/MMLanScan/External Libs/SimplePing/SimplePing.h +++ b/MMLanScan/External Libs/SimplePing/SimplePing.h @@ -138,17 +138,17 @@ struct IPHeader { }; typedef struct IPHeader IPHeader; -check_compile_time(sizeof(IPHeader) == 20); -check_compile_time(offsetof(IPHeader, versionAndHeaderLength) == 0); -check_compile_time(offsetof(IPHeader, differentiatedServices) == 1); -check_compile_time(offsetof(IPHeader, totalLength) == 2); -check_compile_time(offsetof(IPHeader, identification) == 4); -check_compile_time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); -check_compile_time(offsetof(IPHeader, timeToLive) == 8); -check_compile_time(offsetof(IPHeader, protocol) == 9); -check_compile_time(offsetof(IPHeader, headerChecksum) == 10); -check_compile_time(offsetof(IPHeader, sourceAddress) == 12); -check_compile_time(offsetof(IPHeader, destinationAddress) == 16); +__Check_Compile_Time(sizeof(IPHeader) == 20); +__Check_Compile_Time(offsetof(IPHeader, versionAndHeaderLength) == 0); +__Check_Compile_Time(offsetof(IPHeader, differentiatedServices) == 1); +__Check_Compile_Time(offsetof(IPHeader, totalLength) == 2); +__Check_Compile_Time(offsetof(IPHeader, identification) == 4); +__Check_Compile_Time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); +__Check_Compile_Time(offsetof(IPHeader, timeToLive) == 8); +__Check_Compile_Time(offsetof(IPHeader, protocol) == 9); +__Check_Compile_Time(offsetof(IPHeader, headerChecksum) == 10); +__Check_Compile_Time(offsetof(IPHeader, sourceAddress) == 12); +__Check_Compile_Time(offsetof(IPHeader, destinationAddress) == 16); // ICMP type and code combinations: @@ -169,9 +169,9 @@ struct ICMPHeader { }; typedef struct ICMPHeader ICMPHeader; -check_compile_time(sizeof(ICMPHeader) == 8); -check_compile_time(offsetof(ICMPHeader, type) == 0); -check_compile_time(offsetof(ICMPHeader, code) == 1); -check_compile_time(offsetof(ICMPHeader, checksum) == 2); -check_compile_time(offsetof(ICMPHeader, identifier) == 4); -check_compile_time(offsetof(ICMPHeader, sequenceNumber) == 6); +__Check_Compile_Time(sizeof(ICMPHeader) == 8); +__Check_Compile_Time(offsetof(ICMPHeader, type) == 0); +__Check_Compile_Time(offsetof(ICMPHeader, code) == 1); +__Check_Compile_Time(offsetof(ICMPHeader, checksum) == 2); +__Check_Compile_Time(offsetof(ICMPHeader, identifier) == 4); +__Check_Compile_Time(offsetof(ICMPHeader, sequenceNumber) == 6); diff --git a/MMLanScan/Misc/MACOperation.m b/MMLanScan/Misc/MACOperation.m index ebe43b1..3353501 100644 --- a/MMLanScan/Misc/MACOperation.m +++ b/MMLanScan/Misc/MACOperation.m @@ -99,9 +99,8 @@ -(void)getMACDetails{ self.device.ipAddress=self.ipStr; self.device.macAddress =[[MacFinder ip2mac:self.device.ipAddress] uppercaseString]; self.device.hostname = [LANProperties getHostFromIPAddress:self.ipStr]; - + if (!self.device.macAddress) { - errorMessage = [NSError errorWithDomain:@"MAC Address Not Exist" code:10 userInfo:nil]; } else { diff --git a/MMLanScanDemo/MMLanScanDemo.xcodeproj/project.pbxproj b/MMLanScanDemo/MMLanScanDemo.xcodeproj/project.pbxproj index 6b14992..011c01c 100644 --- a/MMLanScanDemo/MMLanScanDemo.xcodeproj/project.pbxproj +++ b/MMLanScanDemo/MMLanScanDemo.xcodeproj/project.pbxproj @@ -290,12 +290,13 @@ 279335BA1D5D1CB9001DFE84 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Miksoft; TargetAttributes = { 279335C11D5D1CB9001DFE84 = { CreatedOnToolsVersion = 7.3; - ProvisioningStyle = Manual; + DevelopmentTeam = JSY962FCU8; + ProvisioningStyle = Automatic; }; }; }; @@ -385,14 +386,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -431,14 +438,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -467,12 +480,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = JSY962FCU8; INFOPLIST_FILE = "$(SRCROOT)/MMLanScanDemo/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.miksoft.MMLanScanDemo; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; @@ -482,12 +497,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = JSY962FCU8; INFOPLIST_FILE = "$(SRCROOT)/MMLanScanDemo/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.miksoft.MMLanScanDemo; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; diff --git a/MMLanScanDemo/MMLanScanDemo.xcworkspace/xcshareddata/MMLanScanDemo.xcscmblueprint b/MMLanScanDemo/MMLanScanDemo.xcworkspace/xcshareddata/MMLanScanDemo.xcscmblueprint deleted file mode 100644 index 49e3dca..0000000 --- a/MMLanScanDemo/MMLanScanDemo.xcworkspace/xcshareddata/MMLanScanDemo.xcscmblueprint +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "CC736D227A29F609AE61B55FA3D72159FB828F32", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "2F8EE4670A46936183FA5C30123302A6625965C2" : 9223372036854775807, - "CC736D227A29F609AE61B55FA3D72159FB828F32" : 9223372036854775807 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "BEC7DDDB-5863-4420-AFE5-FAC352087486", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "2F8EE4670A46936183FA5C30123302A6625965C2" : "MMLanScanPod\/", - "CC736D227A29F609AE61B55FA3D72159FB828F32" : "MMLanScan\/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "MMLanScanDemo", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "MMLanScanDemo\/MMLanScanDemo.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/mavris\/MMLanScanPod.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "2F8EE4670A46936183FA5C30123302A6625965C2" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/mavris\/MMLanScan.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "CC736D227A29F609AE61B55FA3D72159FB828F32" - } - ] -} \ No newline at end of file diff --git a/MMLanScanDemo/MMLanScanDemo/Base.lproj/Main.storyboard b/MMLanScanDemo/MMLanScanDemo/Base.lproj/Main.storyboard index ff5054b..dbfec19 100644 --- a/MMLanScanDemo/MMLanScanDemo/Base.lproj/Main.storyboard +++ b/MMLanScanDemo/MMLanScanDemo/Base.lproj/Main.storyboard @@ -1,8 +1,11 @@ - + + + + - + @@ -21,6 +24,7 @@ + @@ -36,16 +40,18 @@ + - + -