diff --git a/pmc_common.c b/pmc_common.c index 2c75074..41385da 100644 --- a/pmc_common.c +++ b/pmc_common.c @@ -78,7 +78,7 @@ struct pmc *pmc_create(enum transport_type transport_type, const char *iface_nam goto failed; } pmc->port_identity.portNumber = 1; - memset(&pmc->target, 0xff, sizeof(pmc->target)); + pmc_target_all(pmc); pmc->boundary_hops = boundary_hops; pmc->domain_number = domain_number; @@ -325,3 +325,13 @@ int pmc_target(struct pmc *pmc, struct PortIdentity *pid) pmc->target = *pid; return 0; } + +void pmc_target_port(struct pmc *pmc, UInteger16 portNumber) +{ + pmc->target.portNumber = portNumber; +} + +void pmc_target_all(struct pmc *pmc) +{ + memset(&pmc->target, 0xff, sizeof(pmc->target)); +} diff --git a/pmc_common.h b/pmc_common.h index 9fcb51d..9adb9d1 100644 --- a/pmc_common.h +++ b/pmc_common.h @@ -41,5 +41,7 @@ int pmc_send_set_action(struct pmc *pmc, int id, void *data, int datasize); struct ptp_message *pmc_recv(struct pmc *pmc); int pmc_target(struct pmc *pmc, struct PortIdentity *pid); +void pmc_target_port(struct pmc *pmc, UInteger16 portNumber); +void pmc_target_all(struct pmc *pmc); #endif