EpcTools
An event based multi-threaded C++ development framework.
Functions
efdjson.h File Reference

Functions to encode/decode freeDiameter messages and grouped AVP's to and from a JSON string. More...

#include <freeDiameter/freeDiameter-host.h>
#include "freeDiameter/libfdproto.h"
#include "freeDiameter/libfdcore.h"

Go to the source code of this file.

Functions

int fdJsonAddAvps (const char *json, msg_or_avp *msg, void(*errfunc)(const char *))
 Adds the AVP from the JSON string to a freeDiameter message or grouped AVP. More...
 
const char * fdJsonGetJSON (msg_or_avp *msg, void(*errfunc)(const char *))
 Converts the AVP's from a freeDiameter message or grouped AVP to a JSON string. More...
 

Detailed Description

Functions to encode/decode freeDiameter messages and grouped AVP's to and from a JSON string.

Function Documentation

◆ fdJsonAddAvps()

int fdJsonAddAvps ( const char *  json,
msg_or_avp *  msg,
void(*)(const char *)  errfunc 
)

Adds the AVP from the JSON string to a freeDiameter message or grouped AVP.

Parameters
jsonthe JSON string to process.
msgthe freeDiameter or grouped AVP to add to.
errfunca function that is called in the event of an error.
Returns
0 indicates success, otherwise failure.

◆ fdJsonGetJSON()

const char* fdJsonGetJSON ( msg_or_avp *  msg,
void(*)(const char *)  errfunc 
)

Converts the AVP's from a freeDiameter message or grouped AVP to a JSON string.

Parameters
msgthe freeDiameter message or grouped AVP to process.
errfunca function that is called in the event of an error.
Returns
the resulting JSON string.