Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2026 18:53:21 +0100
From:      Bruce Simpson <bms@FreeBSD.org>
To:        ports@freebsd.org
Subject:   Approval requested: net/dot1ag-utils: new port (src committer)
Message-ID:  <5ae499a6-7f6f-48aa-9591-9e05485de1c4@FreeBSD.org>

index | next in thread | raw e-mail

[-- Attachment #1 --]
net/dot1ag-utils: new port

dot1ag-utils is a 2-clause BSD licensed suite of utilities providing Layer 2
Ping & Traceroute functionality for *BSD platforms. The code is currently
hosted at SourceHut ; please be considerate with "git archive" load. This
had languished in Bugzilla for some 15 years after thompsa@ submitted it.

PR: 163072

%%%

I have confirmed that basic functionality works between the FS S3900 and
FreeBSD 15.1 with Mellanox ConnectX-4 LX and Realtek RTL8251 adapters;
however, possibly due to missing TLVs, the S3900 does not record FreeBSD
as an active remote MEP link partner at present.

%%%


[-- Attachment #2 --]
From 8d5b8d999c26b4f439ca794bff6fd6ded918169e Mon Sep 17 00:00:00 2001
From: Bruce M Simpson <bms@FreeBSD.org>
Date: Tue, 28 Jul 2026 15:04:52 +0100
Subject: [PATCH] net/dot1ag-utils: new port

dot1ag-utils is a 2-clause BSD licensed suite of utilities providing Layer 2
Ping & Traceroute functionality for *BSD platforms. The code is currently
hosted at SourceHut ; please be considerate with "git archive" load. This
had languished in Bugzilla for some 15 years after thompsa@ submitted it.

PR: 163072
---
 net/dot1ag-utils/Makefile                     | 19 +++++++++
 net/dot1ag-utils/distinfo                     |  3 ++
 net/dot1ag-utils/files/dot1ag_ccd.in          | 39 +++++++++++++++++++
 net/dot1ag-utils/files/dot1agd.in             | 34 ++++++++++++++++
 .../files/patch-src_dot1ag__eth.c             | 11 ++++++
 net/dot1ag-utils/pkg-descr                    |  4 ++
 net/dot1ag-utils/pkg-plist                    | 16 ++++++++
 7 files changed, 126 insertions(+)
 create mode 100644 net/dot1ag-utils/Makefile
 create mode 100644 net/dot1ag-utils/distinfo
 create mode 100644 net/dot1ag-utils/files/dot1ag_ccd.in
 create mode 100644 net/dot1ag-utils/files/dot1agd.in
 create mode 100644 net/dot1ag-utils/files/patch-src_dot1ag__eth.c
 create mode 100644 net/dot1ag-utils/pkg-descr
 create mode 100644 net/dot1ag-utils/pkg-plist

diff --git a/net/dot1ag-utils/Makefile b/net/dot1ag-utils/Makefile
new file mode 100644
index 000000000000..72b9fb349054
--- /dev/null
+++ b/net/dot1ag-utils/Makefile
@@ -0,0 +1,19 @@
+PORTNAME=	dot1ag-utils
+PORTVERSION=	1.0.1
+CATEGORIES=	net
+MASTER_SITES=	https://git.sr.ht/~bms/${PORTNAME}/archive/${DISTVERSIONFULL}${EXTRACT_SUFX}?dummy=/
+
+MAINTAINER=	bms@FreeBSD.org
+COMMENT=	Utilities for IEEE 802.1ag Connectivity Fault Management
+WWW=		https://github.com/vnrick/dot1ag-utils
+
+LICENSE=	BSD2CLAUSE
+
+GNU_CONFIGURE=	yes
+USE_RC_SUBR=	dot1ag_ccd dot1agd
+
+OPTIONS_DEFINE=		DOCS MANPAGES
+OPTIONS_DEFAULT=	DOCS MANPAGES
+OPTIONS_SUB=            yes
+
+.include <bsd.port.mk>
diff --git a/net/dot1ag-utils/distinfo b/net/dot1ag-utils/distinfo
new file mode 100644
index 000000000000..bd154de70cbb
--- /dev/null
+++ b/net/dot1ag-utils/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1785233480
+SHA256 (dot1ag-utils-1.0.1.tar.gz) = a074e731690a30404fd61e2af0e8611ded9b7799295236a7bb60d4724e870f1d
+SIZE (dot1ag-utils-1.0.1.tar.gz) = 92446
diff --git a/net/dot1ag-utils/files/dot1ag_ccd.in b/net/dot1ag-utils/files/dot1ag_ccd.in
new file mode 100644
index 000000000000..4ab39dde3f36
--- /dev/null
+++ b/net/dot1ag-utils/files/dot1ag_ccd.in
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# PROVIDE: dot1ag_ccd
+# REQUIRE: NETWORKING mountall quota
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# dot1ag_ccd_enable (bool):     Set to "NO" by default.
+#                               Set it to "YES" to enable dot1ag_ccd.
+# dot1ag_ccd_interface (str):   Interface to listen on.
+# dot1ag_ccd_flags (str):       Additional arguments to dot1ag_ccd
+# 
+# See dot1ag_ccd(8) for flags
+#
+
+. /etc/rc.subr
+
+name="dot1ag_ccd"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${dot1ag_ccd_enable="NO"}
+: ${dot1ag_ccd_interface=""}
+: ${dot1ag_ccd_flags=""}
+
+
+start_cmd="${name}_start"
+pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/bin/${name}"
+
+dot1ag_ccd_start() {
+	echo "Starting ${name}."
+	/usr/sbin/daemon -p $pidfile ${command} -i ${dot1ag_ccd_interface} ${dot1ag_ccd_flags}
+}
+
+run_rc_command "$1"
+
diff --git a/net/dot1ag-utils/files/dot1agd.in b/net/dot1ag-utils/files/dot1agd.in
new file mode 100644
index 000000000000..648ac93665e5
--- /dev/null
+++ b/net/dot1ag-utils/files/dot1agd.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# PROVIDE: dot1agd
+# REQUIRE: NETWORKING mountall quota
+#
+# Add the following lines to /etc/rc.conf to enable dot1agd
+#
+# dot1agd_enable (bool):     Set to "NO" by default.
+#                            Set it to "YES" to enable dot1agd.
+# dot1agd_interface (str):   Interface to listen on.
+#
+
+. /etc/rc.subr
+
+name="dot1agd"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${dot1agd_enable="NO"}
+: ${dot1agd_interface=""}
+
+
+start_cmd="${name}_start"
+pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/bin/${name}"
+
+dot1agd_start() {
+	echo "Starting ${name}."
+	/usr/sbin/daemon -p $pidfile ${command} -i ${dot1agd_interface}
+}
+
+run_rc_command "$1"
+
diff --git a/net/dot1ag-utils/files/patch-src_dot1ag__eth.c b/net/dot1ag-utils/files/patch-src_dot1ag__eth.c
new file mode 100644
index 000000000000..83e68dc51cf3
--- /dev/null
+++ b/net/dot1ag-utils/files/patch-src_dot1ag__eth.c
@@ -0,0 +1,11 @@
+--- src/dot1ag_eth.c.orig	2012-09-20 12:44:39 UTC
++++ src/dot1ag_eth.c
+@@ -78,7 +78,7 @@ get_local_mac(char *dev, uint8_t *ea) {
+ 		if (ifa->ifa_addr == NULL) {
+ 			continue;
+ 		}
+-		if (strncmp(ifa->ifa_name, dev, sizeof(dev)) != 0) {
++		if (strcmp(ifa->ifa_name, dev) != 0) {
+ 			continue;  /* not the interface we are looking for */
+ 		}
+ 		sdl = (struct sockaddr_dl *) ifa->ifa_addr;
diff --git a/net/dot1ag-utils/pkg-descr b/net/dot1ag-utils/pkg-descr
new file mode 100644
index 000000000000..50cc313c4c6d
--- /dev/null
+++ b/net/dot1ag-utils/pkg-descr
@@ -0,0 +1,4 @@
+The dot1ag-utils software package is an Open Source (new BSD License)
+implementation of the IEEE 802.1ag protocol and is supported on Arista Networks
+switches and Linux, FreeBSD and MacOSX servers. It provides several debugging
+tools that interact with IEEE 802.1ag enabled routers and switches.
diff --git a/net/dot1ag-utils/pkg-plist b/net/dot1ag-utils/pkg-plist
new file mode 100644
index 000000000000..36350eadbc7d
--- /dev/null
+++ b/net/dot1ag-utils/pkg-plist
@@ -0,0 +1,16 @@
+bin/dot1ag_ccd
+bin/dot1agd
+bin/ethping
+bin/ethtrace
+%%MANPAGES%%share/man/man1/ethping.1.gz
+%%MANPAGES%%share/man/man1/ethtrace.1.gz
+%%MANPAGES%%share/man/man1/dot1ag_ccd.1.gz
+%%MANPAGES%%share/man/man1/dot1agd.1.gz
+%%PORTDOCS%%%%DOCSDIR%%/CREDITS
+%%PORTDOCS%%%%DOCSDIR%%/IMPLEMENTATION
+%%PORTDOCS%%%%DOCSDIR%%/INSTALLATION
+%%PORTDOCS%%%%DOCSDIR%%/INSTALLATION-ARISTA
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/RELNOTES
+%%PORTDOCS%%%%DOCSDIR%%/TODO
-- 
2.54.0

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ae499a6-7f6f-48aa-9591-9e05485de1c4>