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
45
Issues
45
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
4f40367e
Commit
4f40367e
authored
Jan 06, 2012
by
Alessandro Rubini
Committed by
Aurelio Colosimo
Jan 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proto-standard: uncomment all DBGV lines
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
f4ef8683
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
49 deletions
+25
-49
bmc.c
proto-standard/bmc.c
+4
-2
common-fun.c
proto-standard/common-fun.c
+12
-30
state-master.c
proto-standard/state-master.c
+4
-9
state-slave.c
proto-standard/state-slave.c
+5
-8
No files found.
proto-standard/bmc.c
View file @
4f40367e
...
...
@@ -2,6 +2,7 @@
* FIXME header
*/
#include <pptp/pptp.h>
#include <pptp/diag.h>
/* Local clock is becoming Master. Table 13 (9.3.5) of the spec. */
void
m1
(
struct
pp_instance
*
ppi
)
...
...
@@ -104,10 +105,11 @@ Integer8 bmc_dataset_cmp(struct pp_instance *ppi,
MsgHeader
*
hdr_a
,
MsgAnnounce
*
ann_a
,
MsgHeader
*
hdr_b
,
MsgAnnounce
*
ann_b
)
{
/* FIXME DBGV("Data set comparison \n"); */
short
comp
=
0
;
Octet
*
ppci
;
DBGV
(
"Data set comparison
\n
"
);
/* Identity comparison */
if
(
!
pp_memcmp
(
ann_a
->
grandmasterIdentity
,
ann_b
->
grandmasterIdentity
,
PP_CLOCK_IDENTITY_LENGTH
))
{
...
...
@@ -306,7 +308,7 @@ UInteger8 bmc(struct pp_instance *ppi, struct pp_frgn_master *frgn_master,
&
frgn_master
[
best
].
ann
)
<
0
)
best
=
i
;
/* FIXME DBGV("Best record : %d \n",best); */
DBGV_ARGS
(
"Best record : %d
\n
"
,
best
);
ppi
->
foreign_record_best
=
best
;
return
bmc_state_decision
(
ppi
,
&
frgn_master
[
best
].
hdr
,
...
...
proto-standard/common-fun.c
View file @
4f40367e
...
...
@@ -2,14 +2,13 @@
* FIXME: header
*/
#include <pptp/pptp.h>
#include <pptp/diag.h>
#include "common-fun.h"
void
st_com_execute_slave
(
struct
pp_instance
*
ppi
)
{
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_ANN_RECEIPT
]))
{
/* FIXME diag
* DBGV("event ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES\n");
*/
DBGV
(
"event ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
\n
"
);
ppi
->
number_foreign_records
=
0
;
ppi
->
foreign_record_i
=
0
;
if
(
!
DSDEF
(
ppi
)
->
slaveOnly
&&
...
...
@@ -24,17 +23,13 @@ void st_com_execute_slave(struct pp_instance *ppi)
if
(
ppi
->
rt_opts
->
e2e_mode
)
{
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_DELAYREQ
]))
{
/* FIXME diag
* DBGV("event DELAYREQ_INTERVAL_TIMEOUT_EXPIRES\n");
*/
DBGV
(
"TODO: event DELAYREQ_INTERVAL_TIMEOUT_EXPIRES
\n
"
);
/* TODO issueDelayReq(rtOpts,ptpClock); */
}
}
else
{
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]))
{
/* FIXME diag
DBGV("event PDELAYREQ_INTERVAL_TIMEOUT_EXPIRES\n");
*/
DBGV
(
"TODO: event PDELAYREQ_INTERVAL_TOUT_EXPIRES
\n
"
);
/* TODO issuePDelayReq(rtOpts,ptpClock); */
}
}
...
...
@@ -54,7 +49,7 @@ void st_com_restart_annrec_timer(struct pp_instance *ppi)
int
st_com_check_record_update
(
struct
pp_instance
*
ppi
)
{
if
(
ppi
->
record_update
)
{
/* FIXME diag DBGV("event STATE_DECISION_EVENT\n"); */
DBGV
(
"event STATE_DECISION_EVENT
\n
"
);
ppi
->
record_update
=
FALSE
;
ppi
->
next_state
=
bmc
(
ppi
,
ppi
->
frgn_master
,
ppi
->
rt_opts
);
...
...
@@ -85,9 +80,8 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf)
*/
ppi
->
frgn_master
[
j
].
ann_messages
++
;
found
=
1
;
/* FIXME diag
DBGV
(
"addForeign : AnnounceMessage incremented
\n
"
);
*/
msg_copy_header
(
&
ppi
->
frgn_master
[
j
].
hdr
,
hdr
);
msg_unpack_announce
(
buf
,
&
ppi
->
frgn_master
[
j
].
ann
);
break
;
...
...
@@ -121,7 +115,7 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf)
msg_unpack_announce
(
buf
,
&
ppi
->
frgn_master
[
j
].
ann
);
/* FIXME diag DBGV("New foreign Master added \n");*/
DBGV
(
"New foreign Master added
\n
"
);
ppi
->
foreign_record_i
=
(
ppi
->
foreign_record_i
+
1
)
%
ppi
->
max_foreign_records
;
...
...
@@ -228,25 +222,17 @@ int st_com_slave_handle_followup(struct pp_instance *ppi, unsigned char *buf,
return
-
1
;
if
(
!
ppi
->
is_from_cur_par
)
{
/* FIXME diag
DBGV("SequenceID doesn't match with "
"last Sync message \n");
*/
DBGV
(
"SequenceID doesn't match last Sync message
\n
"
);
return
0
;
}
if
(
!
ppi
->
waiting_for_follow
)
{
/* FIXME diag
DBGV("Slave was not waiting a follow up "
"message \n");
*/
DBGV
(
"Slave was not waiting a follow up message
\n
"
);
return
0
;
}
if
(
ppi
->
recv_sync_sequence_id
!=
hdr
->
sequenceId
)
{
/* FIXME diag
DBGV("Follow up message is not from current parent \n");
*/
DBGV
(
"Follow up message is not from current parent
\n
"
);
return
0
;
}
...
...
@@ -310,15 +296,11 @@ int st_com_master_handle_announce(struct pp_instance *ppi, unsigned char *buf,
return
-
1
;
if
(
ppi
->
is_from_self
)
{
/* FIXME diag
DBGV("HandleAnnounce : Ignore message from self \n");
*/
DBGV
(
"HandleAnnounce : Ignore message from self
\n
"
);
return
0
;
}
/* FIXME diag
* DBGV("Announce message from another foreign master");
*/
DBGV
(
"Announce message from another foreign master
\n
"
);
st_com_add_foreign
(
ppi
,
buf
);
...
...
proto-standard/state-master.c
View file @
4f40367e
...
...
@@ -2,6 +2,7 @@
* FIXME: header
*/
#include <pptp/pptp.h>
#include <pptp/diag.h>
#include "common-fun.h"
int
pp_master
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
...
...
@@ -29,24 +30,18 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
goto
state_updated
;
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_SYNC
]))
{
/* FIXME diag
* DBGV("event SYNC_INTERVAL_TIMEOUT_EXPIRES\n");
*/
DBGV
(
"TODO: event SYNC_INTERVAL_TIMEOUT_EXPIRES
\n
"
);
/* TODO issueSync(rtOpts, ptpClock); */
}
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_ANN_INTERVAL
]))
{
/* FIXME diag
* DBGV("event ANNOUNCE_INTERVAL_TIMEOUT_EXPIRES\n");
*/
DBGV
(
"TODO: event ANNOUNCE_INTERVAL_TIMEOUT_EXPIRES
\n
"
);
/* TODO issueAnnounce(rtOpts, ptpClock); */
}
if
(
!
ppi
->
rt_opts
->
e2e_mode
)
{
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]))
{
/* FIXME diag
* DBGV("event PDELAYREQ_INTERVAL_TIMEOUT_EXPIRES\n");
*/
DBGV
(
"TODO: event PDELAYREQ_INTERVAL_TOUT_EXPIRES
\n
"
);
/* TODO issuePDelayReq(rtOpts,ptpClock); */
}
}
...
...
proto-standard/state-slave.c
View file @
4f40367e
...
...
@@ -2,6 +2,7 @@
* FIXME: header
*/
#include <pptp/pptp.h>
#include <pptp/diag.h>
#include "common-fun.h"
int
pp_slave
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
...
...
@@ -115,10 +116,8 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
hdr
->
logMessageInterval
;
}
else
{
/* FIXME diag
DBGV("HandledelayResp : "
"delayResp doesn't match with the delayReq. \n");
*/
DBGV
(
"TODO: HandledelayResp : "
"delayResp doesn't match delayReq.
\n
"
);
}
break
;
...
...
@@ -196,10 +195,8 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
*/
}
}
else
{
/* FIXME diag
DBGV("HandlePdelayResp : Pdelayresp doesn't "
"match with the PdelayReq. \n");
*/
DBGV
(
"TODO: HandlePdelayResp : Pdelayresp doesn't "
"match PdelayReq.
\n
"
);
}
break
;
...
...
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