Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
a2cbe497
Commit
a2cbe497
authored
Dec 06, 2011
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new constants.h file. More defines coming from IEEE 1588 specification
parent
7646a3a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
14 deletions
+108
-14
constants.h
include/pproto/constants.h
+42
-0
ieee1588_types.h
include/pproto/ieee1588_types.h
+64
-1
pproto.h
include/pproto/pproto.h
+2
-13
No files found.
include/pproto/constants.h
0 → 100644
View file @
a2cbe497
#ifndef CONSTANTS_H_
#define CONSTANTS_H_
/* implementation specific constants */
#define PP_DEFAULT_INBOUND_LATENCY 0
/* in nsec */
#define PP_DEFAULT_OUTBOUND_LATENCY 0
/* in nsec */
#define PP_DEFAULT_NO_RESET_CLOCK 0
#define PP_DEFAULT_DOMAIN_NUMBER 0
#define PP_DEFAULT_DELAY_MECHANISM P2P
#define PP_DEFAULT_AP 10
#define PP_DEFAULT_AI 1000
#define PP_DEFAULT_DELAY_S 6
#define PP_DEFAULT_ANNOUNCE_INTERVAL 1
/* 0 in 802.1AS */
#define PP_DEFAULT_UTC_OFFSET 0
#define PP_DEFAULT_UTC_VALID 0
#define PP_DEFAULT_PDELAYREQ_INTERVAL 1
/* -4 in 802.1AS */
#define PP_DEFAULT_DELAYREQ_INTERVAL 3
#define PP_DEFAULT_SYNC_INTERVAL 0
/* -7 in 802.1AS */
#define PP_DEFAULT_SYNC_RECEIPT_TIMEOUT 3
#define PP_DEFAULT_ANNOUNCE_RECEIPT_TIMEOUT 6
/* 3 by default */
#define PP_DEFAULT_QUALIFICATION_TIMEOUT 2
#define PP_DEFAULT_FOREIGN_MASTER_TIME_WINDOW 4
#define PP_DEFAULT_FOREIGN_MASTER_THRESHOLD 2
#define PP_DEFAULT_CLOCK_CLASS 248
#define PP_DEFAULT_CLOCK_ACCURACY 0xFE
#define PP_DEFAULT_PRIORITY1 248
#define PP_DEFAULT_PRIORITY2 248
#define PP_DEFAULT_CLOCK_VARIANCE -4000
/* To be determined in
* 802.1AS. We use the
* same value as in ptpdv1
*/
#define PP_DEFAULT_MAX_FOREIGN_RECORDS 5
#define PP_DEFAULT_PARENTS_STATS 0
/* FIXME: check if the following defines are really useful */
#define PP_TIMER_PDELAYREQ_INTERVAL 0
#define PP_TIMER_DELAYREQ_INTERVAL 1
#define PP_TIMER_SYNC_INTERVAL 2
#define PP_TIMER_ANNOUNCE_RECEIPT 3
#define PP_TIMER_ANNOUNCE_INTERVAL 4
#endif
/*CONSTANTS_H_*/
include/pproto/ieee1588_types.h
View file @
a2cbe497
...
...
@@ -6,7 +6,6 @@
#ifndef IEEE_1588_TYPES_H_
#define IEEE_1588_TYPES_H_
/* FIXME needed? #include <stdio.h> */
#include <stdint.h>
...
...
@@ -239,4 +238,68 @@ typedef struct {
Enumeration8
timeSource
;
}
DSTimeProperties
;
/* Enumeration States (table 8, page 73) */
enum
pp_std_states
{
PPS_END_OF_TABLE
=
0
,
PPS_INITIALIZING
,
PPS_FAULTY
,
PPS_DISABLED
,
PPS_LISTENING
,
PPS_PRE_MASTER
,
PPS_MASTER
,
PPS_PASSIVE
,
PPS_UNCALIBRATED
,
PPS_SLAVE
,
};
enum
pp_std_messages
{
PPM_SYNC
=
0x0
,
PPM_DELAY_REQ
,
PPM_PDELAY_REQ
,
PPM_PDELAY_RESP
,
PPM_FOLLOW_UP
=
0x8
,
PPM_DELAY_RESP
,
PPM_PDELAY_RESP_FOLLOW_UP
,
PPM_ANNOUNCE
,
PPM_SIGNALING
,
PPM_MANAGEMENT
,
};
/* Enumeration Domain Number (table 2, page 41) */
enum
ENDomainNumber
{
DFLT_DOMAIN_NUMBER
=
0
,
ALT1_DOMAIN_NUMBER
,
ALT2_DOMAIN_NUMBER
,
ALT3_DOMAIN_NUMBER
};
/* Enumeration Network Protocol (table 3, page 46) */
enum
ENNetworkProtocol
{
UDP_IPV4
=
1
,
UDP_IPV6
,
IEE_802_3
,
DeviceNet
,
ControlNet
,
PROFINET
};
/* Enumeration Time Source (table 7, page 57) */
enum
ENTimeSource
{
ATOMIC_CLOCK
=
0x10
,
GPS
=
0x20
,
TERRESTRIAL_RADIO
=
0x30
,
PTP
=
0x40
,
NTP
=
0x50
,
HAND_SET
=
0x60
,
OTHER
=
0x90
,
INTERNAL_OSCILLATOR
=
0xA0
};
/* Enumeration Delay mechanism (table 9, page 74) */
enum
ENDelayMechanism
{
E2E
=
1
,
P2P
=
2
,
DELAY_DISABLED
=
0xFE
};
#endif
/*IEEE_1588_TYPES_H_*/
include/pproto/pproto.h
View file @
a2cbe497
...
...
@@ -25,7 +25,7 @@ extern struct pp_runtime_opts default_rt_opts; /* preinitialized
*/
struct
pp_channel
{
union
{
int
fd
;
/* Po
isx wants fide
descriptor */
int
fd
;
/* Po
six wants fid
descriptor */
void
*
custom
;
/* Other archs want other stuff */
};
void
*
arch_data
;
/* Other arch-private info, if any */
...
...
@@ -84,18 +84,7 @@ struct pp_state_table_item {
extern
struct
pp_state_table_item
pp_state_table
[];
/* 0-terminated */
enum
pp_std_states
{
PPS_END_OF_TABLE
=
0
,
PPS_INITIALIZING
,
PPS_FAULTY
,
PPS_DISABLED
,
PPS_LISTENING
,
PPS_PRE_MASTER
,
PPS_MASTER
,
PPS_PASSIVE
,
PPS_UNCALIBRATED
,
PPS_SLAVE
,
};
/* Use a typedef, to avoid long prototypes */
typedef
int
pp_action
(
struct
pp_instance
*
ppi
,
uint8_t
*
packet
,
int
plen
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment