#include <functions.hpp>
|
static CommandId | getCommandId (const anna::DataBlock &) noexcept(false) |
|
static ApplicationId | getApplicationId (const anna::DataBlock &) noexcept(false) |
|
static HopByHop | getHopByHop (const anna::DataBlock &) noexcept(false) |
|
static EndToEnd | getEndToEnd (const anna::DataBlock &) noexcept(false) |
|
static bool | requestBit (const anna::DataBlock &) noexcept(false) |
|
static bool | proxiableBit (const anna::DataBlock &) noexcept(false) |
|
static bool | errorBit (const anna::DataBlock &) noexcept(false) |
|
static bool | potentiallyReTransmittedMessageBit (const anna::DataBlock &) noexcept(false) |
|
static bool | isRequest (const CommandId &cid) |
|
static bool | isRequest (const anna::DataBlock &db) noexcept(false) |
|
static bool | isAnswer (const CommandId &cid) |
|
static bool | isAnswer (const anna::DataBlock &db) noexcept(false) |
|
static void | decodeCommandHeader (const char *start, char &version, U24 &length, char &flags, CommandId &id, int &appId, int &hbh, int &ete) noexcept(false) |
|
static void | decodeAVP (const char *start, AvpId &id, char &flags, int &length, std::string &data) noexcept(false) |
|
static const char * | nextAVP (const char *avpsDB, int avpsLen, const char *start) noexcept(false) |
|
static const char * | findAVP (const char *avpsDB, int avpsLen, const diameter::AvpId &id, int n=1) noexcept(false) |
|
static void | setHopByHop (anna::DataBlock &, HopByHop) noexcept(false) |
|
static void | setEndToEnd (anna::DataBlock &, EndToEnd) noexcept(false) |
|
static void | setPotentiallyReTransmittedMessageBit (const anna::DataBlock &db, bool activate=true) noexcept(false) |
|
static void | messageXmlDocumentFromXmlFile (anna::xml::DocumentFile &xmlDocument, const std::string &xmlPathFile) noexcept(false) |
|
static void | messageXmlDocumentFromXmlString (anna::xml::DocumentMemory &xmlDocument, const std::string &xmlString) noexcept(false) |
|
◆ decodeAVP()
static void anna::diameter::codec::functions::decodeAVP |
( |
const char * |
start, |
|
|
AvpId & |
id, |
|
|
char & |
flags, |
|
|
int & |
length, |
|
|
std::string & |
data |
|
) |
| |
|
staticnoexcept |
Decodes an AVP. This helper cannot check boundaries. start pointer must be a valid avp context.
- Parameters
-
start | Must be a valid avp start (point to the 32-bits avp code word). |
id | Avp identification (code, vendorId). |
flags | Avp flags byte. |
length | Avp length (includes code, flags, length itself, vendorId if exists and data length). |
data | Avp data part. |
◆ decodeCommandHeader()
static void anna::diameter::codec::functions::decodeCommandHeader |
( |
const char * |
start, |
|
|
char & |
version, |
|
|
U24 & |
length, |
|
|
char & |
flags, |
|
|
CommandId & |
id, |
|
|
int & |
appId, |
|
|
int & |
hbh, |
|
|
int & |
ete |
|
) |
| |
|
staticnoexcept |
Decodes a Command Header. This helper cannot check boundaries. start pointer must be a valid command context.
- Parameters
-
start | Must be a valid command start (point to the command version byte). |
version | Diameter version. |
length | Message length. |
flags | Command flags. |
id | Command identification (code, request<true,false>). |
appId | Application-ID. |
hbh | Hop-by-Hop Identifier. |
ete | End-to-End Identifier. |
◆ errorBit()
static bool anna::diameter::codec::functions::errorBit |
( |
const anna::DataBlock & |
| ) |
|
|
staticnoexcept |
◆ findAVP()
static const char* anna::diameter::codec::functions::findAVP |
( |
const char * |
avpsDB, |
|
|
int |
avpsLen, |
|
|
const diameter::AvpId & |
id, |
|
|
int |
n = 1 |
|
) |
| |
|
staticnoexcept |
Gets the next AVP pointer reference starting from a first-avp datablock. It could be the first avp within a command, or within an grouped avp.
- Parameters
-
avpsDB | AVPs set as datablock |
start | Point to start the search. Must be a valid avp start (point to the 32-bits avp code word). |
- Returns
- Pointer to the next AVP found. NULL if no more. Gets the next AVP pointer reference within an AVPs set data block with a certain AVP identification.
- Parameters
-
avpsDB | AVP data block buffer pointer |
avpsLen | AVP data block buffer length |
id | Avp identification (code, vendorId). |
n | Ocurrence number (first avp, second avp, etc.). 1 by default. |
- Returns
- Pointer to first AVP found with identification provided. NULL if not found.
◆ getApplicationId()
◆ getCommandId()
◆ getEndToEnd()
◆ getHopByHop()
◆ isAnswer() [1/2]
static bool anna::diameter::codec::functions::isAnswer |
( |
const CommandId & |
cid | ) |
|
|
inlinestatic |
static bool isRequest(const CommandId &cid)
Definition: functions.hpp:149
◆ isAnswer() [2/2]
static bool anna::diameter::codec::functions::isAnswer |
( |
const anna::DataBlock & |
db | ) |
|
|
inlinestaticnoexcept |
static bool isRequest(const CommandId &cid)
Definition: functions.hpp:149
◆ isRequest() [1/2]
static bool anna::diameter::codec::functions::isRequest |
( |
const CommandId & |
cid | ) |
|
|
inlinestatic |
149 {
return (cid.second); }
◆ isRequest() [2/2]
static bool anna::diameter::codec::functions::isRequest |
( |
const anna::DataBlock & |
db | ) |
|
|
inlinestaticnoexcept |
static bool requestBit(const anna::DataBlock &) noexcept(false)
◆ messageXmlDocumentFromXmlFile()
static void anna::diameter::codec::functions::messageXmlDocumentFromXmlFile |
( |
anna::xml::DocumentFile & |
xmlDocument, |
|
|
const std::string & |
xmlPathFile |
|
) |
| |
|
staticnoexcept |
Interpret a xml file in order to create a memory xml document. The xml file is based on this message DTD:
<!ELEMENT message (avp*)>
<!ELEMENT avp (avp*)>
<!ATTLIST message version CDATA #IMPLIED name CDATA #IMPLIED code CDATA #IMPLIED flags CDATA #IMPLIED application-id CDATA #REQUIRED hop-by-hop-id CDATA #IMPLIED end-to-end-id CDATA #IMPLIED>
<!ATTLIST avp name CDATA #IMPLIED code CDATA #IMPLIED vendor-code CDATA #IMPLIED flags CDATA #IMPLIED data CDATA #IMPLIED hex-data CDATA #IMPLIED>
- Parameters
-
xmlDocument | XML document allocated by the user of the function (anna::xml::DocumentMemory xmlDocument) |
xmlPathFile | Complete path file to the xml document which represents the diameter message |
- See also
- messageXmlDocumentFromXmlString
- Warning
- Whatever you will do with the xml document, will be only valid inside the scope of such xml document. For example, you could load the document to be decoded over a codec Message by mean #Message::fromXML (using the xml document #getRootNode) during document lifetime. After that, it could be destroyed.
◆ messageXmlDocumentFromXmlString()
static void anna::diameter::codec::functions::messageXmlDocumentFromXmlString |
( |
anna::xml::DocumentMemory & |
xmlDocument, |
|
|
const std::string & |
xmlString |
|
) |
| |
|
staticnoexcept |
Interpret xml string representation in order to create a memory xml document. DTD validation is used in the same way that messageXmlDocumentFromXmlFile does.
- Parameters
-
xmlDocument | XML document allocated by the user of the function (anna::xml::DocumentMemory xmlDocument) |
xmlString | XML string representation of the diameter message |
- See also
- messageXmlDocumentFromXmlFile
- Warning
- Whatever you will do with the xml document, will be only valid inside the scope of such xml document. For example, you could load the document to be decoded over a codec Message by mean #Message::fromXML (using the xml document #getRootNode) during document lifetime. After that, it could be destroyed.
◆ nextAVP()
static const char* anna::diameter::codec::functions::nextAVP |
( |
const char * |
avpsDB, |
|
|
int |
avpsLen, |
|
|
const char * |
start |
|
) |
| |
|
staticnoexcept |
Gets the next AVP pointer reference starting from a first-avp data block. It could be the first avp within a command, or within an grouped avp.
- Parameters
-
avpsDB | AVP data block buffer pointer |
avpsLen | AVP data block buffer length |
start | Point to start the search. Must be a valid avp start (point to the 32-bits avp code word). |
- Returns
- Pointer to the next AVP found. NULL if no more.
◆ potentiallyReTransmittedMessageBit()
static bool anna::diameter::codec::functions::potentiallyReTransmittedMessageBit |
( |
const anna::DataBlock & |
| ) |
|
|
staticnoexcept |
◆ proxiableBit()
static bool anna::diameter::codec::functions::proxiableBit |
( |
const anna::DataBlock & |
| ) |
|
|
staticnoexcept |
◆ requestBit()
static bool anna::diameter::codec::functions::requestBit |
( |
const anna::DataBlock & |
| ) |
|
|
staticnoexcept |
◆ setEndToEnd()
◆ setHopByHop()
Gets the next AVP pointer reference within an AVPs set datablock with a certain AVP identification.
- Parameters
-
avpsDB | AVPs set as datablock |
id | Avp identification (code, vendorId). |
n | Ocurrence number (first avp, second avp, etc.). 1 by default. |
- Returns
- Pointer to first AVP found with identification provided. NULL if not found.
◆ setPotentiallyReTransmittedMessageBit()
static void anna::diameter::codec::functions::setPotentiallyReTransmittedMessageBit |
( |
const anna::DataBlock & |
db, |
|
|
bool |
activate = true |
|
) |
| |
|
staticnoexcept |
The documentation for this struct was generated from the following file: