port: Introduce an option to disable mutlicast service.

Some profiles forbid multicast altogther.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2018-04-05 12:09:08 -07:00
parent b9b18268cd
commit b1ce06206f
5 changed files with 11 additions and 0 deletions

View File

@ -218,6 +218,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("hybrid_e2e", 0, 0, 1),
PORT_ITEM_INT("ignore_transport_specific", 0, 0, 1),
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
PORT_ITEM_INT("inhibit_multicast_service", 0, 0, 1),
GLOB_ITEM_INT("initial_delay", 0, 0, INT_MAX),
GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),

View File

@ -39,6 +39,7 @@ logging_level 6
path_trace_enabled 0
follow_up_info 0
hybrid_e2e 0
inhibit_multicast_service 0
net_sync_monitor 0
tc_spanning_tree 0
tx_timestamp_timeout 1

6
port.c
View File

@ -1329,6 +1329,9 @@ int port_tx_announce(struct port *p, struct address *dst)
struct ptp_message *msg;
int err;
if (p->inhibit_multicast_service && !dst) {
return 0;
}
if (!port_capable(p)) {
return 0;
}
@ -1395,6 +1398,9 @@ int port_tx_sync(struct port *p, struct address *dst)
return -1;
}
if (p->inhibit_multicast_service && !dst) {
return 0;
}
if (!port_capable(p)) {
return 0;
}

View File

@ -137,6 +137,7 @@ struct port {
struct unicast_master_table *unicast_master_table;
/* unicast service mode */
struct unicast_service *unicast_service;
int inhibit_multicast_service;
};
#define portnum(p) (p->portIdentity.portNumber)

View File

@ -417,6 +417,8 @@ int unicast_service_initialize(struct port *p)
free(p->unicast_service);
return -1;
}
p->inhibit_multicast_service =
config_get_int(cfg, p->name, "inhibit_multicast_service");
return 0;
}