Samond Classes Library 1.1.6-RELEASE build 132

SCIPAddress Class Reference

IPv4 address representation class. More...

#import <SCIPAddress.h>

Inheritance diagram for SCIPAddress:
SCNetObject SCObject <SCDictionaryObjectProtocol> <SCCodingProtocol> <SCStreamProtocol> <SCCollectionProtocol>

List of all members.

Public Member Functions

Initializing IP Address
(id) - init
(id) - initWithString:
(id) - initWithAddress:
(id) - initWithLocalHost
Changing IP Address
(void) - setAddress:
(void) - copyAddress:
Querying an IP Address
(SCUInteger- raw
(SCUByte- octetAtIndex:
(SCUByte- firstOctet
(NSString *) - address
(NSString *) - description
(NSString *) - addressClass
(SCSubnetMask *) - defaultMask
Comparing IP Addresses
(BOOL) - isEqual:
(BOOL) - isEqualToAddress:
(BOOL) - isEqualToString:
Checking IP Address
(BOOL) - isClassA
(BOOL) - isClassB
(BOOL) - isClassC
(BOOL) - isClassD
(BOOL) - isClassE
(BOOL) - isLocalHost
(BOOL) - isMulticast
(BOOL) - isExperimantal
(BOOL) - isPrivate
(BOOL) - isAddress
Checking IP Address as a Network Address
(BOOL) - isNetAddress
(BOOL) - isNetAddressWithMask:
(BOOL) - isNetAddressWithMaskString:
(BOOL) - isNetAddressWithLength:
(BOOL) - isNetAddressWithPrefix:
(BOOL) - isNetAddressWithWildcard:
(BOOL) - isNetAddressWithCount:
Checking IP Address as a Host Address
(BOOL) - isHostAddress
(BOOL) - isHostAddressWithMask:
(BOOL) - isHostAddressWithMaskString:
(BOOL) - isHostAddressWithLength:
(BOOL) - isHostAddressWithPrefix:
(BOOL) - isHostAddressWithWildcard:
(BOOL) - isHostAddressWithCount:
Checking IP Addresses as a Broadcast Address
(BOOL) - isBroadcast
(BOOL) - isBroadcastWithMask:
(BOOL) - isBroadcastWithMaskString:
(BOOL) - isBroadcastWithLength:
(BOOL) - isBroadcastWithPrefix:
(BOOL) - isBroadcastWithWildcard:
(BOOL) - isBroadcastWithCount:
Querying Network Address
(SCIPAddress *) - netAddress
(SCIPAddress *) - netAddressWithMask:
(SCIPAddress *) - netAddressWithMaskString:
(SCIPAddress *) - netAddressWithLength:
(SCIPAddress *) - netAddressWithPrefix:
(SCIPAddress *) - netAddressWithWildcard:
(SCIPAddress *) - netAddressWithCount:
Querying Broadcast Address
(SCIPAddress *) - broadcastAddress
(SCIPAddress *) - broadcastAddressWithMask:
(SCIPAddress *) - broadcastAddressWithMaskString:
(SCIPAddress *) - broadcastAddressWithLength:
(SCIPAddress *) - broadcastAddressWithPrefix:
(SCIPAddress *) - broadcastAddressWithWildcard:
(SCIPAddress *) - broadcastAddressWithCount:
Querying First Reqular Address
(SCIPAddress *) - firstAddress
(SCIPAddress *) - firstAddressWithMask:
(SCIPAddress *) - firstAddressWithMaskString:
(SCIPAddress *) - firstAddressWithLength:
(SCIPAddress *) - firstAddressWithPrefix:
(SCIPAddress *) - firstAddressWithWildcard:
(SCIPAddress *) - firstAddressWithCount:
Querying Last Reqular Address
(SCIPAddress *) - lastAddress
(SCIPAddress *) - lastAddressWithMask:
(SCIPAddress *) - lastAddressWithMaskString:
(SCIPAddress *) - lastAddressWithLength:
(SCIPAddress *) - lastAddressWithPrefix:
(SCIPAddress *) - lastAddressWithWildcard:
(SCIPAddress *) - lastAddressWithCount:

Static Public Member Functions

Creating IP Address
(SCIPAddress *) + emptyAddress
(SCIPAddress *) + addressWithString:
(SCIPAddress *) + addressWithAddress:
(SCIPAddress *) + addressWithLocalHost
(SCIPAddress *) + addressWithDataDictionary:
(SCIPAddress *) + addressWithDataDictionaryFromFile:
(SCIPAddress *) + addressWithCoder:
(SCIPAddress *) + addressWithContentsOfSerializedFile:
(SCIPAddress *) + addressWithStream:
(SCIPAddress *) + addressWithFileStream:

Detailed Description

IPv4 address representation class.

Class represents IPv4 address for using in addressing and subnetting.
This class was introduced in version 1.0.4.

Class declares the following properities:


Member Function Documentation

- (NSString *) address

Returns the text representation of the IP address.

Returns:
A text representation
- (NSString *) addressClass

Returns the IP address class.

Returns:
A class letter
+ (SCIPAddress *) addressWithAddress: (SCIPAddress *)  address

Returns an IP address created by using the specified existing class instance.

Parameters:
address- existing class instance
Returns:
Created IP address
Exceptions:
SCNetException- incorrect source class instance detected
+ (SCIPAddress *) addressWithCoder: (NSCoder *)  coder

Returns an IP address from the specified coder.

Parameters:
coder- source coder
Returns:
Created IP address
+ (SCIPAddress *) addressWithContentsOfSerializedFile: (NSString *)  path

Returns an IP address from the serialized file with the specified path.

Parameters:
path- serialized file path
Returns:
Created IP address
+ (SCIPAddress *) addressWithDataDictionary: (NSDictionary *)  dictionary

Returns an IP address from the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
Created IP address
+ (SCIPAddress *) addressWithDataDictionaryFromFile: (NSString *)  path

Returns an IP adress from the dictionary file with the specified path.

Parameters:
path- source dictionary file path
Returns:
Created IP address
+ (SCIPAddress *) addressWithFileStream: (NSString *)  path

Returns an IP address from the file stream with the specified path.

Parameters:
path- file stream path
Returns:
Created IP address
Exceptions:
SCStreamException- stream operation error detected
+ (SCIPAddress *) addressWithLocalHost

Returns a local host IP address (127.0.0.1).

Returns:
Created IP address
+ (SCIPAddress *) addressWithStream: (SCStream *)  stream

Returns an IP address from the specified stream.

Parameters:
stream- input stream for reading
Returns:
Created IP address
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCIPAddress *) addressWithString: (NSString *)  address

Returns an IP address created by using the specified address string.

Parameters:
address- address string
Returns:
Created IP address
Exceptions:
SCNetException- incorrect address string detected
- (SCIPAddress *) broadcastAddress

Returns a broadcast address of classfull network with the receiver's address.

Returns:
A broadcast address
- (SCIPAddress *) broadcastAddressWithCount: (SCUInteger count

Returns a broadcast address of network with the receiver's address and the specified hosts count.

Parameters:
count- hosts count
Returns:
A broadcast address
Exceptions:
SCNetException- incorrect hosts count detected
- (SCIPAddress *) broadcastAddressWithLength: (SCUByte length

Returns a broadcast address of network with the receiver's address and the specified subnet prefix length.

Parameters:
length- subnet prefix length
Returns:
A broadcast address
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (SCIPAddress *) broadcastAddressWithMask: (SCSubnetMask *)  mask

Returns a broadcast address of network with the receiver's address and the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
A broadcast address
Exceptions:
SCNetException- incorrect subnet mask detected
- (SCIPAddress *) broadcastAddressWithMaskString: (NSString *)  mask

Returns a broadcast address of network with the receiver's address and the specified subnet mask string.

Parameters:
mask- subnet mask string
Returns:
A broadcast address
Exceptions:
SCNetException- incorrect subnet mask string detected
- (SCIPAddress *) broadcastAddressWithPrefix: (NSString *)  prefix

Returns a broadcast address of network with the receiver's address and the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
A broadcast address
Exceptions:
SCNetException- incorrect subnet prefix string detected
- (SCIPAddress *) broadcastAddressWithWildcard: (NSString *)  wildcard

Returns a broadcast address of network with the receiver's address and the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
A broadcast address
Exceptions:
SCNetException- incorrect wildcard mask string detected
- (void) copyAddress: (SCIPAddress *)  address

Sets IP address using the specified existing source class instance.

Parameters:
address- existing source class instance
Exceptions:
SCNetException- incorrect source class instance detected
- (SCSubnetMask *) defaultMask

Returns the classfull default subnet mask.

Returns:
Classfull default subnet mask
- (NSString *) description

Returns class instance description.

Returns:
An instance description
+ (SCIPAddress *) emptyAddress

Returns an ampty IP address (0.0.0.0).

Returns:
Created IP address
- (SCIPAddress *) firstAddress

Returns a first regular address in classfull network with the receiver's address.

Returns:
A first regular address
- (SCIPAddress *) firstAddressWithCount: (SCUInteger count

Returns a first regular address of network with the receiver's address and the specified hosts count.

Parameters:
count- hosts count
Returns:
A first regular address
Exceptions:
SCNetException- incorrect hosts count detected
- (SCIPAddress *) firstAddressWithLength: (SCUByte length

Returns a first regular address of network with the receiver's address and the specified subnet prefix length.

Parameters:
length- subnet prefix length
Returns:
A first regular address
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (SCIPAddress *) firstAddressWithMask: (SCSubnetMask *)  mask

Returns a first regular address in network with the receiver's address and the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
A first regular address
Exceptions:
SCNetException- incorrect subnet mask detected
- (SCIPAddress *) firstAddressWithMaskString: (NSString *)  mask

Returns a first regular address of network with the receiver's address and the specified subnet mask.

Parameters:
mask- subnet mask string
Returns:
A first regular address
Exceptions:
SCNetException- incorrect subnet mask string detected
- (SCIPAddress *) firstAddressWithPrefix: (NSString *)  prefix

Returns a first regular address of network with the receiver's address and the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
A first regular address
Exceptions:
SCNetException- incorrect subnet prefix string detected
- (SCIPAddress *) firstAddressWithWildcard: (NSString *)  wildcard

Returns a first regular address of network with the receiver's address and the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
A first regular address
Exceptions:
SCNetException- incorrect wildcard mask string detected
- (SCUByte) firstOctet

Returns the first octet value.

Returns:
Value of first octet
- (id) init

Initializes the empty IP address (0.0.0.0).

Returns:
A newly initialized IP address
- (id) initWithAddress: (SCIPAddress *)  address

Initializes the IP address using the specified existing source instance.

Parameters:
address- existing source instance
Returns:
A newly initialized IP address
Exceptions:
SCNetException- incorrect source IP address instance detected
- (id) initWithLocalHost

Initializes local host IP address (127.0.0.1).

Returns:
A newly initialized IP address
- (id) initWithString: (NSString *)  address

Initializes the IP address using the specified address string.

Parameters:
address- address string
Returns:
A newly initialized IP address
Exceptions:
SCNetException- incorrect address string detected
- (BOOL) isAddress

Checks a reffering address to regular addressing space.

Returns:
YES if address refers to regular addressing space, otherwise NO
- (BOOL) isBroadcast

Checks an address whether the broadcast address of classfull network.

Returns:
YES if address is broadcast address, otherwise NO
- (BOOL) isBroadcastWithCount: (SCUInteger count

Checks an address whether the broadcast address of network with the specified hosts count.

Parameters:
count- hosts count
Returns:
YES if address is broadcast address, otherwise NO
Exceptions:
SCNetException- incorrect hosts count detected
- (BOOL) isBroadcastWithLength: (SCUByte length

Checks an address whether the broadcast address of network with the specified prefix length.

Parameters:
length- subnet prefix length
Returns:
YES if address is broadcast, otherwise NO
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (BOOL) isBroadcastWithMask: (SCSubnetMask *)  mask

Checks an address whether the broadcast address of network with the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
YES if address is broadcast address, otherwise NO
Exceptions:
SCNetException- incorrect subnet mask detected
- (BOOL) isBroadcastWithMaskString: (NSString *)  mask

Checks an address whether the broadcast address of network with the specified subnet mask string.

Parameters:
mask- subnet mask string
Returns:
YES if address is broadcast address, otherwise NO
Exceptions:
SCNetException- incorrect subnet mask string detected
- (BOOL) isBroadcastWithPrefix: (NSString *)  prefix

Checks an address whether the broadcast address of network with the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
YES if address is broadcast address, otherwise NO
Exceptions:
SCNetException- incorrect subnet prefix string detected
- (BOOL) isBroadcastWithWildcard: (NSString *)  wildcard

Checks an address whether the broadcast address of network with the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
YES if address is broadcast address, otherwise NO
Exceptions:
SCNetException- incorrect wildcard mask string detected
- (BOOL) isClassA

Checks a referring address to Class A network.

Returns:
YES if address refers to class A network, otherwise NO
- (BOOL) isClassB

Checks a referring address to Class B network.

Returns:
YES if address refers to class B network, otherwise NO
- (BOOL) isClassC

Checks a referring address to Class C network.

Returns:
YES if address refers to class C network, otherwise NO
- (BOOL) isClassD

Checks a referring address to Class D.

Returns:
YES if address refers to class D, otherwise NO
- (BOOL) isClassE

Checks a referring address to Class E.

Returns:
YES if address refers to class D, otherwise NO
- (BOOL) isEqual: (id)  address

Returns a Boolean value as a result of comparing receiver's instance with other address instance.

Parameters:
address- second address instance
Returns:
YES if receiver's instance is equal to other address instance, otherwise NO
Exceptions:
SCNetException- incorrect other address instance detected

Reimplemented from SCObject.

- (BOOL) isEqualToAddress: (SCIPAddress *)  address

Returns a Boolean value as a result of comparing receiver's instance with other address instance.

Parameters:
address- second address instance
Returns:
YES if receiver's instance is equal to other address instance, otherwise NO
Exceptions:
SCNetException- incorrect other address instance detected
- (BOOL) isEqualToString: (NSString *)  address

Returns a Boolean value as a result of comparing receiver's instance with address text representation.

Parameters:
address- address string
Returns:
YES if receiver's instance is equal to address string, otherwise NO
Exceptions:
SCNetException- incorrect address string detected
- (BOOL) isExperimantal

Checks a referring address to experimental address.

Returns:
YES if address refers to experimental address, otherwise NO
- (BOOL) isHostAddress

Checks an address whether the host address in classfull network.

Returns:
YES if address is host address, otherwise NO
- (BOOL) isHostAddressWithCount: (SCUInteger count

Checks an address whether the host address in network with the specified hosts count.

Parameters:
count- hosts count
Returns:
YES if address is host address, otherwise NO
Exceptions:
SCNetException- incorrect hosts count detected
- (BOOL) isHostAddressWithLength: (SCUByte length

Checks an address whether the host address in network with the specified subnet prefix length.

Parameters:
length- subnet prefix length
Returns:
YES if address is host address, otherwise NO
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (BOOL) isHostAddressWithMask: (SCSubnetMask *)  mask

Checks an address whether the host address in network with the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
YES if address is host address, otherwise NO
Exceptions:
SCNetException- incorrect subnet mask detected
- (BOOL) isHostAddressWithMaskString: (NSString *)  mask

Checks an address whether the host address in network with the specified subnet mask string.

Parameters:
mask- subnet mask string
Returns:
YES if address is host address, otherwise NO
Exceptions:
SCNetException- incorrect subnet mask string detected
- (BOOL) isHostAddressWithPrefix: (NSString *)  prefix

Checks an address whether the host address in network with the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
YES if address is host address, otherwise NO
Exceptions:
SCNetException- incorrect subnet prefix detected
- (BOOL) isHostAddressWithWildcard: (NSString *)  wildcard

Checks an address whether the host address in network with the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
YES if address is host address, otherwise NO
Exceptions:
SCNetException- incorrect wildcard mask string detected
- (BOOL) isLocalHost

Checks an equal address to special local host address (127.0.0.1).

Returns:
YES if address is local host address, otherwise NO
- (BOOL) isMulticast

Checks a referring address to multicast address.

Returns:
YES if address refers to multicast address, otherwise NO
- (BOOL) isNetAddress

Checks a reffering address to classfull network address.

Returns:
YES if address is classfull network address, otherwise NO
- (BOOL) isNetAddressWithCount: (SCUInteger count

Checks an address whether the address of network with the specified hosts count.

Parameters:
count- hosts count
Returns:
YES if address is network address, otherwise NO
Exceptions:
SCNetException- incorrect hosts count detected
- (BOOL) isNetAddressWithLength: (SCUByte length

Checks an address whether the address of network with the specified subnet prefix length.

Parameters:
length- subnet prefix length
Returns:
YES if address is network address, otherwise NO
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (BOOL) isNetAddressWithMask: (SCSubnetMask *)  mask

Checks an address whether the address of network with the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
YES if address is network address, otherwise NO
Exceptions:
SCNetException- incorrect subnet mask detected
- (BOOL) isNetAddressWithMaskString: (NSString *)  mask

Checks an address whether the address of network with the specified subnet mask string.

Parameters:
mask- subnet mask string
Returns:
YES if address is network address, otherwise NO
Exceptions:
SCNetException- incorrect subnet mask string detected
- (BOOL) isNetAddressWithPrefix: (NSString *)  prefix

Checks an address whether the address of network with the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
YES if address is network address, otherwise NO
Exceptions:
SCNetException- incorrect subnet prefix string detected
- (BOOL) isNetAddressWithWildcard: (NSString *)  wildcard

Checks an address whether the address of network with the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
YES if address is network address, otherwise NO
Exceptions:
SCNetException- incorrect wildcard mask detected
- (BOOL) isPrivate

Checks a reffering address to private addressing space.

Returns:
YES if address refers to private addressing space, otherwise NO
- (SCIPAddress *) lastAddress

Returns a last regular address of classfull network with the receiver's address. Метод возвращает последний доступный адрес в классовой сети.

Returns:
Последний доступный адрес классовой сети
- (SCIPAddress *) lastAddressWithCount: (SCUInteger count

Returns a last regular address of network with the receiver's address and the specified hosts count.

Parameters:
count- hosts count
Returns:
A last regular address
Exceptions:
SCNetException- incorrect hosts count detected
- (SCIPAddress *) lastAddressWithLength: (SCUByte length

Returns a last regular address of network with the receiver's address and the specified subnet prefix length.

Parameters:
length- subnet prefix length
Returns:
A last regular address
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (SCIPAddress *) lastAddressWithMask: (SCSubnetMask *)  mask

Returns a last regular address of network with the receiver's address and the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
A last regular address
Exceptions:
SCNetException- incorrect subnet mask detected
- (SCIPAddress *) lastAddressWithMaskString: (NSString *)  mask

Returns a last regular address of network with the receiver's address and the specified subnet mask string.

Parameters:
mask- subnet mask string
Returns:
A last regular address
Exceptions:
SCNetException- incorrect subnet mask string detected
- (SCIPAddress *) lastAddressWithPrefix: (NSString *)  prefix

Returns a last regular address of network with the receiver's address and the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
A last regular address
Exceptions:
SCNetException- incorrect subnet prefix string detected
- (SCIPAddress *) lastAddressWithWildcard: (NSString *)  wildcard

Returns a last regular address of network with the receiver's address and the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
A last regular address
Exceptions:
SCNetException- incorrect wildcard mask string detected
- (SCIPAddress *) netAddress

Returns a network address of classfull network with receiver's address.

Returns:
A network address
- (SCIPAddress *) netAddressWithCount: (SCUInteger count

Returns a network address of network with the receiver's address and the specified hosts count.

Parameters:
count- hosts count
Returns:
A network address
Exceptions:
SCNetException- incorrect hosts count detected
- (SCIPAddress *) netAddressWithLength: (SCUByte length

Returns a network address of network with the receiver's address and the specified subnet prefix length.

Parameters:
length- subnet prefix length
Returns:
A network address
Exceptions:
SCNetException- incorrect subnet prefix length detected
- (SCIPAddress *) netAddressWithMask: (SCSubnetMask *)  mask

Returns a network address of network with the receiver's address and the specified subnet mask.

Parameters:
mask- subnet mask
Returns:
A network address
Exceptions:
SCNetException- incorrect subnet mask detected
- (SCIPAddress *) netAddressWithMaskString: (NSString *)  mask

Returns a network address of network with the receiver's address and the specified subnet mask string.

Parameters:
mask- subnet mask string
Returns:
A network address
Exceptions:
SCNetException- incorrect subnet mask detected
- (SCIPAddress *) netAddressWithPrefix: (NSString *)  prefix

Returns a network address of network with the receiver's address and the specified subnet prefix.

Parameters:
prefix- subnet prefix string
Returns:
A network address
Exceptions:
SCNetException- incorrect subnet prefix string detected
- (SCIPAddress *) netAddressWithWildcard: (NSString *)  wildcard

Returns a network address of network with the receiver's address and the specified wildcard mask.

Parameters:
wildcard- wildcard mask string
Returns:
A network address
Exceptions:
SCNetException- incorrect wildcard mask string detected
- (SCUByte) octetAtIndex: (SCInteger index

Returns the value of the specified octet.

Parameters:
index- required octet index
Returns:
Value of the specified octet
- (SCUInteger) raw

Returns the address binary representation.

Returns:
An address binary representation
- (void) setAddress: (NSString *)  address

Sets IP address using the specified address string.

Parameters:
address- address string
Exceptions:
SCNetException- incorrect address string detected

The documentation for this class was generated from the following files:
 All Classes Files Functions Typedefs Enumerations Enumerator Defines