forked from intel/synce4l
-
Notifications
You must be signed in to change notification settings - Fork 0
/
synce_transport.h
55 lines (48 loc) · 1.41 KB
/
synce_transport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* @file synce_transport.h
* @brief Implements the SyncE transport interface.
* @note SPDX-FileCopyrightText: Copyright 2022 Intel Corporation
* @note SPDX-License-Identifier: GPL-2.0+
*/
#ifndef HAVE_SYNCE_TRANSPORT_H
#define HAVE_SYNCE_TRANSPORT_H
#include <stdint.h>
struct synce_transport;
struct ClockIdentity;
struct synce_pdu;
/**
* Create a SyncE transport.
*
* This high level API creates SyncE transport but and initialize it.
*
* @param iface A name of interface to create transport for
* @return A SyncE transport structure
*/
struct synce_transport *synce_transport_create(const char *iface);
/**
* Delete a SyncE transport.
*
* This high level API deletes SyncE transport and frees all memory allocations.
*
* @param transport A SyncE transport interface
*/
void synce_transport_delete(struct synce_transport *transport);
/**
* Send PDU via SyncE transport.
*
* @param transport A SyncE transport interface
* @param pdu A pointer to a ESMC SyncE PDU
* @return Zero on success, non-zero if failure
*/
int synce_transport_send_pdu(struct synce_transport *transport,
struct synce_pdu *pdu);
/**
* Recv PDU via SyncE transport.
*
* @param transport A SyncE transport interface
* @param pdu A pointer to a ESMC SyncE PDU
* @return Zero on success, non-zero if failure
*/
int synce_transport_recv_pdu(struct synce_transport *transport,
struct synce_pdu *pdu);
#endif