libptpmgmt  1.4
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 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
22 typedef struct ptpmgmt_json_t *ptpmgmt_json;
23 
25 typedef const struct ptpmgmt_json_t *const_ptpmgmt_json;
26 
34 char *ptpmgmt_json_msg2json(const_ptpmgmt_msg message, int indent);
35 
45  const void *tlv, int indent);
46 
53  void *_this;
54  struct ptpmgmt_PortIdentity_t *_srcPort;
55  struct ptpmgmt_PortIdentity_t *_dstPort;
56  void *data;
57  void *dataTbl;
64  void (*free)(ptpmgmt_json j);
67  __PTPMGMT_DEPRECATED_DEC(bool (*selectLib)(const char *libName));
68  __PTPMGMT_DEPRECATED_DEC(const char *(*loadLibrary)());
69  __PTPMGMT_DEPRECATED_DEC(bool (*isLibShared)());
76  bool (*fromJson)(ptpmgmt_json j, const char *json);
79  __PTPMGMT_DEPRECATED_DEC(bool (*fromJsonObj)(ptpmgmt_json j, const void *jobj));
93  const void *(*dataField)(ptpmgmt_json j);
177  uint32_t (*sdoId)(const_ptpmgmt_json j);
189  const struct ptpmgmt_PortIdentity_t *(*srcPort)(ptpmgmt_json j);
201  const struct ptpmgmt_PortIdentity_t *(*dstPort)(ptpmgmt_json j);
214 };
217 __PTPMGMT_DEPRECATED_DEC(bool ptpmgmt_json_selectLib(const char *libName));
218 __PTPMGMT_DEPRECATED_DEC(const char *ptpmgmt_json_loadLibrary());
219 __PTPMGMT_DEPRECATED_DEC(bool ptpmgmt_json_isLibShared());
226 
227 #ifdef __cplusplus
228 }
229 #endif
230 
231 #endif /* __PTPMGMT_C_JSON_H */
ptpmgmt_json ptpmgmt_json_alloc()
struct ptpmgmt_json_t * ptpmgmt_json
Definition: json.h:22
const struct ptpmgmt_json_t * const_ptpmgmt_json
Definition: json.h:25
char * ptpmgmt_json_tlv2json(enum ptpmgmt_mng_vals_e managementId, const void *tlv, int indent)
char * ptpmgmt_json_msg2json(const_ptpmgmt_msg message, int indent)
ptpmgmt_mng_vals_e
Management TLVs ID.
Definition: mngIds.h:28
Create and parse PTP management messages.
ptpmgmt_actionField_e
Definition: types.h:199
Definition: types.h:416
Definition: json.h:51
bool(* setAction)(const_ptpmgmt_json j, ptpmgmt_msg message)
Definition: json.h:213
bool(* haveDomainNumber)(const_ptpmgmt_json j)
Definition: json.h:135
bool(* havePTPProfileSpecific)(const_ptpmgmt_json j)
Definition: json.h:123
uint8_t(* versionPTP)(const_ptpmgmt_json j)
Definition: json.h:141
uint32_t(* sdoId)(const_ptpmgmt_json j)
Definition: json.h:177
uint8_t(* domainNumber)(const_ptpmgmt_json j)
Definition: json.h:129
enum ptpmgmt_actionField_e(* actionField)(const_ptpmgmt_json j)
Definition: json.h:99
bool(* isUnicast)(const_ptpmgmt_json j)
Definition: json.h:105
bool(* haveSequenceId)(const_ptpmgmt_json j)
Definition: json.h:171
enum ptpmgmt_mng_vals_e(* managementId)(const_ptpmgmt_json j)
Definition: json.h:86
bool(* fromJson)(ptpmgmt_json j, const char *json)
Definition: json.h:76
void(* free)(ptpmgmt_json j)
Definition: json.h:64
bool(* haveSrcPort)(const_ptpmgmt_json j)
Definition: json.h:195
bool(* haveMinorVersionPTP)(const_ptpmgmt_json j)
Definition: json.h:159
bool(* haveIsUnicast)(const_ptpmgmt_json j)
Definition: json.h:111
bool(* haveSdoId)(const_ptpmgmt_json j)
Definition: json.h:183
uint8_t(* PTPProfileSpecific)(const_ptpmgmt_json j)
Definition: json.h:117
bool(* haveDstPort)(const_ptpmgmt_json j)
Definition: json.h:207
bool(* haveVersionPTP)(const_ptpmgmt_json j)
Definition: json.h:147
uint8_t(* minorVersionPTP)(const_ptpmgmt_json j)
Definition: json.h:153
uint16_t(* sequenceId)(const_ptpmgmt_json j)
Definition: json.h:165
Definition: msg.h:47