-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | HaNS to Network shims for easier HaNS integration
--
-- HaNS is a lightweight, pure Haskell network stack that can be used for
-- Haskell networking in the context of the HaLVM, or with a Linux tap
-- device. It's very cool, but can be hard to integrate into existing
-- systems. This library attempts to mitigate some of the translation
-- cost by mimicking some of the behavior of the standard Haskell network
-- library.
@package network-hans
@version 0.2
module Network.Socket.Internal
data Socket
Socket :: MVar SockState -> NetworkStack -> Word64 -> Socket
[sockState] :: Socket -> MVar SockState
[sockNStack] :: Socket -> NetworkStack
[sockIdent] :: Socket -> Word64
data SocketStatus
NotConnected :: SocketStatus
Bound :: SocketStatus
Listening :: SocketStatus
Connected :: SocketStatus
ConvertedToHandle :: SocketStatus
Closed :: SocketStatus
socket :: Family -> SocketType -> ProtocolNumber -> IO Socket
connect :: Socket -> SockAddr -> IO ()
bind :: Socket -> SockAddr -> IO ()
listen :: Socket -> Int -> IO ()
accept :: Socket -> IO (Socket, SockAddr)
data ShutdownCmd
ShutdownReceive :: ShutdownCmd
ShutdownSend :: ShutdownCmd
ShutdownBoth :: ShutdownCmd
close :: Socket -> IO ()
shutdown :: Socket -> ShutdownCmd -> IO ()
isConnected :: Socket -> IO Bool
isBound :: Socket -> IO Bool
isListening :: Socket -> IO Bool
isReadable :: Socket -> IO Bool
isWritable :: Socket -> IO Bool
data SocketType
NoSocketType :: SocketType
Stream :: SocketType
Datagram :: SocketType
Raw :: SocketType
RDM :: SocketType
SeqPacket :: SocketType
isSupportedSocketType :: SocketType -> Bool
type ProtocolNumber = CInt
defaultProtocol :: ProtocolNumber
data ForAction
ForNeither :: ForAction
ForRead :: ForAction
ForWrite :: ForAction
ForBoth :: ForAction
getConnectedHansSocket :: Socket -> ForAction -> IO Socket
getBoundUdpPort :: Socket -> IO (NetworkStack, Maybe UdpPort)
getNextUdpPacket :: Socket -> IO (ByteString, SockAddr)
data SockAddr
SockAddrInet :: PortNumber -> HostAddress -> SockAddr
hansUdpSockAddr :: SockAddr -> (IP4, UdpPort)
hansTcpSockAddr :: SockAddr -> (IP4, TcpPort)
newtype PortNumber
PortNum :: Word16 -> PortNumber
data Family
-- | unspecified
AF_UNSPEC :: Family
-- | local to host (pipes, portals
AF_UNIX :: Family
-- | internetwork: UDP, TCP, etc
AF_INET :: Family
-- | Internet Protocol version 6
AF_INET6 :: Family
-- | arpanet imp addresses
AF_IMPLINK :: Family
-- | pup protocols: e.g. BSP
AF_PUP :: Family
-- | mit CHAOS protocols
AF_CHAOS :: Family
-- | XEROX NS protocols
AF_NS :: Family
-- | nbs protocols
AF_NBS :: Family
-- | european computer manufacturers
AF_ECMA :: Family
-- | datakit protocols
AF_DATAKIT :: Family
-- | CCITT protocols, X.25 etc
AF_CCITT :: Family
-- | IBM SNA
AF_SNA :: Family
-- | DECnet
AF_DECnet :: Family
-- | Direct data link interface
AF_DLI :: Family
-- | LAT
AF_LAT :: Family
-- | NSC Hyperchannel
AF_HYLINK :: Family
-- | Apple Talk
AF_APPLETALK :: Family
-- | Internal Routing Protocol
AF_ROUTE :: Family
-- | NetBios-style addresses
AF_NETBIOS :: Family
-- | Network Interface Tap
AF_NIT :: Family
-- | IEEE 802.2, also ISO 8802
AF_802 :: Family
-- | ISO protocols
AF_ISO :: Family
-- | umbrella of all families used by OSI
AF_OSI :: Family
-- | DNA Network Management
AF_NETMAN :: Family
-- | CCITT X.25
AF_X25 :: Family
AF_AX25 :: Family
-- | AFI
AF_OSINET :: Family
-- | US Government OSI
AF_GOSSIP :: Family
-- | Novell Internet Protocol
AF_IPX :: Family
-- | eXpress Transfer Protocol (no AF)
Pseudo_AF_XTP :: Family
-- | Common Trace Facility
AF_CTF :: Family
-- | Wide Area Network protocols
AF_WAN :: Family
-- | SGI Data Link for DLPI
AF_SDL :: Family
AF_NETWARE :: Family
AF_NDD :: Family
-- | Debugging use only
AF_INTF :: Family
-- | connection-oriented IP, aka ST II
AF_COIP :: Family
-- | Computer Network Technology
AF_CNT :: Family
-- | Help Identify RTIP packets
Pseudo_AF_RTIP :: Family
-- | Help Identify PIP packets
Pseudo_AF_PIP :: Family
-- | Simple Internet Protocol
AF_SIP :: Family
-- | Integrated Services Digital Network
AF_ISDN :: Family
-- | Internal key-management function
Pseudo_AF_KEY :: Family
-- | native ATM access
AF_NATM :: Family
-- | (rev.) addr. res. prot. (RFC 826)
AF_ARP :: Family
-- | Used by BPF to not rewrite hdrs in iface output
Pseudo_AF_HDRCMPLT :: Family
AF_ENCAP :: Family
-- | Link layer interface
AF_LINK :: Family
-- | Link layer interface
AF_RAW :: Family
-- | raw interface
AF_RIF :: Family
-- | Amateur radio NetROM
AF_NETROM :: Family
-- | multiprotocol bridge
AF_BRIDGE :: Family
-- | ATM PVCs
AF_ATMPVC :: Family
-- | Amateur Radio X.25 PLP
AF_ROSE :: Family
-- |
-- - 2LLC
--
AF_NETBEUI :: Family
-- | Security callback pseudo AF
AF_SECURITY :: Family
-- | Packet family
AF_PACKET :: Family
-- | Ash
AF_ASH :: Family
-- | Acorn Econet
AF_ECONET :: Family
-- | ATM SVCs
AF_ATMSVC :: Family
-- | IRDA sockets
AF_IRDA :: Family
-- | PPPoX sockets
AF_PPPOX :: Family
-- | Wanpipe API sockets
AF_WANPIPE :: Family
-- | bluetooth sockets
AF_BLUETOOTH :: Family
type HostAddress = Word32
type HostAddress6 = (Word32, Word32, Word32, Word32)
getNetworkHansStack :: IO NetworkStack
setNetworkHansStack :: NetworkStack -> IO ()
getNextSockIdent :: IO Word64
instance GHC.Show.Show Network.Socket.Internal.SockAddr
instance GHC.Classes.Ord Network.Socket.Internal.SockAddr
instance GHC.Classes.Eq Network.Socket.Internal.SockAddr
instance GHC.Show.Show Network.Socket.Internal.Family
instance GHC.Read.Read Network.Socket.Internal.Family
instance GHC.Classes.Ord Network.Socket.Internal.Family
instance GHC.Classes.Eq Network.Socket.Internal.Family
instance Foreign.Storable.Storable Network.Socket.Internal.PortNumber
instance GHC.Show.Show Network.Socket.Internal.PortNumber
instance GHC.Real.Real Network.Socket.Internal.PortNumber
instance GHC.Classes.Ord Network.Socket.Internal.PortNumber
instance GHC.Num.Num Network.Socket.Internal.PortNumber
instance GHC.Real.Integral Network.Socket.Internal.PortNumber
instance GHC.Classes.Eq Network.Socket.Internal.PortNumber
instance GHC.Enum.Enum Network.Socket.Internal.PortNumber
instance GHC.Classes.Eq Network.Socket.Internal.ShutdownCmd
instance GHC.Show.Show Network.Socket.Internal.SocketType
instance GHC.Read.Read Network.Socket.Internal.SocketType
instance GHC.Classes.Ord Network.Socket.Internal.SocketType
instance GHC.Classes.Eq Network.Socket.Internal.SocketType
instance GHC.Show.Show Network.Socket.Internal.SocketStatus
instance GHC.Classes.Eq Network.Socket.Internal.SocketStatus
instance GHC.Classes.Eq Network.Socket.Internal.ForAction
instance GHC.Classes.Eq Network.Socket.Internal.Socket
instance GHC.Classes.Eq Network.Socket.Internal.SockState
module Network.Socket.ByteString.Lazy
send :: Socket -> ByteString -> IO Int64
sendAll :: Socket -> ByteString -> IO ()
getContents :: Socket -> IO ByteString
recv :: Socket -> Int64 -> IO ByteString
module Network.Socket.ByteString
send :: Socket -> ByteString -> IO Int
sendAll :: Socket -> ByteString -> IO ()
sendTo :: Socket -> ByteString -> SockAddr -> IO Int
sendAllTo :: Socket -> ByteString -> SockAddr -> IO ()
sendMany :: Socket -> [ByteString] -> IO ()
sendManyTo :: Socket -> [ByteString] -> SockAddr -> IO ()
recv :: Socket -> Int -> IO ByteString
recvFrom :: Socket -> Int -> IO (ByteString, SockAddr)
module Network.BSD
type HostName = String
getHostName :: IO String
data HostEntry
HostEntry :: HostName -> [HostName] -> Family -> [HostAddress] -> HostEntry
[hostName] :: HostEntry -> HostName
[hostAliases] :: HostEntry -> [HostName]
[hostFamily] :: HostEntry -> Family
[hostAddresses] :: HostEntry -> [HostAddress]
getHostByName :: HostName -> IO HostEntry
getHostByAddr :: Family -> HostAddress -> IO HostEntry
hostAddress :: HostEntry -> HostAddress
getHostEntries :: Bool -> IO [HostEntry]
setHostEntry :: Bool -> IO ()
getHostEntry :: IO HostEntry
endHostEntry :: IO ()
data ServiceEntry
ServiceEntry :: ServiceName -> [ServiceName] -> PortNumber -> ProtocolName -> ServiceEntry
[serviceName] :: ServiceEntry -> ServiceName
[serviceAliases] :: ServiceEntry -> [ServiceName]
[servicePort] :: ServiceEntry -> PortNumber
[serviceProtocol] :: ServiceEntry -> ProtocolName
type ServiceName = String
getServiceByName :: ServiceName -> ProtocolName -> IO ServiceEntry
getServiceByPort :: PortNumber -> ProtocolName -> IO ServiceEntry
getServicePortNumber :: ServiceName -> IO PortNumber
getServiceEntries :: Bool -> IO [ServiceEntry]
getServiceEntry :: IO ServiceEntry
setServiceEntry :: Bool -> IO ()
endServiceEntry :: IO ()
type ProtocolName = String
data ProtocolEntry
ProtocolEntry :: ProtocolName -> [ProtocolName] -> ProtocolNumber -> ProtocolEntry
[protoName] :: ProtocolEntry -> ProtocolName
[protoAliases] :: ProtocolEntry -> [ProtocolName]
[protoNumber] :: ProtocolEntry -> ProtocolNumber
getProtocolByName :: ProtocolName -> IO ProtocolEntry
getProtocolByNumber :: ProtocolNumber -> IO ProtocolEntry
getProtocolNumber :: ProtocolName -> IO ProtocolNumber
getProtocolEntries :: Bool -> IO [ProtocolEntry]
setProtocolEntry :: Bool -> IO ()
getProtocolEntry :: IO ProtocolEntry
endProtocolEntry :: IO ()
newtype PortNumber
PortNum :: Word16 -> PortNumber
type NetworkAddr = CULong
data NetworkEntry
NetworkEntry :: NetworkName -> [NetworkName] -> Family -> NetworkAddr -> NetworkEntry
[networkName] :: NetworkEntry -> NetworkName
[networkAliases] :: NetworkEntry -> [NetworkName]
[networkFamily] :: NetworkEntry -> Family
[networkAddress] :: NetworkEntry -> NetworkAddr
getNetworkByName :: NetworkName -> IO NetworkEntry
getNetworkByAddr :: NetworkAddr -> Family -> IO NetworkEntry
getNetworkEntries :: Bool -> IO [NetworkEntry]
setNetworkEntry :: Bool -> IO ()
getNetworkEntry :: IO NetworkEntry
endNetworkEntry :: IO ()
instance GHC.Show.Show Network.BSD.NetworkEntry
instance GHC.Read.Read Network.BSD.NetworkEntry
instance GHC.Show.Show Network.BSD.ProtocolEntry
instance GHC.Read.Read Network.BSD.ProtocolEntry
instance GHC.Show.Show Network.BSD.HostEntry
instance GHC.Read.Read Network.BSD.HostEntry
module Network.Socket
data Socket
data SocketType
NoSocketType :: SocketType
Stream :: SocketType
Datagram :: SocketType
Raw :: SocketType
RDM :: SocketType
SeqPacket :: SocketType
data Family
-- | unspecified
AF_UNSPEC :: Family
-- | local to host (pipes, portals
AF_UNIX :: Family
-- | internetwork: UDP, TCP, etc
AF_INET :: Family
-- | Internet Protocol version 6
AF_INET6 :: Family
-- | arpanet imp addresses
AF_IMPLINK :: Family
-- | pup protocols: e.g. BSP
AF_PUP :: Family
-- | mit CHAOS protocols
AF_CHAOS :: Family
-- | XEROX NS protocols
AF_NS :: Family
-- | nbs protocols
AF_NBS :: Family
-- | european computer manufacturers
AF_ECMA :: Family
-- | datakit protocols
AF_DATAKIT :: Family
-- | CCITT protocols, X.25 etc
AF_CCITT :: Family
-- | IBM SNA
AF_SNA :: Family
-- | DECnet
AF_DECnet :: Family
-- | Direct data link interface
AF_DLI :: Family
-- | LAT
AF_LAT :: Family
-- | NSC Hyperchannel
AF_HYLINK :: Family
-- | Apple Talk
AF_APPLETALK :: Family
-- | Internal Routing Protocol
AF_ROUTE :: Family
-- | NetBios-style addresses
AF_NETBIOS :: Family
-- | Network Interface Tap
AF_NIT :: Family
-- | IEEE 802.2, also ISO 8802
AF_802 :: Family
-- | ISO protocols
AF_ISO :: Family
-- | umbrella of all families used by OSI
AF_OSI :: Family
-- | DNA Network Management
AF_NETMAN :: Family
-- | CCITT X.25
AF_X25 :: Family
AF_AX25 :: Family
-- | AFI
AF_OSINET :: Family
-- | US Government OSI
AF_GOSSIP :: Family
-- | Novell Internet Protocol
AF_IPX :: Family
-- | eXpress Transfer Protocol (no AF)
Pseudo_AF_XTP :: Family
-- | Common Trace Facility
AF_CTF :: Family
-- | Wide Area Network protocols
AF_WAN :: Family
-- | SGI Data Link for DLPI
AF_SDL :: Family
AF_NETWARE :: Family
AF_NDD :: Family
-- | Debugging use only
AF_INTF :: Family
-- | connection-oriented IP, aka ST II
AF_COIP :: Family
-- | Computer Network Technology
AF_CNT :: Family
-- | Help Identify RTIP packets
Pseudo_AF_RTIP :: Family
-- | Help Identify PIP packets
Pseudo_AF_PIP :: Family
-- | Simple Internet Protocol
AF_SIP :: Family
-- | Integrated Services Digital Network
AF_ISDN :: Family
-- | Internal key-management function
Pseudo_AF_KEY :: Family
-- | native ATM access
AF_NATM :: Family
-- | (rev.) addr. res. prot. (RFC 826)
AF_ARP :: Family
-- | Used by BPF to not rewrite hdrs in iface output
Pseudo_AF_HDRCMPLT :: Family
AF_ENCAP :: Family
-- | Link layer interface
AF_LINK :: Family
-- | Link layer interface
AF_RAW :: Family
-- | raw interface
AF_RIF :: Family
-- | Amateur radio NetROM
AF_NETROM :: Family
-- | multiprotocol bridge
AF_BRIDGE :: Family
-- | ATM PVCs
AF_ATMPVC :: Family
-- | Amateur Radio X.25 PLP
AF_ROSE :: Family
-- |
-- - 2LLC
--
AF_NETBEUI :: Family
-- | Security callback pseudo AF
AF_SECURITY :: Family
-- | Packet family
AF_PACKET :: Family
-- | Ash
AF_ASH :: Family
-- | Acorn Econet
AF_ECONET :: Family
-- | ATM SVCs
AF_ATMSVC :: Family
-- | IRDA sockets
AF_IRDA :: Family
-- | PPPoX sockets
AF_PPPOX :: Family
-- | Wanpipe API sockets
AF_WANPIPE :: Family
-- | bluetooth sockets
AF_BLUETOOTH :: Family
isSupportedFamily :: Family -> Bool
data SockAddr
SockAddrInet :: PortNumber -> HostAddress -> SockAddr
data SocketStatus
NotConnected :: SocketStatus
Bound :: SocketStatus
Listening :: SocketStatus
Connected :: SocketStatus
ConvertedToHandle :: SocketStatus
Closed :: SocketStatus
data ShutdownCmd
ShutdownReceive :: ShutdownCmd
ShutdownSend :: ShutdownCmd
ShutdownBoth :: ShutdownCmd
newtype PortNumber
PortNum :: Word16 -> PortNumber
type HostName = String
type ServiceName = String
data AddrInfo
AddrInfo :: [AddrInfoFlag] -> Family -> SocketType -> ProtocolNumber -> SockAddr -> Maybe String -> AddrInfo
[addrFlags] :: AddrInfo -> [AddrInfoFlag]
[addrFamily] :: AddrInfo -> Family
[addrSocketType] :: AddrInfo -> SocketType
[addrProtocol] :: AddrInfo -> ProtocolNumber
[addrAddress] :: AddrInfo -> SockAddr
[addrCanonName] :: AddrInfo -> Maybe String
data AddrInfoFlag
AI_ADDRCONFIG :: AddrInfoFlag
AI_ALL :: AddrInfoFlag
AI_CANONNAME :: AddrInfoFlag
AI_NUMERICHOST :: AddrInfoFlag
AI_NUMERICSERV :: AddrInfoFlag
AI_PASSIVE :: AddrInfoFlag
AI_V4MAPPED :: AddrInfoFlag
addrInfoFlagImplemented :: AddrInfoFlag -> Bool
defaultHints :: AddrInfo
getAddrInfo :: Maybe AddrInfo -> Maybe HostName -> Maybe ServiceName -> IO [AddrInfo]
data NameInfoFlag
NI_DGRAM :: NameInfoFlag
NI_NAMEREQD :: NameInfoFlag
NI_NOFQDN :: NameInfoFlag
NI_NUMERICHOST :: NameInfoFlag
NI_NUMERICSERV :: NameInfoFlag
getNameInfo :: [NameInfoFlag] -> Bool -> Bool -> SockAddr -> IO (Maybe HostName, Maybe ServiceName)
socket :: Family -> SocketType -> ProtocolNumber -> IO Socket
socketPair :: Family -> SocketType -> ProtocolNumber -> IO (Socket, Socket)
connect :: Socket -> SockAddr -> IO ()
bind :: Socket -> SockAddr -> IO ()
listen :: Socket -> Int -> IO ()
accept :: Socket -> IO (Socket, SockAddr)
getPeerName :: Socket -> IO SockAddr
getSocketName :: Socket -> IO SockAddr
getPeerCred :: Socket -> IO (CUInt, CUInt, CUInt)
socketPort :: Socket -> IO PortNumber
socketToHandle :: Socket -> IOMode -> IO Handle
sendTo :: Socket -> String -> SockAddr -> IO Int
sendBufTo :: Socket -> Ptr a -> Int -> SockAddr -> IO Int
recvFrom :: Socket -> Int -> IO (String, Int, SockAddr)
recvBufFrom :: Socket -> Ptr a -> Int -> IO (Int, SockAddr)
send :: Socket -> String -> IO Int
recv :: Socket -> Int -> IO String
recvLen :: Socket -> Int -> IO (String, Int)
sendBuf :: Socket -> Ptr Word8 -> Int -> IO Int
recvBuf :: Socket -> Ptr Word8 -> Int -> IO Int
inet_addr :: String -> IO HostAddress
inet_ntoa :: HostAddress -> IO String
shutdown :: Socket -> ShutdownCmd -> IO ()
close :: Socket -> IO ()
isConnected :: Socket -> IO Bool
isBound :: Socket -> IO Bool
isListening :: Socket -> IO Bool
isReadable :: Socket -> IO Bool
isWritable :: Socket -> IO Bool
data SocketOption
Debug :: SocketOption
ReuseAddr :: SocketOption
Type :: SocketOption
SoError :: SocketOption
DontRoute :: SocketOption
Broadcast :: SocketOption
SendBuffer :: SocketOption
RecvBuffer :: SocketOption
KeepAlive :: SocketOption
OOBInline :: SocketOption
TimeToLive :: SocketOption
MaxSegment :: SocketOption
NoDelay :: SocketOption
Cork :: SocketOption
Linger :: SocketOption
ReusePort :: SocketOption
RecvLowWater :: SocketOption
SendLowWater :: SocketOption
RecvTimeOut :: SocketOption
SendTimeOut :: SocketOption
UseLoopBack :: SocketOption
IPv6Only :: SocketOption
CustomSockOpt :: (CInt, CInt) -> SocketOption
defaultProtocol :: ProtocolNumber
isSupportedSocketOption :: SocketOption -> Bool
getSocketOption :: Socket -> SocketOption -> IO Int
setSocketOption :: Socket -> SocketOption -> Int -> IO ()
aNY_PORT :: PortNumber
iNADDR_ANY :: HostAddress
iN6ADDR_ANY :: HostAddress6
sOMAXCONN :: Int
sOL_SOCKET :: Int
sCM_RIGHTS :: Int
maxListenQueue :: Int
withSocketsDo :: IO a -> IO a
sClose :: Socket -> IO ()
instance GHC.Show.Show Network.Socket.SocketOption
instance GHC.Show.Show Network.Socket.NameInfoFlag
instance GHC.Read.Read Network.Socket.NameInfoFlag
instance GHC.Classes.Eq Network.Socket.NameInfoFlag
instance GHC.Show.Show Network.Socket.AddrInfo
instance GHC.Classes.Eq Network.Socket.AddrInfo
instance GHC.Show.Show Network.Socket.AddrInfoFlag
instance GHC.Read.Read Network.Socket.AddrInfoFlag
instance GHC.Classes.Eq Network.Socket.AddrInfoFlag