Introduce a configuration file option for the server's UDS address.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
e5ddfd491e
commit
9fe2ffd2ef
5
config.c
5
config.c
|
@ -393,6 +393,11 @@ static enum parser_result parse_global_setting(const char *option,
|
|||
return r;
|
||||
*cfg->udp6_scope = uval;
|
||||
|
||||
} else if (!strcmp(option, "uds_address")) {
|
||||
if (strlen(value) > MAX_IFNAME_SIZE)
|
||||
return OUT_OF_RANGE;
|
||||
strncpy(cfg->uds_address, value, MAX_IFNAME_SIZE);
|
||||
|
||||
} else if (!strcmp(option, "logging_level")) {
|
||||
r = get_ranged_int(value, &val,
|
||||
PRINT_LEVEL_MIN, PRINT_LEVEL_MAX);
|
||||
|
|
1
config.h
1
config.h
|
@ -89,6 +89,7 @@ struct config {
|
|||
unsigned char *ptp_dst_mac;
|
||||
unsigned char *p2p_dst_mac;
|
||||
unsigned char *udp6_scope;
|
||||
char *uds_address;
|
||||
|
||||
int print_level;
|
||||
int use_syslog;
|
||||
|
|
|
@ -59,6 +59,7 @@ transportSpecific 0x0
|
|||
ptp_dst_mac 01:1B:19:00:00:00
|
||||
p2p_dst_mac 01:80:C2:00:00:0E
|
||||
udp6_scope 0x0E
|
||||
uds_address /var/run/ptp4l
|
||||
#
|
||||
# Default interface options
|
||||
#
|
||||
|
|
1
gPTP.cfg
1
gPTP.cfg
|
@ -57,6 +57,7 @@ clock_servo pi
|
|||
transportSpecific 0x1
|
||||
ptp_dst_mac 01:80:C2:00:00:0E
|
||||
p2p_dst_mac 01:80:C2:00:00:0E
|
||||
uds_address /var/run/ptp4l
|
||||
#
|
||||
# Default interface options
|
||||
#
|
||||
|
|
6
ptp4l.8
6
ptp4l.8
|
@ -1,4 +1,4 @@
|
|||
.TH PTP4l 8 "July 2013" "linuxptp"
|
||||
.TH PTP4l 8 "October 2013" "linuxptp"
|
||||
.SH NAME
|
||||
ptp4l \- PTP Boundary/Ordinary Clock
|
||||
|
||||
|
@ -354,6 +354,10 @@ will be used as the second byte of the primary address. This option
|
|||
is only relevant with IPv6 transport. See RFC 4291. The default is
|
||||
0x0E for the global scope.
|
||||
.TP
|
||||
.B uds_address
|
||||
Specifies the address of the UNIX domain socket for receiving local
|
||||
management messages. The default is /var/run/ptp4l.
|
||||
.TP
|
||||
.B logging_level
|
||||
The maximum logging level of messages which should be printed.
|
||||
The default is 6 (LOG_INFO).
|
||||
|
|
2
ptp4l.c
2
ptp4l.c
|
@ -32,6 +32,7 @@
|
|||
#include "sk.h"
|
||||
#include "transport.h"
|
||||
#include "udp6.h"
|
||||
#include "uds.h"
|
||||
#include "util.h"
|
||||
#include "version.h"
|
||||
|
||||
|
@ -111,6 +112,7 @@ static struct config cfg_settings = {
|
|||
.ptp_dst_mac = ptp_dst_mac,
|
||||
.p2p_dst_mac = p2p_dst_mac,
|
||||
.udp6_scope = &udp6_scope,
|
||||
.uds_address = uds_path,
|
||||
|
||||
.print_level = LOG_INFO,
|
||||
.use_syslog = 1,
|
||||
|
|
Loading…
Reference in New Issue