From 98cb3b26f4043c9a83029c21855ff61b7601e611 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 24 Oct 2012 14:48:04 +0400 Subject: Initial commit from cibs/examples --- openpgm/Makefile | 26 +++++++++ openpgm/libpgm.p5m | 68 +++++++++++++++++++++ openpgm/patches/000_ifr_netmask.patch | 15 +++++ openpgm/patches/010_ifa_flags.patch | 107 ++++++++++++++++++++++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 openpgm/Makefile create mode 100644 openpgm/libpgm.p5m create mode 100644 openpgm/patches/000_ifr_netmask.patch create mode 100644 openpgm/patches/010_ifa_flags.patch (limited to 'openpgm') diff --git a/openpgm/Makefile b/openpgm/Makefile new file mode 100644 index 0000000..534f229 --- /dev/null +++ b/openpgm/Makefile @@ -0,0 +1,26 @@ +include /usr/share/cibs/rules/ips.mk +include /usr/share/cibs/rules/archive.mk +include /usr/share/cibs/rules/patch.mk +include /usr/share/cibs/rules/autoreconf.mk +include /usr/share/cibs/rules/autotools.mk +include /usr/share/cibs/rules/32.mk +include /usr/share/cibs/rules/64.mk + +configure := $(sourcedir)/openpgm/pgm/configure + +summary := open source implementation of the Pragmatic General Multicast (PGM) specification in RFC 3208 +license := LGPL +license-file := openpgm/pgm/COPYING + +# build-conflicts += + +home := https://code.google.com/p/openpgm/ +name := libpgm +version := 5.1.118 +archive := $(name)-$(version).tar.bz2 +download := https://openpgm.googlecode.com/files/$(archive) +checksum := \ + md5:f561caa7902220eff4d1e2004ba5eedc \ + sha1:76888874a938c26870096105249990c5fdfa9ec2 \ + sha256:7806ab830e3993db77590877fa8133037a86fb6f22e99418a5c7075d93d3aa8b \ + size:857603 diff --git a/openpgm/libpgm.p5m b/openpgm/libpgm.p5m new file mode 100644 index 0000000..573ec84 --- /dev/null +++ b/openpgm/libpgm.p5m @@ -0,0 +1,68 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license +# at http://www.opensource.org/licenses/CDDL-1.0 +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each file. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved. +# + + +set name=pkg.fmri value=pkg:/library/libpgm@$(ips-version) +set name=pkg.summary value="$(summary)" +set name=info.upstream-url value="$(home)" +set name=info.source_url value="$(download)" +license $(license-file) license="$(license)" + +dir path=usr +dir path=usr/lib +dir path=usr/lib/$(MACH64) +dir path=usr/lib/$(MACH64)/pkgconfig +dir path=usr/lib/pkgconfig +dir path=usr/include +dir path=usr/include/pgm-5.1 +dir path=usr/include/pgm-5.1/pgm +file path=usr/lib/$(MACH64)/libpgm-5.1.so.0.0.118 +file path=usr/lib/$(MACH64)/pkgconfig/openpgm-5.1.pc +file path=usr/lib/libpgm-5.1.so.0.0.118 +file path=usr/lib/pkgconfig/openpgm-5.1.pc +file path=usr/include/pgm-5.1/pgm/msgv.h +file path=usr/include/pgm-5.1/pgm/time.h +file path=usr/include/pgm-5.1/pgm/skbuff.h +file path=usr/include/pgm-5.1/pgm/messages.h +file path=usr/include/pgm-5.1/pgm/macros.h +file path=usr/include/pgm-5.1/pgm/zinttypes.h +file path=usr/include/pgm-5.1/pgm/winint.h +file path=usr/include/pgm-5.1/pgm/packet.h +file path=usr/include/pgm-5.1/pgm/list.h +file path=usr/include/pgm-5.1/pgm/atomic.h +file path=usr/include/pgm-5.1/pgm/pgm.h +file path=usr/include/pgm-5.1/pgm/engine.h +file path=usr/include/pgm-5.1/pgm/in.h +file path=usr/include/pgm-5.1/pgm/tsi.h +file path=usr/include/pgm-5.1/pgm/error.h +file path=usr/include/pgm-5.1/pgm/version.h +file path=usr/include/pgm-5.1/pgm/wininttypes.h +file path=usr/include/pgm-5.1/pgm/types.h +file path=usr/include/pgm-5.1/pgm/socket.h +file path=usr/include/pgm-5.1/pgm/gsi.h +file path=usr/include/pgm-5.1/pgm/mem.h +file path=usr/include/pgm-5.1/pgm/if.h +link path=usr/lib/libpgm-5.1.so.0 target=libpgm-5.1.so.0.0.118 +link path=usr/lib/$(MACH64)/libpgm-5.1.so.0 target=libpgm-5.1.so.0.0.118 +link path=usr/lib/$(MACH64)/libpgm.so target=libpgm-5.1.so.0.0.118 +link path=usr/lib/libpgm.so target=libpgm-5.1.so.0.0.118 diff --git a/openpgm/patches/000_ifr_netmask.patch b/openpgm/patches/000_ifr_netmask.patch new file mode 100644 index 0000000..20fc94e --- /dev/null +++ b/openpgm/patches/000_ifr_netmask.patch @@ -0,0 +1,15 @@ +Index: libpgm-5.1.118-1~dfsg/openpgm/pgm/configure.ac +=================================================================== +--- libpgm-5.1.118-1~dfsg.orig/openpgm/pgm/configure.ac 2011-09-27 17:59:08.000000000 +0000 ++++ libpgm-5.1.118-1~dfsg/openpgm/pgm/configure.ac 2012-06-06 20:21:04.407905323 +0000 +@@ -184,8 +184,8 @@ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + #include ]], +- [[struct ifaddrs ifa; +-ifa.ifa_netmask = (struct sockaddr*)0;]])], ++ [[struct ifreq ifr; ++ifr.ifr_netmask = (struct sockaddr*)0;]])], + [AC_MSG_RESULT([yes]) + CFLAGS="$CFLAGS -DCONFIG_HAVE_IFR_NETMASK"], + [AC_MSG_RESULT([no])]) diff --git a/openpgm/patches/010_ifa_flags.patch b/openpgm/patches/010_ifa_flags.patch new file mode 100644 index 0000000..f362703 --- /dev/null +++ b/openpgm/patches/010_ifa_flags.patch @@ -0,0 +1,107 @@ +Descriptions: on illumos ifa_flags is uint64_t +Bug: http://code.google.com/p/openpgm/issues/detail?id=25 + +diff -dubr libpgm-5.1.118/openpgm/pgm/getifaddrs.c libpgm-5.1.118.flags/openpgm/pgm/getifaddrs.c +--- libpgm-5.1.118/openpgm/pgm/getifaddrs.c 2011-09-27 21:59:08.000000000 +0400 ++++ libpgm-5.1.118.flags/openpgm/pgm/getifaddrs.c 2012-09-24 05:25:16.404925472 +0400 +@@ -813,6 +813,68 @@ + return TRUE; + } + #endif /* _WIN32 */ ++#if defined( HAVE_GETIFADDRS ) ++static ++bool ++_pgm_getifaddrs ( ++ struct pgm_ifaddrs_t** restrict ifap, ++ pgm_error_t** restrict error ++ ) ++{ ++ struct ifaddrs *_ifap, *_ifa; ++ const int e = getifaddrs (&_ifap); ++ if (-1 == e) { ++ char errbuf[1024]; ++ pgm_set_error (error, ++ PGM_ERROR_DOMAIN_IF, ++ pgm_error_from_errno (errno), ++ _("getifaddrs failed: %s"), ++ pgm_strerror_s (errbuf, sizeof (errbuf), errno)); ++ return FALSE; ++ } ++ ++ int n = 0, k = 0; ++ for (_ifa = _ifap; _ifa; _ifa = _ifa->ifa_next) ++ ++n; ++ ++ struct _pgm_ifaddrs_t* ifa = pgm_new0 (struct _pgm_ifaddrs_t, n); ++ struct _pgm_ifaddrs_t* ift = ifa; ++ for (_ifa = _ifap; _ifa; _ifa = _ifa->ifa_next) ++ { ++/* ensure IP adapter */ ++ if (NULL == _ifa->ifa_addr || ++ (_ifa->ifa_addr->sa_family != AF_INET && ++ _ifa->ifa_addr->sa_family != AF_INET6) ) ++ { ++ continue; ++ } ++ ++/* address */ ++ ift->_ifa.ifa_addr = (void*)&ift->_addr; ++ memcpy (ift->_ifa.ifa_addr, _ifa->ifa_addr, pgm_sockaddr_len (_ifa->ifa_addr)); ++ ++/* name */ ++ ift->_ifa.ifa_name = ift->_name; ++ pgm_strncpy_s (ift->_ifa.ifa_name, IF_NAMESIZE, _ifa->ifa_name, _TRUNCATE); ++ ++/* flags */ ++ ift->_ifa.ifa_flags = _ifa->ifa_flags; ++ ++/* netmask */ ++ ift->_ifa.ifa_netmask = (void*)&ift->_netmask; ++ memcpy (ift->_ifa.ifa_netmask, _ifa->ifa_netmask, pgm_sockaddr_len (_ifa->ifa_netmask)); ++ ++/* next */ ++ if (k++ < (n - 1)) { ++ ift->_ifa.ifa_next = (struct pgm_ifaddrs_t*)(ift + 1); ++ ift = (struct _pgm_ifaddrs_t*)(ift->_ifa.ifa_next); ++ } ++ } ++ freeifaddrs (_ifap); ++ *ifap = (struct pgm_ifaddrs_t*)ifa; ++ return TRUE; ++} ++#endif /* HAVE_GETIFADDRS */ + + /* returns TRUE on success setting ifap to a linked list of system interfaces, + * returns FALSE on failure and sets error appropriately. +@@ -830,17 +892,7 @@ + (void*)ifap, (void*)error); + + #ifdef CONFIG_HAVE_GETIFADDRS +- const int e = getifaddrs ((struct ifaddrs**)ifap); +- if (-1 == e) { +- char errbuf[1024]; +- pgm_set_error (error, +- PGM_ERROR_DOMAIN_IF, +- pgm_error_from_errno (errno), +- _("getifaddrs failed: %s"), +- pgm_strerror_s (errbuf, sizeof (errbuf), errno)); +- return FALSE; +- } +- return TRUE; ++ return _pgm_getifaddrs (ifap, error); + #elif defined(CONFIG_TARGET_WINE) + return _pgm_getadaptersinfo (ifap, error); + #elif defined(_WIN32) +@@ -861,11 +913,7 @@ + { + pgm_return_if_fail (NULL != ifa); + +-#ifdef CONFIG_HAVE_GETIFADDRS +- freeifaddrs ((struct ifaddrs*)ifa); +-#else + pgm_free (ifa); +-#endif + } + + /* eof */ +Только в libpgm-5.1.118.flags/openpgm/pgm: getifaddrs.c.orig -- cgit v1.2.3