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
47
Issues
47
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
e40d6dc0
Commit
e40d6dc0
authored
Dec 21, 2011
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
state-initializing completed
parent
2e56afaf
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
9 deletions
+33
-9
posix-socket.c
arch-gnu-linux/posix-socket.c
+22
-0
posix-startup.c
arch-gnu-linux/posix-startup.c
+3
-1
constants.h
include/pproto/constants.h
+1
-1
pproto.h
include/pproto/pproto.h
+3
-1
state-initializing.c
proto-standard/state-initializing.c
+4
-6
No files found.
arch-gnu-linux/posix-socket.c
View file @
e40d6dc0
...
...
@@ -14,6 +14,7 @@
#include <net/if.h>
#include <arpa/inet.h>
#include <pproto/pproto.h>
#include <pproto/diag.h>
#include "posix.h"
...
...
@@ -197,3 +198,24 @@ _end:
int
pp_net_shutdown
(
struct
pp_instance
*
ppi
)
__attribute__
((
alias
(
"posix_net_shutdown"
)));
extern
UInteger32
posix_htonl
(
UInteger32
hostlong
)
{
/* FIXME: compile (link) fails (arch 64 bit)
* return hotnl(hostlong); */
return
0
;
/* FIXME */
}
extern
UInteger16
posix_htons
(
UInteger16
hostshort
)
{
/* FIXME: compile (link) fails (arch 64 bit)
* return hotns(hostlong); */
return
0
;
/* FIXME */
}
UInteger32
pp_htonl
(
UInteger32
hostlong
)
__attribute__
((
alias
(
"posix_htonl"
)));
UInteger16
pp_htons
(
UInteger16
hostlong
)
__attribute__
((
alias
(
"posix_htons"
)));
arch-gnu-linux/posix-startup.c
View file @
e40d6dc0
...
...
@@ -38,10 +38,12 @@ int main(int argc, char **argv)
ppi
->
portDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
portDS
));
ppi
->
timePropertiesDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
timePropertiesDS
));
ppi
->
net_path
=
calloc
(
1
,
sizeof
(
*
ppi
->
net_path
));
ppi
->
buf_out
=
calloc
(
1
,
PP_PACKET_SIZE
);
ppi
->
buf_in
=
calloc
(
1
,
PP_PACKET_SIZE
);
if
((
!
ppi
->
defaultDS
)
||
(
!
ppi
->
currentDS
)
||
(
!
ppi
->
parentDS
)
||
(
!
ppi
->
portDS
)
||
(
!
ppi
->
timePropertiesDS
)
||
(
!
ppi
->
sent_seq_id
)
||
(
!
ppi
->
net_path
)
||
(
!
ppi
->
net_path
)
||
(
!
ppi
->
buf_out
)
||
(
!
ppi
->
buf_in
)
)
exit
(
__LINE__
);
...
...
include/pproto/constants.h
View file @
e40d6dc0
...
...
@@ -56,7 +56,6 @@
#define PP_PDELAY_RESP_FOLLOW_UP_LENGTH 54
#define PP_MANAGEMENT_LENGTH 48
/* UDP/IPv4 dependent */
#define PP_SUBDOMAIN_ADDRESS_LENGTH 4
#define PP_PORT_ADDRESS_LENGTH 2
...
...
@@ -71,4 +70,5 @@
#define PP_MM_STARTING_BOUNDARY_HOPS 0x7fff
#endif
/* __PTP_CONSTANTS_H__ */
include/pproto/pproto.h
View file @
e40d6dc0
...
...
@@ -127,6 +127,8 @@ struct pp_instance {
Integer16
foreign_record_i
;
Integer16
foreign_record_best
;
Boolean
record_update
;
Octet
*
buf_out
;
Octet
*
buf_in
;
union
{
MsgSync
sync
;
...
...
@@ -169,7 +171,7 @@ 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
host
long
);
extern
UInteger16
pp_htons
(
UInteger16
host
short
);
/* Timers */
...
...
proto-standard/state-initializing.c
View file @
e40d6dc0
...
...
@@ -54,14 +54,12 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
*
* Init all remaining stuff:
* initClock(rtOpts, ptpClock);
*
* Set myself as master (in case will not receive any announce):
* m1(ptpClock);
*
* Prepare a message:
* msgPackHeader(ptpClock->msgObuf,ptpClock);
*/
m1
(
ppi
);
msg_pack_header
(
ppi
->
buf_out
,
ppi
);
ppi
->
next_state
=
PPS_LISTENING
;
return
0
;
...
...
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