{-# LINE 1 "src/Posix/Socket/Types.hsc" #-}
{-# language DataKinds #-}
{-# language DerivingStrategies #-}
{-# language DuplicateRecordFields #-}
{-# language GADTSyntax #-}
{-# language GeneralizedNewtypeDeriving #-}
{-# language KindSignatures #-}
{-# language MagicHash #-}
{-# language PatternSynonyms #-}
{-# language UnboxedTuples #-}
{-# language NamedFieldPuns #-}
{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
module Posix.Socket.Types
( Family(..)
, Type(..)
, Protocol(..)
, Level(..)
, OptionName(..)
, OptionValue(..)
, SocketAddress(..)
, SocketAddressInternet(..)
, SocketAddressInternet6(..)
, SocketAddressUnix(..)
, MessageFlags(..)
, Message(..)
, ShutdownType(..)
, AddressInfoFlags(..)
, AddressInfo
, pattern Unix
, pattern Unspecified
, pattern Internet
, pattern Internet6
, stream
, datagram
, raw
, sequencedPacket
, defaultProtocol
, rawProtocol
, icmp
, tcp
, udp
, ip
, ipv6
, peek
, outOfBand
, waitAll
, noSignal
, read
, write
, readWrite
, levelSocket
, optionError
, bindToDevice
, broadcast
, reuseAddress
, peekAddressInfoFlags
, peekAddressInfoFamily
, peekAddressInfoSocketType
, peekAddressInfoProtocol
, peekAddressInfoAddressLength
, peekAddressInfoAddress
, peekAddressInfoNext
, pokeAddressInfoFlags
, pokeAddressInfoFamily
, pokeAddressInfoSocketType
, pokeAddressInfoProtocol
, sizeofAddressInfo
, peekMessageHeaderName
, peekMessageHeaderNameLength
, peekMessageHeaderIOVector
, peekMessageHeaderIOVectorLength
, peekMessageHeaderControl
, peekMessageHeaderControlLength
, peekMessageHeaderFlags
, peekControlMessageHeaderLevel
, peekControlMessageHeaderLength
, peekControlMessageHeaderType
, pokeMessageHeaderName
, pokeMessageHeaderNameLength
, pokeMessageHeaderIOVector
, pokeMessageHeaderIOVectorLength
, pokeMessageHeaderControl
, pokeMessageHeaderControlLength
, pokeMessageHeaderFlags
, sizeofMessageHeader
, peekIOVectorBase
, peekIOVectorLength
, pokeIOVectorBase
, pokeIOVectorLength
, sizeofIOVector
) where
import Prelude hiding (read)
import Data.Bits (Bits,(.|.))
import Data.Primitive (ByteArray,Prim(..))
import Data.Primitive.Addr (Addr(..))
import Data.Word (Word16,Word32,Word64)
import Foreign.C.Types (CInt(..),CSize)
import Foreign.Storable (Storable,peekByteOff,pokeByteOff)
import GHC.Ptr (Ptr(..))
import GHC.Exts (Int(I#),Int#,(*#),(+#))
import qualified Data.Kind
import qualified Data.Primitive as PM
data AddressInfo
newtype Family = Family CInt
deriving newtype (Ptr Family -> IO Family
Ptr Family -> Int -> IO Family
Ptr Family -> Int -> Family -> IO ()
Ptr Family -> Family -> IO ()
Family -> Int
(Family -> Int)
-> (Family -> Int)
-> (Ptr Family -> Int -> IO Family)
-> (Ptr Family -> Int -> Family -> IO ())
-> (forall b. Ptr b -> Int -> IO Family)
-> (forall b. Ptr b -> Int -> Family -> IO ())
-> (Ptr Family -> IO Family)
-> (Ptr Family -> Family -> IO ())
-> Storable Family
forall b. Ptr b -> Int -> IO Family
forall b. Ptr b -> Int -> Family -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: Family -> Int
sizeOf :: Family -> Int
$calignment :: Family -> Int
alignment :: Family -> Int
$cpeekElemOff :: Ptr Family -> Int -> IO Family
peekElemOff :: Ptr Family -> Int -> IO Family
$cpokeElemOff :: Ptr Family -> Int -> Family -> IO ()
pokeElemOff :: Ptr Family -> Int -> Family -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Family
peekByteOff :: forall b. Ptr b -> Int -> IO Family
$cpokeByteOff :: forall b. Ptr b -> Int -> Family -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> Family -> IO ()
$cpeek :: Ptr Family -> IO Family
peek :: Ptr Family -> IO Family
$cpoke :: Ptr Family -> Family -> IO ()
poke :: Ptr Family -> Family -> IO ()
Storable)
newtype Type = Type CInt
deriving newtype (Ptr Type -> IO Type
Ptr Type -> Int -> IO Type
Ptr Type -> Int -> Type -> IO ()
Ptr Type -> Type -> IO ()
Type -> Int
(Type -> Int)
-> (Type -> Int)
-> (Ptr Type -> Int -> IO Type)
-> (Ptr Type -> Int -> Type -> IO ())
-> (forall b. Ptr b -> Int -> IO Type)
-> (forall b. Ptr b -> Int -> Type -> IO ())
-> (Ptr Type -> IO Type)
-> (Ptr Type -> Type -> IO ())
-> Storable Type
forall b. Ptr b -> Int -> IO Type
forall b. Ptr b -> Int -> Type -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: Type -> Int
sizeOf :: Type -> Int
$calignment :: Type -> Int
alignment :: Type -> Int
$cpeekElemOff :: Ptr Type -> Int -> IO Type
peekElemOff :: Ptr Type -> Int -> IO Type
$cpokeElemOff :: Ptr Type -> Int -> Type -> IO ()
pokeElemOff :: Ptr Type -> Int -> Type -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Type
peekByteOff :: forall b. Ptr b -> Int -> IO Type
$cpokeByteOff :: forall b. Ptr b -> Int -> Type -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> Type -> IO ()
$cpeek :: Ptr Type -> IO Type
peek :: Ptr Type -> IO Type
$cpoke :: Ptr Type -> Type -> IO ()
poke :: Ptr Type -> Type -> IO ()
Storable)
newtype Protocol = Protocol { Protocol -> CInt
getProtocol :: CInt }
deriving newtype (Ptr Protocol -> IO Protocol
Ptr Protocol -> Int -> IO Protocol
Ptr Protocol -> Int -> Protocol -> IO ()
Ptr Protocol -> Protocol -> IO ()
Protocol -> Int
(Protocol -> Int)
-> (Protocol -> Int)
-> (Ptr Protocol -> Int -> IO Protocol)
-> (Ptr Protocol -> Int -> Protocol -> IO ())
-> (forall b. Ptr b -> Int -> IO Protocol)
-> (forall b. Ptr b -> Int -> Protocol -> IO ())
-> (Ptr Protocol -> IO Protocol)
-> (Ptr Protocol -> Protocol -> IO ())
-> Storable Protocol
forall b. Ptr b -> Int -> IO Protocol
forall b. Ptr b -> Int -> Protocol -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: Protocol -> Int
sizeOf :: Protocol -> Int
$calignment :: Protocol -> Int
alignment :: Protocol -> Int
$cpeekElemOff :: Ptr Protocol -> Int -> IO Protocol
peekElemOff :: Ptr Protocol -> Int -> IO Protocol
$cpokeElemOff :: Ptr Protocol -> Int -> Protocol -> IO ()
pokeElemOff :: Ptr Protocol -> Int -> Protocol -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Protocol
peekByteOff :: forall b. Ptr b -> Int -> IO Protocol
$cpokeByteOff :: forall b. Ptr b -> Int -> Protocol -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> Protocol -> IO ()
$cpeek :: Ptr Protocol -> IO Protocol
peek :: Ptr Protocol -> IO Protocol
$cpoke :: Ptr Protocol -> Protocol -> IO ()
poke :: Ptr Protocol -> Protocol -> IO ()
Storable)
newtype Level = Level CInt
newtype OptionName = OptionName CInt
newtype ShutdownType = ShutdownType CInt
data Message = Send | Receive
newtype MessageFlags :: Message -> Data.Kind.Type where
MessageFlags :: CInt -> MessageFlags m
deriving stock (MessageFlags a -> MessageFlags a -> Bool
(MessageFlags a -> MessageFlags a -> Bool)
-> (MessageFlags a -> MessageFlags a -> Bool)
-> Eq (MessageFlags a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (a :: Message). MessageFlags a -> MessageFlags a -> Bool
$c== :: forall (a :: Message). MessageFlags a -> MessageFlags a -> Bool
== :: MessageFlags a -> MessageFlags a -> Bool
$c/= :: forall (a :: Message). MessageFlags a -> MessageFlags a -> Bool
/= :: MessageFlags a -> MessageFlags a -> Bool
Eq)
deriving newtype (Eq (MessageFlags a)
MessageFlags a
Eq (MessageFlags a) =>
(MessageFlags a -> MessageFlags a -> MessageFlags a)
-> (MessageFlags a -> MessageFlags a -> MessageFlags a)
-> (MessageFlags a -> MessageFlags a -> MessageFlags a)
-> (MessageFlags a -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> MessageFlags a
-> (Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> Bool)
-> (MessageFlags a -> Maybe Int)
-> (MessageFlags a -> Int)
-> (MessageFlags a -> Bool)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int -> MessageFlags a)
-> (MessageFlags a -> Int)
-> Bits (MessageFlags a)
Int -> MessageFlags a
MessageFlags a -> Bool
MessageFlags a -> Int
MessageFlags a -> Maybe Int
MessageFlags a -> MessageFlags a
MessageFlags a -> Int -> Bool
MessageFlags a -> Int -> MessageFlags a
MessageFlags a -> MessageFlags a -> MessageFlags a
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
forall (a :: Message). Eq (MessageFlags a)
forall (a :: Message). MessageFlags a
forall (a :: Message). Int -> MessageFlags a
forall (a :: Message). MessageFlags a -> Bool
forall (a :: Message). MessageFlags a -> Int
forall (a :: Message). MessageFlags a -> Maybe Int
forall (a :: Message). MessageFlags a -> MessageFlags a
forall (a :: Message). MessageFlags a -> Int -> Bool
forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
forall (a :: Message).
MessageFlags a -> MessageFlags a -> MessageFlags a
$c.&. :: forall (a :: Message).
MessageFlags a -> MessageFlags a -> MessageFlags a
.&. :: MessageFlags a -> MessageFlags a -> MessageFlags a
$c.|. :: forall (a :: Message).
MessageFlags a -> MessageFlags a -> MessageFlags a
.|. :: MessageFlags a -> MessageFlags a -> MessageFlags a
$cxor :: forall (a :: Message).
MessageFlags a -> MessageFlags a -> MessageFlags a
xor :: MessageFlags a -> MessageFlags a -> MessageFlags a
$ccomplement :: forall (a :: Message). MessageFlags a -> MessageFlags a
complement :: MessageFlags a -> MessageFlags a
$cshift :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
shift :: MessageFlags a -> Int -> MessageFlags a
$crotate :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
rotate :: MessageFlags a -> Int -> MessageFlags a
$czeroBits :: forall (a :: Message). MessageFlags a
zeroBits :: MessageFlags a
$cbit :: forall (a :: Message). Int -> MessageFlags a
bit :: Int -> MessageFlags a
$csetBit :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
setBit :: MessageFlags a -> Int -> MessageFlags a
$cclearBit :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
clearBit :: MessageFlags a -> Int -> MessageFlags a
$ccomplementBit :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
complementBit :: MessageFlags a -> Int -> MessageFlags a
$ctestBit :: forall (a :: Message). MessageFlags a -> Int -> Bool
testBit :: MessageFlags a -> Int -> Bool
$cbitSizeMaybe :: forall (a :: Message). MessageFlags a -> Maybe Int
bitSizeMaybe :: MessageFlags a -> Maybe Int
$cbitSize :: forall (a :: Message). MessageFlags a -> Int
bitSize :: MessageFlags a -> Int
$cisSigned :: forall (a :: Message). MessageFlags a -> Bool
isSigned :: MessageFlags a -> Bool
$cshiftL :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
shiftL :: MessageFlags a -> Int -> MessageFlags a
$cunsafeShiftL :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
unsafeShiftL :: MessageFlags a -> Int -> MessageFlags a
$cshiftR :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
shiftR :: MessageFlags a -> Int -> MessageFlags a
$cunsafeShiftR :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
unsafeShiftR :: MessageFlags a -> Int -> MessageFlags a
$crotateL :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
rotateL :: MessageFlags a -> Int -> MessageFlags a
$crotateR :: forall (a :: Message). MessageFlags a -> Int -> MessageFlags a
rotateR :: MessageFlags a -> Int -> MessageFlags a
$cpopCount :: forall (a :: Message). MessageFlags a -> Int
popCount :: MessageFlags a -> Int
Bits)
instance Semigroup (MessageFlags m) where <> :: MessageFlags m -> MessageFlags m -> MessageFlags m
(<>) = MessageFlags m -> MessageFlags m -> MessageFlags m
forall a. Bits a => a -> a -> a
(.|.)
instance Monoid (MessageFlags m) where mempty :: MessageFlags m
mempty = CInt -> MessageFlags m
forall (m :: Message). CInt -> MessageFlags m
MessageFlags CInt
0
newtype AddressInfoFlags = AddressInfoFlags CInt
deriving newtype (AddressInfoFlags -> AddressInfoFlags -> Bool
(AddressInfoFlags -> AddressInfoFlags -> Bool)
-> (AddressInfoFlags -> AddressInfoFlags -> Bool)
-> Eq AddressInfoFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddressInfoFlags -> AddressInfoFlags -> Bool
== :: AddressInfoFlags -> AddressInfoFlags -> Bool
$c/= :: AddressInfoFlags -> AddressInfoFlags -> Bool
/= :: AddressInfoFlags -> AddressInfoFlags -> Bool
Eq,Ptr AddressInfoFlags -> IO AddressInfoFlags
Ptr AddressInfoFlags -> Int -> IO AddressInfoFlags
Ptr AddressInfoFlags -> Int -> AddressInfoFlags -> IO ()
Ptr AddressInfoFlags -> AddressInfoFlags -> IO ()
AddressInfoFlags -> Int
(AddressInfoFlags -> Int)
-> (AddressInfoFlags -> Int)
-> (Ptr AddressInfoFlags -> Int -> IO AddressInfoFlags)
-> (Ptr AddressInfoFlags -> Int -> AddressInfoFlags -> IO ())
-> (forall b. Ptr b -> Int -> IO AddressInfoFlags)
-> (forall b. Ptr b -> Int -> AddressInfoFlags -> IO ())
-> (Ptr AddressInfoFlags -> IO AddressInfoFlags)
-> (Ptr AddressInfoFlags -> AddressInfoFlags -> IO ())
-> Storable AddressInfoFlags
forall b. Ptr b -> Int -> IO AddressInfoFlags
forall b. Ptr b -> Int -> AddressInfoFlags -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: AddressInfoFlags -> Int
sizeOf :: AddressInfoFlags -> Int
$calignment :: AddressInfoFlags -> Int
alignment :: AddressInfoFlags -> Int
$cpeekElemOff :: Ptr AddressInfoFlags -> Int -> IO AddressInfoFlags
peekElemOff :: Ptr AddressInfoFlags -> Int -> IO AddressInfoFlags
$cpokeElemOff :: Ptr AddressInfoFlags -> Int -> AddressInfoFlags -> IO ()
pokeElemOff :: Ptr AddressInfoFlags -> Int -> AddressInfoFlags -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AddressInfoFlags
peekByteOff :: forall b. Ptr b -> Int -> IO AddressInfoFlags
$cpokeByteOff :: forall b. Ptr b -> Int -> AddressInfoFlags -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> AddressInfoFlags -> IO ()
$cpeek :: Ptr AddressInfoFlags -> IO AddressInfoFlags
peek :: Ptr AddressInfoFlags -> IO AddressInfoFlags
$cpoke :: Ptr AddressInfoFlags -> AddressInfoFlags -> IO ()
poke :: Ptr AddressInfoFlags -> AddressInfoFlags -> IO ()
Storable)
instance Semigroup AddressInfoFlags where
AddressInfoFlags CInt
x <> :: AddressInfoFlags -> AddressInfoFlags -> AddressInfoFlags
<> AddressInfoFlags CInt
y = CInt -> AddressInfoFlags
AddressInfoFlags (CInt
x CInt -> CInt -> CInt
forall a. Bits a => a -> a -> a
.|. CInt
y)
instance Monoid AddressInfoFlags where mempty :: AddressInfoFlags
mempty = CInt -> AddressInfoFlags
AddressInfoFlags CInt
0
newtype SocketAddress = SocketAddress ByteArray
deriving newtype (SocketAddress -> SocketAddress -> Bool
(SocketAddress -> SocketAddress -> Bool)
-> (SocketAddress -> SocketAddress -> Bool) -> Eq SocketAddress
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SocketAddress -> SocketAddress -> Bool
== :: SocketAddress -> SocketAddress -> Bool
$c/= :: SocketAddress -> SocketAddress -> Bool
/= :: SocketAddress -> SocketAddress -> Bool
Eq,Int -> SocketAddress -> ShowS
[SocketAddress] -> ShowS
SocketAddress -> String
(Int -> SocketAddress -> ShowS)
-> (SocketAddress -> String)
-> ([SocketAddress] -> ShowS)
-> Show SocketAddress
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SocketAddress -> ShowS
showsPrec :: Int -> SocketAddress -> ShowS
$cshow :: SocketAddress -> String
show :: SocketAddress -> String
$cshowList :: [SocketAddress] -> ShowS
showList :: [SocketAddress] -> ShowS
Show)
newtype OptionValue = OptionValue ByteArray
data SocketAddressInternet = SocketAddressInternet
{ SocketAddressInternet -> Word16
port :: !Word16
, SocketAddressInternet -> Word32
address :: !Word32
} deriving (SocketAddressInternet -> SocketAddressInternet -> Bool
(SocketAddressInternet -> SocketAddressInternet -> Bool)
-> (SocketAddressInternet -> SocketAddressInternet -> Bool)
-> Eq SocketAddressInternet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SocketAddressInternet -> SocketAddressInternet -> Bool
== :: SocketAddressInternet -> SocketAddressInternet -> Bool
$c/= :: SocketAddressInternet -> SocketAddressInternet -> Bool
/= :: SocketAddressInternet -> SocketAddressInternet -> Bool
Eq,Int -> SocketAddressInternet -> ShowS
[SocketAddressInternet] -> ShowS
SocketAddressInternet -> String
(Int -> SocketAddressInternet -> ShowS)
-> (SocketAddressInternet -> String)
-> ([SocketAddressInternet] -> ShowS)
-> Show SocketAddressInternet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SocketAddressInternet -> ShowS
showsPrec :: Int -> SocketAddressInternet -> ShowS
$cshow :: SocketAddressInternet -> String
show :: SocketAddressInternet -> String
$cshowList :: [SocketAddressInternet] -> ShowS
showList :: [SocketAddressInternet] -> ShowS
Show)
instance Prim SocketAddressInternet where
sizeOf# :: SocketAddressInternet -> Int#
sizeOf# SocketAddressInternet
_ = Int -> Int#
unI (Int
16)
{-# LINE 233 "src/Posix/Socket/Types.hsc" #-}
alignment# _ = PM.alignment# (undefined :: Word)
indexByteArray# :: ByteArray# -> Int# -> SocketAddressInternet
indexByteArray# ByteArray#
arr Int#
i = SocketAddressInternet
{ $sel:port:SocketAddressInternet :: Word16
port = (\ByteArray#
hsc_arr Int#
hsc_ix -> ByteArray# -> Int# -> Word16
forall a. Prim a => ByteArray# -> Int# -> a
indexByteArray# ByteArray#
hsc_arr (Int#
1# Int# -> Int# -> Int#
+# (Int#
hsc_ix Int# -> Int# -> Int#
*# Int#
8#))) ByteArray#
arr Int#
i
{-# LINE 236 "src/Posix/Socket/Types.hsc" #-}
, address = (\hsc_arr hsc_ix -> indexByteArray# hsc_arr (1# +# (hsc_ix *# 4#))) arr i
{-# LINE 237 "src/Posix/Socket/Types.hsc" #-}
}
indexOffAddr# :: Addr# -> Int# -> SocketAddressInternet
indexOffAddr# Addr#
arr Int#
i = SocketAddressInternet
{ $sel:port:SocketAddressInternet :: Word16
port = (\Addr#
hsc_arr Int#
hsc_ix -> Addr# -> Int# -> Word16
forall a. Prim a => Addr# -> Int# -> a
indexOffAddr# Addr#
hsc_arr (Int#
1# Int# -> Int# -> Int#
+# (Int#
hsc_ix Int# -> Int# -> Int#
*# Int#
8#))) Addr#
arr Int#
i
{-# LINE 240 "src/Posix/Socket/Types.hsc" #-}
, address = (\hsc_arr hsc_ix -> indexOffAddr# hsc_arr (1# +# (hsc_ix *# 4#))) arr i
{-# LINE 241 "src/Posix/Socket/Types.hsc" #-}
}
readByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SocketAddressInternet #)
readByteArray# MutableByteArray# s
arr Int#
i State# s
s0 =
case (\MutableByteArray# s
hsc_arr Int#
hsc_ix -> MutableByteArray# s -> Int# -> State# s -> (# State# s, Word16 #)
forall s.
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word16 #)
forall a s.
Prim a =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)
readByteArray# MutableByteArray# s
hsc_arr (Int#
1# Int# -> Int# -> Int#
+# (Int#
hsc_ix Int# -> Int# -> Int#
*# Int#
8#))) MutableByteArray# s
arr Int#
i State# s
s0 of
{-# LINE 244 "src/Posix/Socket/Types.hsc" #-}
(# s1, port #) -> case (\hsc_arr hsc_ix -> readByteArray# hsc_arr (1# +# (hsc_ix *# 4#))) arr i s1 of
{-# LINE 245 "src/Posix/Socket/Types.hsc" #-}
(# s2, address #) -> (# s2, SocketAddressInternet{port,address} #)
readOffAddr# :: forall s.
Addr# -> Int# -> State# s -> (# State# s, SocketAddressInternet #)
readOffAddr# Addr#
arr Int#
i State# s
s0 =
case (\Addr#
hsc_arr Int#
hsc_ix -> Addr# -> Int# -> State# s -> (# State# s, Word16 #)
forall s. Addr# -> Int# -> State# s -> (# State# s, Word16 #)
forall a s.
Prim a =>
Addr# -> Int# -> State# s -> (# State# s, a #)
readOffAddr# Addr#
hsc_arr (Int#
1# Int# -> Int# -> Int#
+# (Int#
hsc_ix Int# -> Int# -> Int#
*# Int#
8#))) Addr#
arr Int#
i State# s
s0 of
{-# LINE 248 "src/Posix/Socket/Types.hsc" #-}
(# s1, port #) -> case (\hsc_arr hsc_ix -> readOffAddr# hsc_arr (1# +# (hsc_ix *# 4#))) arr i s1 of
{-# LINE 249 "src/Posix/Socket/Types.hsc" #-}
(# s2, address #) -> (# s2, SocketAddressInternet{port,address} #)
writeByteArray# :: forall s.
MutableByteArray# s
-> Int# -> SocketAddressInternet -> State# s -> State# s
writeByteArray# MutableByteArray# s
arr Int#
i SocketAddressInternet{Word16
$sel:port:SocketAddressInternet :: SocketAddressInternet -> Word16
port :: Word16
port,Word32
$sel:address:SocketAddressInternet :: SocketAddressInternet -> Word32
address :: Word32
address} State# s
s0 =
case (\MutableByteArray# s
hsc_arr Int#
hsc_ix -> MutableByteArray# s -> Int# -> Word16 -> State# s -> State# s
forall s.
MutableByteArray# s -> Int# -> Word16 -> State# s -> State# s
forall a s.
Prim a =>
MutableByteArray# s -> Int# -> a -> State# s -> State# s
writeByteArray# MutableByteArray# s
hsc_arr (Int#
0# Int# -> Int# -> Int#
+# (Int#
hsc_ix Int# -> Int# -> Int#
*# Int#
8#))) MutableByteArray# s
arr Int#
i (Word16
2 :: Word16) State# s
s0 of
{-# LINE 252 "src/Posix/Socket/Types.hsc" #-}
s1 -> case (\hsc_arr hsc_ix -> writeByteArray# hsc_arr (1# +# (hsc_ix *# 8#))) arr i port s1 of
{-# LINE 253 "src/Posix/Socket/Types.hsc" #-}
s2 -> (\hsc_arr hsc_ix -> writeByteArray# hsc_arr (1# +# (hsc_ix *# 4#))) arr i address s2
{-# LINE 254 "src/Posix/Socket/Types.hsc" #-}
writeOffAddr# arr i SocketAddressInternet{port,address} s0 =
case (\hsc_arr hsc_ix -> writeOffAddr# hsc_arr (0# +# (hsc_ix *# 8#))) arr i (2 :: Word16) s0 of
{-# LINE 256 "src/Posix/Socket/Types.hsc" #-}
s1 -> case (\hsc_arr hsc_ix -> writeOffAddr# hsc_arr (1# +# (hsc_ix *# 8#))) arr i port s1 of
{-# LINE 257 "src/Posix/Socket/Types.hsc" #-}
s2 -> (\hsc_arr hsc_ix -> writeOffAddr# hsc_arr (1# +# (hsc_ix *# 4#))) arr i address s2
{-# LINE 258 "src/Posix/Socket/Types.hsc" #-}
setByteArray# = PM.defaultSetByteArray#
setOffAddr# :: forall s.
Addr#
-> Int# -> Int# -> SocketAddressInternet -> State# s -> State# s
setOffAddr# = Addr#
-> Int# -> Int# -> SocketAddressInternet -> State# s -> State# s
forall a s.
Prim a =>
Addr# -> Int# -> Int# -> a -> State# s -> State# s
PM.defaultSetOffAddr#
data SocketAddressInternet6 = SocketAddressInternet6
{ SocketAddressInternet6 -> Word16
port :: !Word16
, SocketAddressInternet6 -> Word32
flowInfo :: !Word32
, SocketAddressInternet6 -> Word64
addressA :: !Word64
, SocketAddressInternet6 -> Word64
addressB :: !Word64
, SocketAddressInternet6 -> Word32
scopeId :: !Word32
}
newtype SocketAddressUnix = SocketAddressUnix
{ SocketAddressUnix -> ByteArray
path :: ByteArray
}
stream :: Type
stream :: Type
stream = CInt -> Type
Type CInt
1
{-# LINE 291 "src/Posix/Socket/Types.hsc" #-}
datagram :: Type
datagram :: Type
datagram = CInt -> Type
Type CInt
2
{-# LINE 295 "src/Posix/Socket/Types.hsc" #-}
raw :: Type
raw :: Type
raw = CInt -> Type
Type CInt
3
{-# LINE 305 "src/Posix/Socket/Types.hsc" #-}
sequencedPacket :: Type
sequencedPacket :: Type
sequencedPacket = CInt -> Type
Type CInt
5
{-# LINE 309 "src/Posix/Socket/Types.hsc" #-}
pattern Unix :: Family
pattern $mUnix :: forall {r}. Family -> ((# #) -> r) -> ((# #) -> r) -> r
$bUnix :: Family
Unix = Family 1
{-# LINE 313 "src/Posix/Socket/Types.hsc" #-}
pattern Unspecified :: Family
pattern $mUnspecified :: forall {r}. Family -> ((# #) -> r) -> ((# #) -> r) -> r
$bUnspecified :: Family
Unspecified = Family 0
{-# LINE 317 "src/Posix/Socket/Types.hsc" #-}
pattern Internet :: Family
pattern $mInternet :: forall {r}. Family -> ((# #) -> r) -> ((# #) -> r) -> r
$bInternet :: Family
Internet = Family 2
{-# LINE 321 "src/Posix/Socket/Types.hsc" #-}
pattern Internet6 :: Family
pattern $mInternet6 :: forall {r}. Family -> ((# #) -> r) -> ((# #) -> r) -> r
$bInternet6 :: Family
Internet6 = Family 10
{-# LINE 329 "src/Posix/Socket/Types.hsc" #-}
outOfBand :: MessageFlags m
outOfBand :: forall (a :: Message). MessageFlags a
outOfBand = CInt -> MessageFlags m
forall (m :: Message). CInt -> MessageFlags m
MessageFlags CInt
1
{-# LINE 333 "src/Posix/Socket/Types.hsc" #-}
peek :: MessageFlags Receive
peek :: MessageFlags 'Receive
peek = CInt -> MessageFlags 'Receive
forall (m :: Message). CInt -> MessageFlags m
MessageFlags CInt
2
{-# LINE 337 "src/Posix/Socket/Types.hsc" #-}
waitAll :: MessageFlags Receive
waitAll :: MessageFlags 'Receive
waitAll = CInt -> MessageFlags 'Receive
forall (m :: Message). CInt -> MessageFlags m
MessageFlags CInt
256
{-# LINE 341 "src/Posix/Socket/Types.hsc" #-}
noSignal :: MessageFlags Send
noSignal :: MessageFlags 'Send
noSignal = CInt -> MessageFlags 'Send
forall (m :: Message). CInt -> MessageFlags m
MessageFlags CInt
16384
{-# LINE 345 "src/Posix/Socket/Types.hsc" #-}
defaultProtocol :: Protocol
defaultProtocol :: Protocol
defaultProtocol = CInt -> Protocol
Protocol CInt
0
rawProtocol :: Protocol
rawProtocol :: Protocol
rawProtocol = CInt -> Protocol
Protocol CInt
255
{-# LINE 353 "src/Posix/Socket/Types.hsc" #-}
icmp :: Protocol
icmp :: Protocol
icmp = CInt -> Protocol
Protocol CInt
1
{-# LINE 357 "src/Posix/Socket/Types.hsc" #-}
tcp :: Protocol
tcp :: Protocol
tcp = CInt -> Protocol
Protocol CInt
6
{-# LINE 361 "src/Posix/Socket/Types.hsc" #-}
udp :: Protocol
udp :: Protocol
udp = CInt -> Protocol
Protocol CInt
17
{-# LINE 365 "src/Posix/Socket/Types.hsc" #-}
ip :: Protocol
ip :: Protocol
ip = CInt -> Protocol
Protocol CInt
0
{-# LINE 369 "src/Posix/Socket/Types.hsc" #-}
ipv6 :: Protocol
ipv6 :: Protocol
ipv6 = CInt -> Protocol
Protocol CInt
41
{-# LINE 373 "src/Posix/Socket/Types.hsc" #-}
read :: ShutdownType
read :: ShutdownType
read = CInt -> ShutdownType
ShutdownType CInt
0
{-# LINE 377 "src/Posix/Socket/Types.hsc" #-}
write :: ShutdownType
write :: ShutdownType
write = CInt -> ShutdownType
ShutdownType CInt
1
{-# LINE 381 "src/Posix/Socket/Types.hsc" #-}
readWrite :: ShutdownType
readWrite :: ShutdownType
readWrite = CInt -> ShutdownType
ShutdownType CInt
2
{-# LINE 385 "src/Posix/Socket/Types.hsc" #-}
levelSocket :: Level
levelSocket :: Level
levelSocket = CInt -> Level
Level CInt
1
{-# LINE 389 "src/Posix/Socket/Types.hsc" #-}
optionError :: OptionName
optionError :: OptionName
optionError = CInt -> OptionName
OptionName CInt
4
{-# LINE 393 "src/Posix/Socket/Types.hsc" #-}
bindToDevice :: OptionName
bindToDevice :: OptionName
bindToDevice = CInt -> OptionName
OptionName CInt
25
{-# LINE 397 "src/Posix/Socket/Types.hsc" #-}
reuseAddress :: OptionName
reuseAddress :: OptionName
reuseAddress = CInt -> OptionName
OptionName CInt
2
{-# LINE 401 "src/Posix/Socket/Types.hsc" #-}
broadcast :: OptionName
broadcast :: OptionName
broadcast = CInt -> OptionName
OptionName CInt
6
{-# LINE 405 "src/Posix/Socket/Types.hsc" #-}
peekControlMessageHeaderLength :: Addr -> IO CInt
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
0) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 408 "src/Posix/Socket/Types.hsc" #-}
peekControlMessageHeaderLevel :: Addr -> IO Level
(Addr Addr#
p) = do
CInt
i <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
8) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 412 "src/Posix/Socket/Types.hsc" #-}
pure (Level i)
peekControlMessageHeaderType :: Addr -> IO Type
(Addr Addr#
p) = do
CInt
i <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
12) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 418 "src/Posix/Socket/Types.hsc" #-}
pure (Type i)
peekIOVectorBase :: Addr -> IO Addr
peekIOVectorBase :: Addr -> IO Addr
peekIOVectorBase (Addr Addr#
p) = do
Ptr Addr#
x <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO (Ptr Any)
forall b. Ptr b -> Int -> IO (Ptr Any)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
0) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 429 "src/Posix/Socket/Types.hsc" #-}
pure (Addr x)
peekIOVectorLength :: Addr -> IO CSize
peekIOVectorLength :: Addr -> IO CSize
peekIOVectorLength (Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CSize
forall b. Ptr b -> Int -> IO CSize
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
8) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 434 "src/Posix/Socket/Types.hsc" #-}
sizeofMessageHeader :: CInt
= (CInt
56)
{-# LINE 438 "src/Posix/Socket/Types.hsc" #-}
peekAddressInfoFlags :: Ptr AddressInfo -> IO AddressInfoFlags
peekAddressInfoFlags :: Ptr AddressInfo -> IO AddressInfoFlags
peekAddressInfoFlags Ptr AddressInfo
ptr = do
CInt
x <- (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
0) Ptr AddressInfo
ptr
{-# LINE 443 "src/Posix/Socket/Types.hsc" #-}
pure (AddressInfoFlags x)
pokeAddressInfoFlags :: Ptr AddressInfo -> AddressInfoFlags -> IO ()
pokeAddressInfoFlags :: Ptr AddressInfo -> AddressInfoFlags -> IO ()
pokeAddressInfoFlags Ptr AddressInfo
ptr (AddressInfoFlags CInt
x) = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> CInt -> IO ()
forall b. Ptr b -> Int -> CInt -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AddressInfo
hsc_ptr Int
0) Ptr AddressInfo
ptr CInt
x
{-# LINE 448 "src/Posix/Socket/Types.hsc" #-}
peekAddressInfoFamily :: Ptr AddressInfo -> IO Family
peekAddressInfoFamily :: Ptr AddressInfo -> IO Family
peekAddressInfoFamily Ptr AddressInfo
ptr = do
CInt
x <- (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
4) Ptr AddressInfo
ptr
{-# LINE 453 "src/Posix/Socket/Types.hsc" #-}
pure (Family x)
peekAddressInfoSocketType :: Ptr AddressInfo -> IO Type
peekAddressInfoSocketType :: Ptr AddressInfo -> IO Type
peekAddressInfoSocketType Ptr AddressInfo
ptr = do
CInt
x <- (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
8) Ptr AddressInfo
ptr
{-# LINE 459 "src/Posix/Socket/Types.hsc" #-}
pure (Type x)
peekAddressInfoProtocol :: Ptr AddressInfo -> IO Protocol
peekAddressInfoProtocol :: Ptr AddressInfo -> IO Protocol
peekAddressInfoProtocol Ptr AddressInfo
ptr = do
CInt
x <- (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
12) Ptr AddressInfo
ptr
{-# LINE 465 "src/Posix/Socket/Types.hsc" #-}
pure (Protocol x)
peekAddressInfoAddressLength :: Ptr AddressInfo -> IO CInt
peekAddressInfoAddressLength :: Ptr AddressInfo -> IO CInt
peekAddressInfoAddressLength Ptr AddressInfo
ptr = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
16) Ptr AddressInfo
ptr
{-# LINE 470 "src/Posix/Socket/Types.hsc" #-}
peekAddressInfoAddress :: Ptr AddressInfo -> IO (Ptr SocketAddress)
peekAddressInfoAddress :: Ptr AddressInfo -> IO (Ptr SocketAddress)
peekAddressInfoAddress Ptr AddressInfo
ptr = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO (Ptr SocketAddress)
forall b. Ptr b -> Int -> IO (Ptr SocketAddress)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
24) Ptr AddressInfo
ptr
{-# LINE 474 "src/Posix/Socket/Types.hsc" #-}
peekAddressInfoNext :: Ptr AddressInfo -> IO (Ptr AddressInfo)
peekAddressInfoNext :: Ptr AddressInfo -> IO (Ptr AddressInfo)
peekAddressInfoNext Ptr AddressInfo
ptr = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> IO (Ptr AddressInfo)
forall b. Ptr b -> Int -> IO (Ptr AddressInfo)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr AddressInfo
hsc_ptr Int
40) Ptr AddressInfo
ptr
{-# LINE 478 "src/Posix/Socket/Types.hsc" #-}
pokeAddressInfoFamily :: Ptr AddressInfo -> Family -> IO ()
pokeAddressInfoFamily :: Ptr AddressInfo -> Family -> IO ()
pokeAddressInfoFamily Ptr AddressInfo
ptr (Family CInt
x) = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> CInt -> IO ()
forall b. Ptr b -> Int -> CInt -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AddressInfo
hsc_ptr Int
4) Ptr AddressInfo
ptr CInt
x
{-# LINE 482 "src/Posix/Socket/Types.hsc" #-}
pokeAddressInfoSocketType :: Ptr AddressInfo -> Type -> IO ()
pokeAddressInfoSocketType :: Ptr AddressInfo -> Type -> IO ()
pokeAddressInfoSocketType Ptr AddressInfo
ptr (Type CInt
x) = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> CInt -> IO ()
forall b. Ptr b -> Int -> CInt -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AddressInfo
hsc_ptr Int
8) Ptr AddressInfo
ptr CInt
x
{-# LINE 486 "src/Posix/Socket/Types.hsc" #-}
pokeAddressInfoProtocol :: Ptr AddressInfo -> Protocol -> IO ()
pokeAddressInfoProtocol :: Ptr AddressInfo -> Protocol -> IO ()
pokeAddressInfoProtocol Ptr AddressInfo
ptr (Protocol CInt
x) = (\Ptr AddressInfo
hsc_ptr -> Ptr AddressInfo -> Int -> CInt -> IO ()
forall b. Ptr b -> Int -> CInt -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AddressInfo
hsc_ptr Int
12) Ptr AddressInfo
ptr CInt
x
{-# LINE 490 "src/Posix/Socket/Types.hsc" #-}
sizeofAddressInfo :: Int
sizeofAddressInfo :: Int
sizeofAddressInfo = (Int
48)
{-# LINE 494 "src/Posix/Socket/Types.hsc" #-}
sizeofIOVector :: CInt
sizeofIOVector :: CInt
sizeofIOVector = (CInt
16)
{-# LINE 498 "src/Posix/Socket/Types.hsc" #-}
peekMessageHeaderName :: Addr -> IO Addr
(Addr Addr#
p) = do
Ptr Addr#
x <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO (Ptr Any)
forall b. Ptr b -> Int -> IO (Ptr Any)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
0) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 502 "src/Posix/Socket/Types.hsc" #-}
pure (Addr x)
pokeMessageHeaderName :: Addr -> Addr -> IO ()
(Addr Addr#
p) (Addr Addr#
x) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> Ptr Any -> IO ()
forall b. Ptr b -> Int -> Ptr Any -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
0) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
x)
{-# LINE 506 "src/Posix/Socket/Types.hsc" #-}
pokeMessageHeaderNameLength :: Addr -> CInt -> IO ()
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> CInt -> IO ()
forall b. Ptr b -> Int -> CInt -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
8) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 509 "src/Posix/Socket/Types.hsc" #-}
pokeMessageHeaderIOVector :: Addr -> Addr -> IO ()
(Addr Addr#
p) (Addr Addr#
x) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> Ptr Any -> IO ()
forall b. Ptr b -> Int -> Ptr Any -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
16) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
x)
{-# LINE 512 "src/Posix/Socket/Types.hsc" #-}
pokeMessageHeaderIOVectorLength :: Addr -> CSize -> IO ()
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> CSize -> IO ()
forall b. Ptr b -> Int -> CSize -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
24) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 515 "src/Posix/Socket/Types.hsc" #-}
pokeMessageHeaderControl :: Addr -> Addr -> IO ()
(Addr Addr#
p) (Addr Addr#
x) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> Ptr Any -> IO ()
forall b. Ptr b -> Int -> Ptr Any -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
32) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
x)
{-# LINE 518 "src/Posix/Socket/Types.hsc" #-}
pokeMessageHeaderControlLength :: Addr -> CSize -> IO ()
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> CSize -> IO ()
forall b. Ptr b -> Int -> CSize -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
40) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 521 "src/Posix/Socket/Types.hsc" #-}
pokeMessageHeaderFlags :: Addr -> MessageFlags Receive -> IO ()
(Addr Addr#
p) (MessageFlags CInt
i) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> CInt -> IO ()
forall b. Ptr b -> Int -> CInt -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
48) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p) CInt
i
{-# LINE 524 "src/Posix/Socket/Types.hsc" #-}
peekMessageHeaderNameLength :: Addr -> IO CInt
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
8) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 527 "src/Posix/Socket/Types.hsc" #-}
peekMessageHeaderIOVector :: Addr -> IO Addr
(Addr Addr#
p) = do
Ptr Addr#
r <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO (Ptr Any)
forall b. Ptr b -> Int -> IO (Ptr Any)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
16) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 531 "src/Posix/Socket/Types.hsc" #-}
pure (Addr r)
peekMessageHeaderIOVectorLength :: Addr -> IO CSize
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CSize
forall b. Ptr b -> Int -> IO CSize
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
24) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 535 "src/Posix/Socket/Types.hsc" #-}
peekMessageHeaderControl :: Addr -> IO Addr
(Addr Addr#
p) = do
Ptr Addr#
r <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO (Ptr Any)
forall b. Ptr b -> Int -> IO (Ptr Any)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
32) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 539 "src/Posix/Socket/Types.hsc" #-}
pure (Addr r)
pokeIOVectorBase :: Addr -> Addr -> IO ()
pokeIOVectorBase :: Addr -> Addr -> IO ()
pokeIOVectorBase (Addr Addr#
p) (Addr Addr#
x) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> Ptr Any -> IO ()
forall b. Ptr b -> Int -> Ptr Any -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
0) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
x)
{-# LINE 543 "src/Posix/Socket/Types.hsc" #-}
pokeIOVectorLength :: Addr -> CSize -> IO ()
pokeIOVectorLength :: Addr -> CSize -> IO ()
pokeIOVectorLength (Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> CSize -> IO ()
forall b. Ptr b -> Int -> CSize -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr Any
hsc_ptr Int
8) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 546 "src/Posix/Socket/Types.hsc" #-}
peekMessageHeaderControlLength :: Addr -> IO CSize
(Addr Addr#
p) = (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CSize
forall b. Ptr b -> Int -> IO CSize
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
40) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 549 "src/Posix/Socket/Types.hsc" #-}
peekMessageHeaderFlags :: Addr -> IO (MessageFlags Receive)
(Addr Addr#
p) = do
CInt
i <- (\Ptr Any
hsc_ptr -> Ptr Any -> Int -> IO CInt
forall b. Ptr b -> Int -> IO CInt
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr Any
hsc_ptr Int
48) (Addr# -> Ptr Any
forall a. Addr# -> Ptr a
Ptr Addr#
p)
{-# LINE 553 "src/Posix/Socket/Types.hsc" #-}
pure (MessageFlags i)
unI :: Int -> Int#
unI :: Int -> Int#
unI (I# Int#
i) = Int#
i