port: Export the value of the wildcard port identity.

Code in other modules will need this special port ID value.  This patch
makes it available through the port header file.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2020-04-13 19:05:16 -07:00
parent 44c06f5d44
commit 0695d48332
2 changed files with 5 additions and 2 deletions

3
port.h
View File

@ -33,6 +33,9 @@ struct clock;
/** Opaque type. */
struct port;
/** The port identity that matches any port. */
extern const struct PortIdentity wildcard_pid;
/**
* Returns the dataset from a port's best foreign clock record, if any
* has yet been discovered. This function does not bring the returned

View File

@ -23,7 +23,7 @@
#include "unicast_client.h"
#include "unicast_service.h"
static struct PortIdentity wildcard = {
const struct PortIdentity wildcard_pid = {
.clockIdentity = {
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
},
@ -126,7 +126,7 @@ int process_signaling(struct port *p, struct ptp_message *m)
/* Ignore signaling messages not addressed to this port. */
if (!pid_eq(&m->signaling.targetPortIdentity, &p->portIdentity) &&
!pid_eq(&m->signaling.targetPortIdentity, &wildcard)) {
!pid_eq(&m->signaling.targetPortIdentity, &wildcard_pid)) {
return 0;
}