port: Share more helper functions.

The transparent clock code will want to set qualification timeouts and
perform end to end delay measurements.  This patch exposes the needed
methods.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2018-04-20 22:02:56 -07:00
parent 8f2b1db4fd
commit 4cfbb2627f
2 changed files with 10 additions and 6 deletions

11
port.c
View File

@ -51,7 +51,6 @@ enum syfu_event {
FUP_MATCH,
};
static void flush_delay_req(struct port *p);
static int port_capable(struct port *p);
static int port_is_ieee8021as(struct port *p);
static void port_nrate_initialize(struct port *p);
@ -297,7 +296,7 @@ static int delay_req_current(struct ptp_message *m, struct timespec now)
return t2 - t1 < tmo;
}
static void delay_req_prune(struct port *p)
void delay_req_prune(struct port *p)
{
struct timespec now;
struct ptp_message *m;
@ -1048,7 +1047,7 @@ static int port_set_manno_tmo(struct port *p)
return set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, p->logAnnounceInterval);
}
static int port_set_qualification_tmo(struct port *p)
int port_set_qualification_tmo(struct port *p)
{
return set_tmo_log(p->fda.fd[FD_QUALIFICATION_TIMER],
1+clock_steps_removed(p->clock), p->logAnnounceInterval);
@ -1490,7 +1489,7 @@ int port_is_enabled(struct port *p)
return 1;
}
static void flush_last_sync(struct port *p)
void flush_last_sync(struct port *p)
{
if (p->syfu != SF_EMPTY) {
msg_put(p->last_syncfup);
@ -1498,7 +1497,7 @@ static void flush_last_sync(struct port *p)
}
}
static void flush_delay_req(struct port *p)
void flush_delay_req(struct port *p)
{
struct ptp_message *m;
while ((m = TAILQ_FIRST(&p->delay_req)) != NULL) {
@ -1777,7 +1776,7 @@ out:
return err;
}
static void process_delay_resp(struct port *p, struct ptp_message *m)
void process_delay_resp(struct port *p, struct ptp_message *m)
{
struct delay_resp_msg *rsp = &m->delay_resp;
struct PortIdentity master;

View File

@ -126,7 +126,10 @@ struct port {
#define portnum(p) (p->portIdentity.portNumber)
int clear_fault_asap(struct fault_interval *faint);
void delay_req_prune(struct port *p);
void fc_clear(struct foreign_clock *fc);
void flush_delay_req(struct port *p);
void flush_last_sync(struct port *p);
int port_clr_tmo(int fd);
int port_delay_request(struct port *p);
void port_disable(struct port *p);
@ -135,9 +138,11 @@ int port_is_enabled(struct port *p);
void port_link_status(void *ctx, int index, int linkup);
int port_set_announce_tmo(struct port *p);
int port_set_delay_tmo(struct port *p);
int port_set_qualification_tmo(struct port *p);
void port_show_transition(struct port *p, enum port_state next,
enum fsm_event event);
int process_announce(struct port *p, struct ptp_message *m);
void process_delay_resp(struct port *p, struct ptp_message *m);
void process_follow_up(struct port *p, struct ptp_message *m);
int process_pdelay_req(struct port *p, struct ptp_message *m);
int process_pdelay_resp(struct port *p, struct ptp_message *m);