diff options
author | Christian Weisgerber <naddy@FreeBSD.org> | 2008-11-13 22:17:28 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@FreeBSD.org> | 2008-11-13 22:17:28 +0000 |
commit | 2042b740ed9071c4dc163663e3febc0dd462f37b (patch) | |
tree | f81b817f2de2c497bf0cf747b845c1a4cdd5d4f7 /net/ptpd | |
parent | a2b69b9c69ec7b9384016698e5fd6719296a31dc (diff) |
Notes
Diffstat (limited to 'net/ptpd')
-rw-r--r-- | net/ptpd/Makefile | 8 | ||||
-rw-r--r-- | net/ptpd/files/patch-src-Makefile | 13 | ||||
-rw-r--r-- | net/ptpd/files/patch-src-dep-constants_dep.h | 11 | ||||
-rw-r--r-- | net/ptpd/files/patch-src-dep_net.c | 36 | ||||
-rw-r--r-- | net/ptpd/files/patch-src-dep_ptpd_dep.h | 11 | ||||
-rw-r--r-- | net/ptpd/files/patch-src-ptpd.8 | 122 | ||||
-rw-r--r-- | net/ptpd/files/ptp.in | 25 | ||||
-rw-r--r-- | net/ptpd/files/ptpd.in | 24 |
8 files changed, 86 insertions, 164 deletions
diff --git a/net/ptpd/Makefile b/net/ptpd/Makefile index 0e8f44b5e701..e1499b935a29 100644 --- a/net/ptpd/Makefile +++ b/net/ptpd/Makefile @@ -7,7 +7,7 @@ PORTNAME= ptpd DISTVERSION= 1.0.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= SF MASTER_SITE_SUBDIR= ${PORTNAME} @@ -17,14 +17,14 @@ COMMENT= An implementation of the precision time protocol IEEE 1588 WRKSRC= ${WRKDIR}/ptpd-${DISTVERSION}/src -PLIST_FILES= bin/ptpd +PLIST_FILES= sbin/ptpd -USE_RC_SUBR= ptp +USE_RC_SUBR= ptpd MAN8= ptpd.8 do-install:: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${MANPREFIX}/man/man8 .include <bsd.port.mk> diff --git a/net/ptpd/files/patch-src-Makefile b/net/ptpd/files/patch-src-Makefile deleted file mode 100644 index acc32d3beca2..000000000000 --- a/net/ptpd/files/patch-src-Makefile +++ /dev/null @@ -1,13 +0,0 @@ -Index: Makefile -=================================================================== ---- Makefile (revision 45) -+++ Makefile (working copy) -@@ -1,7 +1,7 @@ - # Makefile for ptpd - - RM = rm -f --CFLAGS = -Wall -+CFLAGS = -Wall -DBSD_INTERFACE_FUNCTIONS - #CPPFLAGS = -DPTPD_DBG -DPTPD_NO_DAEMON - - PROG = ptpd diff --git a/net/ptpd/files/patch-src-dep-constants_dep.h b/net/ptpd/files/patch-src-dep-constants_dep.h new file mode 100644 index 000000000000..9b1183a77e00 --- /dev/null +++ b/net/ptpd/files/patch-src-dep-constants_dep.h @@ -0,0 +1,11 @@ +--- dep/constants_dep.h.orig ++++ dep/constants_dep.h +@@ -46,6 +46,8 @@ + + # define IFCONF_LENGTH 10 + ++# define BSD_INTERFACE_FUNCTIONS ++ + # define adjtimex ntp_adjtime + + # include <machine/endian.h> diff --git a/net/ptpd/files/patch-src-dep_net.c b/net/ptpd/files/patch-src-dep_net.c new file mode 100644 index 000000000000..884b6265efd1 --- /dev/null +++ b/net/ptpd/files/patch-src-dep_net.c @@ -0,0 +1,36 @@ +--- dep/net.c.orig ++++ dep/net.c +@@ -8,26 +8,26 @@ + + /* set multicast group address based on subdomainName */ + if (!memcmp(subdomainName, DEFAULT_PTP_DOMAIN_NAME, PTP_SUBDOMAIN_NAME_LENGTH)) +- memcpy(subdomainAddress, DEFAULT_PTP_DOMAIN_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, DEFAULT_PTP_DOMAIN_ADDRESS, NET_ADDRESS_LENGTH); + else if(!memcmp(subdomainName, ALTERNATE_PTP_DOMAIN1_NAME, PTP_SUBDOMAIN_NAME_LENGTH)) +- memcpy(subdomainAddress, ALTERNATE_PTP_DOMAIN1_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, ALTERNATE_PTP_DOMAIN1_ADDRESS, NET_ADDRESS_LENGTH); + else if(!memcmp(subdomainName, ALTERNATE_PTP_DOMAIN2_NAME, PTP_SUBDOMAIN_NAME_LENGTH)) +- memcpy(subdomainAddress, ALTERNATE_PTP_DOMAIN2_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, ALTERNATE_PTP_DOMAIN2_ADDRESS, NET_ADDRESS_LENGTH); + else if(!memcmp(subdomainName, ALTERNATE_PTP_DOMAIN3_NAME, PTP_SUBDOMAIN_NAME_LENGTH)) +- memcpy(subdomainAddress, ALTERNATE_PTP_DOMAIN3_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, ALTERNATE_PTP_DOMAIN3_ADDRESS, NET_ADDRESS_LENGTH); + else + { + h = crc_algorithm(subdomainName, PTP_SUBDOMAIN_NAME_LENGTH) % 3; + switch(h) + { + case 0: +- memcpy(subdomainAddress, ALTERNATE_PTP_DOMAIN1_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, ALTERNATE_PTP_DOMAIN1_ADDRESS, NET_ADDRESS_LENGTH); + break; + case 1: +- memcpy(subdomainAddress, ALTERNATE_PTP_DOMAIN2_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, ALTERNATE_PTP_DOMAIN2_ADDRESS, NET_ADDRESS_LENGTH); + break; + case 2: +- memcpy(subdomainAddress, ALTERNATE_PTP_DOMAIN3_ADDRESS, NET_ADDRESS_LENGTH); ++ strncpy(subdomainAddress, ALTERNATE_PTP_DOMAIN3_ADDRESS, NET_ADDRESS_LENGTH); + break; + default: + ERROR("handle out of range for '%s'!\n", subdomainName); diff --git a/net/ptpd/files/patch-src-dep_ptpd_dep.h b/net/ptpd/files/patch-src-dep_ptpd_dep.h new file mode 100644 index 000000000000..181ba507191a --- /dev/null +++ b/net/ptpd/files/patch-src-dep_ptpd_dep.h @@ -0,0 +1,11 @@ +--- dep/ptpd_dep.h.orig ++++ dep/ptpd_dep.h +@@ -22,7 +22,7 @@ + + /* system messages */ + #define ERROR(x, ...) fprintf(stderr, "(ptpd error) " x, ##__VA_ARGS__) +-#define PERROR(x, ...) fprintf(stderr, "(ptpd error) " x ": %m\n", ##__VA_ARGS__) ++#define PERROR(x, ...) fprintf(stderr, "(ptpd error) " x ": %s\n", ##__VA_ARGS__, strerror(errno)) + #define NOTIFY(x, ...) fprintf(stderr, "(ptpd notice) " x, ##__VA_ARGS__) + + /* debug messages */ diff --git a/net/ptpd/files/patch-src-ptpd.8 b/net/ptpd/files/patch-src-ptpd.8 deleted file mode 100644 index 9e4d225f6f46..000000000000 --- a/net/ptpd/files/patch-src-ptpd.8 +++ /dev/null @@ -1,122 +0,0 @@ ---- /dev/null Tue Mar 4 13:24:31 2008 -+++ ptpd.8 Mon Mar 3 16:58:16 2008 -@@ -0,0 +1,119 @@ -+.\" -*- nroff -*" -+.TH ptpd 8 "September 22, 2007" "version 1rc1" "Precision Time Protocol daemon" -+.SH NAME -+ptpd \- Precision Time Protocol daemon -+.SH SYNOPSIS -+.B ptpd -+ -+[-?] -+[-c] -+[-f] -+[-d] -+[-D] -+[-x] -+[-t] -+[-a NUMBER,NUMBER] -+[-w NUMBER] -+[-b NAME] -+[-u ADDRESS] -+[-l NUMBER,NUMBER] -+[-o NUMBER] -+[-e NUMBER] -+[-y NUMBER] -+[-m NUMBER] -+[-g] -+[-p] -+[-s NUMBER] -+[-i NAME] -+[-v NUMBER] -+[-n NAME] -+[-k NUMBER,NUMBER] -+ -+.SH DESCRIPTION -+Implements the Precision Time Protocol (PTP) as defined by the IEEE -+1588 standard. PTP was developed to provide very precise time -+coordination of LAN connected computers. -+.PP -+PTPd is a complete implementation of the IEEE 1588 specification for a -+standard (non-boundary) clock. PTPd has been tested with and is known -+to work properly with other IEEE 1588 implementations. The source code -+for PTPd is freely available under a BSD-style license. Thanks to -+contributions from users, PTPd is becoming an increasingly portable, -+interoperable, and stable IEEE 1588 implementation. -+.PP -+For more information, see http://ptpd.sourceforge.net/ -+.SH OPTIONS -+.TP -+.B \-? -+display a short help text -+.TP -+.B \-c -+run in command line (non-daemon) mode -+.TP -+.B \-f FILE -+send output to FILE -+.TP -+.B \-d -+display stats -+.TP -+.B \-D -+display stats in .csv format -+.TP -+.B \-x -+do not reset the clock if off by more than one second -+.TP -+.B \-t -+do not adjust the system clock -+.TP -+.B \-a NUMBER,NUMBER -+specify clock servo P and I attenuations -+.TP -+.B \-w NUMBER -+specify one way delay filter stiffness -+.TP -+.B \-b NAME -+bind PTP to network interface NAME -+.TP -+.B \-u ADDRESS -+don't multicast, send messages unicast to ADDRESS -+.TP -+.B \-l NUMBER,NUMBER -+specify inbound, outbound latency in nsec -+.TP -+.B \-o NUMBER -+specify current UTC offset -+.TP -+.B \-e NUMBER -+specify epoch NUMBER -+.TP -+.B \-y NUMBER -+specify sync interval in 2^NUMBER sec -+.TP -+.B \-m NUMBER -+specify max number of foreign master records -+.TP -+.B \-g -+run as slave only -+.TP -+.B \-p -+make this a preferred clock -+.TP -+.B \-s NUMBER -+specify system clock stratum -+.TP -+.B \-i NAME -+specify system clock identifier -+.TP -+.B \-v NUMBER -+specify system clock allen variance -+.TP -+.B \-n NAME -+specify PTP subdomain name (not related to IP or DNS) -+.TP -+.B \-k NUMBER,NUMBER -+send a management message of key, record, then exit -+ -+.SH AUTHOR -+Kendall Correll <kendall_c@users.sourceforge.net>. This manual page -+was written by Andrew Straw <strawman@astraw.com> for the Debian -+Project (but may be used by others). diff --git a/net/ptpd/files/ptp.in b/net/ptpd/files/ptp.in deleted file mode 100644 index 42ab5b381b6c..000000000000 --- a/net/ptpd/files/ptp.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: /tmp/pcvs/ports/net/ptpd/files/Attic/ptp.in,v 1.1 2008-06-05 01:44:43 wxs Exp $ -# -# PROVIDE: ptpd -# REQUIRE: NETWORKING DAEMON -# -# Add the following lines to /etc/rc.conf to enable ptpd -# -# ptpd_enable (bool): Set to "NO" by default -# Set it to "YES" to enable sshd - -. %%RC_SUBR%% - -name="ptpd" -rcvar=${name}_enable - -if [ -n "${ptpd_flags}" ]; then - command="%%PREFIX%%/bin/${name} ${ptpd_flags}" -else - command="%%PREFIX%%/bin/${name}" -fi - -load_rc_config $name -run_rc_command "$1" diff --git a/net/ptpd/files/ptpd.in b/net/ptpd/files/ptpd.in new file mode 100644 index 000000000000..6015ab8224fc --- /dev/null +++ b/net/ptpd/files/ptpd.in @@ -0,0 +1,24 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: ptpd +# REQUIRE: NETWORKING DAEMON +# KEYWORD: nojail +# +# Add the following lines to /etc/rc.conf to enable ptpd +# +# ptpd_enable (bool): Set to "NO" by default +# Set it to "YES" to enable ptpd + +. %%RC_SUBR%% + +name="ptpd" +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/${name}" + +ptpd_enable=${ptpd_enable:-"NO"} + +load_rc_config $name +run_rc_command "$1" |