stunclient-0.1.0.1: RFC 5389: Session Traversal Utilities for NAT (STUN) client

Safe HaskellNone

Network.Stun.Internal

Description

This module exports everything from this package (except some functions defined in Network.Stun) to avoid the need for copy/paste.

Synopsis

Documentation

showBits :: Bits a => a -> [Char]Source

data Credentials Source

Constructors

LongTerm !Text !Text !Text

username realm password

ShortTerm !Text !Text

username password

data Username Source

Constructors

Username 

Fields

unUsername :: !Text
 

withMessageIntegrity :: Credentials -> Message -> MessageSource

Generate a MESSAGE-INTEGRITY attribute and append it to the message attribute list

checkMessageIntegrity :: Credentials -> Message -> Maybe (Bool, Message)Source

Checks the credentials of a message

  • returns Nothing when the credentials don't match
  • returns Just (False, oldmsg) when no MESSAGE-INTEGRITY attribute is present

where oldmsg is the unchanged message passed to the function

  • returns Just (True, prunedmsg) when the attribute is present and matches

where prunedmsg is the message with all fields after MESSAGE-INTEGRITY removed

data ErrorAttribute Source

Constructors

ErrorAttribute 

Fields

code :: !Int

Code has to be between 300 and 699 inclusive

reason :: !Text

At most 128 unicode characters