libptpmgmt  1.3
libptpmgmt library that provides the functionality of linuxptp pmc
json.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later
2  SPDX-FileCopyrightText: Copyright © 2021 Erez Geva <ErezGeva2@gmail.com> */
3 
12 #ifndef __PTPMGMT_C_JSON_H
13 #define __PTPMGMT_C_JSON_H
14 
15 #include "c/msg.h"
16 
18 typedef struct ptpmgmt_json_t *ptpmgmt_json;
19 
21 typedef const struct ptpmgmt_json_t *const_ptpmgmt_json;
22 
30 char *ptpmgmt_json_msg2json(const_ptpmgmt_msg message, int indent);
31 
41  const void *tlv, int indent);
42 
49  void *_this;
50  struct ptpmgmt_PortIdentity_t *_srcPort;
51  struct ptpmgmt_PortIdentity_t *_dstPort;
52  void *data;
53  void *dataTbl;
60  void (*free)(ptpmgmt_json j);
72  bool (*selectLib)(const char *libName);
79  const char *(*loadLibrary)();
84  bool (*isLibShared)();
90  bool (*fromJson)(ptpmgmt_json j, const char *json);
100  bool (*fromJsonObj)(ptpmgmt_json j, const void *jobj);
113  const void *(*dataField)(ptpmgmt_json j);
197  uint32_t (*sdoId)(const_ptpmgmt_json j);
209  const struct ptpmgmt_PortIdentity_t *(*srcPort)(ptpmgmt_json j);
221  const struct ptpmgmt_PortIdentity_t *(*dstPort)(ptpmgmt_json j);
234 };
235 
247 bool ptpmgmt_json_selectLib(const char *libName);
265 
266 #endif /* __PTPMGMT_C_JSON_H */
ptpmgmt_json ptpmgmt_json_alloc()
bool ptpmgmt_json_selectLib(const char *libName)
struct ptpmgmt_json_t * ptpmgmt_json
Definition: json.h:18
bool ptpmgmt_json_isLibShared()
const struct ptpmgmt_json_t * const_ptpmgmt_json
Definition: json.h:21
char * ptpmgmt_json_tlv2json(enum ptpmgmt_mng_vals_e managementId, const void *tlv, int indent)
const char * ptpmgmt_json_loadLibrary()
char * ptpmgmt_json_msg2json(const_ptpmgmt_msg message, int indent)
ptpmgmt_mng_vals_e
Management TLVs ID.
Definition: mngIds.h:24
Create and parse PTP management messages.
ptpmgmt_actionField_e
Definition: types.h:195
Definition: types.h:412
Definition: json.h:47
bool(* setAction)(const_ptpmgmt_json j, ptpmgmt_msg message)
Definition: json.h:233
bool(* haveDomainNumber)(const_ptpmgmt_json j)
Definition: json.h:155
bool(* havePTPProfileSpecific)(const_ptpmgmt_json j)
Definition: json.h:143
uint8_t(* versionPTP)(const_ptpmgmt_json j)
Definition: json.h:161
bool(* selectLib)(const char *libName)
Definition: json.h:72
uint32_t(* sdoId)(const_ptpmgmt_json j)
Definition: json.h:197
uint8_t(* domainNumber)(const_ptpmgmt_json j)
Definition: json.h:149
enum ptpmgmt_actionField_e(* actionField)(const_ptpmgmt_json j)
Definition: json.h:119
bool(* isUnicast)(const_ptpmgmt_json j)
Definition: json.h:125
bool(* isLibShared)()
Definition: json.h:84
bool(* haveSequenceId)(const_ptpmgmt_json j)
Definition: json.h:191
enum ptpmgmt_mng_vals_e(* managementId)(const_ptpmgmt_json j)
Definition: json.h:106
bool(* fromJson)(ptpmgmt_json j, const char *json)
Definition: json.h:90
void(* free)(ptpmgmt_json j)
Definition: json.h:60
bool(* haveSrcPort)(const_ptpmgmt_json j)
Definition: json.h:215
bool(* haveMinorVersionPTP)(const_ptpmgmt_json j)
Definition: json.h:179
bool(* haveIsUnicast)(const_ptpmgmt_json j)
Definition: json.h:131
bool(* haveSdoId)(const_ptpmgmt_json j)
Definition: json.h:203
uint8_t(* PTPProfileSpecific)(const_ptpmgmt_json j)
Definition: json.h:137
bool(* haveDstPort)(const_ptpmgmt_json j)
Definition: json.h:227
bool(* haveVersionPTP)(const_ptpmgmt_json j)
Definition: json.h:167
bool(* fromJsonObj)(ptpmgmt_json j, const void *jobj)
Definition: json.h:100
uint8_t(* minorVersionPTP)(const_ptpmgmt_json j)
Definition: json.h:173
uint16_t(* sequenceId)(const_ptpmgmt_json j)
Definition: json.h:185
Definition: msg.h:43