libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Classes | Typedefs | Functions
json.h File Reference

Convert a management or a signalling message to JSON. More...

#include "c/msg.h"
Include dependency graph for json.h:

Go to the source code of this file.

Classes

struct  ptpmgmt_json_t
 

Typedefs

typedef struct ptpmgmt_json_tptpmgmt_json
 
typedef const struct ptpmgmt_json_tconst_ptpmgmt_json
 

Functions

char * ptpmgmt_json_msg2json (const_ptpmgmt_msg message, int indent)
 
char * ptpmgmt_json_tlv2json (enum ptpmgmt_mng_vals_e managementId, const void *tlv, int indent)
 
ptpmgmt_json ptpmgmt_json_alloc ()
 

Detailed Description

Convert a management or a signalling message to JSON.

Author
Erez Geva <ErezGeva2@gmail.com>

Typedef Documentation

◆ const_ptpmgmt_json

typedef const struct ptpmgmt_json_t* const_ptpmgmt_json

pointer to constant ptpmgmt json structure

◆ ptpmgmt_json

typedef struct ptpmgmt_json_t* ptpmgmt_json

pointer to ptpmgmt json structure

Function Documentation

◆ ptpmgmt_json_alloc()

ptpmgmt_json ptpmgmt_json_alloc ( )

Alocate new json structure

Returns
new json structure or null in case of error

◆ ptpmgmt_json_msg2json()

char* ptpmgmt_json_msg2json ( const_ptpmgmt_msg  message,
int  indent 
)

Convert Message to JSON string

Parameters
[in]messagereceived from PTP entity
[in]indentbase indent for the JSON string
Returns
JSON string
Note
The caller MUST free the string after use!

◆ ptpmgmt_json_tlv2json()

char* ptpmgmt_json_tlv2json ( enum ptpmgmt_mng_vals_e  managementId,
const void *  tlv,
int  indent 
)

Convert PTP management TLV to JSON string

Parameters
[in]managementIdPTP management TLV id
[in]tlvPTP management TLV
[in]indentbase indent for the JSON string
Returns
JSON string
Note
The caller MUST free the string after use!