Safe Haskell | None |
---|
Network.Protocol.Snmp
Contents
- data Value
- = OI OID
- | Zero
- | Integer Int32
- | String ByteString
- | IpAddress Word8 Word8 Word8 Word8
- | Counter32 Word32
- | Gaude32 Word32
- | TimeTicks Word32
- | Opaque ByteString
- | Counter64 Word64
- | ZeroDotZero
- | NoSuchInstance
- | NoSuchObject
- | EndOfMibView
- type OID = [Integer]
- type OIDS = [OID]
- data V2
- data V3
- data Version
- data Packet
- data Header a
- newtype Community = Community ByteString
- newtype ID = ID Int32
- newtype MaxSize = MaxSize Integer
- data Flag = Flag Reportable PrivAuth
- data SecurityModel = UserBasedSecurityModel
- data SecurityParameter = SecurityParameter {
- authoritiveEngineId :: ByteString
- authoritiveEngineBoots :: Int32
- authoritiveEngineTime :: Int32
- userName :: ByteString
- authenticationParameters :: ByteString
- privacyParameters :: ByteString
- type Reportable = Bool
- data PrivAuth
- = NoAuthNoPriv
- | AuthNoPriv
- | AuthPriv
- type EngineBootId = Int32
- type PrivacyParameter = ByteString
- type EngineTime = Int32
- type EngineId = ByteString
- data PDU a where
- CryptedPDU :: ByteString -> PDU V3
- data Request
- = GetRequest {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | GetNextRequest {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | GetResponse {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | SetRequest {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | GetBulk {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | Inform {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | V2Trap {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- | Report {
- rid :: RequestId
- es :: ErrorStatus
- ei :: ErrorIndex
- = GetRequest {
- type RequestId = Int32
- type ErrorStatus = Integer
- type ErrorIndex = Integer
- newtype Suite = Suite [Coupla]
- data Coupla = Coupla {}
- newtype ContextEngineID = ContextEngineID ByteString
- newtype ContextName = ContextName ByteString
- class Pack a where
- class HasItem a where
- class HasV2 a where
- getCommunity :: Header a -> Community
- setCommunity :: Community -> Header a -> Header a
- class HasV3 a where
- getID :: Header a -> ID
- getMaxSize :: Header a -> MaxSize
- getFlag :: Header a -> Flag
- getSecurityModel :: Header a -> SecurityModel
- getSecurityParameter :: Header a -> SecurityParameter
- getAuthoritiveEngineId :: Header a -> ByteString
- getAuthoritiveEngineBoots :: Header a -> Int32
- getAuthoritiveEngineTime :: Header a -> Int32
- getUserName :: Header a -> ByteString
- getAuthenticationParameters :: Header a -> ByteString
- getPrivacyParameters :: Header a -> ByteString
- getContextEngineID :: PDU a -> ContextEngineID
- getContextName :: PDU a -> ContextName
- setID :: ID -> Header a -> Header a
- setMaxSize :: MaxSize -> Header a -> Header a
- setFlag :: Flag -> Header a -> Header a
- setSecurityModel :: SecurityModel -> Header a -> Header a
- setSecurityParameter :: SecurityParameter -> Header a -> Header a
- setAuthoritiveEngineId :: ByteString -> Header a -> Header a
- setAuthoritiveEngineBoots :: Int32 -> Header a -> Header a
- setAuthoritiveEngineTime :: Int32 -> Header a -> Header a
- setUserName :: ByteString -> Header a -> Header a
- setAuthenticationParameters :: ByteString -> Header a -> Header a
- setPrivacyParameters :: ByteString -> Header a -> Header a
- setContextEngineID :: ContextEngineID -> PDU a -> PDU a
- setContextName :: ContextName -> PDU a -> PDU a
- class Construct a where
- initial :: a
- getVersion :: Packet -> Version
- getRequest :: Packet -> Request
- setRequest :: Request -> Packet -> Packet
- getRid :: Packet -> RequestId
- setRid :: RequestId -> Packet -> Packet
- getSuite :: Packet -> Suite
- setSuite :: Suite -> Packet -> Packet
- getErrorStatus :: Packet -> ErrorStatus
- setErrorStatus :: ErrorStatus -> Packet -> Packet
- setCommunityP :: Community -> Packet -> Packet
- setIDP :: ID -> Packet -> Packet
- setMaxSizeP :: MaxSize -> Packet -> Packet
- setUserNameP :: ByteString -> Packet -> Packet
- getAuthenticationParametersP :: Packet -> ByteString
- setAuthenticationParametersP :: ByteString -> Packet -> Packet
- setReportableP :: Reportable -> Packet -> Packet
- setPrivAuthP :: PrivAuth -> Packet -> Packet
- getEngineIdP :: Packet -> EngineId
- setEngineIdP :: EngineId -> Packet -> Packet
- getEngineBootsP :: Packet -> EngineBootId
- setEngineBootsP :: EngineBootId -> Packet -> Packet
- getEngineTimeP :: Packet -> Int32
- setEngineTimeP :: Int32 -> Packet -> Packet
- getPrivParametersP :: Packet -> ByteString
- setPrivParametersP :: ByteString -> Packet -> Packet
- passwordToKey :: AuthType -> Password -> EngineId -> Key
- signPacket :: AuthType -> Key -> Packet -> Packet
- data AuthType
- data PrivType
- type Password = ByteString
- type Key = ByteString
- cleanPass :: ByteString
- type Salt = ByteString
- type Raw = ByteString
- type Encrypted = ByteString
- type Rand32 = Int32
- type Rand64 = Int64
- desEncrypt :: Key -> EngineBootId -> Rand32 -> Raw -> (Encrypted, Salt)
- desDecrypt :: Key -> Salt -> Encrypted -> Raw
- aesEncrypt :: Key -> EngineBootId -> EngineTime -> Rand64 -> Raw -> (Encrypted, Salt)
- aesDecrypt :: Key -> Salt -> EngineBootId -> EngineTime -> Encrypted -> Raw
- toSalt :: Int32 -> Int32 -> ByteString
- data ClientException
- = TimeoutException
- | ServerException Integer
snmp types
Snmp data types
Constructors
OI OID | |
Zero | |
Integer Int32 | |
String ByteString | |
IpAddress Word8 Word8 Word8 Word8 | |
Counter32 Word32 | |
Gaude32 Word32 | |
TimeTicks Word32 | |
Opaque ByteString | |
Counter64 Word64 | |
ZeroDotZero | |
NoSuchInstance | |
NoSuchObject | |
EndOfMibView |
Instances
Eq Value | |
Show Value | |
ASN1Object Value |
type OID = [Integer]
Standard ASN.1 Object ID (OID)
top level types
Phantom type for version 2 (Header V2, PDU V2)
Phantom type for version 3 (Header V3, PDU V3)
Snmp version tag
Top level type, which describe snmp packet
header
Snmp header without version tag
header snmpV2
(snmp2 only) Community for 2(1) version
Constructors
Community ByteString |
Instances
Eq Community | |
Show Community | |
ASN1Object Community |
header snmpV3
(snmp3 only) Message Identifier (like RequestId in PDU)
Constructors
ID Int32 |
Instances
Eq ID | |
Show ID | |
ASN1Object ID |
(snmp3 only) Message max size must be > 484
Constructors
MaxSize Integer |
Instances
Eq MaxSize | |
Show MaxSize | |
ASN1Object MaxSize |
(snmp3 only) rfc3412, message flag
Constructors
Flag Reportable PrivAuth |
Instances
Eq Flag | |
Show Flag | |
ASN1Object Flag |
data SecurityModel Source
(snmp3 only) rfc3412, security model
Constructors
UserBasedSecurityModel |
Instances
data SecurityParameter Source
(snmp3 only) rfc3412, security parameter
Constructors
SecurityParameter | |
Fields
|
Instances
type Reportable = BoolSource
(snmp3 only) rfc3412, as PrivAuth
(snmp3 only) rfc3412, type for create message flag
Constructors
NoAuthNoPriv | |
AuthNoPriv | |
AuthPriv |
type EngineBootId = Int32Source
type PrivacyParameter = ByteStringSource
type EngineTime = Int32Source
PDU
Snmp body
Constructors
CryptedPDU :: ByteString -> PDU V3 |
PDU universal
requests
Constructors
GetRequest | |
Fields
| |
GetNextRequest | |
Fields
| |
GetResponse | |
Fields
| |
SetRequest | |
Fields
| |
GetBulk | |
Fields
| |
Inform | |
Fields
| |
V2Trap | |
Fields
| |
Report | |
Fields
|
type ErrorStatus = IntegerSource
Error status
type ErrorIndex = IntegerSource
Error index
Variable bindings
Coupla oid -> value
PDU snmpV3
newtype ContextEngineID Source
(snmp3 only) rfc3412, types for ScopedPDU
Constructors
ContextEngineID ByteString |
Instances
Eq ContextEngineID | |
Show ContextEngineID |
newtype ContextName Source
Constructors
ContextName ByteString |
Instances
Eq ContextName | |
Show ContextName |
pack, unpack Packet
class for make binary packet from [ASN1]
some classes and helpers
universal, for work with both versions
some universal getters, setters
v2 only, for work with Header V2
(snmp2 only) getters, setters for work with Header V2
Methods
getCommunity :: Header a -> CommunitySource
setCommunity :: Community -> Header a -> Header aSource
v3 only, for work with Header V3, PDU V3
(snmp3 only) getters, setters for work with Header V3 and PDU V3.
Methods
getMaxSize :: Header a -> MaxSizeSource
getFlag :: Header a -> FlagSource
getSecurityModel :: Header a -> SecurityModelSource
getSecurityParameter :: Header a -> SecurityParameterSource
getAuthoritiveEngineId :: Header a -> ByteStringSource
getAuthoritiveEngineBoots :: Header a -> Int32Source
getAuthoritiveEngineTime :: Header a -> Int32Source
getUserName :: Header a -> ByteStringSource
getAuthenticationParameters :: Header a -> ByteStringSource
getPrivacyParameters :: Header a -> ByteStringSource
getContextEngineID :: PDU a -> ContextEngineIDSource
getContextName :: PDU a -> ContextNameSource
setID :: ID -> Header a -> Header aSource
setMaxSize :: MaxSize -> Header a -> Header aSource
setFlag :: Flag -> Header a -> Header aSource
setSecurityModel :: SecurityModel -> Header a -> Header aSource
setSecurityParameter :: SecurityParameter -> Header a -> Header aSource
setAuthoritiveEngineId :: ByteString -> Header a -> Header aSource
setAuthoritiveEngineBoots :: Int32 -> Header a -> Header aSource
setAuthoritiveEngineTime :: Int32 -> Header a -> Header aSource
setUserName :: ByteString -> Header a -> Header aSource
setAuthenticationParameters :: ByteString -> Header a -> Header aSource
setPrivacyParameters :: ByteString -> Header a -> Header aSource
setContextEngineID :: ContextEngineID -> PDU a -> PDU aSource
setContextName :: ContextName -> PDU a -> PDU aSource
create new Packet
initial new object, like mempty for monoid
helpers for work with Packet
universal
getVersion :: Packet -> VersionSource
getRequest :: Packet -> RequestSource
setRequest :: Request -> Packet -> PacketSource
setErrorStatus :: ErrorStatus -> Packet -> PacketSource
v2 only
setCommunityP :: Community -> Packet -> PacketSource
v3 only
setMaxSizeP :: MaxSize -> Packet -> PacketSource
setUserNameP :: ByteString -> Packet -> PacketSource
getAuthenticationParametersP :: Packet -> ByteStringSource
setAuthenticationParametersP :: ByteString -> Packet -> PacketSource
setReportableP :: Reportable -> Packet -> PacketSource
setPrivAuthP :: PrivAuth -> Packet -> PacketSource
getEngineIdP :: Packet -> EngineIdSource
setEngineIdP :: EngineId -> Packet -> PacketSource
setEngineBootsP :: EngineBootId -> Packet -> PacketSource
getEngineTimeP :: Packet -> Int32Source
setEngineTimeP :: Int32 -> Packet -> PacketSource
getPrivParametersP :: Packet -> ByteStringSource
setPrivParametersP :: ByteString -> Packet -> PacketSource
authentication
passwordToKey :: AuthType -> Password -> EngineId -> KeySource
create auth key from password and context engine id
priv
desEncrypt :: Key -> EngineBootId -> Rand32 -> Raw -> (Encrypted, Salt)Source
aesEncrypt :: Key -> EngineBootId -> EngineTime -> Rand64 -> Raw -> (Encrypted, Salt)Source
aesDecrypt :: Key -> Salt -> EngineBootId -> EngineTime -> Encrypted -> RawSource
exceptions
data ClientException Source
some exception
Constructors
TimeoutException | |
ServerException Integer |
Instances
Eq ClientException | |
Show ClientException | |
Typeable ClientException | |
Exception ClientException |