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
74da3f32
Commit
74da3f32
authored
Dec 12, 2011
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integration of msg.c src file, containing function for message handling
parent
86c25f77
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
301 additions
and
257 deletions
+301
-257
posix-io.c
arch-gnu-linux/posix-io.c
+5
-0
posix-startup.c
arch-gnu-linux/posix-startup.c
+3
-1
dep.h
include/dep/dep.h
+1
-0
constants.h
include/pproto/constants.h
+11
-0
pproto.h
include/pproto/pproto.h
+10
-2
Makefile
proto-standard/Makefile
+1
-0
msg.c
proto-standard/msg.c
+270
-254
No files found.
arch-gnu-linux/posix-io.c
View file @
74da3f32
...
...
@@ -27,6 +27,11 @@ int pp_memcmp(void *s1, const void *s2, int count)
return
memcmp
(
s1
,
s2
,
count
);
}
void
*
pp_memset
(
void
*
s
,
int
c
,
int
count
)
{
return
memset
(
s
,
c
,
count
);
}
void
pp_get_stamp
(
uint32_t
*
sptr
)
{
*
sptr
=
htonl
(
time
(
NULL
));
...
...
arch-gnu-linux/posix-startup.c
View file @
74da3f32
...
...
@@ -31,6 +31,7 @@ int main(int argc, char **argv)
if
(
!
ppi
)
exit
(
__LINE__
);
ppi
->
sent_seq_id
=
calloc
(
16
,
sizeof
(
*
ppi
->
sent_seq_id
));
ppi
->
defaultDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
defaultDS
));
ppi
->
currentDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
currentDS
));
ppi
->
parentDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
parentDS
));
...
...
@@ -38,7 +39,8 @@ int main(int argc, char **argv)
ppi
->
timePropertiesDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
timePropertiesDS
));
if
((
!
ppi
->
defaultDS
)
||
(
!
ppi
->
currentDS
)
||
(
!
ppi
->
parentDS
)
||
(
!
ppi
->
portDS
)
||
(
!
ppi
->
timePropertiesDS
))
||
(
!
ppi
->
portDS
)
||
(
!
ppi
->
timePropertiesDS
)
||
(
!
ppi
->
sent_seq_id
)
)
exit
(
__LINE__
);
if
(
posix_open_ch
(
ppi
,
ifname
))
{
...
...
include/dep/dep.h
View file @
74da3f32
...
...
@@ -15,5 +15,6 @@ extern void pp_puts(const char *s);
extern
int
pp_strnlen
(
const
char
*
s
,
int
maxlen
);
extern
void
*
pp_memcpy
(
void
*
d
,
const
void
*
s
,
int
count
);
extern
int
pp_memcmp
(
void
*
s1
,
const
void
*
s2
,
int
count
);
extern
void
*
pp_memset
(
void
*
s
,
int
c
,
int
count
);
#endif
/* __PTP_DEP_H__ */
include/pproto/constants.h
View file @
74da3f32
...
...
@@ -42,4 +42,15 @@
#define PP_TWO_STEP_FLAG 2
#define PP_VERSION_PTP 2
#define PP_HEADER_LENGTH 34
#define PP_ANNOUNCE_LENGTH 64
#define PP_SYNC_LENGTH 44
#define PP_FOLLOW_UP_LENGTH 44
#define PP_PDELAY_REQ_LENGTH 54
#define PP_DELAY_REQ_LENGTH 44
#define PP_DELAY_RESP_LENGTH 54
#define PP_PDELAY_RESP_LENGTH 54
#define PP_PDELAY_RESP_FOLLOW_UP_LENGTH 54
#define PP_MANAGEMENT_LENGTH 48
#endif
/* __PTP_CONSTANTS_H__ */
include/pproto/pproto.h
View file @
74da3f32
...
...
@@ -108,13 +108,13 @@ struct pp_instance {
DSTimeProperties
*
timePropertiesDS
;
struct
pp_timer
*
timers
[
PP_TIMER_ARRAY_SIZE
];
/* FIXME: check the variables
below
. Now inherited from ptpd src*/
/* FIXME: check the variables
from now on
. Now inherited from ptpd src*/
UInteger16
number_foreign_records
;
Integer16
max_foreign_records
;
Integer16
foreign_record_i
;
Integer16
foreign_record_best
;
Boolean
record_update
;
MsgHeader
msg_tmp_header
;
union
{
MsgSync
sync
;
MsgFollowUp
follow
;
...
...
@@ -127,6 +127,11 @@ struct pp_instance {
MsgAnnounce
announce
;
MsgSignaling
signaling
;
}
msg_tmp
;
UInteger16
*
sent_seq_id
;
/* sequence id of the last message sent of the
* same type
*/
MsgHeader
msg_tmp_header
;
MsgHeader
pdelay_req_hdr
;
};
...
...
@@ -150,8 +155,11 @@ extern int pp_net_init(struct pp_instance *ppi);
extern
int
pp_net_shutdown
(
struct
pp_instance
*
ppi
);
extern
int
pp_recv_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
);
extern
int
pp_send_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
);
extern
UInteger32
pp_htonl
(
UInteger32
hostlong
);
extern
UInteger16
pp_htons
(
UInteger16
hostlong
);
/* Timers */
extern
int
pp_timer_init
(
struct
pp_instance
*
ppi
);
/* initializes timer common
structure */
extern
int
pp_timer_start
(
struct
pp_timer
*
tm
);
...
...
proto-standard/Makefile
View file @
74da3f32
...
...
@@ -18,6 +18,7 @@ OBJ-libstd := $D/state-table-default.o \
$D
/state-uncalibrated.o
\
$D
/state-slave.o
\
$D
/bmc.o
\
$D
/msg.o
\
$D
/open-close.o
$(TARGET).o
:
$(LIBSTD)
...
...
proto-standard/msg.c
View file @
74da3f32
This diff is collapsed.
Click to expand it.
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