Jerboa v0.2.0 Jerboa.Params
Data structure representing STUN message parameters
Summary
Functions
Generates STUN transaction ID
Retrieves single attribute from params struct
Retrieves all attributes from params struct
Retrieves all attributes with given name from params struct
Retrieves class field from params struct
Retrieves transaction ID from params struct
Retrieves method field from params struct
Returns params struct with filled in transaction id
Puts single attribute in params struct
Adds list of attriubutes to params struct
Sets STUN class in params struct
Sets STUN transaction identifier in params struct
Sets STUN method in params struct
Sets whole attributes list in params struct
Types
t() :: %Jerboa.Params{attributes: [Jerboa.Format.Body.Attribute.t], class: Jerboa.Format.Header.Type.Class.t, identifier: binary, method: Jerboa.Format.Header.Type.Method.t, signed?: boolean, verified?: boolean}
The main data structure representing STUN message parameters
The following fields coresspond to the those described in the STUN RFC:
class
is one of request, success or failure response, or indicationmethod
is a STUN (or TURN) message method described in one of the respective RFCsidentifier
is a unique transaction identifierattributes
is a list of STUN (or TURN) attributes as described in their respective RFCssigned?
indicates wheter STUN message was signed with MESSAGE-INTEGRITY attribute - it isn’t important when encoding a messageverified?
- indicates wheter MESSAGE-INTEGRIY from STUN message was successfully verified. Same assigned?
, it’s only relevant when decoding messages. Note that messages which areverified?
are alsosigned?
, but not the other way around.
Functions
get_attr(t, attr_name :: module) :: Jerboa.Format.Body.Attribute.t | nil
Retrieves single attribute from params struct
Returns nil
if attribute is not present.
Retrieves all attributes from params struct
Retrieves all attributes with given name from params struct
Retrieves class field from params struct
Retrieves transaction ID from params struct
Retrieves method field from params struct
Returns params struct with filled in transaction id
put_attr(t, Jerboa.Format.Body.Attribute.t, [{:overwrite, boolean}]) :: t
Puts single attribute in params struct
:overwrite
option determines wheter attributes of the same type
will be removed and the new one will be put in their place.
Defaults to true
.
Adds list of attriubutes to params struct
It’s functionally equal to recursively calling put_attr/2
with overwrite: false
on params struct.
Sets STUN class in params struct
Sets STUN method in params struct
Sets whole attributes list in params struct