Skip to contentSkip to conversation

meta-networking patchwork cleanup

PATCH Superseded Joe MacDonald 3 participants 16 messages Oct 30, 2017 – Oct 31, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover meta-networking patchwork cleanup

When I started comparing the state of meta-networking/master to master-next and to patchwork's own view of pending meta-networking patches I found some disconnects. So I've been chipping away at this for the last few days, trying to bring everything in sync.

I've rejected/accepted the patches in patchwork that I was able to verify have either been rejected or merged already.

ddclient died on the vine for no particular reason, so I refreshed it and added the persistence support as noted in the patch itself.

Following that was Jackie's update to include freediameter, but it depended on the currently-broken lksctp-tools, so I took a stab at fixing that.

There was a pending update to bridge-utils for using the xtools AR, but that needed rework, so I did the rework and updated bridge-utils at the same time.

Finally, most of openssl-no-weak-cyphers was thrown away for good reason, but two of the patches still made sense to include in meta-networking, IMO, with just some minor rework, so I did that too.

Here's the report:

Jackie Huang (2):
freediameter: add new recipe
net-snmp: support openssl without 3des

Joe MacDonald (2):
lksctp-tools: update and remove from blacklist
bridge-utils: update to v1.6

Kai Kang (1):
stunnel: fix compile error when openssl disable des support

Kinsella, Ray (1):
ddclient: new package

 .../recipes-daemons/ddclient/ddclient_3.8.3.bb     |  44 ++++
 .../recipes-daemons/ddclient/files/ip-up           |   4 +
 .../recipes-daemons/ddclient/files/persistent      |   1 +
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 .../net-snmp/net-snmp-fix-for-disable-des.patch    |  32 +++
 .../recipes-protocols/net-snmp/net-snmp_5.7.3.bb   |   4 +-
 .../recipes-support/bridge-utils/bridge-utils.inc  |  28 ---
 ...ld-error-out-correctly-if-a-submake-fails.patch |  69 -------
 ...idge-fix-some-build-time-warnings-fcntl.h.patch |  64 ------
 ...idge-fix-some-build-time-warnings-errno.h.patch |  46 -----
 ...dd-missing-include-s-fix-build-against-mu.patch |  47 -----
 ...uild-don-t-ignore-CFLAGS-from-environment.patch |  29 +--
 ...ridge-Modifying-the-AR-to-cross-toolchain.patch |  51 +++++
 ...5-check-error-returns-from-write-to-sysfs.patch |  87 --------
 ...5-fix-error-message-for-incorrect-command.patch |  33 ---
 ...utils-1.5-fix-incorrect-command-in-manual.patch |  33 ---
 .../bridge-utils/bridge-utils/kernel-headers.patch |  29 ++-
 .../bridge-utils/bridge-utils_1.5.bb               |  16 --
 .../bridge-utils/bridge-utils_1.6.bb               |  35 ++++
 .../lksctp-tools/lksctp-tools_1.0.17.bb            |  16 +-
 .../stunnel/stunnel/fix-openssl-no-des.patch       |  54 +++++
 .../recipes-support/stunnel/stunnel_5.35.bb        |   4 +-
 29 files changed, 776 insertions(+), 466 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils.inc
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
 create mode 100644 meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/6 ddclient: new package

From: "Kinsella, Ray" <[email protected]>

Adding the package ddclient. DDClient updates Dynamic DNS servers with an IP address. Recipe is based on the original OE recipe found here.

http://cgit.openembedded.org/openembedded/tree/recipes/ddclient/ddclient_3.6.3.bb

with modifications based on the recipe at:

https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb

DDClient version has been updated to 3.8.3.

---
 .../recipes-daemons/ddclient/ddclient_3.8.3.bb     | 44 ++++++++++++++++++++++
 .../recipes-daemons/ddclient/files/ip-up           |  4 ++
 .../recipes-daemons/ddclient/files/persistent      |  1 +
 3 files changed, 49 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb new file +44 -0
new file mode 100644
index 0000000..d83a4d4
@@ -0,0 +1,44 @@
+SECTION = "net/misc"
+DESCRIPTION = "Ddclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Services"
+HOMEPAGE = "http://ddclient.sourceforge.net/"
+LICENSE = "GPLv2"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/ddclient/ddclient-${PV}.tar.bz2 \
+    file://ip-up"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+RDEPENDS_${PN} = "\
+    perl-module-getopt-long \
+    perl-module-sys-hostname \
+    perl-module-io-socket \
+    perl-module-vars \
+    perl-module-overload \
+    perl-module-overloading \
+    perl-module-config \
+    perl-module-integer \
+    perl-module-exporter-heavy \
+    perl-module-symbol \
+    perl-module-selectsaver \
+    bash \
+    perl \
+    libio-socket-ssl-perl"
+
+do_install() {
+    install -d ${D}${sbindir} ${D}${sysconfdir}/ddclient ${D}${sysconfdir}/init.d
+    install -d ${D}${sysconfdir}/ppp/ip-up.d/ install -d ${D}${docdir}/ddclient
+    install -m 755 ${S}/ddclient ${D}${sbindir}
+    install ${S}/sample-etc_ddclient.conf ${D}${sysconfdir}/ddclient/ddclient.conf
+    install -m 755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/ip-up.d/ddclient
+    sed -e 's|/etc/ddclient.conf|/etc/ddclient/ddclient.conf|g' ${S}/sample-etc_rc.d_init.d_ddclient > ${S}/rc_init
+    install -m 755 ${S}/rc_init ${D}${sysconfdir}/init.d/ddclient
+    install ${S}/README* ${D}${docdir}/ddclient
+    install ${S}/COPY* ${D}${docdir}/ddclient
+    install ${S}/sample* ${D}${docdir}/ddclient
+}
+
+CONFFILES_${PN} = "${sysconfdir}/ddclient/ddclient.conf"
+
+SRC_URI[md5sum] = "3b426ae52d509e463b42eeb08fb89e0b"
+SRC_URI[sha256sum] = "d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591"
meta-networking/recipes-daemons/ddclient/files/ip-up new file +4 -0
new file mode 100644
index 0000000..4411db9
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+logger -t ddclient $PPP_IFACE $PPP_LOCAL
+ddclient -daemon=0 -syslog -use=if -if=$PPP_IFACE >/dev/null 2>&1
meta-networking/recipes-daemons/ddclient/files/persistent new file +1 -0
new file mode 100644
index 0000000..b721272
@@ -0,0 +1 @@
+l root root 0644 /etc/ddclient.conf /var/persistent/etc/ddclient.conf
Signature · 1 line
2.7.4
#2 lore raw

Re: [meta-networking][PATCH 1/6] ddclient: new package

Quoted 90 lines · Joe MacDonald

From: "Kinsella, Ray" <[email protected]>

Adding the package ddclient. DDClient updates Dynamic DNS servers with an IP address. Recipe is based on the original OE recipe found here.

http://cgit.openembedded.org/openembedded/tree/recipes/ddclient/ddclient_3.6.3.bb

with modifications based on the recipe at:

https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb

DDClient version has been updated to 3.8.3.

---
 .../recipes-daemons/ddclient/ddclient_3.8.3.bb     | 44 ++++++++++++++++++++++
 .../recipes-daemons/ddclient/files/ip-up           |  4 ++
 .../recipes-daemons/ddclient/files/persistent      |  1 +
 3 files changed, 49 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb new file +44 -0
new file mode 100644
index 0000000..d83a4d4
@@ -0,0 +1,44 @@
+SECTION = "net/misc"
+DESCRIPTION = "Ddclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Services"
+HOMEPAGE = "http://ddclient.sourceforge.net/"
+LICENSE = "GPLv2"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/ddclient/ddclient-${PV}.tar.bz2 \
+    file://ip-up"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+RDEPENDS_${PN} = "\
+    perl-module-getopt-long \
+    perl-module-sys-hostname \
+    perl-module-io-socket \
+    perl-module-vars \
+    perl-module-overload \
+    perl-module-overloading \
+    perl-module-config \
+    perl-module-integer \
+    perl-module-exporter-heavy \
+    perl-module-symbol \
+    perl-module-selectsaver \
+    bash \
+    perl \
+    libio-socket-ssl-perl"
+
+do_install() {
+    install -d ${D}${sbindir} ${D}${sysconfdir}/ddclient ${D}${sysconfdir}/init.d
+    install -d ${D}${sysconfdir}/ppp/ip-up.d/ install -d ${D}${docdir}/ddclient
+    install -m 755 ${S}/ddclient ${D}${sbindir}
+    install ${S}/sample-etc_ddclient.conf ${D}${sysconfdir}/ddclient/ddclient.conf
+    install -m 755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/ip-up.d/ddclient
+    sed -e 's|/etc/ddclient.conf|/etc/ddclient/ddclient.conf|g' ${S}/sample-etc_rc.d_init.d_ddclient > ${S}/rc_init
+    install -m 755 ${S}/rc_init ${D}${sysconfdir}/init.d/ddclient
+    install ${S}/README* ${D}${docdir}/ddclient
+    install ${S}/COPY* ${D}${docdir}/ddclient
+    install ${S}/sample* ${D}${docdir}/ddclient
+}
+
+CONFFILES_${PN} = "${sysconfdir}/ddclient/ddclient.conf"
+
+SRC_URI[md5sum] = "3b426ae52d509e463b42eeb08fb89e0b"
+SRC_URI[sha256sum] = "d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591"
meta-networking/recipes-daemons/ddclient/files/ip-up new file +4 -0
new file mode 100644
index 0000000..4411db9
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+logger -t ddclient $PPP_IFACE $PPP_LOCAL
+ddclient -daemon=0 -syslog -use=if -if=$PPP_IFACE >/dev/null 2>&1
meta-networking/recipes-daemons/ddclient/files/persistent new file +0 -0
new file mode 100644
index 0000000..b721272

meta-networking/recipes-daemons/ddclient/files/persistent line 1

Quoted 1 line
meta-networking/recipes-daemons/ddclient/files/persistent new file +1 -0
@@ -0,0 +1 @@
+l root root 0644 /etc/ddclient.conf /var/persistent/etc/ddclient.conf

this file seems to be unused. Can we delete it if no needed.

#3 lore raw

Re: [meta-networking][PATCH 1/6] ddclient: new package

Quoted 87 lines · [Re: [oe] [meta-networking][PATCH 1/6] ddclient: new package] On 17.10.30 (Mon…
Quoted 85 lines · Joe MacDonald

From: "Kinsella, Ray" <[email protected]>

Adding the package ddclient. DDClient updates Dynamic DNS servers with an IP address. Recipe is based on the original OE recipe found here.

http://cgit.openembedded.org/openembedded/tree/recipes/ddclient/ddclient_3.6.3.bb

with modifications based on the recipe at:

https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb

DDClient version has been updated to 3.8.3.

---
 .../recipes-daemons/ddclient/ddclient_3.8.3.bb     | 44 ++++++++++++++++++++++
 .../recipes-daemons/ddclient/files/ip-up           |  4 ++
 .../recipes-daemons/ddclient/files/persistent      |  1 +
 3 files changed, 49 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/ip-up
 create mode 100644 meta-networking/recipes-daemons/ddclient/files/persistent
meta-networking/recipes-daemons/ddclient/ddclient_3.8.3.bb new file +44 -0
new file mode 100644
index 0000000..d83a4d4
@@ -0,0 +1,44 @@
+SECTION = "net/misc"
+DESCRIPTION = "Ddclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Services"
+HOMEPAGE = "http://ddclient.sourceforge.net/"
+LICENSE = "GPLv2"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/ddclient/ddclient-${PV}.tar.bz2 \
+    file://ip-up"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+RDEPENDS_${PN} = "\
+    perl-module-getopt-long \
+    perl-module-sys-hostname \
+    perl-module-io-socket \
+    perl-module-vars \
+    perl-module-overload \
+    perl-module-overloading \
+    perl-module-config \
+    perl-module-integer \
+    perl-module-exporter-heavy \
+    perl-module-symbol \
+    perl-module-selectsaver \
+    bash \
+    perl \
+    libio-socket-ssl-perl"
+
+do_install() {
+    install -d ${D}${sbindir} ${D}${sysconfdir}/ddclient ${D}${sysconfdir}/init.d
+    install -d ${D}${sysconfdir}/ppp/ip-up.d/ install -d ${D}${docdir}/ddclient
+    install -m 755 ${S}/ddclient ${D}${sbindir}
+    install ${S}/sample-etc_ddclient.conf ${D}${sysconfdir}/ddclient/ddclient.conf
+    install -m 755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/ip-up.d/ddclient
+    sed -e 's|/etc/ddclient.conf|/etc/ddclient/ddclient.conf|g' ${S}/sample-etc_rc.d_init.d_ddclient > ${S}/rc_init
+    install -m 755 ${S}/rc_init ${D}${sysconfdir}/init.d/ddclient
+    install ${S}/README* ${D}${docdir}/ddclient
+    install ${S}/COPY* ${D}${docdir}/ddclient
+    install ${S}/sample* ${D}${docdir}/ddclient
+}
+
+CONFFILES_${PN} = "${sysconfdir}/ddclient/ddclient.conf"
+
+SRC_URI[md5sum] = "3b426ae52d509e463b42eeb08fb89e0b"
+SRC_URI[sha256sum] = "d40e2f1fd3f4bff386d27bbdf4b8645199b1995d27605a886b8c71e44d819591"
meta-networking/recipes-daemons/ddclient/files/ip-up new file +4 -0
new file mode 100644
index 0000000..4411db9
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+logger -t ddclient $PPP_IFACE $PPP_LOCAL
+ddclient -daemon=0 -syslog -use=if -if=$PPP_IFACE >/dev/null 2>&1
meta-networking/recipes-daemons/ddclient/files/persistent +0 -0
Quoted 8 lines

meta-networking/recipes-daemons/ddclient/files/persistent line 1

Quoted 6 lines

new file mode 100644
index 0000000..b721272

meta-networking/recipes-daemons/ddclient/files/persistent new file +1 -0
@@ -0,0 +1 @@
+l root root 0644 /etc/ddclient.conf /var/persistent/etc/ddclient.conf

this file seems to be unused. Can we delete it if no needed.

Actually, that appears to be an oversight, it was supposed to be installed in this style:

https://github.com/cshoredaniel/meta-cshored/blob/master/recipes-connectivity/ddclient/ddclient_3.8.3.bb#L31

Corrected in the next version.

Signature · 2 lines
-Joe MacDonald.
:wq
#4 lore raw

PATCH 2/6 lksctp-tools: update and remove from blacklist

In reply to Joe MacDonald

Switching lksctp-tools to build from the upstream git repository rather than a source tarball. At the same time we'll un-blacklist it since it appears the gold-as-ld issue has been resolved underneath us, probably related to a Debian bug of the same form that was also resolved with a binutils update.

---
 .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +5 -11
index 11c43ff..9166aa5 100644
@@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
     file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
 "
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
+SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
+
+SRC_URI = " \
+    git://github.com/sctp/lksctp-tools.git \
     file://run-ptest \
     file://v4test.sh \
     file://v6test.sh \
 "
 
-SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
-SRC_URI[sha256sum] = "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
-
-#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o    -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16
-#| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version
-#| collect2: error: ld returned 1 exit status
-#| make[4]: *** [libsctp.la] Error 1
-PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
-
-S = "${WORKDIR}/${BP}"
+S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native"
 
Signature · 1 line
2.7.4
#5 lore raw

Re: [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist

Quoted 16 lines · Joe MacDonald

Switching lksctp-tools to build from the upstream git repository rather than a source tarball. At the same time we'll un-blacklist it since it appears the gold-as-ld issue has been resolved underneath us, probably related to a Debian bug of the same form that was also resolved with a binutils update.

---
 .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +0 -0
index 11c43ff..9166aa5 100644

meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb LIC_FILES_CHKSUM = " \ · line 12

Quoted 6 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +2 -1
@@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
     file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
 "
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
+SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
+

perhaps we need to reflect it in PV as well.

PV .= "+git${SRCPV}"

Quoted 29 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +3 -11
+SRC_URI = " \
+    git://github.com/sctp/lksctp-tools.git \
     file://run-ptest \
     file://v4test.sh \
     file://v6test.sh \
 "
 
-SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
-SRC_URI[sha256sum] = "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
-
-#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o    -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16
-#| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version
-#| collect2: error: ld returned 1 exit status
-#| make[4]: *** [libsctp.la] Error 1
-PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
-
-S = "${WORKDIR}/${BP}"
+S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native"
 
--

2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#6 lore raw

Re: [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist

Quoted 21 lines · [Re: [oe] [meta-networking][PATCH 2/6] lksctp-tools: update and remove from…
Quoted 19 lines · Joe MacDonald

Switching lksctp-tools to build from the upstream git repository rather than a source tarball. At the same time we'll un-blacklist it since it appears the gold-as-ld issue has been resolved underneath us, probably related to a Debian bug of the same form that was also resolved with a binutils update.

---
 .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +0 -0
index 11c43ff..9166aa5 100644
@@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
     file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
 "
 
Quoted 7 lines

meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb LIC_FILES_CHKSUM = " \ · line 12

Quoted 3 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +2 -1
-SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
+SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
+

perhaps we need to reflect it in PV as well.

PV .= "+git${SRCPV}"

I was less inclined to decorate the PV with the git hash since the SRCREV points at the release tag for 1.0.17, but I suppose if upstream chose to move the tag then this would be out of sync, so it's worth it.

-J.

Quoted 30 lines
Quoted 30 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +3 -11
+SRC_URI = " \
+    git://github.com/sctp/lksctp-tools.git \
     file://run-ptest \
     file://v4test.sh \
     file://v6test.sh \
 "
 
-SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
-SRC_URI[sha256sum] = "1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"
-
-#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o    -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16
-#| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version
-#| collect2: error: ld returned 1 exit status
-#| make[4]: *** [libsctp.la] Error 1
-PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"
-
-S = "${WORKDIR}/${BP}"
+S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native"
 
--

2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Signature · 2 lines
-Joe MacDonald.
:wq
#7 lore raw

Re: [meta-networking][PATCH 2/6] lksctp-tools: update and remove from blacklist

Quoted 35 lines · Joe MacDonald

[Re: [oe] [meta-networking][PATCH 2/6] lksctp-tools: update and remove

Quoted 11 lines · from blacklist] On 17.10.30 (Mon 16:21) Khem Raj wrote:
Quoted 9 lines · Joe MacDonald

Switching lksctp-tools to build from the upstream git repository rather than a source tarball. At the same time we'll un-blacklist it since it appears the gold-as-ld issue has been resolved underneath us, probably related to a Debian bug of the same form that was also resolved with a binutils update.

---
 .../recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb  | 16

+++++-----------

Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 5 insertions(+), 11 deletions(-)
(quoted diff) +0 -0

lksctp-tools_1.0.17.bb b/meta-networking/recipes-support/lksctp-tools/ lksctp-tools_1.0.17.bb

Quoted 2 lines
Quoted 2 lines

index 11c43ff..9166aa5 100644
--- a/meta-networking/recipes-support/lksctp-tools/

lksctp-tools_1.0.17.bb

Quoted 1 line
Quoted 1 line

+++ b/meta-networking/recipes-support/lksctp-tools/

lksctp-tools_1.0.17.bb

Quoted 10 lines

meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb LIC_FILES_CHKSUM = " \ · line 12

Quoted 7 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +2 -1
@@ -8,22 +8,16 @@ LIC_FILES_CHKSUM = " \
     file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
 "
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz \
+SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
+

perhaps we need to reflect it in PV as well.

Quoted 6 lines
Quoted 1 line

PV .= "+git${SRCPV}"

I was less inclined to decorate the PV with the git hash since the SRCREV points at the release tag for 1.0.17, but I suppose if upstream chose to move the tag then this would be out of sync, so it's worth it.

I know they don’t look pretty but the information is useful

Quoted 51 lines

-J.

Quoted 10 lines

meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb LIC_FILES_CHKSUM = " \

Quoted 10 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +2 -2
+SRC_URI = " \
+    git://github.com/sctp/lksctp-tools.git \
     file://run-ptest \
     file://v4test.sh \
     file://v6test.sh \
 "
 
-SRC_URI[md5sum] = "68e9b8fa4d4e331029b247b72d46d7a5"
-SRC_URI[sha256sum] =

"1aeb204cdb2befc94d9eb3037d1609c9d1d2cd5379d6dd2c0a8ca9b10533aa15"

Quoted 2 lines
Quoted 2 lines
(quoted diff) +0 -2
-
-#| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc
(quoted diff) +0 -3
-march=armv5te -marm -mthumb-interwork
--sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm
-shared  -fPIC -DPIC  .libs/bindx.o .libs/connectx.o .libs/peeloff.o

.libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o

(quoted diff) +0 -5
-march=armv5te -marm -mthumb-interwork
--sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2
-Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map
-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -Wl,-soname -Wl,libsctp.so.1
-o .libs/libsctp.so.1.0.16
Quoted 1 line

Review LIC_FILES_CHKSUM = " \ · line 21

Quoted 1 line
(quoted diff) +0 -1
-#|

/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld:
error: symbol sctp_connectx has undefined version

Quoted 3 lines

meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb LIC_FILES_CHKSUM = " \

Quoted 3 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +0 -3
-#| collect2: error: ld returned 1 exit status
-#| make[4]: *** [libsctp.la] Error 1
-PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES',

'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}"

Quoted 6 lines
Quoted 6 lines
meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb +1 -2
-
-S = "${WORKDIR}/${BP}"
+S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native"
 
Quoted 8 lines
Quoted 8 lines

--
2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
-Joe MacDonald.
:wq

#8 lore raw

PATCH 3/6 freediameter: add new recipe

In reply to Joe MacDonald

From: Jackie Huang <[email protected]>

freeDiameter is an open source Diameter protocol implementation. It provides an extensible platform for deploying a Diameter network for your Authentication, Authorization and Accounting needs.

---
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 8 files changed, 516 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch new file +223 -0
new file mode 100644
index 0000000..71a5a1a
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <[email protected]>
+---
+ libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+ 
+ 
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c)						\
++	do {							\
++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
++	} while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+-	uint32_t hash = len;
+-	uint8_t * data = string;
+-	
+-	const unsigned int m = 0x5bd1e995;
+-	const int r = 24;
+-	int align = (long)string & 3;
+-	
+-	if (!align || (len < 4)) {
+-		/* In case data is aligned, MurmurHash2 function */
+-		while(len >= 4)
+-		{
+-			/* Mix 4 bytes at a time into the hash */
+-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle the last few bytes of the input */
+-		switch(len) {
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-	        		hash *= m;
+-		}
+-		
+-	} else {
+-		/* Unaligned data, use alignment-safe slower version */
+-		
+-		/* Pre-load the temp registers */
+-		uint32_t t = 0, d = 0;
+-		switch(align)
+-		{
+-			case 1: t |= data[2] << 16;
+-			case 2: t |= data[1] << 8;
+-			case 3: t |= data[0];
+-		}
+-		t <<= (8 * align);
+-
+-		data += 4-align;
+-		len -= 4-align;
+-		
+-		/* From this point, "data" can be read by chunks of 4 bytes */
+-		
+-		int sl = 8 * (4-align);
+-		int sr = 8 * align;
+-
+-		/* Mix */
+-		while(len >= 4)
+-		{
+-			uint32_t k;
+-			
+-			d = *(unsigned int *)data;
+-			k = (t >> sr) | (d << sl);
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			t = d;
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle leftover data in temp registers */
+-		d = 0;
+-		if(len >= align)
+-		{
+-			uint32_t k;
+-			
+-			switch(align)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			}
+-
+-			k = (t >> sr) | (d << sl);
+-			_HASH_MIX(hash, k, m);
+-
+-			data += align;
+-			len -= align;
+-
+-			/* Handle tail bytes */
+-
+-			switch(len)
+-			{
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-					hash *= m;
+-			};
+-		}
+-		else
+-		{
+-			switch(len)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			case 0: hash ^= (t >> sr) | (d << sl);
+-					hash *= m;
+-			}
+-		}
+-
++	const unsigned char *k = (const unsigned char *)str;
++	uint32_t a, b, c;  /* the internal state */
++	uint32_t len;      /* how many key bytes still need mixing */
++
++	/* Set up the internal state */
++	len = length;
++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
++	b = a;
++	c = 0;               /* variable initialization of internal state */
++
++	/* handle most of the key */
++	while (len >= 12) {
++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++			 ((uint32_t)k[3] << 24));
++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++			 ((uint32_t)k[7] << 24));
++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++			 ((uint32_t)k[11] << 24));
++		mix(a, b, c);
++		k = k + 12;
++		len = len - 12;
++	}
+ 
++	/* handle the last 11 bytes */
++	c = c + length;
++	switch (len) {            /* all the case statements fall through */
++	case 11:
++		c = c + ((uint32_t)k[10] << 24);
++	case 10:
++		c = c + ((uint32_t)k[9] << 16);
++	case 9:
++		c = c + ((uint32_t)k[8] << 8);
++		/* the first byte of c is reserved for the length */
++	case 8:
++		b = b + ((uint32_t)k[7] << 24);
++	case 7:
++		b = b + ((uint32_t)k[6] << 16);
++	case 6:
++		b = b + ((uint32_t)k[5] << 8);
++	case 5:
++		b = b + k[4];
++	case 4:
++		a = a + ((uint32_t)k[3] << 24);
++	case 3:
++		a = a + ((uint32_t)k[2] << 16);
++	case 2:
++		a = a + ((uint32_t)k[1] << 8);
++	case 1:
++		a = a + k[0];
++		/* case 0: nothing left to add */
+ 	}
++	mix(a, b, c);
+ 
+-	/* Do a few final mixes of the hash to ensure the last few
+-	   bytes are well-incorporated. */
+-	hash ^= hash >> 13;
+-	hash *= m;
+-	hash ^= hash >> 15;
++	return c;
++}
+ 
+-	return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++	return hash_rjenkins(string, len); 
+ } 
+ 
+-- 
+1.7.10.4
+
meta-networking/recipes-protocols/freediameter/files/freediameter.init new file +72 -0

72 lines not on this page · raw message

meta-networking/recipes-protocols/freediameter/files/freediameter.service new file +11 -0
new file mode 100644
index 0000000..514481b
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-protocols/freediameter/files/install_test.patch new file +22 -0
new file mode 100644
index 0000000..151037d
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+ 
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++        COMPONENT freeDiameter-common)
meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch new file +72 -0

72 lines not on this page · raw message

meta-networking/recipes-protocols/freediameter/files/run-ptest new file +11 -0
new file mode 100644
index 0000000..d0ca8d9
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+        echo "Couldn't load kernel module sctp."
+        echo "Test cases testsctp and testcnx will fail."
+        echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake  -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +98 -0

98 lines not on this page · raw message

meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb new file +7 -0
new file mode 100644
index 0000000..3fb929a
@@ -0,0 +1,7 @@
+include freediameter.inc
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
Signature · 1 line
2.7.4
#9 lore raw

Re: [meta-networking][PATCH 3/6] freediameter: add new recipe

Quoted 498 lines · Joe MacDonald

From: Jackie Huang <[email protected]>

freeDiameter is an open source Diameter protocol implementation. It provides an extensible platform for deploying a Diameter network for your Authentication, Authorization and Accounting needs.

---
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 8 files changed, 516 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch new file +223 -0
new file mode 100644
index 0000000..71a5a1a
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <[email protected]>
+---
+ libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+
+
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c)                                          \
++      do {                                                    \
++              a = a - b;  a = a - c;  a = a ^ (c >> 13);      \
++              b = b - c;  b = b - a;  b = b ^ (a << 8);       \
++              c = c - a;  c = c - b;  c = c ^ (b >> 13);      \
++              a = a - b;  a = a - c;  a = a ^ (c >> 12);      \
++              b = b - c;  b = b - a;  b = b ^ (a << 16);      \
++              c = c - a;  c = c - b;  c = c ^ (b >> 5);       \
++              a = a - b;  a = a - c;  a = a ^ (c >> 3);       \
++              b = b - c;  b = b - a;  b = b ^ (a << 10);      \
++              c = c - a;  c = c - b;  c = c ^ (b >> 15);      \
++      } while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+-      uint32_t hash = len;
+-      uint8_t * data = string;
+-
+-      const unsigned int m = 0x5bd1e995;
+-      const int r = 24;
+-      int align = (long)string & 3;
+-
+-      if (!align || (len < 4)) {
+-              /* In case data is aligned, MurmurHash2 function */
+-              while(len >= 4)
+-              {
+-                      /* Mix 4 bytes at a time into the hash */
+-                      uint32_t k = *(uint32_t *)data; /* We don't care about the byte order */
+-
+-                      _HASH_MIX(hash, k, m);
+-
+-                      data += 4;
+-                      len -= 4;
+-              }
+-
+-              /* Handle the last few bytes of the input */
+-              switch(len) {
+-                      case 3: hash ^= data[2] << 16;
+-                      case 2: hash ^= data[1] << 8;
+-                      case 1: hash ^= data[0];
+-                              hash *= m;
+-              }
+-
+-      } else {
+-              /* Unaligned data, use alignment-safe slower version */
+-
+-              /* Pre-load the temp registers */
+-              uint32_t t = 0, d = 0;
+-              switch(align)
+-              {
+-                      case 1: t |= data[2] << 16;
+-                      case 2: t |= data[1] << 8;
+-                      case 3: t |= data[0];
+-              }
+-              t <<= (8 * align);
+-
+-              data += 4-align;
+-              len -= 4-align;
+-
+-              /* From this point, "data" can be read by chunks of 4 bytes */
+-
+-              int sl = 8 * (4-align);
+-              int sr = 8 * align;
+-
+-              /* Mix */
+-              while(len >= 4)
+-              {
+-                      uint32_t k;
+-
+-                      d = *(unsigned int *)data;
+-                      k = (t >> sr) | (d << sl);
+-
+-                      _HASH_MIX(hash, k, m);
+-
+-                      t = d;
+-
+-                      data += 4;
+-                      len -= 4;
+-              }
+-
+-              /* Handle leftover data in temp registers */
+-              d = 0;
+-              if(len >= align)
+-              {
+-                      uint32_t k;
+-
+-                      switch(align)
+-                      {
+-                      case 3: d |= data[2] << 16;
+-                      case 2: d |= data[1] << 8;
+-                      case 1: d |= data[0];
+-                      }
+-
+-                      k = (t >> sr) | (d << sl);
+-                      _HASH_MIX(hash, k, m);
+-
+-                      data += align;
+-                      len -= align;
+-
+-                      /* Handle tail bytes */
+-
+-                      switch(len)
+-                      {
+-                      case 3: hash ^= data[2] << 16;
+-                      case 2: hash ^= data[1] << 8;
+-                      case 1: hash ^= data[0];
+-                                      hash *= m;
+-                      };
+-              }
+-              else
+-              {
+-                      switch(len)
+-                      {
+-                      case 3: d |= data[2] << 16;
+-                      case 2: d |= data[1] << 8;
+-                      case 1: d |= data[0];
+-                      case 0: hash ^= (t >> sr) | (d << sl);
+-                                      hash *= m;
+-                      }
+-              }
+-
++      const unsigned char *k = (const unsigned char *)str;
++      uint32_t a, b, c;  /* the internal state */
++      uint32_t len;      /* how many key bytes still need mixing */
++
++      /* Set up the internal state */
++      len = length;
++      a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
++      b = a;
++      c = 0;               /* variable initialization of internal state */
++
++      /* handle most of the key */
++      while (len >= 12) {
++              a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++                       ((uint32_t)k[3] << 24));
++              b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++                       ((uint32_t)k[7] << 24));
++              c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++                       ((uint32_t)k[11] << 24));
++              mix(a, b, c);
++              k = k + 12;
++              len = len - 12;
++      }
+
++      /* handle the last 11 bytes */
++      c = c + length;
++      switch (len) {            /* all the case statements fall through */
++      case 11:
++              c = c + ((uint32_t)k[10] << 24);
++      case 10:
++              c = c + ((uint32_t)k[9] << 16);
++      case 9:
++              c = c + ((uint32_t)k[8] << 8);
++              /* the first byte of c is reserved for the length */
++      case 8:
++              b = b + ((uint32_t)k[7] << 24);
++      case 7:
++              b = b + ((uint32_t)k[6] << 16);
++      case 6:
++              b = b + ((uint32_t)k[5] << 8);
++      case 5:
++              b = b + k[4];
++      case 4:
++              a = a + ((uint32_t)k[3] << 24);
++      case 3:
++              a = a + ((uint32_t)k[2] << 16);
++      case 2:
++              a = a + ((uint32_t)k[1] << 8);
++      case 1:
++              a = a + k[0];
++              /* case 0: nothing left to add */
+       }
++      mix(a, b, c);
+
+-      /* Do a few final mixes of the hash to ensure the last few
+-         bytes are well-incorporated. */
+-      hash ^= hash >> 13;
+-      hash *= m;
+-      hash ^= hash >> 15;
++      return c;
++}
+
+-      return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++      return hash_rjenkins(string, len);
+ }
+
+--
+1.7.10.4
+
meta-networking/recipes-protocols/freediameter/files/freediameter.init new file +72 -0
new file mode 100755
index 0000000..e63a42a
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          freediameter
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description:       Start the freeDiameter daemon at boot time.
+#       freeDiameter is an extensible implementation of the Diameter protocol,
+#       designed for Authentication, Authorization and Accounting. Diameter is
+#       an evolution of the RADIUS protocol.
+### END INIT INFO#
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+. /etc/init.d/functions
+start() {
+       [ -x $DAEMON ] || exit 5
+       echo -n $"Starting $DAEMON: "
+       start-stop-daemon -S -b -x ${DAEMON} && success || failure
+       retval=$?
+       echo ""
+       return $retval
+}
+
+stop() {
+       echo -n $"Stopping $prog: "
+       start-stop-daemon -K -x $DAEMON
+       retval=$?
+       echo ""
+       return $retval
+}
+
+restart() {
+       stop
+       sleep 3
+       start
+}
+
+rh_status() {
+       status $DAEMON
+}
+
+rh_status_q() {
+       rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+  start)
+       rh_status_q && exit 0
+       start
+       ;;
+  stop)
+       rh_status_q || exit 0
+       stop
+       ;;
+  restart)
+       restart
+       ;;
+  status)
+       rh_status
+       ;;
+  *)
+       echo $"Usage: $prog {start|stop|status|restart}"
+       exit 2
+esac
+
+exit $?
meta-networking/recipes-protocols/freediameter/files/freediameter.service new file +11 -0
new file mode 100644
index 0000000..514481b
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-protocols/freediameter/files/install_test.patch new file +22 -0
new file mode 100644
index 0000000..151037d
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++        COMPONENT freeDiameter-common)
meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch new file +72 -0
new file mode 100644
index 0000000..ea857af
@@ -0,0 +1,72 @@
+freediameter ptest cases testmesg_stress.c and testloadext.c need load
+extensions both build time and runtime. Then they search extensions with
+build directory that causes runtime failures.
+
+Pass an environment variable to define runtime extension path.
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
+--- freeDiameter-1.2.0.orig/tests/testloadext.c        2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testloadext.c     2014-02-19 20:08:03.871403924 +0800
+@@ -49,7 +49,7 @@
+ {
+       DIR *dir;
+       struct dirent *dp;
+-      char fullname[512];
++      char fullname[1024];
+       int pathlen;
+
+       /* First, initialize the daemon modules */
+@@ -57,11 +57,16 @@
+       CHECK( 0, fd_queues_init()  );
+       CHECK( 0, fd_msg_init()  );
+       CHECK( 0, fd_rtdisp_init()  );
+-
++
++      char *ext_dir = getenv("EXTENSIONS_DIR");
++      if (ext_dir)
++              pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++      else
++              pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+       /* Find all extensions which have been compiled along the test */
+-      TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
+-      CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-      pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++      TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++      CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+
+       while ((dp = readdir (dir)) != NULL) {
+               char * dot = strrchr(dp->d_name, '.');
+diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
+--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c    2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testmesg_stress.c 2014-02-19 20:08:03.928403924 +0800
+@@ -67,15 +67,20 @@
+ {
+       DIR *dir;
+       struct dirent *dp;
+-      char fullname[512];
++      char fullname[1024];
+       int pathlen;
+       struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
+       struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
+
++      char *ext_dir = getenv("EXTENSIONS_DIR");
++      if (ext_dir)
++              pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++      else
++              pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+       /* Find all extensions which have been compiled along the test */
+-      LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
+-      CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-      pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++      TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++      CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+
+       while ((dp = readdir (dir)) != NULL) {
+               char * dot = strrchr(dp->d_name, '.');
meta-networking/recipes-protocols/freediameter/files/run-ptest new file +11 -0
new file mode 100644
index 0000000..d0ca8d9
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+        echo "Couldn't load kernel module sctp."
+        echo "Test cases testsctp and testcnx will fail."
+        echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake  -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +17 -0
new file mode 100644
index 0000000..6880d26
@@ -0,0 +1,98 @@
+SUMMARY = "An open source implementation of the diameter protocol"
+DESCRIPTION = "\
+freeDiameter is an open source Diameter protocol implementation. It \
+provides an extensible platform for deploying a Diameter network for \
+your Authentication, Authorization and Accounting needs."
+
+HOMEPAGE = "http://www.freediameter.net"
+
+DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
+
+pkgname = "freeDiameter"
+
+SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
+           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
+           file://freediameter.service \
+           file://freediameter.init \
+           \

meta-networking/recipes-protocols/freediameter/freediameter.inc line 27

Quoted 10 lines
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +10 -0
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
+           'file://install_test.patch \
+            file://run-ptest \
+            file://pass-ptest-env.patch', '', d)} \
+           "
+
+S = "${WORKDIR}/${pkgname}-${PV}"
+
+PTEST_PATH = "${libdir}/${pkgname}/ptest"
+

pkgname is used elsewhere in global metadata like build history, may be use something else so the changes of conflicts are less

Quoted 92 lines
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +71 -0
+inherit cmake update-rc.d ptest systemd
+
+EXTRA_OECMAKE = " \
+    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
+    -DBUILD_DBG_MONITOR:BOOL=ON  \
+    -DBUILD_TEST_APP:BOOL=ON \
+    -DBUILD_TESTING:BOOL=ON \
+    -DBUILD_APP_RADGW:BOOL=ON \
+    -DBUILD_APP_REDIRECT:BOOL=ON \
+    -DBUILD_TEST_ACCT:BOOL=ON \
+    -DBUILD_TEST_NETEMUL:BOOL=ON \
+    -DBUILD_TEST_RT_ANY:BOOL=ON \
+    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
+    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
+    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
+    -DCMAKE_SKIP_RPATH:BOOL=ON \
+"
+# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
+# specify it on cmd line will fix the SET bug in CMakeList.txt
+
+# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
+
+# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
+# These need MySQL support
+
+# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
+
+# -DALL_EXTENSIONS=ON will enable all
+
+do_install_append() {
+    # install the sample configuration file
+    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
+    for i in ${S}/doc/*.conf.sample; do
+        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
+    done
+    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
+      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
+
+    # install daemon init related files
+    install -d -m 0755 ${D}${sysconfdir}/default
+    install -d -m 0755 ${D}${sysconfdir}/init.d
+    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
+      ${D}${sysconfdir}/default/${BPN}
+    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
+
+    # install for systemd
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
+}
+
+do_install_ptest() {
+    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
+    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
+    rmdir ${D}${PTEST_PATH}-tests
+    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
+}
+
+FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
+
+# include the extensions in main package
+FILES_${PN} += "${libdir}/${pkgname}/*"
+
+RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
+RDEPENDS_${PN}-ptest = "cmake"
+
+INITSCRIPT_NAME = "${BPN}"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "freediameter.service"
+SYSTEMD_AUTO_ENABLE = "disable"
meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb new file +7 -1
new file mode 100644
index 0000000..3fb929a
@@ -0,0 +1,7 @@
+include freediameter.inc
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
--

2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#10 lore raw

Re: [meta-networking][PATCH 3/6] freediameter: add new recipe

In reply to Joe MacDonald
Quoted 9 lines · Joe MacDonald

From: Jackie Huang <[email protected]>

freeDiameter is an open source Diameter protocol implementation. It provides an extensible platform for deploying a Diameter network for your Authentication, Authorization and Accounting needs.

If you want this in meta-networking, please send a patch to remove it from meta-security.

- armin

Quoted 583 lines
---
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 8 files changed, 516 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch new file +223 -0
new file mode 100644
index 0000000..71a5a1a
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <[email protected]>
+---
+ libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+ 
+ 
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c)						\
++	do {							\
++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
++	} while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+-	uint32_t hash = len;
+-	uint8_t * data = string;
+-	
+-	const unsigned int m = 0x5bd1e995;
+-	const int r = 24;
+-	int align = (long)string & 3;
+-	
+-	if (!align || (len < 4)) {
+-		/* In case data is aligned, MurmurHash2 function */
+-		while(len >= 4)
+-		{
+-			/* Mix 4 bytes at a time into the hash */
+-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle the last few bytes of the input */
+-		switch(len) {
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-	        		hash *= m;
+-		}
+-		
+-	} else {
+-		/* Unaligned data, use alignment-safe slower version */
+-		
+-		/* Pre-load the temp registers */
+-		uint32_t t = 0, d = 0;
+-		switch(align)
+-		{
+-			case 1: t |= data[2] << 16;
+-			case 2: t |= data[1] << 8;
+-			case 3: t |= data[0];
+-		}
+-		t <<= (8 * align);
+-
+-		data += 4-align;
+-		len -= 4-align;
+-		
+-		/* From this point, "data" can be read by chunks of 4 bytes */
+-		
+-		int sl = 8 * (4-align);
+-		int sr = 8 * align;
+-
+-		/* Mix */
+-		while(len >= 4)
+-		{
+-			uint32_t k;
+-			
+-			d = *(unsigned int *)data;
+-			k = (t >> sr) | (d << sl);
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			t = d;
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle leftover data in temp registers */
+-		d = 0;
+-		if(len >= align)
+-		{
+-			uint32_t k;
+-			
+-			switch(align)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			}
+-
+-			k = (t >> sr) | (d << sl);
+-			_HASH_MIX(hash, k, m);
+-
+-			data += align;
+-			len -= align;
+-
+-			/* Handle tail bytes */
+-
+-			switch(len)
+-			{
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-					hash *= m;
+-			};
+-		}
+-		else
+-		{
+-			switch(len)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			case 0: hash ^= (t >> sr) | (d << sl);
+-					hash *= m;
+-			}
+-		}
+-
++	const unsigned char *k = (const unsigned char *)str;
++	uint32_t a, b, c;  /* the internal state */
++	uint32_t len;      /* how many key bytes still need mixing */
++
++	/* Set up the internal state */
++	len = length;
++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
++	b = a;
++	c = 0;               /* variable initialization of internal state */
++
++	/* handle most of the key */
++	while (len >= 12) {
++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++			 ((uint32_t)k[3] << 24));
++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++			 ((uint32_t)k[7] << 24));
++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++			 ((uint32_t)k[11] << 24));
++		mix(a, b, c);
++		k = k + 12;
++		len = len - 12;
++	}
+ 
++	/* handle the last 11 bytes */
++	c = c + length;
++	switch (len) {            /* all the case statements fall through */
++	case 11:
++		c = c + ((uint32_t)k[10] << 24);
++	case 10:
++		c = c + ((uint32_t)k[9] << 16);
++	case 9:
++		c = c + ((uint32_t)k[8] << 8);
++		/* the first byte of c is reserved for the length */
++	case 8:
++		b = b + ((uint32_t)k[7] << 24);
++	case 7:
++		b = b + ((uint32_t)k[6] << 16);
++	case 6:
++		b = b + ((uint32_t)k[5] << 8);
++	case 5:
++		b = b + k[4];
++	case 4:
++		a = a + ((uint32_t)k[3] << 24);
++	case 3:
++		a = a + ((uint32_t)k[2] << 16);
++	case 2:
++		a = a + ((uint32_t)k[1] << 8);
++	case 1:
++		a = a + k[0];
++		/* case 0: nothing left to add */
+ 	}
++	mix(a, b, c);
+ 
+-	/* Do a few final mixes of the hash to ensure the last few
+-	   bytes are well-incorporated. */
+-	hash ^= hash >> 13;
+-	hash *= m;
+-	hash ^= hash >> 15;
++	return c;
++}
+ 
+-	return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++	return hash_rjenkins(string, len); 
+ } 
+ 
+-- 
+1.7.10.4
+
meta-networking/recipes-protocols/freediameter/files/freediameter.init new file +72 -0
new file mode 100755
index 0000000..e63a42a
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          freediameter
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description:       Start the freeDiameter daemon at boot time.
+#       freeDiameter is an extensible implementation of the Diameter protocol,
+#       designed for Authentication, Authorization and Accounting. Diameter is
+#       an evolution of the RADIUS protocol.
+### END INIT INFO#
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+. /etc/init.d/functions
+start() {
+	[ -x $DAEMON ] || exit 5
+	echo -n $"Starting $DAEMON: "
+	start-stop-daemon -S -b -x ${DAEMON} && success || failure
+	retval=$?
+	echo ""
+	return $retval
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	start-stop-daemon -K -x $DAEMON
+	retval=$?
+	echo ""
+	return $retval
+}
+
+restart() {
+	stop
+	sleep 3
+	start
+}
+
+rh_status() {
+	status $DAEMON
+}
+
+rh_status_q() {
+	rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+  start)
+	rh_status_q && exit 0
+	start
+	;;
+  stop)
+	rh_status_q || exit 0
+	stop
+	;;
+  restart)
+	restart
+	;;
+  status)
+	rh_status
+	;;
+  *)
+	echo $"Usage: $prog {start|stop|status|restart}"
+	exit 2
+esac
+
+exit $?
meta-networking/recipes-protocols/freediameter/files/freediameter.service new file +11 -0
new file mode 100644
index 0000000..514481b
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-protocols/freediameter/files/install_test.patch new file +22 -0
new file mode 100644
index 0000000..151037d
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+ 
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++        COMPONENT freeDiameter-common)
meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch new file +72 -0
new file mode 100644
index 0000000..ea857af
@@ -0,0 +1,72 @@
+freediameter ptest cases testmesg_stress.c and testloadext.c need load
+extensions both build time and runtime. Then they search extensions with
+build directory that causes runtime failures.
+
+Pass an environment variable to define runtime extension path.
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
+--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
+@@ -49,7 +49,7 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 
+ 	/* First, initialize the daemon modules */
+@@ -57,11 +57,16 @@
+ 	CHECK( 0, fd_queues_init()  );
+ 	CHECK( 0, fd_msg_init()  );
+ 	CHECK( 0, fd_rtdisp_init()  );
+-	
++
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
+diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
+--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
+@@ -67,15 +67,20 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
+ 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
+ 
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
meta-networking/recipes-protocols/freediameter/files/run-ptest new file +11 -0
new file mode 100644
index 0000000..d0ca8d9
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+        echo "Couldn't load kernel module sctp."
+        echo "Test cases testsctp and testcnx will fail."
+        echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake  -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +98 -0
new file mode 100644
index 0000000..6880d26
@@ -0,0 +1,98 @@
+SUMMARY = "An open source implementation of the diameter protocol"
+DESCRIPTION = "\
+freeDiameter is an open source Diameter protocol implementation. It \
+provides an extensible platform for deploying a Diameter network for \
+your Authentication, Authorization and Accounting needs."
+
+HOMEPAGE = "http://www.freediameter.net"
+
+DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
+
+pkgname = "freeDiameter"
+
+SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
+           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
+           file://freediameter.service \
+           file://freediameter.init \
+           \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
+           'file://install_test.patch \
+            file://run-ptest \
+            file://pass-ptest-env.patch', '', d)} \
+           "
+
+S = "${WORKDIR}/${pkgname}-${PV}"
+
+PTEST_PATH = "${libdir}/${pkgname}/ptest"
+
+inherit cmake update-rc.d ptest systemd
+
+EXTRA_OECMAKE = " \
+    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
+    -DBUILD_DBG_MONITOR:BOOL=ON  \
+    -DBUILD_TEST_APP:BOOL=ON \
+    -DBUILD_TESTING:BOOL=ON \
+    -DBUILD_APP_RADGW:BOOL=ON \
+    -DBUILD_APP_REDIRECT:BOOL=ON \
+    -DBUILD_TEST_ACCT:BOOL=ON \
+    -DBUILD_TEST_NETEMUL:BOOL=ON \
+    -DBUILD_TEST_RT_ANY:BOOL=ON \
+    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
+    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
+    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
+    -DCMAKE_SKIP_RPATH:BOOL=ON \
+"
+# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
+# specify it on cmd line will fix the SET bug in CMakeList.txt
+
+# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
+
+# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
+# These need MySQL support
+
+# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
+
+# -DALL_EXTENSIONS=ON will enable all
+
+do_install_append() {
+    # install the sample configuration file
+    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
+    for i in ${S}/doc/*.conf.sample; do
+        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
+    done
+    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
+      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
+
+    # install daemon init related files
+    install -d -m 0755 ${D}${sysconfdir}/default
+    install -d -m 0755 ${D}${sysconfdir}/init.d
+    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
+      ${D}${sysconfdir}/default/${BPN}
+    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
+
+    # install for systemd
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
+}
+
+do_install_ptest() {
+    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
+    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
+    rmdir ${D}${PTEST_PATH}-tests
+    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
+}
+
+FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
+
+# include the extensions in main package
+FILES_${PN} += "${libdir}/${pkgname}/*"
+
+RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
+RDEPENDS_${PN}-ptest = "cmake"
+
+INITSCRIPT_NAME = "${BPN}"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "freediameter.service"
+SYSTEMD_AUTO_ENABLE = "disable"
meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb new file +7 -0
new file mode 100644
index 0000000..3fb929a
@@ -0,0 +1,7 @@
+include freediameter.inc
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
#11 lore raw

Re: [meta-networking][PATCH 3/6] freediameter: add new recipe

Quoted 10 lines · [Re: [oe] [meta-networking][PATCH 3/6] freediameter: add new recipe] On…
Quoted 7 lines · Joe MacDonald

From: Jackie Huang <[email protected]>

freeDiameter is an open source Diameter protocol implementation. It provides an extensible platform for deploying a Diameter network for your Authentication, Authorization and Accounting needs.

Quoted 4 lines
Quoted 2 lines

If you want this in meta-networking, please send a patch to remove it from meta-security.

I never even thought of looking for it in meta-security. Since I've always encountered it in the CGL space it just never occurred, and since the patch was still apparently active in patchwork, I just assumed it'd been lost.

Do you (or anyone else using the layers) have a preference for what we do with the recipe? Unfortunately at a glance they look at least a bit different from each other, so if I'm going to include it in meta-networking I'll want to review what's in meta-security first to determine what changes are appropriate to the meta-networking version.

-J.

Quoted 586 lines

- armin

Quoted 583 lines
---
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 8 files changed, 516 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch new file +223 -0
new file mode 100644
index 0000000..71a5a1a
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <[email protected]>
+---
+ libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+ 
+ 
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c)						\
++	do {							\
++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
++	} while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+-	uint32_t hash = len;
+-	uint8_t * data = string;
+-	
+-	const unsigned int m = 0x5bd1e995;
+-	const int r = 24;
+-	int align = (long)string & 3;
+-	
+-	if (!align || (len < 4)) {
+-		/* In case data is aligned, MurmurHash2 function */
+-		while(len >= 4)
+-		{
+-			/* Mix 4 bytes at a time into the hash */
+-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle the last few bytes of the input */
+-		switch(len) {
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-	        		hash *= m;
+-		}
+-		
+-	} else {
+-		/* Unaligned data, use alignment-safe slower version */
+-		
+-		/* Pre-load the temp registers */
+-		uint32_t t = 0, d = 0;
+-		switch(align)
+-		{
+-			case 1: t |= data[2] << 16;
+-			case 2: t |= data[1] << 8;
+-			case 3: t |= data[0];
+-		}
+-		t <<= (8 * align);
+-
+-		data += 4-align;
+-		len -= 4-align;
+-		
+-		/* From this point, "data" can be read by chunks of 4 bytes */
+-		
+-		int sl = 8 * (4-align);
+-		int sr = 8 * align;
+-
+-		/* Mix */
+-		while(len >= 4)
+-		{
+-			uint32_t k;
+-			
+-			d = *(unsigned int *)data;
+-			k = (t >> sr) | (d << sl);
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			t = d;
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle leftover data in temp registers */
+-		d = 0;
+-		if(len >= align)
+-		{
+-			uint32_t k;
+-			
+-			switch(align)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			}
+-
+-			k = (t >> sr) | (d << sl);
+-			_HASH_MIX(hash, k, m);
+-
+-			data += align;
+-			len -= align;
+-
+-			/* Handle tail bytes */
+-
+-			switch(len)
+-			{
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-					hash *= m;
+-			};
+-		}
+-		else
+-		{
+-			switch(len)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			case 0: hash ^= (t >> sr) | (d << sl);
+-					hash *= m;
+-			}
+-		}
+-
++	const unsigned char *k = (const unsigned char *)str;
++	uint32_t a, b, c;  /* the internal state */
++	uint32_t len;      /* how many key bytes still need mixing */
++
++	/* Set up the internal state */
++	len = length;
++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
++	b = a;
++	c = 0;               /* variable initialization of internal state */
++
++	/* handle most of the key */
++	while (len >= 12) {
++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++			 ((uint32_t)k[3] << 24));
++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++			 ((uint32_t)k[7] << 24));
++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++			 ((uint32_t)k[11] << 24));
++		mix(a, b, c);
++		k = k + 12;
++		len = len - 12;
++	}
+ 
++	/* handle the last 11 bytes */
++	c = c + length;
++	switch (len) {            /* all the case statements fall through */
++	case 11:
++		c = c + ((uint32_t)k[10] << 24);
++	case 10:
++		c = c + ((uint32_t)k[9] << 16);
++	case 9:
++		c = c + ((uint32_t)k[8] << 8);
++		/* the first byte of c is reserved for the length */
++	case 8:
++		b = b + ((uint32_t)k[7] << 24);
++	case 7:
++		b = b + ((uint32_t)k[6] << 16);
++	case 6:
++		b = b + ((uint32_t)k[5] << 8);
++	case 5:
++		b = b + k[4];
++	case 4:
++		a = a + ((uint32_t)k[3] << 24);
++	case 3:
++		a = a + ((uint32_t)k[2] << 16);
++	case 2:
++		a = a + ((uint32_t)k[1] << 8);
++	case 1:
++		a = a + k[0];
++		/* case 0: nothing left to add */
+ 	}
++	mix(a, b, c);
+ 
+-	/* Do a few final mixes of the hash to ensure the last few
+-	   bytes are well-incorporated. */
+-	hash ^= hash >> 13;
+-	hash *= m;
+-	hash ^= hash >> 15;
++	return c;
++}
+ 
+-	return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++	return hash_rjenkins(string, len); 
+ } 
+ 
+-- 
+1.7.10.4
+
meta-networking/recipes-protocols/freediameter/files/freediameter.init new file +72 -0
new file mode 100755
index 0000000..e63a42a
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          freediameter
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description:       Start the freeDiameter daemon at boot time.
+#       freeDiameter is an extensible implementation of the Diameter protocol,
+#       designed for Authentication, Authorization and Accounting. Diameter is
+#       an evolution of the RADIUS protocol.
+### END INIT INFO#
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+. /etc/init.d/functions
+start() {
+	[ -x $DAEMON ] || exit 5
+	echo -n $"Starting $DAEMON: "
+	start-stop-daemon -S -b -x ${DAEMON} && success || failure
+	retval=$?
+	echo ""
+	return $retval
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	start-stop-daemon -K -x $DAEMON
+	retval=$?
+	echo ""
+	return $retval
+}
+
+restart() {
+	stop
+	sleep 3
+	start
+}
+
+rh_status() {
+	status $DAEMON
+}
+
+rh_status_q() {
+	rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+  start)
+	rh_status_q && exit 0
+	start
+	;;
+  stop)
+	rh_status_q || exit 0
+	stop
+	;;
+  restart)
+	restart
+	;;
+  status)
+	rh_status
+	;;
+  *)
+	echo $"Usage: $prog {start|stop|status|restart}"
+	exit 2
+esac
+
+exit $?
meta-networking/recipes-protocols/freediameter/files/freediameter.service new file +11 -0
new file mode 100644
index 0000000..514481b
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-protocols/freediameter/files/install_test.patch new file +22 -0
new file mode 100644
index 0000000..151037d
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+ 
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++        COMPONENT freeDiameter-common)
meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch new file +72 -0
new file mode 100644
index 0000000..ea857af
@@ -0,0 +1,72 @@
+freediameter ptest cases testmesg_stress.c and testloadext.c need load
+extensions both build time and runtime. Then they search extensions with
+build directory that causes runtime failures.
+
+Pass an environment variable to define runtime extension path.
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
+--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
+@@ -49,7 +49,7 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 
+ 	/* First, initialize the daemon modules */
+@@ -57,11 +57,16 @@
+ 	CHECK( 0, fd_queues_init()  );
+ 	CHECK( 0, fd_msg_init()  );
+ 	CHECK( 0, fd_rtdisp_init()  );
+-	
++
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
+diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
+--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
+@@ -67,15 +67,20 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
+ 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
+ 
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
meta-networking/recipes-protocols/freediameter/files/run-ptest new file +11 -0
new file mode 100644
index 0000000..d0ca8d9
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+        echo "Couldn't load kernel module sctp."
+        echo "Test cases testsctp and testcnx will fail."
+        echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake  -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +98 -0
new file mode 100644
index 0000000..6880d26
@@ -0,0 +1,98 @@
+SUMMARY = "An open source implementation of the diameter protocol"
+DESCRIPTION = "\
+freeDiameter is an open source Diameter protocol implementation. It \
+provides an extensible platform for deploying a Diameter network for \
+your Authentication, Authorization and Accounting needs."
+
+HOMEPAGE = "http://www.freediameter.net"
+
+DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
+
+pkgname = "freeDiameter"
+
+SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
+           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
+           file://freediameter.service \
+           file://freediameter.init \
+           \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
+           'file://install_test.patch \
+            file://run-ptest \
+            file://pass-ptest-env.patch', '', d)} \
+           "
+
+S = "${WORKDIR}/${pkgname}-${PV}"
+
+PTEST_PATH = "${libdir}/${pkgname}/ptest"
+
+inherit cmake update-rc.d ptest systemd
+
+EXTRA_OECMAKE = " \
+    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
+    -DBUILD_DBG_MONITOR:BOOL=ON  \
+    -DBUILD_TEST_APP:BOOL=ON \
+    -DBUILD_TESTING:BOOL=ON \
+    -DBUILD_APP_RADGW:BOOL=ON \
+    -DBUILD_APP_REDIRECT:BOOL=ON \
+    -DBUILD_TEST_ACCT:BOOL=ON \
+    -DBUILD_TEST_NETEMUL:BOOL=ON \
+    -DBUILD_TEST_RT_ANY:BOOL=ON \
+    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
+    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
+    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
+    -DCMAKE_SKIP_RPATH:BOOL=ON \
+"
+# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
+# specify it on cmd line will fix the SET bug in CMakeList.txt
+
+# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
+
+# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
+# These need MySQL support
+
+# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
+
+# -DALL_EXTENSIONS=ON will enable all
+
+do_install_append() {
+    # install the sample configuration file
+    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
+    for i in ${S}/doc/*.conf.sample; do
+        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
+    done
+    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
+      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
+
+    # install daemon init related files
+    install -d -m 0755 ${D}${sysconfdir}/default
+    install -d -m 0755 ${D}${sysconfdir}/init.d
+    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
+      ${D}${sysconfdir}/default/${BPN}
+    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
+
+    # install for systemd
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
+}
+
+do_install_ptest() {
+    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
+    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
+    rmdir ${D}${PTEST_PATH}-tests
+    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
+}
+
+FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
+
+# include the extensions in main package
+FILES_${PN} += "${libdir}/${pkgname}/*"
+
+RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
+RDEPENDS_${PN}-ptest = "cmake"
+
+INITSCRIPT_NAME = "${BPN}"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "freediameter.service"
+SYSTEMD_AUTO_ENABLE = "disable"
meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb new file +7 -0
new file mode 100644
index 0000000..3fb929a
@@ -0,0 +1,7 @@
+include freediameter.inc
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
Signature · 2 lines
-Joe MacDonald.
:wq
#12 lore raw

Re: [meta-networking][PATCH 3/6] freediameter: add new recipe

Quoted 15 lines · Joe MacDonald
Quoted 9 lines · [Re: [oe] [meta-networking][PATCH 3/6] freediameter: add new recipe] On…
Quoted 7 lines · Joe MacDonald

From: Jackie Huang <[email protected]>

freeDiameter is an open source Diameter protocol implementation. It provides an extensible platform for deploying a Diameter network for your Authentication, Authorization and Accounting needs.

Quoted 4 lines
Quoted 2 lines

If you want this in meta-networking, please send a patch to remove it from meta-security.

Quoted 7 lines

I never even thought of looking for it in meta-security. Since I've always encountered it in the CGL space it just never occurred, and since the patch was still apparently active in patchwork, I just assumed it'd been lost.

Do you (or anyone else using the layers) have a preference for what we do with the recipe?

Meta-networking is fine by me.

-Armin

Quoted 591 lines

Unfortunately at a glance they look at least a bit
different from each other, so if I'm going to include it in meta-networking I'll want to review what's in meta-security first to determine what changes are appropriate to the meta-networking version.

-J.

Quoted 584 lines

- armin

Quoted 583 lines
---
 ...murhash-algorithm-with-Robert-Jenkin-s-ha.patch | 223 +++++++++++++++++++++
 .../freediameter/files/freediameter.init           |  72 +++++++
 .../freediameter/files/freediameter.service        |  11 +
 .../freediameter/files/install_test.patch          |  22 ++
 .../freediameter/files/pass-ptest-env.patch        |  72 +++++++
 .../recipes-protocols/freediameter/files/run-ptest |  11 +
 .../freediameter/freediameter.inc                  |  98 +++++++++
 .../freediameter/freediameter_1.2.1.bb             |   7 +
 8 files changed, 516 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
 create mode 100755 meta-networking/recipes-protocols/freediameter/files/freediameter.init
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/freediameter.service
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/install_test.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
 create mode 100644 meta-networking/recipes-protocols/freediameter/files/run-ptest
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter.inc
 create mode 100644 meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch new file +223 -0
new file mode 100644
index 0000000..71a5a1a
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <[email protected]>
+---
+ libfdproto/ostr.c |  192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+ 
+ 
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c)						\
++	do {							\
++		a = a - b;  a = a - c;  a = a ^ (c >> 13);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 8);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 13);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 12);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 16);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 5);	\
++		a = a - b;  a = a - c;  a = a ^ (c >> 3);	\
++		b = b - c;  b = b - a;  b = b ^ (a << 10);	\
++		c = c - a;  c = c - b;  c = c ^ (b >> 15);	\
++	} while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+-	uint32_t hash = len;
+-	uint8_t * data = string;
+-	
+-	const unsigned int m = 0x5bd1e995;
+-	const int r = 24;
+-	int align = (long)string & 3;
+-	
+-	if (!align || (len < 4)) {
+-		/* In case data is aligned, MurmurHash2 function */
+-		while(len >= 4)
+-		{
+-			/* Mix 4 bytes at a time into the hash */
+-			uint32_t k = *(uint32_t *)data;	/* We don't care about the byte order */
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle the last few bytes of the input */
+-		switch(len) {
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-	        		hash *= m;
+-		}
+-		
+-	} else {
+-		/* Unaligned data, use alignment-safe slower version */
+-		
+-		/* Pre-load the temp registers */
+-		uint32_t t = 0, d = 0;
+-		switch(align)
+-		{
+-			case 1: t |= data[2] << 16;
+-			case 2: t |= data[1] << 8;
+-			case 3: t |= data[0];
+-		}
+-		t <<= (8 * align);
+-
+-		data += 4-align;
+-		len -= 4-align;
+-		
+-		/* From this point, "data" can be read by chunks of 4 bytes */
+-		
+-		int sl = 8 * (4-align);
+-		int sr = 8 * align;
+-
+-		/* Mix */
+-		while(len >= 4)
+-		{
+-			uint32_t k;
+-			
+-			d = *(unsigned int *)data;
+-			k = (t >> sr) | (d << sl);
+-
+-			_HASH_MIX(hash, k, m);
+-
+-			t = d;
+-
+-			data += 4;
+-			len -= 4;
+-		}
+-
+-		/* Handle leftover data in temp registers */
+-		d = 0;
+-		if(len >= align)
+-		{
+-			uint32_t k;
+-			
+-			switch(align)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			}
+-
+-			k = (t >> sr) | (d << sl);
+-			_HASH_MIX(hash, k, m);
+-
+-			data += align;
+-			len -= align;
+-
+-			/* Handle tail bytes */
+-
+-			switch(len)
+-			{
+-			case 3: hash ^= data[2] << 16;
+-			case 2: hash ^= data[1] << 8;
+-			case 1: hash ^= data[0];
+-					hash *= m;
+-			};
+-		}
+-		else
+-		{
+-			switch(len)
+-			{
+-			case 3: d |= data[2] << 16;
+-			case 2: d |= data[1] << 8;
+-			case 1: d |= data[0];
+-			case 0: hash ^= (t >> sr) | (d << sl);
+-					hash *= m;
+-			}
+-		}
+-
++	const unsigned char *k = (const unsigned char *)str;
++	uint32_t a, b, c;  /* the internal state */
++	uint32_t len;      /* how many key bytes still need mixing */
++
++	/* Set up the internal state */
++	len = length;
++	a = 0x9e3779b9;      /* the golden ratio; an arbitrary value */
++	b = a;
++	c = 0;               /* variable initialization of internal state */
++
++	/* handle most of the key */
++	while (len >= 12) {
++		a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++			 ((uint32_t)k[3] << 24));
++		b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++			 ((uint32_t)k[7] << 24));
++		c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++			 ((uint32_t)k[11] << 24));
++		mix(a, b, c);
++		k = k + 12;
++		len = len - 12;
++	}
+ 
++	/* handle the last 11 bytes */
++	c = c + length;
++	switch (len) {            /* all the case statements fall through */
++	case 11:
++		c = c + ((uint32_t)k[10] << 24);
++	case 10:
++		c = c + ((uint32_t)k[9] << 16);
++	case 9:
++		c = c + ((uint32_t)k[8] << 8);
++		/* the first byte of c is reserved for the length */
++	case 8:
++		b = b + ((uint32_t)k[7] << 24);
++	case 7:
++		b = b + ((uint32_t)k[6] << 16);
++	case 6:
++		b = b + ((uint32_t)k[5] << 8);
++	case 5:
++		b = b + k[4];
++	case 4:
++		a = a + ((uint32_t)k[3] << 24);
++	case 3:
++		a = a + ((uint32_t)k[2] << 16);
++	case 2:
++		a = a + ((uint32_t)k[1] << 8);
++	case 1:
++		a = a + k[0];
++		/* case 0: nothing left to add */
+ 	}
++	mix(a, b, c);
+ 
+-	/* Do a few final mixes of the hash to ensure the last few
+-	   bytes are well-incorporated. */
+-	hash ^= hash >> 13;
+-	hash *= m;
+-	hash ^= hash >> 15;
++	return c;
++}
+ 
+-	return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++	return hash_rjenkins(string, len); 
+ } 
+ 
+-- 
+1.7.10.4
+
meta-networking/recipes-protocols/freediameter/files/freediameter.init new file +72 -0
new file mode 100755
index 0000000..e63a42a
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          freediameter
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description:       Start the freeDiameter daemon at boot time.
+#       freeDiameter is an extensible implementation of the Diameter protocol,
+#       designed for Authentication, Authorization and Accounting. Diameter is
+#       an evolution of the RADIUS protocol.
+### END INIT INFO#
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+. /etc/init.d/functions
+start() {
+	[ -x $DAEMON ] || exit 5
+	echo -n $"Starting $DAEMON: "
+	start-stop-daemon -S -b -x ${DAEMON} && success || failure
+	retval=$?
+	echo ""
+	return $retval
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	start-stop-daemon -K -x $DAEMON
+	retval=$?
+	echo ""
+	return $retval
+}
+
+restart() {
+	stop
+	sleep 3
+	start
+}
+
+rh_status() {
+	status $DAEMON
+}
+
+rh_status_q() {
+	rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+  start)
+	rh_status_q && exit 0
+	start
+	;;
+  stop)
+	rh_status_q || exit 0
+	stop
+	;;
+  restart)
+	restart
+	;;
+  status)
+	rh_status
+	;;
+  *)
+	echo $"Usage: $prog {start|stop|status|restart}"
+	exit 2
+esac
+
+exit $?
meta-networking/recipes-protocols/freediameter/files/freediameter.service new file +11 -0
new file mode 100644
index 0000000..514481b
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-protocols/freediameter/files/install_test.patch new file +22 -0
new file mode 100644
index 0000000..151037d
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+ 
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX       /opt/${FD_PROJECT_NAME}-tests   CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++        RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++        COMPONENT freeDiameter-common)
meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch new file +72 -0
new file mode 100644
index 0000000..ea857af
@@ -0,0 +1,72 @@
+freediameter ptest cases testmesg_stress.c and testloadext.c need load
+extensions both build time and runtime. Then they search extensions with
+build directory that causes runtime failures.
+
+Pass an environment variable to define runtime extension path.
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+
+diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
+--- freeDiameter-1.2.0.orig/tests/testloadext.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testloadext.c	2014-02-19 20:08:03.871403924 +0800
+@@ -49,7 +49,7 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 
+ 	/* First, initialize the daemon modules */
+@@ -57,11 +57,16 @@
+ 	CHECK( 0, fd_queues_init()  );
+ 	CHECK( 0, fd_msg_init()  );
+ 	CHECK( 0, fd_rtdisp_init()  );
+-	
++
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
+diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
+--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c	2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testmesg_stress.c	2014-02-19 20:08:03.928403924 +0800
+@@ -67,15 +67,20 @@
+ {
+ 	DIR *dir;
+ 	struct dirent *dp;
+-	char fullname[512];
++	char fullname[1024];
+ 	int pathlen;
+ 	struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
+ 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
+ 
++	char *ext_dir = getenv("EXTENSIONS_DIR");
++	if (ext_dir)
++		pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++	else
++		pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ 	/* Find all extensions which have been compiled along the test */
+-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
+-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++	TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++	CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+ 	
+ 	while ((dp = readdir (dir)) != NULL) {
+ 		char * dot = strrchr(dp->d_name, '.');
meta-networking/recipes-protocols/freediameter/files/run-ptest new file +11 -0
new file mode 100644
index 0000000..d0ca8d9
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+        echo "Couldn't load kernel module sctp."
+        echo "Test cases testsctp and testcnx will fail."
+        echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake  -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
meta-networking/recipes-protocols/freediameter/freediameter.inc new file +98 -0
new file mode 100644
index 0000000..6880d26
@@ -0,0 +1,98 @@
+SUMMARY = "An open source implementation of the diameter protocol"
+DESCRIPTION = "\
+freeDiameter is an open source Diameter protocol implementation. It \
+provides an extensible platform for deploying a Diameter network for \
+your Authentication, Authorization and Accounting needs."
+
+HOMEPAGE = "http://www.freediameter.net"
+
+DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
+
+pkgname = "freeDiameter"
+
+SRC_URI = "http://www.freediameter.net/hg/${pkgname}/archive/${PV}.tar.gz;downloadfilename=${pkgname}-${PV}.tar.gz \
+           file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
+           file://freediameter.service \
+           file://freediameter.init \
+           \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
+           'file://install_test.patch \
+            file://run-ptest \
+            file://pass-ptest-env.patch', '', d)} \
+           "
+
+S = "${WORKDIR}/${pkgname}-${PV}"
+
+PTEST_PATH = "${libdir}/${pkgname}/ptest"
+
+inherit cmake update-rc.d ptest systemd
+
+EXTRA_OECMAKE = " \
+    -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${pkgname} \
+    -DBUILD_DBG_MONITOR:BOOL=ON  \
+    -DBUILD_TEST_APP:BOOL=ON \
+    -DBUILD_TESTING:BOOL=ON \
+    -DBUILD_APP_RADGW:BOOL=ON \
+    -DBUILD_APP_REDIRECT:BOOL=ON \
+    -DBUILD_TEST_ACCT:BOOL=ON \
+    -DBUILD_TEST_NETEMUL:BOOL=ON \
+    -DBUILD_TEST_RT_ANY:BOOL=ON \
+    -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
+    -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${pkgname} \
+    -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
+    -DCMAKE_SKIP_RPATH:BOOL=ON \
+"
+# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
+# specify it on cmd line will fix the SET bug in CMakeList.txt
+
+# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
+
+# -DBUILD_APP_DIAMEAP:BOOL=ON  -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
+# These need MySQL support
+
+# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
+
+# -DALL_EXTENSIONS=ON will enable all
+
+do_install_append() {
+    # install the sample configuration file
+    install -d -m 0755 ${D}${sysconfdir}/${pkgname}
+    for i in ${S}/doc/*.conf.sample; do
+        install -m 0644 $i ${D}${sysconfdir}/${pkgname}/
+    done
+    mv ${D}${sysconfdir}/${pkgname}/freediameter.conf.sample \
+      ${D}${sysconfdir}/${pkgname}/freeDiameter.conf.sample
+
+    # install daemon init related files
+    install -d -m 0755 ${D}${sysconfdir}/default
+    install -d -m 0755 ${D}${sysconfdir}/init.d
+    install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
+      ${D}${sysconfdir}/default/${BPN}
+    install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
+
+    # install for systemd
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
+}
+
+do_install_ptest() {
+    sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${pkgname}/#" ${D}${PTEST_PATH}/run-ptest
+    mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
+    rmdir ${D}${PTEST_PATH}-tests
+    install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
+}
+
+FILES_${PN}-dbg += "${libdir}/${pkgname}/.debug/*"
+
+# include the extensions in main package
+FILES_${PN} += "${libdir}/${pkgname}/*"
+
+RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
+RDEPENDS_${PN}-ptest = "cmake"
+
+INITSCRIPT_NAME = "${BPN}"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "freediameter.service"
+SYSTEMD_AUTO_ENABLE = "disable"
meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb new file +7 -0
new file mode 100644
index 0000000..3fb929a
@@ -0,0 +1,7 @@
+include freediameter.inc
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
#13 lore raw

PATCH 4/6 net-snmp: support openssl without 3des

In reply to Joe MacDonald

From: Jackie Huang <[email protected]>

net-snmp enables 3des support by default and fails to build with distro feature openssl-no-weak-ciphers:

| ../../net-snmp-5.7.3/snmplib/scapi.c:82:25: fatal error: openssl/des.h: No such file or directory | #include <openssl/des.h>

To fix the issue:
* add a patch to include des.h only if it's found in openssl
* disable des when openssl-no-weak-ciphers is enabled

---
 .../net-snmp/net-snmp-fix-for-disable-des.patch    | 32 ++++++++++++++++++++++
 .../recipes-protocols/net-snmp/net-snmp_5.7.3.bb   |  4 ++-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch new file +32 -0
new file mode 100644
index 0000000..25eb9c9
@@ -0,0 +1,32 @@
+From 270e952f58a7e5ddeabe5a15e3ddaaadf40017d0 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <[email protected]>
+Date: Thu, 22 Jun 2017 10:25:08 +0800
+Subject: [PATCH] net-snmp: fix for --disable-des
+
+Include des.h only if it's found in openssl so that
+the --disable-des works correctly.
+
+Upstream-Status: Submitted [[email protected]]
+
+Signed-off-by: Jackie Huang <[email protected]>
+---
+ snmplib/scapi.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/snmplib/scapi.c b/snmplib/scapi.c
+index 16ac829..271684b 100644
+--- a/snmplib/scapi.c
++++ b/snmplib/scapi.c
+@@ -79,7 +79,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support)
+ #include <openssl/hmac.h>
+ #include <openssl/evp.h>
+ #include <openssl/rand.h>
++#ifdef HAVE_OPENSSL_DES_H
+ #include <openssl/des.h>
++#endif
+ #ifdef HAVE_AES
+ #include <openssl/aes.h>
+ #endif
+-- 
+2.11.0
+
meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb +3 -1
index af6fd1b..849ae07 100644
@@ -31,6 +31,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
            file://0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \
            file://0004-configure-fix-incorrect-variable.patch \
            file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
+           file://net-snmp-fix-for-disable-des.patch \
            "
 SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee"
 SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e"
@@ -59,7 +60,8 @@ EXTRA_OECONF = "--enable-shared \
                 --with-defaults \
                 --with-install-prefix=${D} \
                 --with-persistent-directory=${localstatedir}/lib/net-snmp \
-                ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}"
+                ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
+"
 
 # net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp
 EXTRA_OECONF += "--with-mib-modules=smux"
Signature · 1 line
2.7.4
#14 lore raw

PATCH 5/6 stunnel: fix compile error when openssl disable des support

In reply to Joe MacDonald

From: Kai Kang <[email protected]>

When openssl disable des support with configure option 'no-des', it doesn't provide des related header file and functions. That causes stunnel compile failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related library conditionaly.

---
 .../stunnel/stunnel/fix-openssl-no-des.patch       | 54 ++++++++++++++++++++++
 .../recipes-support/stunnel/stunnel_5.35.bb        |  4 +-
 2 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch new file +54 -0
new file mode 100644
index 0000000..209b0dd
@@ -0,0 +1,54 @@
+Upstream-Status: Pending
+
+When openssl disable des support with configure option 'no-des', it doesn't
+provide des related header file and functions. That causes stunnel compile
+failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related
+library conditionaly.
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+diff --git a/src/common.h b/src/common.h
+index f7d38b0..bf485af 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -471,7 +471,9 @@ extern char *sys_errlist[];
+ #ifndef OPENSSL_NO_MD4
+ #include <openssl/md4.h>
+ #endif /* !defined(OPENSSL_NO_MD4) */
++#ifndef OPENSSL_NO_DES
+ #include <openssl/des.h>
++#endif
+ #ifndef OPENSSL_NO_DH
+ #include <openssl/dh.h>
+ #if OPENSSL_VERSION_NUMBER<0x10100000L
+diff --git a/src/protocol.c b/src/protocol.c
+index 587df09..8198eb6 100644
+--- a/src/protocol.c
++++ b/src/protocol.c
+@@ -66,7 +66,7 @@ NOEXPORT char *imap_server(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *nntp_client(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *connect_server(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *connect_client(CLI *, SERVICE_OPTIONS *, const PHASE);
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+ NOEXPORT void ntlm(CLI *, SERVICE_OPTIONS *);
+ NOEXPORT char *ntlm1();
+ NOEXPORT char *ntlm3(char *, char *, char *, char *);
+@@ -1175,7 +1175,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
+     fd_printf(c, c->remote_fd.fd, "Host: %s", opt->protocol_host);
+     if(opt->protocol_username && opt->protocol_password) {
+         if(!strcasecmp(opt->protocol_authentication, "ntlm")) {
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+             ntlm(c, opt);
+ #else
+             s_log(LOG_ERR, "NTLM authentication is not available");
+@@ -1216,7 +1216,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
+     return NULL;
+ }
+ 
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+ 
+ /*
+  * NTLM code is based on the following documentation:
meta-networking/recipes-support/stunnel/stunnel_5.35.bb +3 -1
index efe9d9e..ec8478d 100644
@@ -8,7 +8,9 @@ DEPENDS = "openssl zlib tcp-wrappers"
 
 RDEPENDS_${PN} += "perl"
 
-SRC_URI = "ftp://ftp.stunnel.org/stunnel/archive/5.x/${BP}.tar.gz"
+SRC_URI = "ftp://ftp.stunnel.org/stunnel/archive/5.x/${BP}.tar.gz \
+           file://fix-openssl-no-des.patch \
+"
 
 SRC_URI[md5sum] = "9079f5fafbccaf88b7d92b227d78249a"
 SRC_URI[sha256sum] = "ffa386ae4c825f35f35157c285e7402a6d58779ad8c3822f74a9d355b54aba1d"
Signature · 1 line
2.7.4
#15 lore raw

PATCH 6/6 bridge-utils: update to v1.6

In reply to Joe MacDonald

Updating to the latest version (1.6) and taking the opportunity to clean up the old patches, switch to the upstream git repo for SRC_URI and make the requested change to the older AR patch from a while back.

---
 .../recipes-support/bridge-utils/bridge-utils.inc  | 28 -------
 ...ld-error-out-correctly-if-a-submake-fails.patch | 69 -----------------
 ...idge-fix-some-build-time-warnings-fcntl.h.patch | 64 ----------------
 ...idge-fix-some-build-time-warnings-errno.h.patch | 46 ------------
 ...dd-missing-include-s-fix-build-against-mu.patch | 47 ------------
 ...uild-don-t-ignore-CFLAGS-from-environment.patch | 29 ++------
 ...ridge-Modifying-the-AR-to-cross-toolchain.patch | 51 +++++++++++++
 ...5-check-error-returns-from-write-to-sysfs.patch | 87 ----------------------
 ...5-fix-error-message-for-incorrect-command.patch | 33 --------
 ...utils-1.5-fix-incorrect-command-in-manual.patch | 33 --------
 .../bridge-utils/bridge-utils/kernel-headers.patch | 29 +++++---
 .../bridge-utils/bridge-utils_1.5.bb               | 16 ----
 .../bridge-utils/bridge-utils_1.6.bb               | 35 +++++++++
 13 files changed, 114 insertions(+), 453 deletions(-)
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils.inc
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
 delete mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
 create mode 100644 meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
meta-networking/recipes-support/bridge-utils/bridge-utils.inc deleted +0 -28
deleted file mode 100644
index 0fb18d5..0000000
@@ -1,28 +0,0 @@
-SUMMARY = "Tools for ethernet bridging"
-HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"
-SECTION = "net"
-LICENSE = "GPLv2"
-
-DEPENDS = "sysfsutils"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/bridge/bridge-utils-${PV}.tar.gz \
-          file://bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch \
-          file://bridge-utils-1.5-fix-error-message-for-incorrect-command.patch \
-          file://bridge-utils-1.5-fix-incorrect-command-in-manual.patch \
-"
-
-inherit autotools-brokensep update-alternatives
-
-ALTERNATIVE_${PN} = "brctl"
-ALTERNATIVE_PRIORITY[brctl] = "100"
-ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl"
-
-EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
-
-do_install_append () {
-    install -d ${D}/${datadir}/bridge-utils
-    install -d ${D}/${sysconfdir}/network/if-pre-up.d
-    install -d ${D}/${sysconfdir}/network/if-post-down.d
-}
-
-RRECOMMENDS_${PN} = "kernel-module-bridge"
meta-networking/recipes-support/bridge-utils/bridge-utils/0001-build-error-out-correctly-if-a-submake-fails.patch deleted +0 -69

69 lines not on this page · raw message

meta-networking/recipes-support/bridge-utils/bridge-utils/0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch deleted +0 -64

64 lines not on this page · raw message

meta-networking/recipes-support/bridge-utils/bridge-utils/0003-bridge-fix-some-build-time-warnings-errno.h.patch deleted +0 -46

46 lines not on this page · raw message

meta-networking/recipes-support/bridge-utils/bridge-utils/0004-libbridge-add-missing-include-s-fix-build-against-mu.patch deleted +0 -47

47 lines not on this page · raw message

meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch +8 -21
index 9f2155e..0a72c6b 100644
@@ -1,7 +1,7 @@
-From 7bc1932cabfafca8c68e18bd43e3d203c70d2dd8 Mon Sep 17 00:00:00 2001
-From: root <[email protected]>
-Date: Wed, 20 Jul 2016 23:40:33 +0100
-Subject: [PATCH 5/5] build: don't ignore CFLAGS from environment
+From 9d63838d12c772dfe33371e2bb8b8191625539f2 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <[email protected]>
+Date: Mon, 30 Oct 2017 13:37:48 -0400
+Subject: [PATCH] build: don't ignore CFLAGS from environment
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
@@ -17,10 +17,10 @@ used during compilation must also always be used during linking!
 Upstream-Status: Pending
 
 Signed-off-by: André Draszik <[email protected]>
+Signed-off-by: Joe MacDonald <[email protected]>
 ---
- brctl/Makefile.in     | 2 +-
- libbridge/Makefile.in | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ brctl/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/brctl/Makefile.in b/brctl/Makefile.in
 index e1956d6..eff260c 100644
@@ -35,19 +35,6 @@ index e1956d6..eff260c 100644
  
  %.o: %.c brctl.h
  	$(CC) $(CFLAGS) $(INCLUDE) -c $< 
-diff --git a/libbridge/Makefile.in b/libbridge/Makefile.in
-index 20512c4..4e1cddc 100644
---- a/libbridge/Makefile.in
-+++ b/libbridge/Makefile.in
-@@ -5,7 +5,7 @@ AR=ar
- RANLIB=@RANLIB@
- 
- CC=@CC@
--CFLAGS = -Wall -g $(KERNEL_HEADERS)
-+CFLAGS = -Wall -g $(KERNEL_HEADERS) @CFLAGS@
- 
- prefix=@prefix@
- exec_prefix=@exec_prefix@
 -- 
-2.8.1
+2.7.4
 
meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch new file +51 -0

51 lines not on this page · raw message

meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch deleted +0 -87

87 lines not on this page · raw message

meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch deleted +0 -33
deleted file mode 100644
index 2d0494e..0000000
@@ -1,33 +0,0 @@
-Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
-
-Signed-off-by: Roy.Li <[email protected]>
-
-From c7ed0996ef58b497d3d30be802ab5ae6c37099b5 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <[email protected]>
-Date: Tue, 3 May 2011 09:49:57 -0700
-Subject: [PATCH 2/3] Fix error message for incorrect command
-
-Debian bug 406907
-Error message was refering to incorrect command argument.
-
-Signed-off-by: Petr Sabata <[email protected]>
----
- brctl/brctl.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/brctl/brctl.c b/brctl/brctl.c
-index 454b8dd..46ca352 100644
---- a/brctl/brctl.c
-+++ b/brctl/brctl.c
-@@ -69,7 +69,7 @@ int main(int argc, char *const* argv)
- 	argc -= optind;
- 	argv += optind;
- 	if ((cmd = command_lookup(*argv)) == NULL) {
--		fprintf(stderr, "never heard of command [%s]\n", argv[1]);
-+		fprintf(stderr, "never heard of command [%s]\n", *argv);
- 		goto help;
- 	}
- 	
--- 
-1.7.5.2
-
meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch deleted +0 -33
deleted file mode 100644
index 6f6d6d4..0000000
@@ -1,33 +0,0 @@
-Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-incorrect-command-in-manual.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
-
-Signed-off-by: Roy.Li <[email protected]>
-
-From 8ef7b77562b636efcbd8b759eb324d6c069200f2 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <[email protected]>
-Date: Tue, 3 May 2011 09:48:40 -0700
-Subject: [PATCH 1/3] Fix incorrect command in manual
-
-Command is "setageing" not "setageingtime"; fix man page.
-Debian bug report.
-
-Signed-off-by: Petr Sabata <[email protected]>
----
- doc/brctl.8 |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/doc/brctl.8 b/doc/brctl.8
-index d904047..771f323 100644
---- a/doc/brctl.8
-+++ b/doc/brctl.8
-@@ -89,7 +89,7 @@ data. Machines can move to other ports, network cards can be replaced
- .B brctl showmacs <brname>
- shows a list of learned MAC addresses for this bridge.
- 
--.B brctl setageingtime <brname> <time>
-+.B brctl setageing <brname> <time>
- sets the ethernet (MAC) address ageing time, in seconds. After <time>
- seconds of not having seen a frame coming from a certain address, the
- bridge will time out (delete) that address from the Forwarding
--- 
-1.7.5.2
-
meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch +20 -9
index de36f05..8a23a30 100644
@@ -1,22 +1,33 @@
-include missing kernel header
+From 824f838cc9c7b8a44174358446993d61be7bbb3f Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <[email protected]>
+Date: Mon, 30 Oct 2017 13:18:20 -0400
+Subject: [PATCH] include missing kernel header
 
 Fixes errors like
 
 | /b/kraj/jlinux-next/poky/build/tmp-eglibc/sysroots/re-64b/usr/include/linux/if_bridge.h:172:20: error: field 'ip6' has incomplete type
 | In file included from ../libbridge/libbridge.h:24:0,
 
-Signed-off-by: Khem Raj <[email protected]>
 Upstream-Status: Pending
 
-Index: bridge-utils-1.5/libbridge/libbridge.h
-===================================================================
---- bridge-utils-1.5.orig/libbridge/libbridge.h	2011-03-28 17:52:54.000000000 -0700
-+++ bridge-utils-1.5/libbridge/libbridge.h	2013-03-04 21:16:25.781188309 -0800
-@@ -20,6 +20,7 @@
- #define _LIBBRIDGE_H
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Joe MacDonald <[email protected]>
+---
+ libbridge/libbridge.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h
+index c038b92..fd09306 100644
+--- a/libbridge/libbridge.h
++++ b/libbridge/libbridge.h
+@@ -24,6 +24,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
  
- #include <sys/socket.h>
 +#include <linux/in6.h>
  #include <linux/if.h>
  #include <linux/if_bridge.h>
  
+-- 
+2.7.4
+
meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb deleted +0 -16
deleted file mode 100644
index 6032ab0..0000000
@@ -1,16 +0,0 @@
-require bridge-utils.inc
-
-SRC_URI += "\
-    file://kernel-headers.patch \
-    file://0001-build-error-out-correctly-if-a-submake-fails.patch \
-    file://0002-libbridge-fix-some-build-time-warnings-fcntl.h.patch \
-    file://0003-bridge-fix-some-build-time-warnings-errno.h.patch \
-    file://0004-libbridge-add-missing-include-s-fix-build-against-mu.patch \
-    file://0005-build-don-t-ignore-CFLAGS-from-environment.patch \
-"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37"
-
-SRC_URI[md5sum] = "ec7b381160b340648dede58c31bb2238"
-SRC_URI[sha256sum] = "42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688"
-
meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb new file +35 -0
new file mode 100644
index 0000000..1c87c48
@@ -0,0 +1,35 @@
+SUMMARY = "Tools for ethernet bridging"
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"
+SECTION = "net"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37"
+
+SRCREV = "42c1aefc303fdf891fbb099ea51f00dca83ab606"
+
+SRC_URI = "\
+    git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/bridge-utils.git \
+    file://kernel-headers.patch \
+    file://0005-build-don-t-ignore-CFLAGS-from-environment.patch \
+    file://0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch \
+"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "sysfsutils"
+
+inherit autotools-brokensep update-alternatives
+
+ALTERNATIVE_${PN} = "brctl"
+ALTERNATIVE_PRIORITY[brctl] = "100"
+ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl"
+
+EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
+
+do_install_append () {
+    install -d ${D}/${datadir}/bridge-utils
+    install -d ${D}/${sysconfdir}/network/if-pre-up.d
+    install -d ${D}/${sysconfdir}/network/if-post-down.d
+}
+
+RRECOMMENDS_${PN} = "kernel-module-bridge"
Signature · 1 line
2.7.4