Pike Module Reference: module version 1, prepared
2012-02-04
| CLASS IP.v4.Address |
Methods cast() create()
|
- Description
This module describes an IP.v4 address.
You can use this module by simply casting to an int or string.
- Inherit
"helpers"
-
Method create
void IP.v4.Address()->create(int|string _ip)
- Description
Close the IP.v4.Address module.
- Parameter _ip
An IP address.
-
Method cast
void|int|string IP.v4.Address()->cast(string type)
|
| CLASS IP.v4.helpers |
Methods broadcast() inttoip() iptoint() lengthtoint() masktolength() network()
|
- Description
This module provides handy helpers to the IP.v4 modules.
-
Method iptoint
int IP.v4.helpers()->iptoint(string _ip)
- Description
Convert an IP address to a 32 bit integer.
- Parameter _ip
The IP address to convert.
-
Method inttoip
string IP.v4.helpers()->inttoip(int _ip)
- Description
Convert a 32 bit integer to an IP address.
- Parameter _ip
The IP address to convert.
-
Method network
int IP.v4.helpers()->network(int ip, int mask)
- Description
Find the network address for the given address and mask.
- Parameter ip
An IP address.
- Parameter mask
A netmask.
-
Method broadcast
int IP.v4.helpers()->broadcast(int ip, int mask)
- Description
Find the broadcast address for the given address and mask.
- Parameter ip
An IP address.
- Parameter mask
A netmask.
-
Method lengthtoint
int IP.v4.helpers()->lengthtoint(int length)
- Description
Convert a prefix length into an integer mask.
- Parameter length
A prefix length.
-
Method masktolength
int IP.v4.helpers()->masktolength(int|object mask)
- Description
Convert a mask to a prefix length.
- Parameter mask
The netmask.
|
| CLASS IP.v4.Prefix |
Methods broadcast() contains() create() length() netmask() network()
|
- Description
This module describes an IP prefix, ie a network/netmask pair.
- Inherit
"helpers"
-
Method create
void IP.v4.Prefix()->create(string prefix)
- Description
Clone the IP.v4.Prefix module.
- Parameter prefix
The IP prefix in the CIDR format (ie x.x.x.x/m)
-
Method network
object(IP.v4.Address) IP.v4.Prefix()->network()
- Description
Get the network address of this prefix.
-
Method broadcast
object(IP.v4.Address) IP.v4.Prefix()->broadcast()
- Description
Get the broadcast address of this prefix.
-
Method netmask
object(IP.v4.Address) IP.v4.Prefix()->netmask()
- Description
Get the netmask of this prefix.
-
Method length
int(0..32) IP.v4.Prefix()->length()
- Description
Get the length of this prefix (ie, number of "on" bits in the mask).
-
Method contains
int(0..1) IP.v4.Prefix()->contains(object(IP.v4.Address)|object(IP.v4.Prefix) test)
- Description
Test if an IP address is inside this prefix.
Returns 1 if true, 0 otherwise.
- Parameter test
The IP address to test.
|
| CLASS IP.v4.Protocol |
Methods create()
|
- Description
This module describes an IP protocol.
You should use this module by casting it to a string or int.
-
Method create
void IP.v4.Protocol()->create(int|string proto)
- Description
Clone an instance of IP.v4.Protocol.
- Parameter proto
The IP protocol number or name.
|
| CLASS IP.v4.Tuple |
Methods create()
|
- Description
This module defines a connection between two machines, for example a TCP
socket, or a UDP datagram.
-
Variable _local_addr
object(IP.v4.Address) IP.v4.Tuple()->_local_addr
- Description
The local address of the datagram or stream.
-
Variable _remote_addr
object(IP.v4.Address) IP.v4.Tuple()->_remote_addr
- Description
The remote address of the datagram or stream.
-
Variable _local_port
int IP.v4.Tuple()->_local_port
- Description
The local port of the datagram or streamm if applicable.
-
Variable _remote_port
int IP.v4.Tuple()->_remote_port
- Description
The remote port of the datagram or stream, if applicable.
-
Variable _protocol
object(IP.v4.Protocol) IP.v4.Tuple()->_protocol
- Description
The IP protocol used for this datagram or stream.
-
Method create
void IP.v4.Tuple()->create(object(Stdio.File)|object(IP.v4.Address) l_addr, void|int l_port, void|object(IP.v4.Address) r_addr, void|int r_port, void|object(IP.v4.Protocol) proto)
- Description
Clone the IP.v4.Tuple class.
- Parameter l_addr
Either an IP.v4.Address representing the local address of the
connection, or a Stdio.File object containing the TCP socket.
- Parameter l_port
The local port, if applicable.
- Parameter r_addr
An IP.v4.Address represnting the remote endpoint of the connection.
- Parameter r_port
The remote port.
- Parameter proto
An IP.v4.Protocol representing the IP protocol.
|
|