monky-2.2.0.0: A system state collecting library and application

Maintainerongy
Stabilityexperimental
PortabilityLinux
Safe HaskellNone
LanguageHaskell2010

Monky.IP.Raw

Description

This may change at any time when the main IP module changes. Consider this API unstable!

Synopsis

Documentation

data IP Source #

Datatype for IP addresses, abstracts over v4/v6

Constructors

IPv4 IP4 
IPv6 IP6 

Instances

Eq IP Source # 

Methods

(==) :: IP -> IP -> Bool #

(/=) :: IP -> IP -> Bool #

Show IP Source # 

Methods

showsPrec :: Int -> IP -> ShowS #

show :: IP -> String #

showList :: [IP] -> ShowS #

data IP4 Source #

IPv4 addresses

Instances

Eq IP4 Source # 

Methods

(==) :: IP4 -> IP4 -> Bool #

(/=) :: IP4 -> IP4 -> Bool #

Show IP4 Source # 

Methods

showsPrec :: Int -> IP4 -> ShowS #

show :: IP4 -> String #

showList :: [IP4] -> ShowS #

Storable IP4 Source # 

Methods

sizeOf :: IP4 -> Int #

alignment :: IP4 -> Int #

peekElemOff :: Ptr IP4 -> Int -> IO IP4 #

pokeElemOff :: Ptr IP4 -> Int -> IP4 -> IO () #

peekByteOff :: Ptr b -> Int -> IO IP4 #

pokeByteOff :: Ptr b -> Int -> IP4 -> IO () #

peek :: Ptr IP4 -> IO IP4 #

poke :: Ptr IP4 -> IP4 -> IO () #

data IP6 Source #

IPv6 addresses

Instances

Eq IP6 Source # 

Methods

(==) :: IP6 -> IP6 -> Bool #

(/=) :: IP6 -> IP6 -> Bool #

Show IP6 Source # 

Methods

showsPrec :: Int -> IP6 -> ShowS #

show :: IP6 -> String #

showList :: [IP6] -> ShowS #

Storable IP6 Source # 

Methods

sizeOf :: IP6 -> Int #

alignment :: IP6 -> Int #

peekElemOff :: Ptr IP6 -> Int -> IO IP6 #

pokeElemOff :: Ptr IP6 -> Int -> IP6 -> IO () #

peekByteOff :: Ptr b -> Int -> IO IP6 #

pokeByteOff :: Ptr b -> Int -> IP6 -> IO () #

peek :: Ptr IP6 -> IO IP6 #

poke :: Ptr IP6 -> IP6 -> IO () #

parseIP :: String -> IP4 Source #

Parse an IP4 from a String

ipFromBS :: ByteString -> IP Source #

Read an IP from a ByteString. The type is determined by the size of the ByteString.

familyToNum :: Num a => AddressFamily -> a Source #

Get the number associated with the family address. This is for interfacing with libraries

data AddressFamily Source #

AddressFamilies support for libraries

Constructors

AF_UNSPEC 
AF_INET 
AF_INET6 

getAddrFamily :: IP -> AddressFamily Source #

Get the address family for a given ip address