-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Interface library for strongSwan SQL backend -- -- Interface library and companion CLI tool to configure strongSwan IPsec -- over MySQL backend @package strongswan-sql @version 1.0.0.0 -- | This library allows for the manipulation of strongSwan connection -- configuration stored in a MySQL database in a manner that is -- compatible with the strongSwan SQL plugin for charon. -- --
-- context <- init def { dbName = "acmeDB" }
--
--
mkContext :: (Failable m, MonadIO m) => Settings -> m Context
-- | Pushes an IPsec configuration into the DB specified in the given
-- context. Note that if there are any existing elements in the
-- configuration, they are first released (and their inter relationships
-- in the SQL DB removed), before creating them. As a result the
-- different IDs inside the elements etc will probably change. This is
-- the reason why a new IPSecSettings value is returned as
-- a result of the operation and the value "pushed" to the DB originally
-- should not be used any further.
writeIPSecSettings :: (Failable m, MonadIO m) => IPSecSettings -> Context -> m IPSecSettings
-- | Search for an IPsec connection configuration by its unique name. Take
-- note of the Failable context, which means that unless it is
-- desired that this function throws an asynchronous exception upon not
-- finding a configuration, you probably want to run this inside a
-- monadic transformer such as MaybeT or ExceptT
findIPSecSettings :: (Failable m, MonadIO m) => Text -> Context -> m IPSecSettings
-- | Removes the specified IPSecSettings from the DB, releasing all
-- linked elements. The returned IPSecSettings will contain now
-- "unlinked" elements (i.e. no IDs, etc).
deleteIPSecSettings :: (Failable m, MonadIO m) => IPSecSettings -> Context -> m IPSecSettings
writeChild2TSConfig :: (Failable m, MonadIO m) => Child2TSConfig -> Context -> m (Result (Int, Int))
writeChildSAConfig :: (Failable m, MonadIO m) => ChildSAConfig -> Context -> m (Result Int)
writeIKEConfig :: (Failable m, MonadIO m) => IKEConfig -> Context -> m (Result Int)
writePeerConfig :: (Failable m, MonadIO m) => PeerConfig -> Context -> m (Result Int)
writePeer2ChildConfig :: (Failable m, MonadIO m) => Peer2ChildConfig -> Context -> m (Result (Int, Int))
writeTrafficSelector :: (Failable m, MonadIO m) => TrafficSelector -> Context -> m (Result Int)
lookupChild2TSConfig :: (Failable m, MonadIO m) => Int -> Context -> m [Child2TSConfig]
findChildSAConfig :: (Failable m, MonadIO m) => Int -> Context -> m ChildSAConfig
findChildSAConfigByName :: (Failable m, MonadIO m) => Text -> Context -> m [ChildSAConfig]
findIKEConfig :: (Failable m, MonadIO m) => Int -> Context -> m IKEConfig
findPeerConfig :: (Failable m, MonadIO m) => Int -> Context -> m PeerConfig
findPeerConfigByName :: (Failable m, MonadIO m) => Text -> Context -> m [PeerConfig]
findPeer2ChildConfig :: (Failable m, MonadIO m) => Int -> Int -> Context -> m Peer2ChildConfig
findTrafficSelector :: (Failable m, MonadIO m) => Int -> Context -> m TrafficSelector
deleteChild2TSConfig :: (Failable m, MonadIO m) => Int -> Context -> m (Result Int)
deleteChildSAConfig :: (Failable m, MonadIO m) => Int -> Context -> m (Result Int)
deleteIKEConfig :: (Failable m, MonadIO m) => Int -> Context -> m (Result Int)
deletePeer2ChildConfig :: (Failable m, MonadIO m) => Int -> Int -> Context -> m (Result (Int, Int))
deletePeerConfig :: (Failable m, MonadIO m) => Int -> Context -> m (Result Int)
ikeReqCert :: Lens' IKEConfig Bool
ikeRemoteAddress :: Lens' IKEConfig Text
ikeLocalAddress :: Lens' IKEConfig Text
ikeId :: Lens' IKEConfig (Maybe Int)
ikeForceEncap :: Lens' IKEConfig Bool
childSAUpDown :: Lens' ChildSAConfig (Maybe Text)
childSAStartAction :: Lens' ChildSAConfig SAAction
childSAReqID :: Lens' ChildSAConfig Word32
childSARekeyTime :: Lens' ChildSAConfig Word32
childSAName :: Lens' ChildSAConfig Text
childSAMode :: Lens' ChildSAConfig SAMode
childSALifeTime :: Lens' ChildSAConfig Word32
childSAJitter :: Lens' ChildSAConfig Word32
childSAId :: Lens' ChildSAConfig (Maybe Int)
childSAIPCompression :: Lens' ChildSAConfig Bool
childSAHostAccess :: Lens' ChildSAConfig Bool
childSADPDAction :: Lens' ChildSAConfig SAAction
childSACloseAction :: Lens' ChildSAConfig SAAction
peerCfgVirtual :: Lens' PeerConfig (Maybe Text)
peerCfgUniqueIds :: Lens' PeerConfig Bool
peerCfgRemoteId :: Lens' PeerConfig Text
peerCfgRekeyTime :: Lens' PeerConfig Word32
peerCfgReauthTime :: Lens' PeerConfig Word32
peerCfgPool :: Lens' PeerConfig (Maybe Text)
peerCfgPeerId :: Lens' PeerConfig Int
peerCfgOverTime :: Lens' PeerConfig Word32
peerCfgName :: Lens' PeerConfig Text
peerCfgMobike :: Lens' PeerConfig Bool
peerCfgMediation :: Lens' PeerConfig Bool
peerCfgMediatedBy :: Lens' PeerConfig Int
peerCfgLocalId :: Lens' PeerConfig Text
peerCfgKeyingTries :: Lens' PeerConfig Word8
peerCfgJitter :: Lens' PeerConfig Word32
peerCfgId :: Lens' PeerConfig (Maybe Int)
peerCfgIKEVersion :: Lens' PeerConfig Word8
peerCfgIKEConfigId :: Lens' PeerConfig Int
peerCfgEAPVendor :: Lens' PeerConfig Word16
peerCfgEAPType :: Lens' PeerConfig EAPType
peerCfgDPDDelay :: Lens' PeerConfig Word32
peerCfgCertPolicy :: Lens' PeerConfig CertPolicy
peerCfgAuthMethod :: Lens' PeerConfig AuthMethod
tsType :: Lens' TrafficSelector TrafficSelectorType
tsStartPort :: Lens' TrafficSelector PortNumber
tsStartAddr :: Lens' TrafficSelector IP
tsProtocol :: Lens' TrafficSelector Word16
tsId :: Lens' TrafficSelector (Maybe Int)
tsEndPort :: Lens' TrafficSelector PortNumber
tsEndAddr :: Lens' TrafficSelector IP
getRemoteTrafficSelector :: Lens' IPSecSettings TrafficSelector
getPeerConfig :: Lens' IPSecSettings PeerConfig
getLocalTrafficSelector :: Lens' IPSecSettings TrafficSelector
getIPSecCfgName :: Lens' IPSecSettings Text
getIKEConfig :: Lens' IPSecSettings IKEConfig
getChildSAConfig :: Lens' IPSecSettings ChildSAConfig
dbHost :: Lens' Settings HostName
dbPort :: Lens' Settings PortNumber
dbName :: Lens' Settings String
dbUser :: Lens' Settings String
dbPassword :: Lens' Settings String
dbCharSet :: Lens' Settings MySQLCharacterEncoding
data AuthMethod
Any :: AuthMethod
PubKey :: AuthMethod
PSK :: AuthMethod
EAP :: AuthMethod
XAUTH :: AuthMethod
data ChildSAConfig
ChildSAConfig :: Maybe Int -> Text -> Word32 -> Word32 -> Word32 -> Maybe Text -> Bool -> SAMode -> SAAction -> SAAction -> SAAction -> Bool -> Word32 -> ChildSAConfig
[_childSAId] :: ChildSAConfig -> Maybe Int
[_childSAName] :: ChildSAConfig -> Text
[_childSALifeTime] :: ChildSAConfig -> Word32
[_childSARekeyTime] :: ChildSAConfig -> Word32
[_childSAJitter] :: ChildSAConfig -> Word32
[_childSAUpDown] :: ChildSAConfig -> Maybe Text
[_childSAHostAccess] :: ChildSAConfig -> Bool
[_childSAMode] :: ChildSAConfig -> SAMode
[_childSAStartAction] :: ChildSAConfig -> SAAction
[_childSADPDAction] :: ChildSAConfig -> SAAction
[_childSACloseAction] :: ChildSAConfig -> SAAction
[_childSAIPCompression] :: ChildSAConfig -> Bool
[_childSAReqID] :: ChildSAConfig -> Word32
data Child2TSConfig
Child2TSConfig :: Int -> Int -> TrafficSelectorKind -> Child2TSConfig
[c2tsChildCfgId] :: Child2TSConfig -> Int
[c2tsTrafficSelectorCfgId] :: Child2TSConfig -> Int
[c2tsTrafficSelectorKind] :: Child2TSConfig -> TrafficSelectorKind
data CertPolicy
AlwaysSend :: CertPolicy
SendIfAsked :: CertPolicy
NeverSend :: CertPolicy
type Context = MVar Context_
data EAPType
EAPMD5 :: EAPType
EAPGTC :: EAPType
EAPTLS :: EAPType
EAPSIM :: EAPType
EAPTTLS :: EAPType
EAPAKA :: EAPType
EAPMSCHAPV2 :: EAPType
EAPTNC :: EAPType
EAPRADIUS :: EAPType
data IKEConfig
IKEConfig :: Maybe Int -> Bool -> Bool -> Text -> Text -> IKEConfig
[_ikeId] :: IKEConfig -> Maybe Int
[_ikeReqCert] :: IKEConfig -> Bool
[_ikeForceEncap] :: IKEConfig -> Bool
[_ikeLocalAddress] :: IKEConfig -> Text
[_ikeRemoteAddress] :: IKEConfig -> Text
-- | The managed IPsec configuration type encompasses a complete set of
-- elements which are pushed and interlinked as necessary by the
-- Managed API (see above). Note that there are lenses available
-- to facilitate accessing all these fields (see
-- StrongSwan.SQL.Lenses)
data IPSecSettings
IPSecSettings :: Text -> IKEConfig -> ChildSAConfig -> PeerConfig -> TrafficSelector -> TrafficSelector -> IPSecSettings
[_getIPSecCfgName] :: IPSecSettings -> Text
[_getIKEConfig] :: IPSecSettings -> IKEConfig
[_getChildSAConfig] :: IPSecSettings -> ChildSAConfig
[_getPeerConfig] :: IPSecSettings -> PeerConfig
[_getLocalTrafficSelector] :: IPSecSettings -> TrafficSelector
[_getRemoteTrafficSelector] :: IPSecSettings -> TrafficSelector
data PeerConfig
PeerConfig :: Maybe Int -> Text -> Word8 -> Int -> Text -> Text -> CertPolicy -> Bool -> AuthMethod -> EAPType -> Word16 -> Word8 -> Word32 -> Word32 -> Word32 -> Word32 -> Bool -> Word32 -> Maybe Text -> Maybe Text -> Bool -> Int -> Int -> PeerConfig
[_peerCfgId] :: PeerConfig -> Maybe Int
[_peerCfgName] :: PeerConfig -> Text
[_peerCfgIKEVersion] :: PeerConfig -> Word8
[_peerCfgIKEConfigId] :: PeerConfig -> Int
[_peerCfgLocalId] :: PeerConfig -> Text
[_peerCfgRemoteId] :: PeerConfig -> Text
[_peerCfgCertPolicy] :: PeerConfig -> CertPolicy
[_peerCfgUniqueIds] :: PeerConfig -> Bool
[_peerCfgAuthMethod] :: PeerConfig -> AuthMethod
[_peerCfgEAPType] :: PeerConfig -> EAPType
[_peerCfgEAPVendor] :: PeerConfig -> Word16
[_peerCfgKeyingTries] :: PeerConfig -> Word8
[_peerCfgRekeyTime] :: PeerConfig -> Word32
[_peerCfgReauthTime] :: PeerConfig -> Word32
[_peerCfgJitter] :: PeerConfig -> Word32
[_peerCfgOverTime] :: PeerConfig -> Word32
[_peerCfgMobike] :: PeerConfig -> Bool
[_peerCfgDPDDelay] :: PeerConfig -> Word32
[_peerCfgVirtual] :: PeerConfig -> Maybe Text
[_peerCfgPool] :: PeerConfig -> Maybe Text
[_peerCfgMediation] :: PeerConfig -> Bool
[_peerCfgMediatedBy] :: PeerConfig -> Int
[_peerCfgPeerId] :: PeerConfig -> Int
data Peer2ChildConfig
Peer2ChildConfig :: Int -> Int -> Peer2ChildConfig
[p2cPeerCfgId] :: Peer2ChildConfig -> Int
[p2cChildCfgId] :: Peer2ChildConfig -> Int
data Result a
Result :: a -> OK -> Result a
[lastModifiedKey] :: Result a -> a
[response] :: Result a -> OK
data SAAction
None :: SAAction
Route :: SAAction
Restart :: SAAction
data SAMode
Transport :: SAMode
Tunnel :: SAMode
Beet :: SAMode
Pass :: SAMode
Drop :: SAMode
data Settings
Settings :: String -> HostName -> PortNumber -> String -> String -> MySQLCharacterEncoding -> Settings
-- | Name of the DB to use
[_dbName] :: Settings -> String
-- | SQL server host (defaults to localhost)
[_dbHost] :: Settings -> HostName
-- | TCP port (defaults to 3306)
[_dbPort] :: Settings -> PortNumber
-- | DB username (defaults to root)
[_dbUser] :: Settings -> String
-- | DB user password
[_dbPassword] :: Settings -> String
-- | Defaults to UTF8MB4
[_dbCharSet] :: Settings -> MySQLCharacterEncoding
-- | You may get interested in OK packet because it provides
-- information about successful operations.
data OK
OK :: !Int -> !Int -> !Word16 -> !Word16 -> OK
-- | affected row number
[okAffectedRows] :: OK -> !Int
-- | last insert's ID
[okLastInsertID] :: OK -> !Int
[okStatus] :: OK -> !Word16
[okWarningCnt] :: OK -> !Word16
class SQLRow a
data TrafficSelector
TrafficSelector :: Maybe Int -> TrafficSelectorType -> Word16 -> IP -> IP -> PortNumber -> PortNumber -> TrafficSelector
[_tsId] :: TrafficSelector -> Maybe Int
[_tsType] :: TrafficSelector -> TrafficSelectorType
[_tsProtocol] :: TrafficSelector -> Word16
[_tsStartAddr] :: TrafficSelector -> IP
[_tsEndAddr] :: TrafficSelector -> IP
[_tsStartPort] :: TrafficSelector -> PortNumber
[_tsEndPort] :: TrafficSelector -> PortNumber
data TrafficSelectorType
IPv4AddrRange :: TrafficSelectorType
IPv6AddrRange :: TrafficSelectorType
data TrafficSelectorKind
LocalTS :: TrafficSelectorKind
RemoteTS :: TrafficSelectorKind
LocalDynamicTS :: TrafficSelectorKind
RemoteDynamicTS :: TrafficSelectorKind
instance Data.Default.Class.Default StrongSwan.SQL.Settings
instance GHC.Show.Show StrongSwan.SQL.Settings