Module network:ip - IP interface
IP interface
Index
-
Process
ip.fragment.fragmenter- Packet fragmenter, takes 1 possibly oversised packet as input and outputs a number of smaller packets -
Function
make.ip.address- Construct an INT32 ipaddress from 4 bytes i.e -
Function
make.ip.mask- Make a CIDR mask -- mask.ip.mask (8) = #FF000000 -
Function
match.ip.address.mask- Match an IP address against a routing-style mask -
Process
out.ip.packet- pritty prints a packet -
Function
parse.ip.addr- Parse an ip string
Declarations
ip.occ:50Function make.ip.address
INT32 FUNCTION make.ip.address (VAL BYTE a, b, c, d)
Construct an INT32 ipaddress from 4 bytes i.e. make.ip.address(10,0,0,1)
ip.occ:63Function make.ip.mask
INT32 FUNCTION make.ip.mask (VAL INT nbits)
Make a CIDR mask -- mask.ip.mask (8) = #FF000000
ip.occ:67Function match.ip.address.mask
BOOL FUNCTION match.ip.address.mask (VAL INT32 addr, match, mask)
Match an IP address against a routing-style mask.
ip.occ:78Function parse.ip.addr
INT32, BOOL FUNCTION parse.ip.addr (VAL []BYTE str)
Parse an ip string.
Parameters:
VAL []BYTE |
str |
String version of ip to parse in format "xxx.xxx.xxx.xxx" |
Returns:
INT32 |
the ip address | |
BOOL |
returns true if ip string was successfully parsed. |
ip.occ:176Process out.ip.packet
PROC out.ip.packet (VAL []BYTE p, CHAN BYTE out!)
pritty prints a packet.
Parameters:
VAL []BYTE |
p |
the packet to print |
CHAN BYTE |
out |
the out chan |
ip.occ:468Process ip.fragment.fragmenter
PROC ip.fragment.fragmenter (VAL INT mtu, CHAN PACKET in?, out!, SHARED LOG! log)
Packet fragmenter, takes 1 possibly oversised packet as input and outputs a number of smaller packets. If a packet inters the fragmenter which is larger than the mtu, but the IP.FLAG.DF is set the packet is discarded.
Parameters:
VAL INT |
mtu |
maximum transmissable unit. The Largest size a packet can be. |
CHAN PACKET |
in |
a stream of incoming packet. |
CHAN PACKET |
out |
a stream of outgoing fragmented packets. |
SHARED LOG! |
log |
system log channel. |