#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Interfaces.DtlsClientConnection
(
DtlsClientConnection(..) ,
noDtlsClientConnection ,
IsDtlsClientConnection ,
toDtlsClientConnection ,
#if ENABLE_OVERLOADING
DtlsClientConnectionGetAcceptedCasMethodInfo,
#endif
dtlsClientConnectionGetAcceptedCas ,
#if ENABLE_OVERLOADING
DtlsClientConnectionGetServerIdentityMethodInfo,
#endif
dtlsClientConnectionGetServerIdentity ,
#if ENABLE_OVERLOADING
DtlsClientConnectionGetValidationFlagsMethodInfo,
#endif
dtlsClientConnectionGetValidationFlags ,
dtlsClientConnectionNew ,
#if ENABLE_OVERLOADING
DtlsClientConnectionSetServerIdentityMethodInfo,
#endif
dtlsClientConnectionSetServerIdentity ,
#if ENABLE_OVERLOADING
DtlsClientConnectionSetValidationFlagsMethodInfo,
#endif
dtlsClientConnectionSetValidationFlags ,
#if ENABLE_OVERLOADING
DtlsClientConnectionAcceptedCasPropertyInfo,
#endif
#if ENABLE_OVERLOADING
dtlsClientConnectionAcceptedCas ,
#endif
getDtlsClientConnectionAcceptedCas ,
#if ENABLE_OVERLOADING
DtlsClientConnectionServerIdentityPropertyInfo,
#endif
constructDtlsClientConnectionServerIdentity,
#if ENABLE_OVERLOADING
dtlsClientConnectionServerIdentity ,
#endif
getDtlsClientConnectionServerIdentity ,
setDtlsClientConnectionServerIdentity ,
#if ENABLE_OVERLOADING
DtlsClientConnectionValidationFlagsPropertyInfo,
#endif
constructDtlsClientConnectionValidationFlags,
#if ENABLE_OVERLOADING
dtlsClientConnectionValidationFlags ,
#endif
getDtlsClientConnectionValidationFlags ,
setDtlsClientConnectionValidationFlags ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DatagramBased as Gio.DatagramBased
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DtlsConnection as Gio.DtlsConnection
import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
newtype DtlsClientConnection = DtlsClientConnection (ManagedPtr DtlsClientConnection)
noDtlsClientConnection :: Maybe DtlsClientConnection
noDtlsClientConnection = Nothing
#if ENABLE_OVERLOADING
type instance O.SignalList DtlsClientConnection = DtlsClientConnectionSignalList
type DtlsClientConnectionSignalList = ('[ '("acceptCertificate", Gio.DtlsConnection.DtlsConnectionAcceptCertificateSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dtls_client_connection_get_type"
c_g_dtls_client_connection_get_type :: IO GType
instance GObject DtlsClientConnection where
gobjectType = c_g_dtls_client_connection_get_type
class (GObject o, O.IsDescendantOf DtlsClientConnection o) => IsDtlsClientConnection o
instance (GObject o, O.IsDescendantOf DtlsClientConnection o) => IsDtlsClientConnection o
instance O.HasParentTypes DtlsClientConnection
type instance O.ParentTypes DtlsClientConnection = '[Gio.DatagramBased.DatagramBased, Gio.DtlsConnection.DtlsConnection, GObject.Object.Object]
toDtlsClientConnection :: (MonadIO m, IsDtlsClientConnection o) => o -> m DtlsClientConnection
toDtlsClientConnection = liftIO . unsafeCastTo DtlsClientConnection
getDtlsClientConnectionAcceptedCas :: (MonadIO m, IsDtlsClientConnection o) => o -> m ([Ptr ()])
getDtlsClientConnectionAcceptedCas obj = liftIO $ B.Properties.getObjectPropertyPtrGList obj "accepted-cas"
#if ENABLE_OVERLOADING
data DtlsClientConnectionAcceptedCasPropertyInfo
instance AttrInfo DtlsClientConnectionAcceptedCasPropertyInfo where
type AttrAllowedOps DtlsClientConnectionAcceptedCasPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DtlsClientConnectionAcceptedCasPropertyInfo = (~) ()
type AttrBaseTypeConstraint DtlsClientConnectionAcceptedCasPropertyInfo = IsDtlsClientConnection
type AttrGetType DtlsClientConnectionAcceptedCasPropertyInfo = ([Ptr ()])
type AttrLabel DtlsClientConnectionAcceptedCasPropertyInfo = "accepted-cas"
type AttrOrigin DtlsClientConnectionAcceptedCasPropertyInfo = DtlsClientConnection
attrGet _ = getDtlsClientConnectionAcceptedCas
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDtlsClientConnectionServerIdentity :: (MonadIO m, IsDtlsClientConnection o) => o -> m Gio.SocketConnectable.SocketConnectable
getDtlsClientConnectionServerIdentity obj = liftIO $ checkUnexpectedNothing "getDtlsClientConnectionServerIdentity" $ B.Properties.getObjectPropertyObject obj "server-identity" Gio.SocketConnectable.SocketConnectable
setDtlsClientConnectionServerIdentity :: (MonadIO m, IsDtlsClientConnection o, Gio.SocketConnectable.IsSocketConnectable a) => o -> a -> m ()
setDtlsClientConnectionServerIdentity obj val = liftIO $ B.Properties.setObjectPropertyObject obj "server-identity" (Just val)
constructDtlsClientConnectionServerIdentity :: (IsDtlsClientConnection o, Gio.SocketConnectable.IsSocketConnectable a) => a -> IO (GValueConstruct o)
constructDtlsClientConnectionServerIdentity val = B.Properties.constructObjectPropertyObject "server-identity" (Just val)
#if ENABLE_OVERLOADING
data DtlsClientConnectionServerIdentityPropertyInfo
instance AttrInfo DtlsClientConnectionServerIdentityPropertyInfo where
type AttrAllowedOps DtlsClientConnectionServerIdentityPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DtlsClientConnectionServerIdentityPropertyInfo = Gio.SocketConnectable.IsSocketConnectable
type AttrBaseTypeConstraint DtlsClientConnectionServerIdentityPropertyInfo = IsDtlsClientConnection
type AttrGetType DtlsClientConnectionServerIdentityPropertyInfo = Gio.SocketConnectable.SocketConnectable
type AttrLabel DtlsClientConnectionServerIdentityPropertyInfo = "server-identity"
type AttrOrigin DtlsClientConnectionServerIdentityPropertyInfo = DtlsClientConnection
attrGet _ = getDtlsClientConnectionServerIdentity
attrSet _ = setDtlsClientConnectionServerIdentity
attrConstruct _ = constructDtlsClientConnectionServerIdentity
attrClear _ = undefined
#endif
getDtlsClientConnectionValidationFlags :: (MonadIO m, IsDtlsClientConnection o) => o -> m [Gio.Flags.TlsCertificateFlags]
getDtlsClientConnectionValidationFlags obj = liftIO $ B.Properties.getObjectPropertyFlags obj "validation-flags"
setDtlsClientConnectionValidationFlags :: (MonadIO m, IsDtlsClientConnection o) => o -> [Gio.Flags.TlsCertificateFlags] -> m ()
setDtlsClientConnectionValidationFlags obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "validation-flags" val
constructDtlsClientConnectionValidationFlags :: (IsDtlsClientConnection o) => [Gio.Flags.TlsCertificateFlags] -> IO (GValueConstruct o)
constructDtlsClientConnectionValidationFlags val = B.Properties.constructObjectPropertyFlags "validation-flags" val
#if ENABLE_OVERLOADING
data DtlsClientConnectionValidationFlagsPropertyInfo
instance AttrInfo DtlsClientConnectionValidationFlagsPropertyInfo where
type AttrAllowedOps DtlsClientConnectionValidationFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DtlsClientConnectionValidationFlagsPropertyInfo = (~) [Gio.Flags.TlsCertificateFlags]
type AttrBaseTypeConstraint DtlsClientConnectionValidationFlagsPropertyInfo = IsDtlsClientConnection
type AttrGetType DtlsClientConnectionValidationFlagsPropertyInfo = [Gio.Flags.TlsCertificateFlags]
type AttrLabel DtlsClientConnectionValidationFlagsPropertyInfo = "validation-flags"
type AttrOrigin DtlsClientConnectionValidationFlagsPropertyInfo = DtlsClientConnection
attrGet _ = getDtlsClientConnectionValidationFlags
attrSet _ = setDtlsClientConnectionValidationFlags
attrConstruct _ = constructDtlsClientConnectionValidationFlags
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DtlsClientConnection
type instance O.AttributeList DtlsClientConnection = DtlsClientConnectionAttributeList
type DtlsClientConnectionAttributeList = ('[ '("acceptedCas", DtlsClientConnectionAcceptedCasPropertyInfo), '("advertisedProtocols", Gio.DtlsConnection.DtlsConnectionAdvertisedProtocolsPropertyInfo), '("baseSocket", Gio.DtlsConnection.DtlsConnectionBaseSocketPropertyInfo), '("certificate", Gio.DtlsConnection.DtlsConnectionCertificatePropertyInfo), '("database", Gio.DtlsConnection.DtlsConnectionDatabasePropertyInfo), '("interaction", Gio.DtlsConnection.DtlsConnectionInteractionPropertyInfo), '("negotiatedProtocol", Gio.DtlsConnection.DtlsConnectionNegotiatedProtocolPropertyInfo), '("peerCertificate", Gio.DtlsConnection.DtlsConnectionPeerCertificatePropertyInfo), '("peerCertificateErrors", Gio.DtlsConnection.DtlsConnectionPeerCertificateErrorsPropertyInfo), '("rehandshakeMode", Gio.DtlsConnection.DtlsConnectionRehandshakeModePropertyInfo), '("requireCloseNotify", Gio.DtlsConnection.DtlsConnectionRequireCloseNotifyPropertyInfo), '("serverIdentity", DtlsClientConnectionServerIdentityPropertyInfo), '("validationFlags", DtlsClientConnectionValidationFlagsPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
dtlsClientConnectionAcceptedCas :: AttrLabelProxy "acceptedCas"
dtlsClientConnectionAcceptedCas = AttrLabelProxy
dtlsClientConnectionServerIdentity :: AttrLabelProxy "serverIdentity"
dtlsClientConnectionServerIdentity = AttrLabelProxy
dtlsClientConnectionValidationFlags :: AttrLabelProxy "validationFlags"
dtlsClientConnectionValidationFlags = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type family ResolveDtlsClientConnectionMethod (t :: Symbol) (o :: *) :: * where
ResolveDtlsClientConnectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDtlsClientConnectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDtlsClientConnectionMethod "close" o = Gio.DtlsConnection.DtlsConnectionCloseMethodInfo
ResolveDtlsClientConnectionMethod "closeAsync" o = Gio.DtlsConnection.DtlsConnectionCloseAsyncMethodInfo
ResolveDtlsClientConnectionMethod "closeFinish" o = Gio.DtlsConnection.DtlsConnectionCloseFinishMethodInfo
ResolveDtlsClientConnectionMethod "conditionCheck" o = Gio.DatagramBased.DatagramBasedConditionCheckMethodInfo
ResolveDtlsClientConnectionMethod "conditionWait" o = Gio.DatagramBased.DatagramBasedConditionWaitMethodInfo
ResolveDtlsClientConnectionMethod "createSource" o = Gio.DatagramBased.DatagramBasedCreateSourceMethodInfo
ResolveDtlsClientConnectionMethod "emitAcceptCertificate" o = Gio.DtlsConnection.DtlsConnectionEmitAcceptCertificateMethodInfo
ResolveDtlsClientConnectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDtlsClientConnectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDtlsClientConnectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDtlsClientConnectionMethod "handshake" o = Gio.DtlsConnection.DtlsConnectionHandshakeMethodInfo
ResolveDtlsClientConnectionMethod "handshakeAsync" o = Gio.DtlsConnection.DtlsConnectionHandshakeAsyncMethodInfo
ResolveDtlsClientConnectionMethod "handshakeFinish" o = Gio.DtlsConnection.DtlsConnectionHandshakeFinishMethodInfo
ResolveDtlsClientConnectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDtlsClientConnectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDtlsClientConnectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDtlsClientConnectionMethod "receiveMessages" o = Gio.DatagramBased.DatagramBasedReceiveMessagesMethodInfo
ResolveDtlsClientConnectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDtlsClientConnectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDtlsClientConnectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDtlsClientConnectionMethod "sendMessages" o = Gio.DatagramBased.DatagramBasedSendMessagesMethodInfo
ResolveDtlsClientConnectionMethod "shutdown" o = Gio.DtlsConnection.DtlsConnectionShutdownMethodInfo
ResolveDtlsClientConnectionMethod "shutdownAsync" o = Gio.DtlsConnection.DtlsConnectionShutdownAsyncMethodInfo
ResolveDtlsClientConnectionMethod "shutdownFinish" o = Gio.DtlsConnection.DtlsConnectionShutdownFinishMethodInfo
ResolveDtlsClientConnectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDtlsClientConnectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDtlsClientConnectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDtlsClientConnectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDtlsClientConnectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDtlsClientConnectionMethod "getAcceptedCas" o = DtlsClientConnectionGetAcceptedCasMethodInfo
ResolveDtlsClientConnectionMethod "getCertificate" o = Gio.DtlsConnection.DtlsConnectionGetCertificateMethodInfo
ResolveDtlsClientConnectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDtlsClientConnectionMethod "getDatabase" o = Gio.DtlsConnection.DtlsConnectionGetDatabaseMethodInfo
ResolveDtlsClientConnectionMethod "getInteraction" o = Gio.DtlsConnection.DtlsConnectionGetInteractionMethodInfo
ResolveDtlsClientConnectionMethod "getNegotiatedProtocol" o = Gio.DtlsConnection.DtlsConnectionGetNegotiatedProtocolMethodInfo
ResolveDtlsClientConnectionMethod "getPeerCertificate" o = Gio.DtlsConnection.DtlsConnectionGetPeerCertificateMethodInfo
ResolveDtlsClientConnectionMethod "getPeerCertificateErrors" o = Gio.DtlsConnection.DtlsConnectionGetPeerCertificateErrorsMethodInfo
ResolveDtlsClientConnectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDtlsClientConnectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDtlsClientConnectionMethod "getRehandshakeMode" o = Gio.DtlsConnection.DtlsConnectionGetRehandshakeModeMethodInfo
ResolveDtlsClientConnectionMethod "getRequireCloseNotify" o = Gio.DtlsConnection.DtlsConnectionGetRequireCloseNotifyMethodInfo
ResolveDtlsClientConnectionMethod "getServerIdentity" o = DtlsClientConnectionGetServerIdentityMethodInfo
ResolveDtlsClientConnectionMethod "getValidationFlags" o = DtlsClientConnectionGetValidationFlagsMethodInfo
ResolveDtlsClientConnectionMethod "setAdvertisedProtocols" o = Gio.DtlsConnection.DtlsConnectionSetAdvertisedProtocolsMethodInfo
ResolveDtlsClientConnectionMethod "setCertificate" o = Gio.DtlsConnection.DtlsConnectionSetCertificateMethodInfo
ResolveDtlsClientConnectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDtlsClientConnectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDtlsClientConnectionMethod "setDatabase" o = Gio.DtlsConnection.DtlsConnectionSetDatabaseMethodInfo
ResolveDtlsClientConnectionMethod "setInteraction" o = Gio.DtlsConnection.DtlsConnectionSetInteractionMethodInfo
ResolveDtlsClientConnectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDtlsClientConnectionMethod "setRehandshakeMode" o = Gio.DtlsConnection.DtlsConnectionSetRehandshakeModeMethodInfo
ResolveDtlsClientConnectionMethod "setRequireCloseNotify" o = Gio.DtlsConnection.DtlsConnectionSetRequireCloseNotifyMethodInfo
ResolveDtlsClientConnectionMethod "setServerIdentity" o = DtlsClientConnectionSetServerIdentityMethodInfo
ResolveDtlsClientConnectionMethod "setValidationFlags" o = DtlsClientConnectionSetValidationFlagsMethodInfo
ResolveDtlsClientConnectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDtlsClientConnectionMethod t DtlsClientConnection, O.MethodInfo info DtlsClientConnection p) => OL.IsLabel t (DtlsClientConnection -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
foreign import ccall "g_dtls_client_connection_get_accepted_cas" g_dtls_client_connection_get_accepted_cas ::
Ptr DtlsClientConnection ->
IO (Ptr (GList (Ptr GByteArray)))
dtlsClientConnectionGetAcceptedCas ::
(B.CallStack.HasCallStack, MonadIO m, IsDtlsClientConnection a) =>
a
-> m [ByteString]
dtlsClientConnectionGetAcceptedCas conn = liftIO $ do
conn' <- unsafeManagedPtrCastPtr conn
result <- g_dtls_client_connection_get_accepted_cas conn'
result' <- unpackGList result
result'' <- mapM unpackGByteArray result'
mapGList unrefGByteArray result
g_list_free result
touchManagedPtr conn
return result''
#if ENABLE_OVERLOADING
data DtlsClientConnectionGetAcceptedCasMethodInfo
instance (signature ~ (m [ByteString]), MonadIO m, IsDtlsClientConnection a) => O.MethodInfo DtlsClientConnectionGetAcceptedCasMethodInfo a signature where
overloadedMethod _ = dtlsClientConnectionGetAcceptedCas
#endif
foreign import ccall "g_dtls_client_connection_get_server_identity" g_dtls_client_connection_get_server_identity ::
Ptr DtlsClientConnection ->
IO (Ptr Gio.SocketConnectable.SocketConnectable)
dtlsClientConnectionGetServerIdentity ::
(B.CallStack.HasCallStack, MonadIO m, IsDtlsClientConnection a) =>
a
-> m Gio.SocketConnectable.SocketConnectable
dtlsClientConnectionGetServerIdentity conn = liftIO $ do
conn' <- unsafeManagedPtrCastPtr conn
result <- g_dtls_client_connection_get_server_identity conn'
checkUnexpectedReturnNULL "dtlsClientConnectionGetServerIdentity" result
result' <- (newObject Gio.SocketConnectable.SocketConnectable) result
touchManagedPtr conn
return result'
#if ENABLE_OVERLOADING
data DtlsClientConnectionGetServerIdentityMethodInfo
instance (signature ~ (m Gio.SocketConnectable.SocketConnectable), MonadIO m, IsDtlsClientConnection a) => O.MethodInfo DtlsClientConnectionGetServerIdentityMethodInfo a signature where
overloadedMethod _ = dtlsClientConnectionGetServerIdentity
#endif
foreign import ccall "g_dtls_client_connection_get_validation_flags" g_dtls_client_connection_get_validation_flags ::
Ptr DtlsClientConnection ->
IO CUInt
dtlsClientConnectionGetValidationFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsDtlsClientConnection a) =>
a
-> m [Gio.Flags.TlsCertificateFlags]
dtlsClientConnectionGetValidationFlags conn = liftIO $ do
conn' <- unsafeManagedPtrCastPtr conn
result <- g_dtls_client_connection_get_validation_flags conn'
let result' = wordToGFlags result
touchManagedPtr conn
return result'
#if ENABLE_OVERLOADING
data DtlsClientConnectionGetValidationFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.TlsCertificateFlags]), MonadIO m, IsDtlsClientConnection a) => O.MethodInfo DtlsClientConnectionGetValidationFlagsMethodInfo a signature where
overloadedMethod _ = dtlsClientConnectionGetValidationFlags
#endif
foreign import ccall "g_dtls_client_connection_set_server_identity" g_dtls_client_connection_set_server_identity ::
Ptr DtlsClientConnection ->
Ptr Gio.SocketConnectable.SocketConnectable ->
IO ()
dtlsClientConnectionSetServerIdentity ::
(B.CallStack.HasCallStack, MonadIO m, IsDtlsClientConnection a, Gio.SocketConnectable.IsSocketConnectable b) =>
a
-> b
-> m ()
dtlsClientConnectionSetServerIdentity conn identity = liftIO $ do
conn' <- unsafeManagedPtrCastPtr conn
identity' <- unsafeManagedPtrCastPtr identity
g_dtls_client_connection_set_server_identity conn' identity'
touchManagedPtr conn
touchManagedPtr identity
return ()
#if ENABLE_OVERLOADING
data DtlsClientConnectionSetServerIdentityMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDtlsClientConnection a, Gio.SocketConnectable.IsSocketConnectable b) => O.MethodInfo DtlsClientConnectionSetServerIdentityMethodInfo a signature where
overloadedMethod _ = dtlsClientConnectionSetServerIdentity
#endif
foreign import ccall "g_dtls_client_connection_set_validation_flags" g_dtls_client_connection_set_validation_flags ::
Ptr DtlsClientConnection ->
CUInt ->
IO ()
dtlsClientConnectionSetValidationFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsDtlsClientConnection a) =>
a
-> [Gio.Flags.TlsCertificateFlags]
-> m ()
dtlsClientConnectionSetValidationFlags conn flags = liftIO $ do
conn' <- unsafeManagedPtrCastPtr conn
let flags' = gflagsToWord flags
g_dtls_client_connection_set_validation_flags conn' flags'
touchManagedPtr conn
return ()
#if ENABLE_OVERLOADING
data DtlsClientConnectionSetValidationFlagsMethodInfo
instance (signature ~ ([Gio.Flags.TlsCertificateFlags] -> m ()), MonadIO m, IsDtlsClientConnection a) => O.MethodInfo DtlsClientConnectionSetValidationFlagsMethodInfo a signature where
overloadedMethod _ = dtlsClientConnectionSetValidationFlags
#endif
foreign import ccall "g_dtls_client_connection_new" g_dtls_client_connection_new ::
Ptr Gio.DatagramBased.DatagramBased ->
Ptr Gio.SocketConnectable.SocketConnectable ->
Ptr (Ptr GError) ->
IO (Ptr DtlsClientConnection)
dtlsClientConnectionNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DatagramBased.IsDatagramBased a, Gio.SocketConnectable.IsSocketConnectable b) =>
a
-> Maybe (b)
-> m DtlsClientConnection
dtlsClientConnectionNew baseSocket serverIdentity = liftIO $ do
baseSocket' <- unsafeManagedPtrCastPtr baseSocket
maybeServerIdentity <- case serverIdentity of
Nothing -> return nullPtr
Just jServerIdentity -> do
jServerIdentity' <- unsafeManagedPtrCastPtr jServerIdentity
return jServerIdentity'
onException (do
result <- propagateGError $ g_dtls_client_connection_new baseSocket' maybeServerIdentity
checkUnexpectedReturnNULL "dtlsClientConnectionNew" result
result' <- (wrapObject DtlsClientConnection) result
touchManagedPtr baseSocket
whenJust serverIdentity touchManagedPtr
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
#endif