GCKNetworkAddress Class Reference

An object that represents a network IP address. More...

#import <GCKNetworkAddress.h>

+ Inheritance diagram for GCKNetworkAddress:

Instance Methods

(instancetype) - NS_UNAVAILABLE
 Using the default initializer is not allowed. More...
 
(instancetype) - initWithType:ipAddress:
 Constructs a GCKNetworkAddress with the given address type and IP address. More...
 
(instancetype) - initWithType:addressData:
 Constructs a GCKNetworkAddress with the given address type and raw address. More...
 

Class Methods

(GCKNetworkAddress *) + wildcardAddressOfType:
 Constructs a wildcard address of the given type. More...
 
(GCKNetworkAddress *) + loopbackAddressOfType:
 Constructs a loopback address of the given type. More...
 
(GCKNetworkAddress *) + IPv4BroadcastAddress
 Constructs an IPv4 broadcast address. More...
 
(GCKNetworkAddress *) + addressWithIPv4Address:
 Constructs an IPv4 address. More...
 
(GCKNetworkAddress *) + addressWithIPv6Address:
 Constructs an IPv6 address. More...
 
(GCKNetworkAddress *) + addressWithIPCPath:
 Constructs an IPC address. More...
 

Properties

GCKNetworkAddressType type
 The address type. More...
 
NSString * ipAddress
 The IP address. More...
 
NSData * addressData
 The network address as an NSData containing the appropriate address structure (e.g., struct in_addr or struct in6_addr). More...
 

Detailed Description

An object that represents a network IP address.

This object is immutable.

Since
4.2

Method Documentation

+ (GCKNetworkAddress *) addressWithIPCPath: (NSString *)  path

Constructs an IPC address.

+ (GCKNetworkAddress *) addressWithIPv4Address: (NSString *)  ipAddress

Constructs an IPv4 address.

+ (GCKNetworkAddress *) addressWithIPv6Address: (NSString *)  ipAddress

Constructs an IPv6 address.

- (instancetype) initWithType: (GCKNetworkAddressType)  type
addressData: (NSData *GCK_NULLABLE_TYPE)  addressData 

Constructs a GCKNetworkAddress with the given address type and raw address.

Parameters
typeThe address type.
addressDataAn NSData object containing the appropriate address structure (e.g., struct in_addr or struct in6_addr). For the GCKNNetworkAddressTypeIPC, the data is expected to be a UTF8 encoding.
- (instancetype) initWithType: (GCKNetworkAddressType)  type
ipAddress: (NSString *GCK_NULLABLE_TYPE)  ipAddress 

Constructs a GCKNetworkAddress with the given address type and IP address.

Parameters
typeThe address type.
ipAddressThe IP address, in textual form. May be nil to indicate the wildcard ("any") address.
+ (GCKNetworkAddress *) IPv4BroadcastAddress

Constructs an IPv4 broadcast address.

+ (GCKNetworkAddress *) loopbackAddressOfType: (GCKNetworkAddressType)  type

Constructs a loopback address of the given type.

- (instancetype) NS_UNAVAILABLE

Using the default initializer is not allowed.

+ (GCKNetworkAddress *) wildcardAddressOfType: (GCKNetworkAddressType)  type

Constructs a wildcard address of the given type.

Property Documentation

- (NSData*) addressData
readnonatomiccopy

The network address as an NSData containing the appropriate address structure (e.g., struct in_addr or struct in6_addr).

For the address type IPC, this field is a UTF8 encoding.

- (NSString*) ipAddress
readnonatomiccopy

The IP address.

- (GCKNetworkAddressType) type
readnonatomicassign

The address type.


The documentation for this class was generated from the following file: