snmp-0.1.0.2: API for write snmp client.

Safe HaskellNone

Network.Protocol.Snmp

Contents

Synopsis

snmp types

data Value Source

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

type OID = [Integer]

Standard ASN.1 Object ID (OID)

type OIDS = [OID]Source

top level types

data V2 Source

Phantom type for version 2 (Header V2, PDU V2)

data V3 Source

Phantom type for version 3 (Header V3, PDU V3)

data Version Source

Snmp version tag

Constructors

Version1 
Version2 
Version3 

data Packet Source

Top level type, which describe snmp packet

header

data Header a Source

Snmp header without version tag

header snmpV2

newtype Community Source

(snmp2 only) Community for 2(1) version

Constructors

Community ByteString 

header snmpV3

newtype ID Source

(snmp3 only) Message Identifier (like RequestId in PDU)

Constructors

ID Int32 

Instances

Eq ID 
Show ID 
ASN1Object ID 

newtype MaxSize Source

(snmp3 only) Message max size must be > 484

Constructors

MaxSize Integer 

Instances

data Flag Source

(snmp3 only) rfc3412, message flag

Constructors

Flag Reportable PrivAuth 

Instances

Eq Flag 
Show Flag 
ASN1Object Flag 

data SecurityModel Source

(snmp3 only) rfc3412, security model

data SecurityParameter Source

(snmp3 only) rfc3412, security parameter

Constructors

SecurityParameter 

Fields

authoritiveEngineId :: ByteString
 
authoritiveEngineBoots :: Int32
 
authoritiveEngineTime :: Int32
 
userName :: ByteString
 
authenticationParameters :: ByteString
 
privacyParameters :: ByteString
 

type Reportable = BoolSource

(snmp3 only) rfc3412, as PrivAuth

data PrivAuth Source

(snmp3 only) rfc3412, type for create message flag

Instances

Eq PrivAuth 
Show PrivAuth 

type EngineBootId = Int32Source

type PrivacyParameter = ByteStringSource

type EngineTime = Int32Source

type EngineId = ByteStringSource

PDU

data PDU a whereSource

Snmp body

Constructors

CryptedPDU :: ByteString -> PDU V3 

Instances

Eq (PDU a) 
Show (PDU a) 
ASN1Object (PDU V3) 
ASN1Object (PDU V2) 
Construct (PDU V3) 
Construct (PDU V2) 
Pack (PDU V3) 

PDU universal

type RequestId = Int32Source

Request id

type ErrorStatus = IntegerSource

Error status

type ErrorIndex = IntegerSource

Error index

newtype Suite Source

Variable bindings

Constructors

Suite [Coupla] 

Instances

data Coupla Source

Coupla oid -> value

Constructors

Coupla 

Fields

oid :: OID
 
value :: Value
 

Instances

Eq Coupla 
Show Coupla 

PDU snmpV3

newtype ContextEngineID Source

(snmp3 only) rfc3412, types for ScopedPDU

Constructors

ContextEngineID ByteString 

Instances

newtype ContextName Source

Constructors

ContextName ByteString 

Instances

pack, unpack Packet

class Pack a whereSource

class for make binary packet from [ASN1]

Methods

encode :: a -> ByteStringSource

decode :: ByteString -> aSource

Instances

some classes and helpers

universal, for work with both versions

class HasItem a whereSource

some universal getters, setters

Instances

v2 only, for work with Header V2

class HasV2 a whereSource

(snmp2 only) getters, setters for work with Header V2

Instances

v3 only, for work with Header V3, PDU V3

class HasV3 a whereSource

(snmp3 only) getters, setters for work with Header V3 and PDU V3.

Instances

create new Packet

class Construct a whereSource

initial new object, like mempty for monoid

Methods

initial :: aSource

helpers for work with Packet

universal

v2 only

v3 only

setUserNameP :: ByteString -> Packet -> PacketSource

authentication

passwordToKey :: AuthType -> Password -> EngineId -> KeySource

create auth key from password and context engine id

signPacket :: AuthType -> Key -> Packet -> PacketSource

(only V3) sign Packet

data AuthType Source

Constructors

MD5 
SHA 

Instances

Eq AuthType 
Show AuthType 

data PrivType Source

Constructors

DES 
AES 

Instances

Eq PrivType 
Show PrivType 

type Password = ByteStringSource

type Key = ByteStringSource

cleanPass :: ByteStringSource

priv

type Salt = ByteStringSource

type Raw = ByteStringSource

type Encrypted = ByteStringSource

type Rand32 = Int32Source

type Rand64 = Int64Source

toSalt :: Int32 -> Int32 -> ByteStringSource

exceptions

data ClientException Source

some exception

Constructors

TimeoutException 
ServerException Integer 

Instances

usage example