Copyright | (c) Erick Gonzalez 2017 |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Network.RADIUS.Encoding
Contents
Description
This module provides Binary instances for the RADIUS Packet type and attributes. So you basically decode a (lazy) ByteString and get a RADIUS Packet back or you can encode a RADIUS Packet to a ByteString, which you can then send on the wire as is, etc. Simple as that.
- radiusHeaderSize :: Word16
- authenticatorLength :: Int64
- decodeHeader :: Get Header
- decodePacket :: Header -> Get Packet
- sign :: ByteString -> ByteString -> ByteString
- hashMD5 :: ByteString -> ByteString
- encodeAttributes :: [PacketAttribute] -> ByteString
- decodeAttributes :: [PacketAttribute] -> Get [PacketAttribute]
- putAttributeStr :: Word8 -> ByteString -> Put
- putAttribute :: Binary a => Word8 -> a -> Put
- getAttribute :: Word8 -> Get PacketAttribute
- getAttributeStr :: Get ByteString
- getAttributeValue :: Binary a => Get a
- putEnum :: Enum a => a -> Put
- getEnum :: Enum a => Get a
Documentation
radiusHeaderSize :: Word16 Source #
Self explanatory. It can be useful when reading a RADIUS packet from a socket for example, so one can retrieve the packet header (containing the packet length) first and then use that to figure out how much data is left to read
authenticatorLength :: Int64 Source #
Fixed authenticator length as per RFC 2865
decodeHeader :: Get Header Source #
Allows decoding of a RADIUS header in the Get Monad
decodePacket :: Header -> Get Packet Source #
Given an already decoded header, this function can be used to decode the complete packet from the available data
sign :: ByteString -> ByteString -> ByteString Source #
hashMD5 :: ByteString -> ByteString Source #
encodeAttributes :: [PacketAttribute] -> ByteString Source #
Used internally to encode a list of RADIUS attributes. You probably don't need this.
decodeAttributes :: [PacketAttribute] -> Get [PacketAttribute] Source #
Used internally to decode a list of RADIUS attributes. You probably don't need this.
putAttributeStr :: Word8 -> ByteString -> Put Source #
For internal use
getAttribute :: Word8 -> Get PacketAttribute Source #
getAttributeStr :: Get ByteString Source #
For internal use.
getAttributeValue :: Binary a => Get a Source #
For internal use.