libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
Loading...
Searching...
No Matches
cfg.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-3.0-or-later
2 SPDX-FileCopyrightText: Copyright © 2023 Erez Geva <ErezGeva2@gmail.com> */
3
12#ifndef __PTPMGMT_C_CFG_H
13#define __PTPMGMT_C_CFG_H
14
15#include "name.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
22typedef struct ptpmgmt_cfg_t *ptpmgmt_cfg;
23
25typedef const struct ptpmgmt_cfg_t *const_ptpmgmt_cfg;
26
28typedef struct ptpmgmt_spp_t *ptpmgmt_spp;
29
31typedef const struct ptpmgmt_spp_t *const_ptpmgmt_spp;
32
35
38
45 void *_this;
52 void (*free)(ptpmgmt_cfg cfg);
59 bool (*read_cfg)(ptpmgmt_cfg cfg, const char *file);
67 uint8_t (*transportSpecific)(const_ptpmgmt_cfg cfg, const char *section);
75 uint8_t (*domainNumber)(const_ptpmgmt_cfg cfg, const char *section);
83 uint8_t (*udp6_scope)(const_ptpmgmt_cfg cfg, const char *section);
91 uint8_t (*udp_ttl)(const_ptpmgmt_cfg cfg, const char *section);
99 uint8_t (*socket_priority)(const_ptpmgmt_cfg cfg, const char *section);
107 uint8_t (*network_transport)(const_ptpmgmt_cfg cfg, const char *section);
115 uint16_t (*active_key_id)(const_ptpmgmt_cfg cfg, const char *section);
123 uint8_t (*spp)(const_ptpmgmt_cfg cfg, const char *section);
131 uint8_t (*allow_unauth)(const_ptpmgmt_cfg cfg, const char *section);
139 bool (*haveSpp)(const_ptpmgmt_cfg cfg, const char *section);
147 const char *(*uds_address)(const_ptpmgmt_cfg cfg, const char *section);
155 const char *(*sa_file)(const_ptpmgmt_cfg cfg, const char *section);
164 const void *(*ptp_dst_mac)(const_ptpmgmt_cfg cfg, size_t *len,
165 const char *section);
174 const void *(*p2p_dst_mac)(const_ptpmgmt_cfg cfg, size_t *len,
175 const char *section);
176};
177
183
200
207 void *_this;
214 void (*free)(ptpmgmt_spp spp);
226 bool (*addKey)(ptpmgmt_spp spp, uint32_t id, enum PTPMGMT_HMAC_t type,
227 const void *value, size_t size, size_t digest, bool replace);
234 bool (*have)(const_ptpmgmt_spp spp, uint32_t key);
241 size_t (*mac_size)(const_ptpmgmt_spp spp, uint32_t key);
248 const void *(*key)(const_ptpmgmt_spp spp, uint32_t key);
255 size_t (*key_size)(const_ptpmgmt_spp spp, uint32_t key);
262 size_t (*keys)(const_ptpmgmt_spp spp);
269 enum PTPMGMT_HMAC_t (*htype)(const_ptpmgmt_spp spp, uint32_t key);
275 uint8_t (*ownID)(const_ptpmgmt_spp spp);
276};
277
289
296 void *_this;
297 ptpmgmt_spp _all[UINT8_MAX];
304 void (*free)(ptpmgmt_safile sf);
311 bool (*read_sa)(ptpmgmt_safile sf, const char *file);
323 const char *section);
330 bool (*have)(const_ptpmgmt_safile sf, uint8_t spp);
338 bool (*have_key)(const_ptpmgmt_safile sf, uint8_t spp, uint32_t key);
346};
347
353
354#ifdef __cplusplus
355}
356#endif
357
358#endif /* __PTPMGMT_C_CFG_H */
ptpmgmt_cfg ptpmgmt_cfg_alloc()
struct ptpmgmt_cfg_t * ptpmgmt_cfg
Definition cfg.h:22
PTPMGMT_HMAC_t
Authentication key type.
Definition cfg.h:189
@ PTPMGMT_HMAC_AES256
Definition cfg.h:198
@ PTPMGMT_HMAC_AES128
Definition cfg.h:194
@ PTPMGMT_HMAC_SHA256
Definition cfg.h:190
struct ptpmgmt_spp_t * ptpmgmt_spp
Definition cfg.h:28
ptpmgmt_spp ptpmgmt_spp_alloc_cp(const_ptpmgmt_spp spp)
const struct ptpmgmt_safile_t * const_ptpmgmt_safile
Definition cfg.h:37
ptpmgmt_safile ptpmgmt_safile_alloc()
struct ptpmgmt_safile_t * ptpmgmt_safile
Definition cfg.h:34
const struct ptpmgmt_cfg_t * const_ptpmgmt_cfg
Definition cfg.h:25
const struct ptpmgmt_spp_t * const_ptpmgmt_spp
Definition cfg.h:31
ptpmgmt_spp ptpmgmt_spp_alloc(uint8_t id)
Define name space.
Definition cfg.h:43
uint8_t(* spp)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:123
uint8_t(* allow_unauth)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:131
uint8_t(* udp6_scope)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:83
uint8_t(* transportSpecific)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:67
bool(* read_cfg)(ptpmgmt_cfg cfg, const char *file)
Definition cfg.h:59
uint16_t(* active_key_id)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:115
uint8_t(* udp_ttl)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:91
uint8_t(* socket_priority)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:99
uint8_t(* network_transport)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:107
void(* free)(ptpmgmt_cfg cfg)
Definition cfg.h:52
uint8_t(* domainNumber)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:75
bool(* haveSpp)(const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:139
Definition cfg.h:294
bool(* have_key)(const_ptpmgmt_safile sf, uint8_t spp, uint32_t key)
Definition cfg.h:338
void(* free)(ptpmgmt_safile sf)
Definition cfg.h:304
bool(* have)(const_ptpmgmt_safile sf, uint8_t spp)
Definition cfg.h:330
bool(* read_sa)(ptpmgmt_safile sf, const char *file)
Definition cfg.h:311
const_ptpmgmt_spp(* spp)(ptpmgmt_safile sf, uint8_t spp)
Definition cfg.h:345
bool(* read_sa_cfg)(ptpmgmt_safile sf, const_ptpmgmt_cfg cfg, const char *section)
Definition cfg.h:322
Definition cfg.h:205
uint8_t(* ownID)(const_ptpmgmt_spp spp)
Definition cfg.h:275
void(* free)(ptpmgmt_spp spp)
Definition cfg.h:214
bool(* addKey)(ptpmgmt_spp spp, uint32_t id, enum PTPMGMT_HMAC_t type, const void *value, size_t size, size_t digest, bool replace)
Definition cfg.h:226
const void *(* key)(const_ptpmgmt_spp spp, uint32_t key)
Definition cfg.h:248
bool(* have)(const_ptpmgmt_spp spp, uint32_t key)
Definition cfg.h:234
size_t(* mac_size)(const_ptpmgmt_spp spp, uint32_t key)
Definition cfg.h:241
size_t(* key_size)(const_ptpmgmt_spp spp, uint32_t key)
Definition cfg.h:255
size_t(* keys)(const_ptpmgmt_spp spp)
Definition cfg.h:262
enum PTPMGMT_HMAC_t(* htype)(const_ptpmgmt_spp spp, uint32_t key)
Definition cfg.h:269