[
  {
    "path": ".gitignore",
    "content": "*.pbxuser\n*.mode1v3\n*.DS_Store\n*.xcuserdata*\nxcuserdata*\n*.xcuserdata*\n.gitattributes\n*xcuserdata*\n*.xccheckout\n"
  },
  {
    "path": "STPingTest/Base.lproj/LaunchScreen.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"6214\" systemVersion=\"14A314h\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"6207\"/>\n        <capability name=\"Constraints with non-1.0 multipliers\" minToolsVersion=\"5.1\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"480\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"  Copyright (c) 2015年 Suen. All rights reserved.\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8ie-xW-0ye\">\n                    <rect key=\"frame\" x=\"20\" y=\"439\" width=\"441\" height=\"21\"/>\n                    <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"STPingTest\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"kId-c2-rCX\">\n                    <rect key=\"frame\" x=\"20\" y=\"140\" width=\"441\" height=\"43\"/>\n                    <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>\n                    <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n            <constraints>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"centerY\" secondItem=\"iN0-l3-epB\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"5cJ-9S-tgC\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"kId-c2-rCX\" secondAttribute=\"centerX\" id=\"Koa-jz-hwk\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"bottom\" constant=\"20\" id=\"Kzo-t9-V3l\"/>\n                <constraint firstItem=\"8ie-xW-0ye\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"MfP-vx-nX0\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"centerX\" id=\"ZEH-qu-HZ9\"/>\n                <constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"fvb-Df-36g\"/>\n            </constraints>\n            <nil key=\"simulatedStatusBarMetrics\"/>\n            <freeformSimulatedSizeMetrics key=\"simulatedDestinationMetrics\"/>\n            <point key=\"canvasLocation\" x=\"548\" y=\"455\"/>\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "STPingTest/Classes/PingTester/STSimplePing.h",
    "content": "/*\n    Copyright (C) 2016 Apple Inc. All Rights Reserved.\n    See LICENSE.txt for this sample’s licensing information\n    \n    Abstract:\n    An object wrapper around the low-level BSD Sockets ping function.\n */\n\n@import Foundation;\n\n#include <AssertMacros.h>           // for __Check_Compile_Time\n\nNS_ASSUME_NONNULL_BEGIN\n\n@protocol STSimplePingDelegate;\n\n/*! Controls the IP address version used by SimplePing instances.\n */\n\ntypedef NS_ENUM(NSInteger, STSimplePingAddressStyle) {\n    STSimplePingAddressStyleAny,          ///< Use the first IPv4 or IPv6 address found; the default.\n    STSimplePingAddressStyleICMPv4,       ///< Use the first IPv4 address found.\n    STSimplePingAddressStyleICMPv6        ///< Use the first IPv6 address found.\n};\n\n/*! An object wrapper around the low-level BSD Sockets ping function.\n *  \\details To use the class create an instance, set the delegate and call `-start` \n *      to start the instance on the current run loop.  If things go well you'll soon get the \n *      `-simplePing:didStartWithAddress:` delegate callback.  From there you can can call \n *      `-sendPingWithData:` to send a ping and you'll receive the \n *      `-simplePing:didReceivePingResponsePacket:sequenceNumber:` and \n *      `-simplePing:didReceiveUnexpectedPacket:` delegate callbacks as ICMP packets arrive.\n *\n *      The class can be used from any thread but the use of any single instance must be \n *      confined to a specific thread and that thread must run its run loop.\n */\n\n@interface STSimplePing : NSObject\n\n- (instancetype)init NS_UNAVAILABLE;\n\n/*! Initialise the object to ping the specified host.\n *  \\param hostName The DNS name of the host to ping; an IPv4 or IPv6 address in string form will \n *      work here.\n *  \\returns The initialised object.\n */\n\n- (instancetype)initWithHostName:(NSString *)hostName NS_DESIGNATED_INITIALIZER;\n\n/*! A copy of the value passed to `-initWithHostName:`.\n */\n\n@property (nonatomic, copy, readonly) NSString * hostName;\n\n/*! The delegate for this object.\n *  \\details Delegate callbacks are schedule in the default run loop mode of the run loop of the \n *      thread that calls `-start`.\n */\n\n@property (nonatomic, weak, readwrite, nullable) id<STSimplePingDelegate> delegate;\n\n/*! Controls the IP address version used by the object.\n *  \\details You should set this value before starting the object.\n */\n\n@property (nonatomic, assign, readwrite) STSimplePingAddressStyle addressStyle;\n\n/*! The address being pinged.\n *  \\details The contents of the NSData is a (struct sockaddr) of some form.  The \n *      value is nil while the object is stopped and remains nil on start until \n *      `-simplePing:didStartWithAddress:` is called.\n */\n \n@property (nonatomic, copy, readonly, nullable) NSData * hostAddress;\n@property (nonatomic, copy, readonly, nullable) NSString *IPAddress;\n@property (nonatomic, assign, readonly) NSInteger packetLength;\n\n/*! The address family for `hostAddress`, or `AF_UNSPEC` if that's nil.\n */\n\n@property (nonatomic, assign, readonly) sa_family_t hostAddressFamily;\n\n/*! The identifier used by pings by this object.\n *  \\details When you create an instance of this object it generates a random identifier \n *      that it uses to identify its own pings.\n */\n\n@property (nonatomic, assign, readonly) uint16_t identifier;\n\n/*! The next sequence number to be used by this object.\n *  \\details This value starts at zero and increments each time you send a ping (safely \n *      wrapping back to zero if necessary).  The sequence number is included in the ping, \n *      allowing you to match up requests and responses, and thus calculate ping times and \n *      so on.\n */\n\n@property (nonatomic, assign, readonly) uint16_t nextSequenceNumber;\n\n/*! Starts the object.\n *  \\details You should set up the delegate and any ping parameters before calling this.\n *      \n *      If things go well you'll soon get the `-simplePing:didStartWithAddress:` delegate \n *      callback, at which point you can start sending pings (via `-sendPingWithData:`) and \n *      will start receiving ICMP packets (either ping responses, via the \n *      `-simplePing:didReceivePingResponsePacket:sequenceNumber:` delegate callback, or \n *      unsolicited ICMP packets, via the `-simplePing:didReceiveUnexpectedPacket:` delegate \n *      callback).\n *\n *      If the object fails to start, typically because `hostName` doesn't resolve, you'll get \n *      the `-simplePing:didFailWithError:` delegate callback.\n *\n *      It is not correct to start an already started object.\n */\n\n- (void)start;\n\n- (nonnull NSData *)packetWithPingData:(nullable  NSData *)data;\n\n/*! Sends a ping packet containing the specified data.\n *  \\details Sends an actual ping.\n *\n *      The object must be started when you call this method and, on starting the object, you must \n *      wait for the `-simplePing:didStartWithAddress:` delegate callback before calling it.\n *  \\param data Some data to include in the ping packet, after the ICMP header, or nil if you \n *      want the packet to include a standard 56 byte payload (resulting in a standard 64 byte \n *      ping).\n */\n\n- (void)sendPacket:(nonnull NSData *)data;\n\n/*! Stops the object.\n *  \\details You should call this when you're done pinging.\n *      \n *      It's safe to call this on an object that's stopped.\n */\n\n- (void)stop;\n\n@end\n\n/*! A delegate protocol for the SimplePing class.\n */\n\n@protocol STSimplePingDelegate <NSObject>\n\n@optional\n\n/*! A SimplePing delegate callback, called once the object has started up.\n *  \\details This is called shortly after you start the object to tell you that the \n *      object has successfully started.  On receiving this callback, you can call \n *      `-sendPingWithData:` to send pings.\n *\n *      If the object didn't start, `-simplePing:didFailWithError:` is called instead.\n *  \\param pinger The object issuing the callback.\n *  \\param address The address that's being pinged; at the time this delegate callback \n *      is made, this will have the same value as the `hostAddress` property.\n */\n\n- (void)st_simplePing:(STSimplePing *)pinger didStartWithAddress:(NSData *)address;\n\n/*! A SimplePing delegate callback, called if the object fails to start up.\n *  \\details This is called shortly after you start the object to tell you that the \n *      object has failed to start.  The most likely cause of failure is a problem \n *      resolving `hostName`.\n *\n *      By the time this callback is called, the object has stopped (that is, you don't \n *      need to call `-stop` yourself).\n *  \\param pinger The object issuing the callback.\n *  \\param error Describes the failure.\n */\n    \n- (void)st_simplePing:(STSimplePing *)pinger didFailWithError:(NSError *)error;\n\n/*! A SimplePing delegate callback, called when the object has successfully sent a ping packet. \n *  \\details Each call to `-sendPingWithData:` will result in either a \n *      `-simplePing:didSendPacket:sequenceNumber:` delegate callback or a \n *      `-simplePing:didFailToSendPacket:sequenceNumber:error:` delegate callback (unless you \n *      stop the object before you get the callback).  These callbacks are currently delivered \n *      synchronously from within `-sendPingWithData:`, but this synchronous behaviour is not \n *      considered API.\n *  \\param pinger The object issuing the callback.\n *  \\param packet The packet that was sent; this includes the ICMP header (`ICMPHeader`) and the \n *      data you passed to `-sendPingWithData:` but does not include any IP-level headers.\n *  \\param sequenceNumber The ICMP sequence number of that packet.\n */\n\n- (void)st_simplePing:(STSimplePing *)pinger didSendPacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber;\n\n/*! A SimplePing delegate callback, called when the object fails to send a ping packet. \n *  \\details Each call to `-sendPingWithData:` will result in either a \n *      `-simplePing:didSendPacket:sequenceNumber:` delegate callback or a \n *      `-simplePing:didFailToSendPacket:sequenceNumber:error:` delegate callback (unless you \n *      stop the object before you get the callback).  These callbacks are currently delivered \n *      synchronously from within `-sendPingWithData:`, but this synchronous behaviour is not \n *      considered API.\n *  \\param pinger The object issuing the callback.\n *  \\param packet The packet that was not sent; see `-simplePing:didSendPacket:sequenceNumber:` \n *      for details.\n *  \\param sequenceNumber The ICMP sequence number of that packet.\n *  \\param error Describes the failure.\n */\n\n- (void)st_simplePing:(STSimplePing *)pinger didFailToSendPacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber error:(NSError *)error;\n\n/*! A SimplePing delegate callback, called when the object receives a ping response.\n *  \\details If the object receives an ping response that matches a ping request that it \n *      sent, it informs the delegate via this callback.  Matching is primarily done based on \n *      the ICMP identifier, although other criteria are used as well.\n *  \\param pinger The object issuing the callback.\n *  \\param packet The packet received; this includes the ICMP header (`ICMPHeader`) and any data that \n *      follows that in the ICMP message but does not include any IP-level headers.\n *  \\param sequenceNumber The ICMP sequence number of that packet.\n */\n\n- (void)st_simplePing:(STSimplePing *)pinger didReceivePingResponsePacket:(NSData *)packet timeToLive:(NSInteger)timeToLive sequenceNumber:(uint16_t)sequenceNumber timeElapsed:(NSTimeInterval)timeElapsed;\n\n/*! A SimplePing delegate callback, called when the object receives an unmatched ICMP message.\n *  \\details If the object receives an ICMP message that does not match a ping request that it \n *      sent, it informs the delegate via this callback.  The nature of ICMP handling in a \n *      BSD kernel makes this a common event because, when an ICMP message arrives, it is \n *      delivered to all ICMP sockets.\n *\n *      IMPORTANT: This callback is especially common when using IPv6 because IPv6 uses ICMP \n *      for important network management functions.  For example, IPv6 routers periodically \n *      send out Router Advertisement (RA) packets via Neighbor Discovery Protocol (NDP), which \n *      is implemented on top of ICMP.\n *\n *      For more on matching, see the discussion associated with \n *      `-simplePing:didReceivePingResponsePacket:sequenceNumber:`.\n *  \\param pinger The object issuing the callback.\n *  \\param packet The packet received; this includes the ICMP header (`ICMPHeader`) and any data that \n *      follows that in the ICMP message but does not include any IP-level headers.\n */\n\n- (void)st_simplePing:(STSimplePing *)pinger didReceiveUnexpectedPacket:(NSData *)packet;\n\n@end\n\n#pragma mark * ICMP On-The-Wire Format\n/*! Describes the on-the-wire header format for an ICMP ping.\n *  \\details This defines the header structure of ping packets on the wire.  Both IPv4 and \n *      IPv6 use the same basic structure.  \n *  \n *      This is declared in the header because clients of SimplePing might want to use \n *      it parse received ping packets.\n */\n\nstruct STICMPHeader {\n    uint8_t     type;\n    uint8_t     code;\n    uint16_t    checksum;\n    uint16_t    identifier;\n    uint16_t    sequenceNumber;\n    // data...\n};\ntypedef struct STICMPHeader STICMPHeader;\n\n__Check_Compile_Time(sizeof(STICMPHeader) == 8);\n__Check_Compile_Time(offsetof(STICMPHeader, type) == 0);\n__Check_Compile_Time(offsetof(STICMPHeader, code) == 1);\n__Check_Compile_Time(offsetof(STICMPHeader, checksum) == 2);\n__Check_Compile_Time(offsetof(STICMPHeader, identifier) == 4);\n__Check_Compile_Time(offsetof(STICMPHeader, sequenceNumber) == 6);\n\nenum {\n    STICMPv4TypeEchoRequest = 8,          ///< The ICMP `type` for a ping request; in this case `code` is always 0.\n    STICMPv4TypeEchoReply   = 0           ///< The ICMP `type` for a ping response; in this case `code` is always 0.\n};\n\nenum {\n    STICMPv6TypeEchoRequest = 128,        ///< The ICMP `type` for a ping request; in this case `code` is always 0.\n    STICMPv6TypeEchoReply   = 129         ///< The ICMP `type` for a ping response; in this case `code` is always 0.\n};\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "STPingTest/Classes/PingTester/STSimplePing.m",
    "content": "/*\n    Copyright (C) 2016 Apple Inc. All Rights Reserved.\n    See LICENSE.txt for this sample’s licensing information\n    \n    Abstract:\n    An object wrapper around the low-level BSD Sockets ping function.\n */\n\n#import \"STSimplePing.h\"\n\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <errno.h>\n#include <arpa/inet.h>\n\n\n#pragma mark * IPv4 and ICMPv4 On-The-Wire Format\n/*! Describes the on-the-wire header format for an IPv4 packet.\n *  \\details This defines the header structure of IPv4 packets on the wire.  We need\n *      this in order to skip this header in the IPv4 case, where the kernel passes\n *      it to us for no obvious reason.\n */\n\nstruct STIPv4Header {\n    uint8_t     versionAndHeaderLength;\n    uint8_t     differentiatedServices;\n    uint16_t    totalLength;\n    uint16_t    identification;\n    uint16_t    flagsAndFragmentOffset;\n    uint8_t     timeToLive;\n    uint8_t     protocol;\n    uint16_t    headerChecksum;\n    uint8_t     sourceAddress[4];\n    uint8_t     destinationAddress[4];\n    // options...\n    // data...\n};\ntypedef struct STIPv4Header STIPv4Header;\n\n__Check_Compile_Time(sizeof(STIPv4Header) == 20);\n__Check_Compile_Time(offsetof(STIPv4Header, versionAndHeaderLength) == 0);\n__Check_Compile_Time(offsetof(STIPv4Header, differentiatedServices) == 1);\n__Check_Compile_Time(offsetof(STIPv4Header, totalLength) == 2);\n__Check_Compile_Time(offsetof(STIPv4Header, identification) == 4);\n__Check_Compile_Time(offsetof(STIPv4Header, flagsAndFragmentOffset) == 6);\n__Check_Compile_Time(offsetof(STIPv4Header, timeToLive) == 8);\n__Check_Compile_Time(offsetof(STIPv4Header, protocol) == 9);\n__Check_Compile_Time(offsetof(STIPv4Header, headerChecksum) == 10);\n__Check_Compile_Time(offsetof(STIPv4Header, sourceAddress) == 12);\n__Check_Compile_Time(offsetof(STIPv4Header, destinationAddress) == 16);\n\n/*! Calculates an IP checksum.\n *  \\details This is the standard BSD checksum code, modified to use modern types.\n *  \\param buffer A pointer to the data to checksum.\n *  \\param bufferLen The length of that data.\n *  \\returns The checksum value, in network byte order.\n */\n\nstatic uint16_t st_in_cksum(const void *buffer, size_t bufferLen) {\n    // \n\tsize_t              bytesLeft;\n    int32_t             sum;\n\tconst uint16_t *    cursor;\n\tunion {\n\t\tuint16_t        us;\n\t\tuint8_t         uc[2];\n\t} last;\n\tuint16_t            answer;\n\n\tbytesLeft = bufferLen;\n\tsum = 0;\n\tcursor = buffer;\n\n\t/*\n\t * Our algorithm is simple, using a 32 bit accumulator (sum), we add\n\t * sequential 16 bit words to it, and at the end, fold back all the\n\t * carry bits from the top 16 bits into the lower 16 bits.\n\t */\n\twhile (bytesLeft > 1) {\n\t\tsum += *cursor;\n        cursor += 1;\n\t\tbytesLeft -= 2;\n\t}\n\n\t/* mop up an odd byte, if necessary */\n\tif (bytesLeft == 1) {\n\t\tlast.uc[0] = * (const uint8_t *) cursor;\n\t\tlast.uc[1] = 0;\n\t\tsum += last.us;\n\t}\n\n\t/* add back carry outs from top 16 bits to low 16 bits */\n\tsum = (sum >> 16) + (sum & 0xffff);\t/* add hi 16 to low 16 */\n\tsum += (sum >> 16);\t\t\t/* add carry */\n\tanswer = (uint16_t) ~sum;   /* truncate to 16 bits */\n\n\treturn answer;\n}\n\n#pragma mark * SimplePing\n\n@interface STSimplePing ()\n\n// read/write versions of public properties\n\n@property (nonatomic, copy,   readwrite, nullable) NSData *     hostAddress;\n@property (nonatomic, copy, readwrite, nullable) NSString *IPAddress;\n@property (nonatomic, assign, readwrite          ) uint16_t     nextSequenceNumber;\n\n// private properties\n\n/*! True if nextSequenceNumber has wrapped from 65535 to 0.\n */\n \n@property (nonatomic, assign, readwrite)           BOOL         nextSequenceNumberHasWrapped;\n\n/*! A host object for name-to-address resolution.\n */\n\n@property (nonatomic, strong, readwrite, nullable) CFHostRef host __attribute__ ((NSObject));\n\n/*! A socket object for ICMP send and receive.\n */\n\n@property (nonatomic, strong, readwrite, nullable) CFSocketRef socket __attribute__ ((NSObject));\n\n@property (nonatomic, strong) NSDate *pingStartDate;\n\n@end\n\n@implementation STSimplePing\n\n- (instancetype)initWithHostName:(NSString *)hostName {\n    NSParameterAssert(hostName != nil);\n    self = [super init];\n    if (self != nil) {\n        _hostName   = [hostName copy];\n        _identifier = (uint16_t) arc4random();\n    }\n    return self;\n}\n\n- (void)dealloc {\n    [self stop];\n    // Double check that -stop took care of _host and _socket.\n    assert(_host == NULL);\n    assert(_socket == NULL);\n}\n\n- (sa_family_t)hostAddressFamily {\n    sa_family_t     result;\n    \n    result = AF_UNSPEC;\n    if ( (self.hostAddress != nil) && (self.hostAddress.length >= sizeof(struct sockaddr)) ) {\n        result = ((const struct sockaddr *) self.hostAddress.bytes)->sa_family;\n    }\n    return result;\n}\n\n/*! Shuts down the pinger object and tell the delegate about the error.\n *  \\param error Describes the failure.\n */\n\n- (void)didFailWithError:(NSError *)error {\n    id<STSimplePingDelegate>  strongDelegate;\n    \n    assert(error != nil);\n    \n    // We retain ourselves temporarily because it's common for the delegate method \n    // to release its last reference to us, which causes -dealloc to be called here. \n    // If we then reference self on the return path, things go badly.  I don't think \n    // that happens currently, but I've got into the habit of doing this as a \n    // defensive measure.\n    \n    CFAutorelease( CFBridgingRetain( self ));\n    \n    [self stop];\n    strongDelegate = self.delegate;\n    if ( (strongDelegate != nil) && [strongDelegate respondsToSelector:@selector(st_simplePing:didFailWithError:)] ) {\n        [strongDelegate st_simplePing:self didFailWithError:error];\n    }\n}\n\n/*! Shuts down the pinger object and tell the delegate about the error.\n *  \\details This converts the CFStreamError to an NSError and then call through to \n *      -didFailWithError: to do the real work.\n *  \\param streamError Describes the failure.\n */\n\n- (void)didFailWithHostStreamError:(CFStreamError)streamError {\n    NSDictionary *  userInfo;\n    NSError *       error;\n\n    if (streamError.domain == kCFStreamErrorDomainNetDB) {\n        userInfo = @{(id) kCFGetAddrInfoFailureKey: @(streamError.error)};\n    } else {\n        userInfo = nil;\n    }\n    error = [NSError errorWithDomain:(NSString *) kCFErrorDomainCFNetwork code:kCFHostErrorUnknown userInfo:userInfo];\n\n    [self didFailWithError:error];\n}\n\n/*! Builds a ping packet from the supplied parameters.\n *  \\param type The packet type, which is different for IPv4 and IPv6.\n *  \\param payload Data to place after the ICMP header.\n *  \\param requiresChecksum Determines whether a checksum is calculated (IPv4) or not (IPv6).\n *  \\returns A ping packet suitable to be passed to the kernel.\n */\n\n- (NSData *)pingPacketWithType:(uint8_t)type payload:(NSData *)payload requiresChecksum:(BOOL)requiresChecksum {\n    NSMutableData *         packet;\n    STICMPHeader *            icmpPtr;\n\n    packet = [NSMutableData dataWithLength:sizeof(*icmpPtr) + payload.length];\n    assert(packet != nil);\n\n    icmpPtr = packet.mutableBytes;\n    icmpPtr->type = type;\n    icmpPtr->code = 0;\n    icmpPtr->checksum = 0;\n    icmpPtr->identifier     = OSSwapHostToBigInt16(self.identifier);\n    icmpPtr->sequenceNumber = OSSwapHostToBigInt16(self.nextSequenceNumber);\n    memcpy(&icmpPtr[1], [payload bytes], [payload length]);\n    \n    if (requiresChecksum) {\n        // The IP checksum routine returns a 16-bit number that's already in correct byte order \n        // (due to wacky 1's complement maths), so we just put it into the packet as a 16-bit unit.\n        \n        icmpPtr->checksum = st_in_cksum(packet.bytes, packet.length);\n    }\n    \n    return packet;\n}\n\n- (NSData *)packetWithPingData:(NSData *)data {\n    NSData *                payload;\n    NSData *                packet;\n    \n    // data may be nil\n    NSParameterAssert(self.hostAddress != nil);     // gotta wait for -simplePing:didStartWithAddress:\n    \n    // Construct the ping packet.\n    \n    payload = data;\n    if (payload == nil) {\n        payload = [[NSString stringWithFormat:@\"%28zd bottles of beer on the wall\", (ssize_t) 99 - (size_t) (self.nextSequenceNumber % 100) ] dataUsingEncoding:NSASCIIStringEncoding];\n        assert(payload != nil);\n        \n        // Our dummy payload is sized so that the resulting ICMP packet, including the ICMPHeader, is\n        // 64-bytes, which makes it easier to recognise our packets on the wire.\n        \n        assert([payload length] == 56);\n    }\n    \n    switch (self.hostAddressFamily) {\n        case AF_INET: {\n            packet = [self pingPacketWithType:STICMPv4TypeEchoRequest payload:payload requiresChecksum:YES];\n        } break;\n        case AF_INET6: {\n            packet = [self pingPacketWithType:STICMPv6TypeEchoRequest payload:payload requiresChecksum:NO];\n        } break;\n        default: {\n            assert(NO);\n        } break;\n    }\n    assert(packet != nil);\n    return packet;\n}\n\n- (void)sendPacket:(nonnull NSData *)packet {\n    int                     err;\n    ssize_t                 bytesSent;\n    id<STSimplePingDelegate>  strongDelegate;\n    // Send the packet.\n    \n    if (self.socket == NULL) {\n        bytesSent = -1;\n        err = EBADF;\n    } else {\n        self.pingStartDate = [NSDate date];\n        bytesSent = sendto(\n            CFSocketGetNative(self.socket),\n            packet.bytes,\n            packet.length, \n            0,\n            self.hostAddress.bytes, \n            (socklen_t) self.hostAddress.length\n        );\n        err = 0;\n        if (bytesSent < 0) {\n            err = errno;\n        }\n    }\n\n    // Handle the results of the send.\n    \n    strongDelegate = self.delegate;\n    if ( (bytesSent > 0) && (((NSUInteger) bytesSent) == packet.length) ) {\n\n        // Complete success.  Tell the client.\n\n        if ( (strongDelegate != nil) && [strongDelegate respondsToSelector:@selector(st_simplePing:didSendPacket:sequenceNumber:)] ) {\n            [strongDelegate st_simplePing:self didSendPacket:packet sequenceNumber:self.nextSequenceNumber];\n        }\n    } else {\n        NSError *   error;\n        \n        // Some sort of failure.  Tell the client.\n        if (err == 0) {\n            err = ENOBUFS;          // This is not a hugely descriptor error, alas.\n        }\n        error = [NSError errorWithDomain:NSPOSIXErrorDomain code:err userInfo:nil];\n        if ( (strongDelegate != nil) && [strongDelegate respondsToSelector:@selector(st_simplePing:didFailToSendPacket:sequenceNumber:error:)] ) {\n            [strongDelegate st_simplePing:self didFailToSendPacket:packet sequenceNumber:self.nextSequenceNumber error:error];\n        }\n    }\n    \n    self.nextSequenceNumber += 1;\n    if (self.nextSequenceNumber == 0) {\n        self.nextSequenceNumberHasWrapped = YES;\n    }\n}\n\n/*! Calculates the offset of the ICMP header within an IPv4 packet.\n *  \\details In the IPv4 case the kernel returns us a buffer that includes the \n *      IPv4 header.  We're not interested in that, so we have to skip over it. \n *      This code does a rough check of the IPv4 header and, if it looks OK, \n *      returns the offset of the ICMP header.\n *  \\param packet The IPv4 packet, as returned to us by the kernel.\n *  \\returns The offset of the ICMP header, or NSNotFound.\n */\n\n+ (NSUInteger)icmpHeaderOffsetInIPv4Packet:(NSData *)packet timeToLive:(NSInteger *)timeToLive {\n    // Returns the offset of the ICMPv4Header within an IP packet.\n    NSUInteger                  result;\n    const struct STIPv4Header *   ipPtr;\n    size_t                      ipHeaderLength;\n    \n    result = NSNotFound;\n    if (packet.length >= (sizeof(STIPv4Header) + sizeof(STICMPHeader))) {\n        ipPtr = (const STIPv4Header *) packet.bytes;\n        if ( ((ipPtr->versionAndHeaderLength & 0xF0) == 0x40) &&            // IPv4\n             ( ipPtr->protocol == IPPROTO_ICMP ) ) {\n            ipHeaderLength = (ipPtr->versionAndHeaderLength & 0x0F) * sizeof(uint32_t);\n            if (packet.length >= (ipHeaderLength + sizeof(STICMPHeader))) {\n                result = ipHeaderLength;\n            }\n        }\n        if (timeToLive) {\n            *timeToLive = ipPtr->timeToLive;\n        }\n    }\n    return result;\n}\n\n/*! Checks whether the specified sequence number is one we sent.\n *  \\param sequenceNumber The incoming sequence number.\n *  \\returns YES if the sequence number looks like one we sent.\n */\n \n- (BOOL)validateSequenceNumber:(uint16_t)sequenceNumber {\n    if (self.nextSequenceNumberHasWrapped) {\n        // If the sequence numbers have wrapped that we can't reliably check \n        // whether this is a sequence number we sent.  Rather, we check to see \n        // whether the sequence number is within the last 120 sequence numbers \n        // we sent.  Note that the uint16_t subtraction here does the right \n        // thing regardless of the wrapping.\n        // \n        // Why 120?  Well, if we send one ping per second, 120 is 2 minutes, which \n        // is the standard \"max time a packet can bounce around the Internet\" value.\n        return ((uint16_t) (self.nextSequenceNumber - sequenceNumber)) < (uint16_t) 120;\n    } else {\n        return sequenceNumber < self.nextSequenceNumber;\n    }\n}\n\n/*! Checks whether an incoming IPv4 packet looks like a ping response.\n *  \\details This routine modifies this `packet` data!  It does this for two reasons:\n *\n *      * It needs to zero out the `checksum` field of the ICMPHeader in order to do \n *          its checksum calculation.\n *\n *      * It removes the IPv4 header from the front of the packet.\n *  \\param packet The IPv4 packet, as returned to us by the kernel.\n *  \\param sequenceNumberPtr A pointer to a place to start the ICMP sequence number.\n *  \\returns YES if the packet looks like a reasonable IPv4 ping response.\n */\n\n- (BOOL)validatePing4ResponsePacket:(NSMutableData *)packet sequenceNumber:(uint16_t *)sequenceNumberPtr timeToLive:(NSInteger *)timeToLive {\n    BOOL                result;\n    NSUInteger          icmpHeaderOffset;\n    STICMPHeader *        icmpPtr;\n    uint16_t            receivedChecksum;\n    uint16_t            calculatedChecksum;\n    \n    result = NO;\n    \n    icmpHeaderOffset = [[self class] icmpHeaderOffsetInIPv4Packet:packet timeToLive:timeToLive];\n    if (icmpHeaderOffset != NSNotFound) {\n        icmpPtr = (struct STICMPHeader *) (((uint8_t *) packet.mutableBytes) + icmpHeaderOffset);\n        receivedChecksum   = icmpPtr->checksum;\n        icmpPtr->checksum  = 0;\n        calculatedChecksum = st_in_cksum(icmpPtr, packet.length - icmpHeaderOffset);\n        icmpPtr->checksum  = receivedChecksum;\n        \n        if (receivedChecksum == calculatedChecksum) {\n            if ( (icmpPtr->type == STICMPv4TypeEchoReply) && (icmpPtr->code == 0) ) {\n                if ( OSSwapBigToHostInt16(icmpPtr->identifier) == self.identifier ) {\n                    uint16_t    sequenceNumber;\n                    \n                    sequenceNumber = OSSwapBigToHostInt16(icmpPtr->sequenceNumber);\n                    if ([self validateSequenceNumber:sequenceNumber]) {\n\n                        // Remove the IPv4 header off the front of the data we received, leaving us with \n                        // just the ICMP header and the ping payload.\n                        [packet replaceBytesInRange:NSMakeRange(0, icmpHeaderOffset) withBytes:NULL length:0];\n\n                        *sequenceNumberPtr = sequenceNumber;\n                        result = YES;\n                    }\n                }\n            }\n        }\n    }\n\n    return result;\n}\n\n/*! Checks whether an incoming IPv6 packet looks like a ping response.\n *  \\param packet The IPv6 packet, as returned to us by the kernel; note that this routine\n *      could modify this data but does not need to in the IPv6 case.\n *  \\param sequenceNumberPtr A pointer to a place to start the ICMP sequence number.\n *  \\returns YES if the packet looks like a reasonable IPv4 ping response.\n */\n\n- (BOOL)validatePing6ResponsePacket:(NSMutableData *)packet sequenceNumber:(uint16_t *)sequenceNumberPtr {\n    BOOL                    result;\n    const STICMPHeader *      icmpPtr;\n    \n    result = NO;\n    \n    if (packet.length >= sizeof(*icmpPtr)) {\n        icmpPtr = packet.bytes;\n        \n        // In the IPv6 case we don't check the checksum because that's hard (we need to \n        // cook up an IPv6 pseudo header and we don't have the ingredients) and unnecessary \n        // (the kernel has already done this check).\n        \n        if ( (icmpPtr->type == STICMPv6TypeEchoReply) && (icmpPtr->code == 0) ) {\n            if ( OSSwapBigToHostInt16(icmpPtr->identifier) == self.identifier ) {\n                uint16_t    sequenceNumber;\n                \n                sequenceNumber = OSSwapBigToHostInt16(icmpPtr->sequenceNumber);\n                if ([self validateSequenceNumber:sequenceNumber]) {\n                    *sequenceNumberPtr = sequenceNumber;\n                    result = YES;\n                }\n            }\n        }\n    }\n    return result;\n}\n\n/*! Checks whether an incoming packet looks like a ping response.\n *  \\param packet The packet, as returned to us by the kernel; note that may end up modifying \n *      this data.\n *  \\param sequenceNumberPtr A pointer to a place to start the ICMP sequence number.\n *  \\returns YES if the packet looks like a reasonable IPv4 ping response.\n */\n\n- (BOOL)validatePingResponsePacket:(NSMutableData *)packet sequenceNumber:(uint16_t *)sequenceNumberPtr timeToLive:(NSInteger *)timeToLive {\n    BOOL        result;\n    \n    switch (self.hostAddressFamily) {\n        case AF_INET: {\n            result = [self validatePing4ResponsePacket:packet sequenceNumber:sequenceNumberPtr timeToLive:timeToLive];\n        } break;\n        case AF_INET6: {\n            result = [self validatePing6ResponsePacket:packet sequenceNumber:sequenceNumberPtr];\n        } break;\n        default: {\n            assert(NO);\n            result = NO;\n        } break;\n    }\n    return result;\n}\n\n/*! Reads data from the ICMP socket.\n *  \\details Called by the socket handling code (SocketReadCallback) to process an ICMP \n *      message waiting on the socket.\n */\n\n- (void)readData {\n    int                     err;\n    struct sockaddr_storage addr;\n    socklen_t               addrLen;\n    ssize_t                 bytesRead;\n    void *                  buffer;\n    enum { kBufferSize = 65535 };\n\n    // 65535 is the maximum IP packet size, which seems like a reasonable bound \n    // here (plus it's what <x-man-page://8/ping> uses).\n    \n    buffer = malloc(kBufferSize);\n    assert(buffer != NULL);\n    \n    // Actually read the data.  We use recvfrom(), and thus get back the source address, \n    // but we don't actually do anything with it.  It would be trivial to pass it to \n    // the delegate but we don't need it in this example.\n    \n    addrLen = sizeof(addr);\n    bytesRead = recvfrom(CFSocketGetNative(self.socket), buffer, kBufferSize, 0, (struct sockaddr *) &addr, &addrLen);\n    err = 0;\n    if (bytesRead < 0) {\n        err = errno;\n    }\n    \n    // Process the data we read.\n    \n    if (bytesRead > 0) {\n        NSMutableData *         packet;\n        id<STSimplePingDelegate>  strongDelegate;\n        uint16_t                sequenceNumber;\n        NSInteger timeToLive = 0;\n\n        packet = [NSMutableData dataWithBytes:buffer length:(NSUInteger) bytesRead];\n        assert(packet != nil);\n\n        // We got some data, pass it up to our client.\n\n        strongDelegate = self.delegate;\n        if ( [self validatePingResponsePacket:packet sequenceNumber:&sequenceNumber timeToLive:&timeToLive] ) {\n            if ( (strongDelegate != nil) && [strongDelegate respondsToSelector:@selector(st_simplePing:didReceivePingResponsePacket:timeToLive:sequenceNumber:timeElapsed:)] ) {\n                NSTimeInterval timeElapsed = [[NSDate date] timeIntervalSinceDate:self.pingStartDate];\n                [strongDelegate st_simplePing:self didReceivePingResponsePacket:packet timeToLive:timeToLive sequenceNumber:sequenceNumber timeElapsed:timeElapsed];\n            }\n        } else {\n            if ( (strongDelegate != nil) && [strongDelegate respondsToSelector:@selector(st_simplePing:didReceiveUnexpectedPacket:)] ) {\n                [strongDelegate st_simplePing:self didReceiveUnexpectedPacket:packet];\n            }\n        }\n    } else {\n    \n        // We failed to read the data, so shut everything down.\n        \n        if (err == 0) {\n            err = EPIPE;\n        }\n        [self didFailWithError:[NSError errorWithDomain:NSPOSIXErrorDomain code:err userInfo:nil]];\n    }\n    \n    free(buffer);\n    \n    // Note that we don't loop back trying to read more data.  Rather, we just \n    // let CFSocket call us again.\n}\n\n/*! The callback for our CFSocket object.\n *  \\details This simply routes the call to our `-readData` method.\n *  \\param s See the documentation for CFSocketCallBack.\n *  \\param type See the documentation for CFSocketCallBack.\n *  \\param address See the documentation for CFSocketCallBack.\n *  \\param data See the documentation for CFSocketCallBack.\n *  \\param info See the documentation for CFSocketCallBack; this is actually a pointer to the \n *      'owning' object.\n */\n\nstatic void STSocketReadCallback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) {\n    // This C routine is called by CFSocket when there's data waiting on our \n    // ICMP socket.  It just redirects the call to Objective-C code.\n    STSimplePing *    obj;\n    \n    obj = (__bridge STSimplePing *) info;\n    assert([obj isKindOfClass:[STSimplePing class]]);\n    \n    #pragma unused(s)\n    assert(s == obj.socket);\n    #pragma unused(type)\n    assert(type == kCFSocketReadCallBack);\n    #pragma unused(address)\n    assert(address == nil);\n    #pragma unused(data)\n    assert(data == nil);\n    \n    [obj readData];\n}\n\n/*! Starts the send and receive infrastructure.\n *  \\details This is called once we've successfully resolved `hostName` in to \n *      `hostAddress`.  It's responsible for setting up the socket for sending and \n *      receiving pings.\n */\n\n- (void)startWithHostAddress {\n    int                     err;\n    int                     fd;\n\n    assert(self.hostAddress != nil);\n\n    // Open the socket.\n    \n    fd = -1;\n    err = 0;\n    switch (self.hostAddressFamily) {\n        case AF_INET: {\n            fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);\n            if (fd < 0) {\n                err = errno;\n            }\n        } break;\n        case AF_INET6: {\n            fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6);\n            if (fd < 0) {\n                err = errno;\n            }\n        } break;\n        default: {\n            err = EPROTONOSUPPORT;\n        } break;\n    }\n    \n    if (err != 0) {\n        [self didFailWithError:[NSError errorWithDomain:NSPOSIXErrorDomain code:err userInfo:nil]];\n    } else {\n        CFSocketContext         context = {0, (__bridge void *)(self), NULL, NULL, NULL};\n        CFRunLoopSourceRef      rls;\n        id<STSimplePingDelegate>  strongDelegate;\n        \n        // Wrap it in a CFSocket and schedule it on the runloop.\n        \n        self.socket = (CFSocketRef) CFAutorelease( CFSocketCreateWithNative(NULL, fd, kCFSocketReadCallBack, STSocketReadCallback, &context) );\n        assert(self.socket != NULL);\n        \n        // The socket will now take care of cleaning up our file descriptor.\n        \n        assert( CFSocketGetSocketFlags(self.socket) & kCFSocketCloseOnInvalidate );\n        fd = -1;\n        \n        rls = CFSocketCreateRunLoopSource(NULL, self.socket, 0);\n        assert(rls != NULL);\n        \n        CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);\n        \n        CFRelease(rls);\n\n        strongDelegate = self.delegate;\n        if ( (strongDelegate != nil) && [strongDelegate respondsToSelector:@selector(st_simplePing:didStartWithAddress:)] ) {\n            [strongDelegate st_simplePing:self didStartWithAddress:self.hostAddress];\n        }\n    }\n    assert(fd == -1);\n}\n\n/*! Processes the results of our name-to-address resolution.\n *  \\details Called by our CFHost resolution callback (HostResolveCallback) when host \n *      resolution is complete.  We just latch the first appropriate address and kick \n *      off the send and receive infrastructure.\n */\n\n- (void)hostResolutionDone {\n    Boolean     resolved;\n    NSArray *   addresses;\n    \n    // Find the first appropriate address.\n    \n    addresses = (__bridge NSArray *) CFHostGetAddressing(self.host, &resolved);\n    if ( resolved && (addresses != nil) ) {\n        resolved = false;\n        for (NSData * address in addresses) {\n            const struct sockaddr * addrPtr;\n            \n            addrPtr = (const struct sockaddr *) address.bytes;\n            if ( address.length >= sizeof(struct sockaddr) ) {\n                char *s = NULL;\n                switch (addrPtr->sa_family) {\n                    case AF_INET: {\n                        struct sockaddr_in *addr_in = (struct sockaddr_in *)addrPtr;\n                        s = malloc(INET_ADDRSTRLEN);\n                        inet_ntop(AF_INET, &(addr_in->sin_addr), s, INET_ADDRSTRLEN);\n                        self.IPAddress = [NSString stringWithFormat:@\"%s\", s];\n                        if (self.addressStyle != STSimplePingAddressStyleICMPv6) {\n                            self.hostAddress = address;\n                            resolved = true;\n                        }\n                    } break;\n                    case AF_INET6: {\n                        struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addrPtr;\n                        s = malloc(INET6_ADDRSTRLEN);\n                        inet_ntop(AF_INET6, &(addr_in6->sin6_addr), s, INET6_ADDRSTRLEN);\n                        self.IPAddress = [NSString stringWithFormat:@\"%s\", s];\n                        if (self.addressStyle != STSimplePingAddressStyleICMPv4) {\n                            self.hostAddress = address;\n                            resolved = true;\n                        }\n                    } break;\n                }\n            }\n            if (resolved) {\n                break;\n            }\n        }\n    }\n\n    // We're done resolving, so shut that down.\n    \n    [self stopHostResolution];\n    \n    // If all is OK, start the send and receive infrastructure, otherwise stop.\n    \n    if (resolved) {\n        [self startWithHostAddress];\n    } else {\n        [self didFailWithError:[NSError errorWithDomain:(NSString *)kCFErrorDomainCFNetwork code:kCFHostErrorHostNotFound userInfo:nil]];\n    }\n}\n\n/*! The callback for our CFHost object.\n *  \\details This simply routes the call to our `-hostResolutionDone` or \n *      `-didFailWithHostStreamError:` methods.\n *  \\param theHost See the documentation for CFHostClientCallBack.\n *  \\param typeInfo See the documentation for CFHostClientCallBack.\n *  \\param error See the documentation for CFHostClientCallBack.\n *  \\param info See the documentation for CFHostClientCallBack; this is actually a pointer to \n *      the 'owning' object.\n */\n\nstatic void STHostResolveCallback(CFHostRef theHost, CFHostInfoType typeInfo, const CFStreamError *error, void *info) {\n    // This C routine is called by CFHost when the host resolution is complete. \n    // It just redirects the call to the appropriate Objective-C method.\n    STSimplePing *    obj;\n\n    obj = (__bridge STSimplePing *) info;\n    assert([obj isKindOfClass:[STSimplePing class]]);\n    \n    #pragma unused(theHost)\n    assert(theHost == obj.host);\n    #pragma unused(typeInfo)\n    assert(typeInfo == kCFHostAddresses);\n    \n    if ( (error != NULL) && (error->domain != 0) ) {\n        [obj didFailWithHostStreamError:*error];\n    } else {\n        [obj hostResolutionDone];\n    }\n}\n\n- (void)start {\n    Boolean             success;\n    CFHostClientContext context = {0, (__bridge void *)(self), NULL, NULL, NULL};\n    CFStreamError       streamError;\n    \n    assert(self.host == NULL);\n    assert(self.hostAddress == nil);\n\n    self.host = (CFHostRef) CFAutorelease( CFHostCreateWithName(NULL, (__bridge CFStringRef) self.hostName) );\n    assert(self.host != NULL);\n    \n    CFHostSetClient(self.host, STHostResolveCallback, &context);\n    \n    CFHostScheduleWithRunLoop(self.host, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);\n    \n    success = CFHostStartInfoResolution(self.host, kCFHostAddresses, &streamError);\n    if ( ! success ) {\n        [self didFailWithHostStreamError:streamError];\n    }\n}\n\n/*! Stops the name-to-address resolution infrastructure.\n */\n\n- (void)stopHostResolution {\n    // Shut down the CFHost.\n    if (self.host != NULL) {\n        CFHostSetClient(self.host, NULL, NULL);\n        CFHostUnscheduleFromRunLoop(self.host, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);\n        self.host = NULL;\n    }\n}\n\n/*! Stops the send and receive infrastructure.\n */\n\n- (void)stopSocket {\n    if (self.socket != NULL) {\n        CFSocketInvalidate(self.socket);\n        self.socket = NULL;\n    }\n}\n\n- (void)stop {\n    [self stopHostResolution];\n    [self stopSocket];\n    \n    // Junk the host address on stop.  If the client calls -start again, we'll \n    // re-resolve the host name.\n    self.IPAddress = nil;\n    self.hostAddress = NULL;\n}\n\n@end\n"
  },
  {
    "path": "STPingTest/Classes/STDDebugPingViewController.h",
    "content": "//\n//  STDDebugPingViewController.h\n//  STKitDemo\n//\n//  Created by SunJiangting on 15-3-9.\n//  Copyright (c) 2015年 SunJiangting. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface STDDebugPingViewController : UIViewController\n\n@end\n"
  },
  {
    "path": "STPingTest/Classes/STDDebugPingViewController.m",
    "content": "//\n//  STDDebugPingViewController.m\n//  STKitDemo\n//\n//  Created by SunJiangting on 15-3-9.\n//  Copyright (c) 2015年 SunJiangting. All rights reserved.\n//\n\n#import \"STDDebugPingViewController.h\"\n#import \"STDebugFoundation.h\"\n#import \"STDPingServices.h\"\n\n@interface STDDebugPingViewController ()\n\n@property(nonatomic, strong) UITextField        *textField;\n@property(nonatomic, strong) STDebugTextView    *textView;\n@property(nonatomic, strong) STDPingServices    *pingServices;\n\n@end\n\n@implementation STDDebugPingViewController\n\n- (void)dealloc {\n    [self.pingServices cancel];\n}\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    // Do any additional setup after loading the view.\n    self.navigationItem.title = @\"Ping网络\";\n    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@\"Clear\" style:UIBarButtonItemStylePlain target:self action:@selector(_clearDebugViewActionFired:)];\n    if ([UIViewController instancesRespondToSelector:@selector(setEdgesForExtendedLayout:)]) {\n        self.edgesForExtendedLayout  = UIRectEdgeNone;\n    }\n    self.view.backgroundColor = [UIColor whiteColor];\n    \n    self.textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, CGRectGetWidth(self.view.frame) - 100, 30)];\n    self.textField.borderStyle = UITextBorderStyleRoundedRect;\n    self.textField.placeholder = @\"请输入IP地址或者域名\";\n    self.textField.text = @\"suenblog.duapp.com\";\n    [self.view addSubview:self.textField];\n    \n    UIButton *goButton = [UIButton buttonWithType:UIButtonTypeCustom];\n    goButton.frame = CGRectMake(CGRectGetMaxX(self.textField.frame) + 10, 10, 60, 30);\n    [goButton setTitle:@\"Ping\" forState:UIControlStateNormal];\n    [goButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];\n    [goButton addTarget:self action:@selector(_pingActionFired:) forControlEvents:UIControlEventTouchUpInside];\n    goButton.tag = 10001;\n    [self.view addSubview:goButton];\n    \n    self.textView = [[STDebugTextView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.textField.frame) + 10, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - CGRectGetMaxY(self.textField.frame) - 10)];\n    self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n    self.textView.editable = NO;\n    [self.view addSubview:self.textView];\n}\n\n- (void)_clearDebugViewActionFired:(id)sender {\n    self.textView.text = nil;\n}\n\n- (void)_pingActionFired:(UIButton *)button {\n    //    [SimplePingHelper ping:self.textField.text target:self sel:@selector(_pingCallback:)];\n    [self.textField resignFirstResponder];\n    if (button.tag == 10001) {\n        __weak STDDebugPingViewController *weakSelf = self;\n        [button setTitle:@\"Stop\" forState:UIControlStateNormal];\n        button.tag = 10002;\n        self.pingServices = [STDPingServices startPingAddress:self.textField.text callbackHandler:^(STDPingItem *pingItem, NSArray *pingItems) {\n            if (pingItem.status != STDPingStatusFinished) {\n                [weakSelf.textView appendText:pingItem.description];\n            } else {\n                [weakSelf.textView appendText:[STDPingItem statisticsWithPingItems:pingItems]];\n                [button setTitle:@\"Ping\" forState:UIControlStateNormal];\n                button.tag = 10001;\n                weakSelf.pingServices = nil;\n            }\n        }];\n    } else {\n        [self.pingServices cancel];\n    }\n    \n}\n\n- (void)didReceiveMemoryWarning {\n    [super didReceiveMemoryWarning];\n    // Dispose of any resources that can be recreated.\n}\n\n@end\n"
  },
  {
    "path": "STPingTest/Classes/STDPingServices.h",
    "content": "//\n//  STDPingServices.h\n//  STKitDemo\n//\n//  Created by SunJiangting on 15-3-9.\n//  Copyright (c) 2015年 SunJiangting. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <CoreGraphics/CoreGraphics.h>\n#import \"STSimplePing.h\"\n\ntypedef NS_ENUM(NSInteger, STDPingStatus) {\n    STDPingStatusDidStart,\n    STDPingStatusDidFailToSendPacket,\n    STDPingStatusDidReceivePacket,\n    STDPingStatusDidReceiveUnexpectedPacket,\n    STDPingStatusDidTimeout,\n    STDPingStatusError,\n    STDPingStatusFinished,\n};\n\n@interface STDPingItem : NSObject\n\n@property(nonatomic) NSString *originalAddress;\n@property(nonatomic, copy) NSString *IPAddress;\n\n@property(nonatomic) NSUInteger dateBytesLength;\n@property(nonatomic) double     timeMilliseconds;\n@property(nonatomic) NSInteger  timeToLive;\n@property(nonatomic) NSInteger  ICMPSequence;\n\n@property(nonatomic) STDPingStatus status;\n\n+ (NSString *)statisticsWithPingItems:(NSArray *)pingItems;\n\n@end\n\n@interface STDPingServices : NSObject\n\n/// 超时时间, default 500ms\n@property(nonatomic) double timeoutMilliseconds;\n\n+ (STDPingServices *)startPingAddress:(NSString *)address\n                      callbackHandler:(void(^)(STDPingItem *pingItem, NSArray *pingItems))handler;\n\n@property(nonatomic) NSInteger  maximumPingTimes;\n- (void)cancel;\n\n@end\n"
  },
  {
    "path": "STPingTest/Classes/STDPingServices.m",
    "content": "//\n//  STDPingServices.m\n//  STKitDemo\n//\n//  Created by SunJiangting on 15-3-9.\n//  Copyright (c) 2015年 SunJiangting. All rights reserved.\n//\n\n#import \"STDPingServices.h\"\n\n@implementation STDPingItem\n\n- (NSString *)description {\n    switch (self.status) {\n        case STDPingStatusDidStart:\n            return [NSString stringWithFormat:@\"PING %@ (%@): %ld data bytes\",self.originalAddress, self.IPAddress, (long)self.dateBytesLength];\n        case STDPingStatusDidReceivePacket:\n            return [NSString stringWithFormat:@\"%ld bytes from %@: icmp_seq=%ld ttl=%ld time=%.3f ms\", (long)self.dateBytesLength, self.IPAddress, (long)self.ICMPSequence, (long)self.timeToLive, self.timeMilliseconds];\n        case STDPingStatusDidTimeout:\n            return [NSString stringWithFormat:@\"Request timeout for icmp_seq %ld\", (long)self.ICMPSequence];\n        case STDPingStatusDidFailToSendPacket:\n            return [NSString stringWithFormat:@\"Fail to send packet to %@: icmp_seq=%ld\", self.IPAddress, (long)self.ICMPSequence];\n        case STDPingStatusDidReceiveUnexpectedPacket:\n            return [NSString stringWithFormat:@\"Receive unexpected packet from %@: icmp_seq=%ld\", self.IPAddress, (long)self.ICMPSequence];\n        case STDPingStatusError:\n            return [NSString stringWithFormat:@\"Can not ping to %@\", self.originalAddress];\n        default:\n            break;\n    }\n    if (self.status == STDPingStatusDidReceivePacket) {\n    }\n    return super.description;\n}\n\n+ (NSString *)statisticsWithPingItems:(NSArray *)pingItems {\n    //    --- ping statistics ---\n    //    5 packets transmitted, 5 packets received, 0.0% packet loss\n    //    round-trip min/avg/max/stddev = 4.445/9.496/12.210/2.832 ms\n    NSString *address = [pingItems.firstObject originalAddress];\n    __block NSInteger receivedCount = 0, allCount = 0;\n    [pingItems enumerateObjectsUsingBlock:^(STDPingItem *obj, NSUInteger idx, BOOL *stop) {\n        if (obj.status != STDPingStatusFinished && obj.status != STDPingStatusError) {\n            allCount ++;\n            if (obj.status == STDPingStatusDidReceivePacket) {\n                receivedCount ++;\n            }\n        }\n    }];\n    \n    NSMutableString *description = [NSMutableString stringWithCapacity:50];\n    [description appendFormat:@\"--- %@ ping statistics ---\\n\", address];\n    \n    CGFloat lossPercent = (CGFloat)(allCount - receivedCount) / MAX(1.0, allCount) * 100;\n    [description appendFormat:@\"%ld packets transmitted, %ld packets received, %.1f%% packet loss\\n\", (long)allCount, (long)receivedCount, lossPercent];\n    return [description stringByReplacingOccurrencesOfString:@\".0%\" withString:@\"%\"];\n}\n@end\n\n@interface STDPingServices () <STSimplePingDelegate> {\n    BOOL _hasStarted;\n    BOOL _isTimeout;\n    NSInteger   _repingTimes;\n    NSInteger   _sequenceNumber;\n    NSMutableArray *_pingItems;\n}\n\n@property(nonatomic, copy)   NSString   *address;\n@property(nonatomic, strong) STSimplePing *simplePing;\n\n@property(nonatomic, strong)void(^callbackHandler)(STDPingItem *item, NSArray *pingItems);\n\n@end\n\n@implementation STDPingServices\n\n+ (STDPingServices *)startPingAddress:(NSString *)address\n                      callbackHandler:(void(^)(STDPingItem *item, NSArray *pingItems))handler {\n    STDPingServices *services = [[STDPingServices alloc] initWithAddress:address];\n    services.callbackHandler = handler;\n    [services startPing];\n    return services;\n}\n\n- (instancetype)initWithAddress:(NSString *)address {\n    self = [super init];\n    if (self) {\n        self.timeoutMilliseconds = 500;\n        self.maximumPingTimes = 100;\n        self.address = address;\n        self.simplePing = [[STSimplePing alloc] initWithHostName:address];\n        self.simplePing.addressStyle = STSimplePingAddressStyleAny;\n        self.simplePing.delegate = self;\n        _pingItems = [NSMutableArray arrayWithCapacity:10];\n    }\n    return self;\n}\n\n- (void)startPing {\n    _repingTimes = 0;\n    _hasStarted = NO;\n    [_pingItems removeAllObjects];\n    [self.simplePing start];\n}\n\n- (void)reping {\n    [self.simplePing stop];\n    [self.simplePing start];\n}\n\n- (void)_timeoutActionFired {\n    STDPingItem *pingItem = [[STDPingItem alloc] init];\n    pingItem.ICMPSequence = _sequenceNumber;\n    pingItem.originalAddress = self.address;\n    pingItem.status = STDPingStatusDidTimeout;\n    [self.simplePing stop];\n    [self _handlePingItem:pingItem];\n}\n\n- (void)_handlePingItem:(STDPingItem *)pingItem {\n    if (pingItem.status == STDPingStatusDidReceivePacket || pingItem.status == STDPingStatusDidTimeout) {\n        [_pingItems addObject:pingItem];\n    }\n    if (_repingTimes < self.maximumPingTimes - 1) {\n        if (self.callbackHandler) {\n            self.callbackHandler(pingItem, [_pingItems copy]);\n        }\n        _repingTimes ++;\n        NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(reping) userInfo:nil repeats:NO];\n        [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];\n    } else {\n        if (self.callbackHandler) {\n            self.callbackHandler(pingItem, [_pingItems copy]);\n        }\n        [self cancel];\n    }\n}\n\n- (void)cancel {\n    [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(_timeoutActionFired) object:nil];\n    [self.simplePing stop];\n    STDPingItem *pingItem = [[STDPingItem alloc] init];\n    pingItem.status = STDPingStatusFinished;\n    [_pingItems addObject:pingItem];\n    if (self.callbackHandler) {\n        self.callbackHandler(pingItem, [_pingItems copy]);\n    }\n}\n\n- (void)st_simplePing:(STSimplePing *)pinger didStartWithAddress:(NSData *)address {\n    NSData *packet = [pinger packetWithPingData:nil];\n    if (!_hasStarted) {\n        STDPingItem *pingItem = [[STDPingItem alloc] init];\n        pingItem.IPAddress = pinger.IPAddress;\n        pingItem.originalAddress = self.address;\n        pingItem.dateBytesLength = packet.length - sizeof(STICMPHeader);\n        pingItem.status = STDPingStatusDidStart;\n        if (self.callbackHandler) {\n            self.callbackHandler(pingItem, nil);\n        }\n        _hasStarted = YES;\n    }\n    [pinger sendPacket:packet];\n    [self performSelector:@selector(_timeoutActionFired) withObject:nil afterDelay:self.timeoutMilliseconds / 1000.0];\n}\n\n// If this is called, the SimplePing object has failed.  By the time this callback is\n// called, the object has stopped (that is, you don't need to call -stop yourself).\n\n// IMPORTANT: On the send side the packet does not include an IP header.\n// On the receive side, it does.  In that case, use +[SimplePing icmpInPacket:]\n// to find the ICMP header within the packet.\n\n- (void)st_simplePing:(STSimplePing *)pinger didSendPacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber {\n    _sequenceNumber = sequenceNumber;\n}\n\n- (void)st_simplePing:(STSimplePing *)pinger didFailToSendPacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber error:(NSError *)error {\n    [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(_timeoutActionFired) object:nil];\n    _sequenceNumber = sequenceNumber;\n    STDPingItem *pingItem = [[STDPingItem alloc] init];\n    pingItem.ICMPSequence = _sequenceNumber;\n    pingItem.originalAddress = self.address;\n    pingItem.status = STDPingStatusDidFailToSendPacket;\n    [self _handlePingItem:pingItem];\n}\n\n- (void)st_simplePing:(STSimplePing *)pinger didReceiveUnexpectedPacket:(NSData *)packet {\n    [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(_timeoutActionFired) object:nil];\n    STDPingItem *pingItem = [[STDPingItem alloc] init];\n    pingItem.ICMPSequence = _sequenceNumber;\n    pingItem.originalAddress = self.address;\n    pingItem.status = STDPingStatusDidReceiveUnexpectedPacket;\n//    [self _handlePingItem:pingItem];\n}\n\n- (void)st_simplePing:(STSimplePing *)pinger didReceivePingResponsePacket:(NSData *)packet timeToLive:(NSInteger)timeToLive sequenceNumber:(uint16_t)sequenceNumber timeElapsed:(NSTimeInterval)timeElapsed {\n    [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(_timeoutActionFired) object:nil];\n    STDPingItem *pingItem = [[STDPingItem alloc] init];\n    pingItem.IPAddress = pinger.IPAddress;\n    pingItem.dateBytesLength = packet.length;\n    pingItem.timeToLive = timeToLive;\n    pingItem.timeMilliseconds = timeElapsed * 1000;\n    pingItem.ICMPSequence = sequenceNumber;\n    pingItem.originalAddress = self.address;\n    pingItem.status = STDPingStatusDidReceivePacket;\n    [self _handlePingItem:pingItem];\n}\n\n- (void)st_simplePing:(STSimplePing *)pinger didFailWithError:(NSError *)error {\n    [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(_timeoutActionFired) object:nil];\n    [self.simplePing stop];\n    \n    STDPingItem *errorPingItem = [[STDPingItem alloc] init];\n    errorPingItem.originalAddress = self.address;\n    errorPingItem.status = STDPingStatusError;\n    if (self.callbackHandler) {\n        self.callbackHandler(errorPingItem, [_pingItems copy]);\n    }\n    \n    STDPingItem *pingItem = [[STDPingItem alloc] init];\n    pingItem.originalAddress = self.address;\n    pingItem.IPAddress = pinger.IPAddress ?: pinger.hostName;\n    [_pingItems addObject:pingItem];\n    pingItem.status = STDPingStatusFinished;\n    if (self.callbackHandler) {\n        self.callbackHandler(pingItem, [_pingItems copy]);\n    }\n}\n@end\n"
  },
  {
    "path": "STPingTest/Classes/STDebugFoundation.h",
    "content": "//\n//  STDebugFoundation.h\n//  STKitDemo\n//\n//  Created by SunJiangting on 15-3-9.\n//  Copyright (c) 2015年 SunJiangting. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\n@interface STDebugTextView : UITextView\n\n- (void)appendText:(NSString *)text;\n\n@end"
  },
  {
    "path": "STPingTest/Classes/STDebugFoundation.m",
    "content": "//\n//  STDebugFoundation.m\n//  STKitDemo\n//\n//  Created by SunJiangting on 15-3-9.\n//  Copyright (c) 2015年 SunJiangting. All rights reserved.\n//\n\n#import \"STDebugFoundation.h\"\n\n@implementation STDebugTextView\n\n- (instancetype)initWithFrame:(CGRect)frame {\n    self = [super initWithFrame:frame];\n    if (self) {\n        self.backgroundColor = [UIColor blackColor];\n        self.textColor = [UIColor greenColor];\n        if ([self respondsToSelector:@selector(layoutManager)]) {\n            self.layoutManager.allowsNonContiguousLayout = NO;\n        }\n        self.font = [UIFont systemFontOfSize:14];\n        self.editable = NO;\n    }\n    return self;\n}\n\n- (void)appendText:(NSString *)text {\n    if (text.length == 0) {\n        return;\n    }\n    if (self.text.length == 0) {\n        self.text = text;\n    } else {\n        self.text = [NSString stringWithFormat:@\"%@\\n%@\" , self.text, text];\n        [self scrollToBottomAnimated:YES];\n    }\n}\n\n- (void)scrollToBottomAnimated:(BOOL)animated {\n    [self scrollRangeToVisible:NSMakeRange(self.text.length, 0)];\n}\n\n- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {\n    NSString *selectorName = NSStringFromSelector(action);\n    return [selectorName hasPrefix:@\"copy\"] || [selectorName hasPrefix:@\"select\"];\n}\n\n@end\n"
  },
  {
    "path": "STPingTest/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "STPingTest/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSApplicationCategoryType</key>\n\t<string></string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "STPingTest/STPAppDelegate.h",
    "content": "//\n//  STPAppDelegate.h\n//  STPingTest\n//\n//  Created by SunJiangting on 15-3-19.\n//  Copyright (c) 2015年 Suen. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface STPAppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (strong, nonatomic) UIWindow *window;\n\n\n@end\n\n"
  },
  {
    "path": "STPingTest/STPAppDelegate.m",
    "content": "//\n//  STPAppDelegate.m\n//  STPingTest\n//\n//  Created by SunJiangting on 15-3-19.\n//  Copyright (c) 2015年 Suen. All rights reserved.\n//\n\n#import \"STPAppDelegate.h\"\n#import \"STDDebugPingViewController.h\"\n\n@interface STPAppDelegate ()\n\n@end\n\n@implementation STPAppDelegate\n\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n    // Override point for customization after application launch.\n    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n    \n    STDDebugPingViewController *pingViewController = [[STDDebugPingViewController alloc] init];\n    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:pingViewController];\n    self.window.rootViewController = navigationController;\n    [self.window makeKeyAndVisible];\n    return YES;\n}\n\n- (void)applicationWillResignActive:(UIApplication *)application {\n    // 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.\n    // 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.\n}\n\n- (void)applicationDidEnterBackground:(UIApplication *)application {\n    // 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.\n    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n}\n\n- (void)applicationWillEnterForeground:(UIApplication *)application {\n    // 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.\n}\n\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n    // 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.\n}\n\n- (void)applicationWillTerminate:(UIApplication *)application {\n    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n}\n\n@end\n"
  },
  {
    "path": "STPingTest/main.m",
    "content": "//\n//  main.m\n//  STPingTest\n//\n//  Created by SunJiangting on 15-3-19.\n//  Copyright (c) 2015年 Suen. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n#import \"STPAppDelegate.h\"\n\nint main(int argc, char * argv[]) {\n    @autoreleasepool {\n        return UIApplicationMain(argc, argv, nil, NSStringFromClass([STPAppDelegate class]));\n    }\n}\n"
  },
  {
    "path": "STPingTest.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t06BE9C5C1ABA86DC0074C95F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 06BE9C5B1ABA86DC0074C95F /* main.m */; };\n\t\t06BE9C5F1ABA86DC0074C95F /* STPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 06BE9C5E1ABA86DC0074C95F /* STPAppDelegate.m */; };\n\t\t06BE9C671ABA86DC0074C95F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 06BE9C661ABA86DC0074C95F /* Images.xcassets */; };\n\t\t06BE9C6A1ABA86DC0074C95F /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 06BE9C681ABA86DC0074C95F /* LaunchScreen.xib */; };\n\t\t06BE9C871ABA874A0074C95F /* STSimplePing.m in Sources */ = {isa = PBXBuildFile; fileRef = 06BE9C821ABA874A0074C95F /* STSimplePing.m */; };\n\t\t06BE9C881ABA874A0074C95F /* STDDebugPingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 06BE9C841ABA874A0074C95F /* STDDebugPingViewController.m */; };\n\t\t06BE9C891ABA874A0074C95F /* STDPingServices.m in Sources */ = {isa = PBXBuildFile; fileRef = 06BE9C861ABA874A0074C95F /* STDPingServices.m */; };\n\t\t06BE9C8C1ABA87A50074C95F /* STDebugFoundation.m in Sources */ = {isa = PBXBuildFile; fileRef = 06BE9C8B1ABA87A50074C95F /* STDebugFoundation.m */; };\n\t\t06BE9C931ABA88A70074C95F /* libz.1.2.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 06BE9C921ABA88A70074C95F /* libz.1.2.5.dylib */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t06BE9C561ABA86DC0074C95F /* STPingTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = STPingTest.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t06BE9C5A1ABA86DC0074C95F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t06BE9C5B1ABA86DC0074C95F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t06BE9C5D1ABA86DC0074C95F /* STPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = STPAppDelegate.h; sourceTree = \"<group>\"; };\n\t\t06BE9C5E1ABA86DC0074C95F /* STPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STPAppDelegate.m; sourceTree = \"<group>\"; };\n\t\t06BE9C661ABA86DC0074C95F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = \"<group>\"; };\n\t\t06BE9C691ABA86DC0074C95F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = \"<group>\"; };\n\t\t06BE9C811ABA874A0074C95F /* STSimplePing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STSimplePing.h; sourceTree = \"<group>\"; };\n\t\t06BE9C821ABA874A0074C95F /* STSimplePing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STSimplePing.m; sourceTree = \"<group>\"; };\n\t\t06BE9C831ABA874A0074C95F /* STDDebugPingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STDDebugPingViewController.h; sourceTree = \"<group>\"; };\n\t\t06BE9C841ABA874A0074C95F /* STDDebugPingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STDDebugPingViewController.m; sourceTree = \"<group>\"; };\n\t\t06BE9C851ABA874A0074C95F /* STDPingServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STDPingServices.h; sourceTree = \"<group>\"; };\n\t\t06BE9C861ABA874A0074C95F /* STDPingServices.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STDPingServices.m; sourceTree = \"<group>\"; };\n\t\t06BE9C8A1ABA87A50074C95F /* STDebugFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STDebugFoundation.h; sourceTree = \"<group>\"; };\n\t\t06BE9C8B1ABA87A50074C95F /* STDebugFoundation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STDebugFoundation.m; sourceTree = \"<group>\"; };\n\t\t06BE9C921ABA88A70074C95F /* libz.1.2.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libz.1.2.5.dylib; path = usr/lib/libz.1.2.5.dylib; sourceTree = SDKROOT; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t06BE9C531ABA86DC0074C95F /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t06BE9C931ABA88A70074C95F /* libz.1.2.5.dylib in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t06BE9C4D1ABA86DC0074C95F = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C921ABA88A70074C95F /* libz.1.2.5.dylib */,\n\t\t\t\t06BE9C581ABA86DC0074C95F /* STPingTest */,\n\t\t\t\t06BE9C571ABA86DC0074C95F /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t06BE9C571ABA86DC0074C95F /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C561ABA86DC0074C95F /* STPingTest.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t06BE9C581ABA86DC0074C95F /* STPingTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C7F1ABA874A0074C95F /* Classes */,\n\t\t\t\t06BE9C5D1ABA86DC0074C95F /* STPAppDelegate.h */,\n\t\t\t\t06BE9C5E1ABA86DC0074C95F /* STPAppDelegate.m */,\n\t\t\t\t06BE9C661ABA86DC0074C95F /* Images.xcassets */,\n\t\t\t\t06BE9C681ABA86DC0074C95F /* LaunchScreen.xib */,\n\t\t\t\t06BE9C591ABA86DC0074C95F /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = STPingTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t06BE9C591ABA86DC0074C95F /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C5A1ABA86DC0074C95F /* Info.plist */,\n\t\t\t\t06BE9C5B1ABA86DC0074C95F /* main.m */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t06BE9C7F1ABA874A0074C95F /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C801ABA874A0074C95F /* PingTester */,\n\t\t\t\t06BE9C851ABA874A0074C95F /* STDPingServices.h */,\n\t\t\t\t06BE9C861ABA874A0074C95F /* STDPingServices.m */,\n\t\t\t\t06BE9C8A1ABA87A50074C95F /* STDebugFoundation.h */,\n\t\t\t\t06BE9C8B1ABA87A50074C95F /* STDebugFoundation.m */,\n\t\t\t\t06BE9C831ABA874A0074C95F /* STDDebugPingViewController.h */,\n\t\t\t\t06BE9C841ABA874A0074C95F /* STDDebugPingViewController.m */,\n\t\t\t);\n\t\t\tpath = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t06BE9C801ABA874A0074C95F /* PingTester */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C811ABA874A0074C95F /* STSimplePing.h */,\n\t\t\t\t06BE9C821ABA874A0074C95F /* STSimplePing.m */,\n\t\t\t);\n\t\t\tpath = PingTester;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t06BE9C551ABA86DC0074C95F /* STPingTest */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 06BE9C791ABA86DC0074C95F /* Build configuration list for PBXNativeTarget \"STPingTest\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t06BE9C521ABA86DC0074C95F /* Sources */,\n\t\t\t\t06BE9C531ABA86DC0074C95F /* Frameworks */,\n\t\t\t\t06BE9C541ABA86DC0074C95F /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = STPingTest;\n\t\t\tproductName = STPingTest;\n\t\t\tproductReference = 06BE9C561ABA86DC0074C95F /* STPingTest.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t06BE9C4E1ABA86DC0074C95F /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0730;\n\t\t\t\tORGANIZATIONNAME = Suen;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t06BE9C551ABA86DC0074C95F = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 06BE9C511ABA86DC0074C95F /* Build configuration list for PBXProject \"STPingTest\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 06BE9C4D1ABA86DC0074C95F;\n\t\t\tproductRefGroup = 06BE9C571ABA86DC0074C95F /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t06BE9C551ABA86DC0074C95F /* STPingTest */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t06BE9C541ABA86DC0074C95F /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t06BE9C6A1ABA86DC0074C95F /* LaunchScreen.xib in Resources */,\n\t\t\t\t06BE9C671ABA86DC0074C95F /* Images.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t06BE9C521ABA86DC0074C95F /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t06BE9C871ABA874A0074C95F /* STSimplePing.m in Sources */,\n\t\t\t\t06BE9C5F1ABA86DC0074C95F /* STPAppDelegate.m in Sources */,\n\t\t\t\t06BE9C881ABA874A0074C95F /* STDDebugPingViewController.m in Sources */,\n\t\t\t\t06BE9C891ABA874A0074C95F /* STDPingServices.m in Sources */,\n\t\t\t\t06BE9C5C1ABA86DC0074C95F /* main.m in Sources */,\n\t\t\t\t06BE9C8C1ABA87A50074C95F /* STDebugFoundation.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t06BE9C681ABA86DC0074C95F /* LaunchScreen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t06BE9C691ABA86DC0074C95F /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t06BE9C771ABA86DC0074C95F /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.1;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t06BE9C781ABA86DC0074C95F /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.1;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t06BE9C7A1ABA86DC0074C95F /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/STPingTest/Classes\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = STPingTest/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.suen.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t06BE9C7B1ABA86DC0074C95F /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/STPingTest/Classes\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = STPingTest/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.suen.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t06BE9C511ABA86DC0074C95F /* Build configuration list for PBXProject \"STPingTest\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t06BE9C771ABA86DC0074C95F /* Debug */,\n\t\t\t\t06BE9C781ABA86DC0074C95F /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t06BE9C791ABA86DC0074C95F /* Build configuration list for PBXNativeTarget \"STPingTest\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t06BE9C7A1ABA86DC0074C95F /* Debug */,\n\t\t\t\t06BE9C7B1ABA86DC0074C95F /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 06BE9C4E1ABA86DC0074C95F /* Project object */;\n}\n"
  },
  {
    "path": "STPingTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:STPingTest.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  }
]