svn commit: r216900 - in projects/ofed/base/contrib/ofed/libsdp: .
config src src/linux
Jeff Roberson
jeff at FreeBSD.org
Mon Jan 3 01:44:14 UTC 2011
Author: jeff
Date: Mon Jan 3 01:44:13 2011
New Revision: 216900
URL: http://svn.freebsd.org/changeset/base/216900
Log:
- Import libsdp
Sponsored by: Isilon Systems, iX Systems, and Panasas.
Added:
projects/ofed/base/contrib/ofed/libsdp/
projects/ofed/base/contrib/ofed/libsdp/COPYING
projects/ofed/base/contrib/ofed/libsdp/ChangeLog
projects/ofed/base/contrib/ofed/libsdp/Makefile.am
projects/ofed/base/contrib/ofed/libsdp/NEWS
projects/ofed/base/contrib/ofed/libsdp/README
projects/ofed/base/contrib/ofed/libsdp/autogen.sh (contents, props changed)
projects/ofed/base/contrib/ofed/libsdp/changelog_from_git.sh (contents, props changed)
projects/ofed/base/contrib/ofed/libsdp/config/
projects/ofed/base/contrib/ofed/libsdp/config/libsdp_indent (contents, props changed)
projects/ofed/base/contrib/ofed/libsdp/configure.in
projects/ofed/base/contrib/ofed/libsdp/libsdp.conf
projects/ofed/base/contrib/ofed/libsdp/libsdp.spec.in
projects/ofed/base/contrib/ofed/libsdp/src/
projects/ofed/base/contrib/ofed/libsdp/src/Makefile.am
projects/ofed/base/contrib/ofed/libsdp/src/config_parser.c
projects/ofed/base/contrib/ofed/libsdp/src/config_parser.h
projects/ofed/base/contrib/ofed/libsdp/src/config_parser.y
projects/ofed/base/contrib/ofed/libsdp/src/config_scanner.c
projects/ofed/base/contrib/ofed/libsdp/src/config_scanner.l
projects/ofed/base/contrib/ofed/libsdp/src/libsdp.h
projects/ofed/base/contrib/ofed/libsdp/src/linux/
projects/ofed/base/contrib/ofed/libsdp/src/linux/sdp_inet.h
projects/ofed/base/contrib/ofed/libsdp/src/log.c
projects/ofed/base/contrib/ofed/libsdp/src/match.c
projects/ofed/base/contrib/ofed/libsdp/src/port.c
projects/ofed/base/contrib/ofed/libsdp/src/socket.c
Added: projects/ofed/base/contrib/ofed/libsdp/COPYING
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/COPYING Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,36 @@
+This software is available to you under a choice of one of two
+licenses. You may choose to be licensed under the terms of the GNU
+General Public License (GPL) Version 2, available at
+<http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
+license, included below.
+
+Copyright (c) 2004 Topspin Communications. All rights reserved.
+Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
+
+
+OpenIB.org BSD license:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
Added: projects/ofed/base/contrib/ofed/libsdp/ChangeLog
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/ChangeLog Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,96 @@
+2010-12-26 18:14:02 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 9c2ad15 libsdp: full ipv6 support
+
+2010-11-29 11:43:51 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 0a3d5c3 libsdp: BUG2130 - libsdp.so is not installed + version
+ 1.1.106
+2010-11-08 14:41:27 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 7a1880f libsdp: updated version to 1.1.105
+
+2010-11-08 14:31:13 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * c6efc06 libsdp: fix security issues with log file
+
+2010-11-02 15:28:06 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 09343d1 libsdp: fix bad permissions
+
+2010-10-28 13:46:39 +0200 root <root at swv300.lab.mtl.com>
+ * 46d845d libsdp: fixed indentation
+
+2010-10-04 11:49:46 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 59b6a36 libsdp: updated version to 1.1.104
+
+2010-10-04 11:22:23 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 21b63e0 libsdp: fix libsdp.so permissions
+
+2010-10-04 11:20:49 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 3180e25 libsdp: fix "make dist"
+
+2010-09-13 10:31:52 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * df744a5 libsdp: updated version to 1.1.103
+
+2010-09-13 10:45:40 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * e3ce469 libsdp: don't make libsdp depend on sdp_socket.h from ib-kernel
+
+2010-08-03 15:35:11 +0300 Amir Vadai <amirv at mellanox.co.il>
+ * c5ff8e2 libsdp: updated version to 1.1.102
+
+2010-08-03 15:33:57 +0300 Amir Vadai <amirv at mellanox.co.il>
+ * 82fe3f9 libsdp: search openib headers according to 'prefix'
+
+2010-04-11 11:38:47 +0300 Amir Vadai <amirv at mellanox.co.il>
+ * 76060c5 libsdp: changed version to 1.1.101
+
+2010-04-08 09:33:29 +0300 Eldad Zinger <eldadz at mellanox.co.il>
+ * 8bf57aa libsdp: added differentiation between bind failures of sdp.
+
+2010-03-23 10:13:45 +0200 Eldad Zinger <eldadz at mellanox.co.il>
+ * 93706ed sdp: BUG1984 - fix for bad memory access.
+
+2010-04-08 15:40:55 +0300 Amir Vadai <amirv at mellanox.co.il>
+ * dadef4b libsdp: add path to openib include's
+
+2010-02-18 11:04:29 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 920ea31 libsdp: changed version to 1.1.100
+
+2010-02-18 11:02:20 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 0fe8a11 libsdp: updated changelog from git + script to get change log
+
+2010-02-18 10:49:42 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * a298098 libsdp: Fix memory leak. free libsdp_fd_attributes
+
+2010-02-18 10:49:00 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * cf4ceab libsdp: make libsdp.so have gid bit on
+
+2008-11-26 13:44:26 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * b1eaecb libsdp: Enable building libsdp on Solaris
+
+2008-11-23 Amir Vadai <amirv at mellanox.co.il>
+ * BUG1405 - conflict when running an application that use yacc.
+
+2008-12-08 18:29:09 +0200 Yossi Etigin <yossi.openib at gmail.com>
+ * dcfca98 libsdp: BUG1256 - Add epoll support
+
+2008-11-23 16:09:21 +0200 Amir Vadai <amirv at mellanox.co.il>
+ * 02404fb libsdp: BUG1405 - conflict when running an application that use yacc.
+
+2008-09-02 15:13:22 +0300 Yossi Etigin <[yossi.openib at gmail.com]>
+ * 64adc0e libsdp: enable fallback to TCP for nonblocking sockets
+
+2008-08-21 10:52:19 +0300 Yossi Etigin <[yossi.openib at gmail.com]>
+ * cee8053 libsdp: write fcntl argument in debug prints
+
+2008-07-21 22:01:21 +0300 Amir Vadai <amirv at mellanox.co.il>
+ * 81d6ec3 removed not unnecessary use of va_copy.
+
+2008-06-12 14:13:07 +0300 Amir Vadai <amirv at mellanox.co.il>
+ * 90f25b7 Fixed compilation error on Fedora Release 9
+
+2006-05-29 Eitan Zahavi <eitan at mellanox.co.il>
+
+ * Support IPv4 embedded in IPv6 addresses. Since SDP currently does
+ not support IPv6 we need to convert to IPv4 and back on queries.
+
+ * port.c - cleanup abnd re-written for clearer flow. Added verbose
+ messages.
+
+ * Major re-write of the parser to support new syntax and using BNF
Added: projects/ofed/base/contrib/ofed/libsdp/Makefile.am
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/Makefile.am Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,23 @@
+SUBDIRS = src
+
+EXTRA_DIST = libsdp.spec.in libsdp.conf
+
+dist-hook: libsdp.spec
+ cp libsdp.spec $(distdir)
+
+install-data-hook:
+ if test -e $(DESTDIR)$(sysconfdir)/libsdp.conf; then \
+ diff -q $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf 1> /dev/null; \
+ if test $$? == 1; then \
+ t=$(shell date +'%Y%m%d%H%M%S'); \
+ cp -p $(srcdir)/libsdp.conf \
+ $(DESTDIR)$(sysconfdir)/libsdp.conf.$$t; \
+ echo "NOTE: existing libsdp.conf was not updated."; \
+ echo " libsdp.conf installed as ibsdp.conf.$$t instead."; \
+ fi; \
+ else \
+ if test ! -d $(DESTDIR)$(sysconfdir); then \
+ mkdir -p $(DESTDIR)$(sysconfdir); \
+ fi; \
+ cp -p $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf; \
+ fi
Added: projects/ofed/base/contrib/ofed/libsdp/NEWS
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/NEWS Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,4 @@
+0.9.0 - Initial release.
+1.0.0 - Following RFC for enhanced configuration semantics, strong parsing,
+ major cleanup, verbosity logging and thread safe code
+
\ No newline at end of file
Added: projects/ofed/base/contrib/ofed/libsdp/README
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/README Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,68 @@
+LIBSDP - A User Level Socket Switch for Seemless Migration to SDP
+-----------------------------------------------------------------
+
+OVERVIEW:
+---------
+libsdp is a LD_PRELOAD-able library that can be used to migrate existing
+applications use InfiniBand Sockets Direct Protocol (SDP) instead of
+TCP sockets, transparently and without recompilations. To setup libsdp
+please follow the instructions below.
+
+SETUP:
+------
+libsdp.so isn't setup automatically. it can be used in one of 2 ways:
+1) LD_PRELOAD environment variable. Setting this to the name of the
+ library you want to use will cause it to be preloaded.
+2) Adding the name of the library into /etc/ld.so.preload. This will
+ cause the library to be preloaded for every executable that is linked
+ with libc.
+
+The library should be installed in a directory in which the dynamic loader
+searches for shared libraries (as specified by LD_LIBRARY_PATH,
+/etc/ld.so.conf, etc). Alternatively, you can specify the full path to the
+library that you want to use in LD_PRELOAD or /etc/ld.so.preload as described
+above.
+
+The last option cant be used if you have multiple library versions
+(e.g. 64/32 bit) and want the linker to select between them automatically.
+The best way to handle such case is to use LD_LIBRARY_PATH to point to both the
+lib (the 32 bit version) and lib64 directories and LD_RELOAD the libsdp.so.
+This way the correct 32/64bit libsdp.so will be selected.
+For example running ssh over SDP with OFED distribution from bash this can be written:
+LD_LIBRARY_PATH=/usr/local/ofed/lib64:/usr/local/ofed/lib LD_PRELOAD=libsdp.so ssh
+
+CONFIGURATION:
+--------------
+libsdp supports two modes of configuration:
+* simple operation where it converts all calls to socket(2) with a family
+ of AF_INET(6) and a type of SOCK_STREAM into family of AF_INET_SDP.
+* selective mode where it uses a configuration file to select which sockets
+ will be using SDP and which will not.
+
+For real world applications where communication with X, authentication,
+DNS and other servers connected through TCP is required the selective mode
+is required.
+
+Simple mode will be selected in one of the following conditions:
+* the environment variable SIMPLE_LIBSDP to a non-empty value
+* no configuration file is defined or is un-readble
+* the configuration file does not include any address family rule
+
+For information on how to configure libsdp, see libsdp.conf, which is installed
+in $(sysconfdir) (usually /usr/local/etc or /etc). The user can further control
+the file to be used for configuration by setting the environment variable:
+LIBSDP_CONFIG_FILE
+
+LIMITATIONS:
+------------
+1. Applications statically linked with libc will not allow dynamic pre-loading
+ to port these applications to use SDP one needs to replace specific socket
+ calls (within the application) with AF_INET_SDP and recompile.
+2. If for some reason the dynamic linker fail to pre-load libc before the
+ libsdp.so is initialized or it does not support RTDL_NEXT, libsdp will
+ fail to find the libc socket API. To overcome this situation a simple
+ implementation of hijacking "socket" call is provided in libsdp_sys.
+ This partial implementation does not support any configuration and is
+ limited to i386 architecture.
+3. Non-blocking connect in "both" mode defaults to SDP. Specific rules might be
+ needed for applications to operate properly.
Added: projects/ofed/base/contrib/ofed/libsdp/autogen.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/autogen.sh Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -x
+aclocal -I config
+libtoolize --force --copy
+autoheader
+automake --foreign --add-missing --copy
+autoconf
Added: projects/ofed/base/contrib/ofed/libsdp/changelog_from_git.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/changelog_from_git.sh Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+git log --pretty=format:"%ai %an <%ae>%n * %h %s%n"
Added: projects/ofed/base/contrib/ofed/libsdp/config/libsdp_indent
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/config/libsdp_indent Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,71 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 Mellanox Technologies LTD. All rights reserved.
+#
+# This software is available to you under a choice of one of two
+# licenses. You may choose to be licensed under the terms of the GNU
+# General Public License (GPL) Version 2, available from the file
+# COPYING in the main directory of this source tree, or the
+# OpenIB.org BSD license below:
+#
+# Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+#
+# - Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the following
+# disclaimer.
+#
+# - Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# $Id: osm_indent 4707 2006-01-03 16:18:08Z halr $
+#
+#########################################################################
+#
+# Abstract:
+# Indent script for enforcing source code formatting.
+#
+# This is the indent format used for libsdp:
+#
+# -bad Blank line after declarations
+# -bap Blank line after Procedures
+# -nbbb NO Blank line before block comments
+# -nbbo NO Break after Boolean operator
+# -bl Break after if line
+# -bli0 Indent for braces is 0
+# -bls Break after struct declarations
+# -cbi0 Case break indent 0
+# -ci3 Continue indent 3 spaces
+# -cli0 Case label indent 0 spaces
+# -ncs No space after cast operator
+# -hnl Honor existing newlines on long lines
+# -i3 Substitute indent with 3 spaces
+# -npcs No space after procedure calls
+# -prs Space after parenthesis
+# -nsai No space after if keyword - removed
+# -nsaw No space after while keyword - removed
+# -sc Put * at left of comments in a block comment style
+# -nsob Don't swallow unnecessary blank lines
+# -ts3 Tab size is 3
+# -psl Type of procedure return in a separate line
+# -bfda Function declaration arguments in a separate line.
+# -ut No tabs as we allow spaces
+# -br Put braces on line with if, etc
+# -ce Cuddle else and preceeding }
+#
+#########################################################################
+
+eval indent -bad -bap -nbbb -nbbo -bl -bli0 -bls -cbi0 -ci3 -cli0 -ncs \
+ -hnl -i3 -npcs -prs -sc -nsob -ts3 -psl -bfda -ut -br -ce $*
Added: projects/ofed/base/contrib/ofed/libsdp/configure.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/configure.in Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,59 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+
+AC_PREREQ(2.57)
+AC_INIT(libsdp, 1.1.108, openib-general at openib.org)
+AC_CONFIG_SRCDIR([src/port.c])
+AC_CONFIG_AUX_DIR(config)
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(libsdp, 1.1.108)
+
+AC_CANONICAL_HOST
+AM_MAINTAINER_MODE
+
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_LEX
+AC_PROG_YACC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdlib.h string.h sys/socket.h syslog.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+
+# Checks for library functions.
+AC_REPLACE_FNMATCH
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MALLOC
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([dup2 memset socket strcasecmp strchr strdup strpbrk strrchr strtoul])
+
+# check OS
+case "${host}" in
+i[[3456]]86-*-linux*) AC_DEFINE(LINUX_BUILD, 1, [OS is linux]) ac_cv_linux_build="yes" ;;
+sparc*-sun-solaris*) AC_DEFINE(SOLARIS_BUILD, 1, [OS is sparc solaris]) ac_cv_solaris_build="yes";;
+esac
+
+AM_CONDITIONAL(LINUX_BUILD, test "$ac_cv_linux_build" = "yes")
+AM_CONDITIONAL(SOLARIS_BUILD, test "$ac_cv_solaris_build" = "yes")
+
+# Check if we should build libsdp_sys
+AC_CACHE_CHECK(whether to build i386-specific libsdp_sys, ac_cv_libsdp_sys,
+ AC_TRY_COMPILE(,[
+ #if !i386
+ #error Not i386
+ #endif
+ ], ac_cv_libsdp_sys="yes", ac_cv_libsdp_sys="no"))
+
+AM_CONDITIONAL(WANT_LIBSDP_SYS, test "$ac_cv_libsdp_sys" = "yes")
+
+AC_CONFIG_FILES([Makefile src/Makefile libsdp.spec])
+AC_OUTPUT
Added: projects/ofed/base/contrib/ofed/libsdp/libsdp.conf
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/libsdp.conf Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,139 @@
+# libsdp.conf - configuration file for libsdp
+#
+# $Id$
+#
+# Comments are starts with # and cause the entire line after it to be ignored.
+# Any beginning whitespace is skipped. Any line that is empty is also skipped.
+#
+# There are 2 main types of statements supported by this configuration file:
+# - "use" - which defines the address family to be used for the sockets that
+# match the line
+# - "log" - for setting logging related configuration. As the log settings
+# takes immidiate effect we define these at the beggining of the file.
+#
+##############################################################################
+# DEAFUALT SETTINGS:
+# Please do not forget to comment if you want to change these.
+# (the rest of this file explains the syntax and give examples)
+#
+# Get errors printed into the files /tmp/libsdp.log.<uid>/log
+# or /var/log/<path> for root
+log min-level 9 destination file libsdp.log
+#
+# By default we let all servers and client try SDP first.
+# to exclude SDP add "use tcp" rules before these defaults.
+use both server * *:*
+use both client * *:*
+#
+#
+##############################################################################
+#
+# LOG CONFIGURATION:
+# ------------------
+# The log directive allows the user to specify which and where debug and error
+# messages get sent. The log statement format is:
+# log [destination stderr|syslog|file <path>] [min-level <1-9>]
+#
+# destination - defines the destination of the log messages:
+# stderr - messages will be forwarded to the stderr
+# syslog - messages sent to the syslog service
+# file <path> - messages will be written to the file /var/log/<path> for root.
+# for regular user, if full path is requsted <path>.<uid>/log
+# or /tmp/<path>.<uid>/log if no path is requested
+# Due to security reasons, <path> must not be:
+# 1. a soft link
+# 2. owned by other user.
+# 3. Other permissions except User permissions.
+#
+# min-level - defines the verbosity of the log:
+# 9 - only errors are printed
+# 8 - warnings
+# 7 - connect and listen summary (useful for tracking SDP usage)
+# 4 - positive match summary (useful for config file debug)
+# 3 - negative match summary (useful for config file debug)
+# 2 - function calls and return values
+# 1 - debug messages
+#
+# Examples:
+#
+# Get SDP usage per connect and listen into stderr
+# log min-level 7 destination stderr
+#
+# Send errors only into syslog
+# log min-level 9 destination syslog
+#
+##############################################################################
+#
+# SOCKET ADDRESS FAMILY CONTROL:
+# ------------------------------
+# The socket control statements allows the user to specify when libsdp will
+# replace AF_INET/SOCK_STREAM sockets with AF_SDP/SOCK_STREAM
+# sockets. Each control statement specifies a matching rule that all its
+# subexpressions must evaluate as true (logical and) to apply.
+#
+# The statements that control which type of sockets to open are made
+# of the following:
+# use <address-family> <role> <program name> <address|*>:<port range|*>
+#
+# <address-family> can be one of:
+# "sdp" - for specifying when an SDP should be used
+# "tcp" - for specifying when SDP socket should not be matched
+# "both" - for specifying when both SDP and AF_INET sockets should be used.
+#
+# Note: that "both" semantics is different between "server" and "client" roles:
+# For a "server" is means that the server will be listening on both sdp and tcp
+# For a "client" the connect will prefer using sdp but will silently
+# fall back to tcp if the sdp connection failed.
+#
+# <role> can be one of:
+# "server" or "listen" - for defining the listening port address family
+# "client" or "connect" - for defining the connected port address family
+#
+# <program-name|*> field:
+# Defines the program name (not including the path) the rule applies to.
+# Wildcards with same semantics as "ls" are supported (* and ?).
+# So db2* would match on any program with a name starting with db2.
+# t?cp would match on ttcp, etc.
+# If not provided (default) the statement matches all programs.
+#
+# <address|*> means:
+# Either the local address the server is bind to or the remote server
+# address the client connects to. Syntax for address matching is:
+# <IPv4 address>[/<prefix_length>]|*
+# IPv4 address = [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ each sub number < 255
+# prefix_length = [0-9]+ and with value <= 32. A prefix_length of 24
+# matches the subnet mask 255.255.255.0 . A prefix_length of 32
+# requires matching of the exact IP.
+#
+# <port range> is:
+# start-port[-end-port] where port numbers are >0 and < 65536
+#
+# Rules are evaluated in order of definition. So the first match wins.
+# If no match is made libsdp will default to "both".
+#
+# Examples:
+#
+# Use SDP by clients connecting to machines that belongs to subnet 192.168.1.*
+# family role program address:port[-range]
+# use sdp connect * 192.168.1.0/24:*
+#
+# Use SDP by ttcp when it connects to port 5001 of any machine
+# family role program address:port[-range]
+# use sdp listen ttcp *:5001
+#
+# Use TCP for any program with name starting with ttcp* serving ports 22 to 25
+# family role program address:port[-range]
+# use tcp server ttcp* *:22-25
+#
+# Listen on both TCP and SDP by any server that listen on port 8080
+# family role program address:port[-range]
+# use both server * *:8080
+#
+# Connect ssh through SDP and fallback to TCP to hosts on 11.4.8.* port 22
+# family role program address:port[-range]
+# use both connect * 11.4.8.0/24:22
+#
+# NOTE: If all "use" rules are commented SDP will take "simple SDP"
+# mode and use SDP for all connections
+#
+##############################################################################
Added: projects/ofed/base/contrib/ofed/libsdp/libsdp.spec.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/libsdp.spec.in Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,55 @@
+
+Summary: LD_PRELOAD-able library for using SDP
+Name: libsdp
+Version: @VERSION@
+Release: 1%{?dist}
+License: GPL/BSD
+Group: System Environment/Libraries
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Source: http://www.openfabrics.org/downloads/%{name}-%{version}.tar.gz
+Url: http://www.openfabrics.org/
+
+%description
+libsdp can be LD_PRELOAD-ed to have a sockets application use
+InfiniBand Sockets Direct Protocol (SDP) instead of TCP, transparently
+and without recompiling the application.
+
+%package devel
+Summary: Development files for the libsdp
+Group: System Environment/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Development files of libsdp that may be linked directly to an
+application, which may be useful for debugging.
+
+%prep
+%setup -q
+
+%build
+%configure
+make
+
+%install
+make DESTDIR=${RPM_BUILD_ROOT} install
+# remove unpackaged files from the buildroot
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(6644,root,root)
+%{_libdir}/libsdp*.so*
+%defattr(0644,root,root)
+%config(noreplace) %{_sysconfdir}/libsdp.conf
+%config(noreplace) %{_includedir}/linux/sdp_inet.h
+%doc README NEWS ChangeLog COPYING
+
+%files devel
+%defattr(6644,root,root,-)
+%{_libdir}/libsdp*.so
+
+%changelog
+* Sun Jul 22 2007 Vladimir Sokolovsky <vlad at mellanox.co.il>
+- Initial packaging
Added: projects/ofed/base/contrib/ofed/libsdp/src/Makefile.am
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/src/Makefile.am Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,29 @@
+lib_LTLIBRARIES = libsdp.la $(LIB_SDP_SYS)
+if WANT_LIBSDP_SYS
+LIB_SDP_SYS = libsdp_sys.la
+endif
+
+AM_CFLAGS = -Wall -DSYSCONFDIR=\"$(sysconfdir)\"
+
+libsdp_la_SOURCES = log.c match.c port.c config_parser.c config_scanner.c
+libsdp_la_LDFLAGS = -version-info 1 -ldl -lc
+if SOLARIS_BUILD
+libsdp_la_LDFLAGS += -lsocket
+endif
+libsdp_sys_la_SOURCES = socket.c
+libsdp_sys_la_LDFLAGS = -version-info 1
+
+EXTRA_DIST = libsdp.h linux/sdp_inet.h config_parser.h
+
+config_parser.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/config_parser.y
+ $(YACC) -y -plibsdp_yy -d $(srcdir)/config_parser.y
+ mv y.tab.c config_parser.c
+ mv y.tab.h config_parser.h
+ cp -f config_parser.c config_parser.h $(srcdir)/
+
+config_scanner.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/config_scanner.l
+ $(LEX) -Plibsdp_yy $(srcdir)/config_scanner.l
+ mv lex.libsdp_yy.c config_scanner.c
+ cp -f config_scanner.c $(srcdir)/config_scanner.c
+
+nobase_include_HEADERS = linux/sdp_inet.h
Added: projects/ofed/base/contrib/ofed/libsdp/src/config_parser.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ofed/base/contrib/ofed/libsdp/src/config_parser.c Mon Jan 3 01:44:13 2011 (r216900)
@@ -0,0 +1,1890 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Bison version. */
+#define YYBISON_VERSION "2.3"
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 0
+
+/* Using locations. */
+#define YYLSP_NEEDED 0
+
+/* Substitute the variable and function names. */
+#define yyparse libsdp_yyparse
+#define yylex libsdp_yylex
+#define yyerror libsdp_yyerror
+#define yylval libsdp_yylval
+#define yychar libsdp_yychar
+#define yydebug libsdp_yydebug
+#define yynerrs libsdp_yynerrs
+
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ USE = 258,
+ CLIENT = 259,
+ SERVER = 260,
+ TCP = 261,
+ SDP = 262,
+ BOTH = 263,
+ INT = 264,
+ LOG = 265,
+ DEST = 266,
+ STDERR = 267,
+ SYSLOG = 268,
+ FILENAME = 269,
+ NAME = 270,
+ LEVEL = 271,
+ LINE = 272
+ };
+#endif
+/* Tokens. */
+#define USE 258
+#define CLIENT 259
+#define SERVER 260
+#define TCP 261
+#define SDP 262
+#define BOTH 263
+#define INT 264
+#define LOG 265
+#define DEST 266
+#define STDERR 267
+#define SYSLOG 268
+#define FILENAME 269
+#define NAME 270
+#define LEVEL 271
+#define LINE 272
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 39 "./config_parser.y"
+
+
+/* header section */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "libsdp.h"
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#define YYERROR_VERBOSE 1
+
+extern int yyerror(char *msg);
+extern int yylex(void);
+static int parse_err = 0;
+
+struct use_family_rule *__sdp_clients_family_rules_head = NULL;
+struct use_family_rule *__sdp_clients_family_rules_tail = NULL;
+struct use_family_rule *__sdp_servers_family_rules_head = NULL;
+struct use_family_rule *__sdp_servers_family_rules_tail = NULL;
+
+/* some globals to store intermidiate parser state */
+static struct use_family_rule __sdp_rule;
+static int current_role = 0;
+
+int __sdp_config_empty(
+ void
+ )
+{
+ return ( (__sdp_clients_family_rules_head == NULL) &&
+ (__sdp_servers_family_rules_head == NULL) );
+}
+
+/* define the address by 4 integers */
+static void __sdp_set_ipv4_addr(short a0, short a1, short a2, short a3)
+{
+ char buf[16];
+ sprintf(buf,"%d.%d.%d.%d", a0, a1, a2, a3);
+ if (!inet_aton(buf, &( __sdp_rule.ipv4 )))
+ {
+ parse_err = 1;
+ yyerror("provided address is not legal");
+ }
+}
+
+static void __sdp_set_prog_name_expr(char *prog_name_expr)
+{
+ __sdp_rule.prog_name_expr = strdup(prog_name_expr);
+ if (!__sdp_rule.prog_name_expr) {
+ yyerror("fail to allocate program name expression");
+ }
+}
+
+static char *__sdp_get_role_str(int role)
+{
+ if (role == 1) return("server");
+ if (role == 2) return("client");
+ return("unknown role");
+}
+
+extern int __sdp_min_level;
+
+/* dump the current state in readable format */
+static void __sdp_dump_config_state() {
+ char buf[1024];
+ sprintf(buf, "CONFIG: use %s %s %s",
+ __sdp_get_family_str(__sdp_rule.target_family),
+ __sdp_get_role_str( current_role ),
+ __sdp_rule.prog_name_expr);
+ if (__sdp_rule.match_by_addr) {
+ if ( __sdp_rule.prefixlen != 32 )
+ sprintf(buf+strlen(buf), " %s/%d",
+ inet_ntoa( __sdp_rule.ipv4 ), __sdp_rule.prefixlen);
+ else
+ sprintf(buf+strlen(buf), " %s", inet_ntoa( __sdp_rule.ipv4 ));
+ } else {
+ sprintf(buf+strlen(buf), " *");
+ }
+ if (__sdp_rule.match_by_port) {
+ sprintf(buf+strlen(buf), ":%d",__sdp_rule.sport);
+ if (__sdp_rule.eport > __sdp_rule.sport)
+ sprintf(buf+strlen(buf), "-%d",__sdp_rule.eport);
+ }
+ else
+ sprintf(buf+strlen(buf), ":*");
+ sprintf(buf+strlen(buf), "\n");
+ __sdp_log(1, buf);
+}
+
+/* use the above state for making a new rule */
+static void __sdp_add_rule() {
+ struct use_family_rule **p_tail, **p_head, *rule;
+
+ if (__sdp_min_level <= 1) __sdp_dump_config_state();
+ if ( current_role == 1 ) {
+ p_tail = &__sdp_servers_family_rules_tail;
+ p_head = &__sdp_servers_family_rules_head;
+ } else if ( current_role == 2 ) {
+ p_tail = &__sdp_clients_family_rules_tail;
+ p_head = &__sdp_clients_family_rules_head;
+ } else {
+ yyerror("ignoring unknown role");
+ parse_err = 1;
+ return;
+ }
+
+ rule = (struct use_family_rule *)malloc(sizeof(*rule));
+ if (!rule) {
+ yyerror("fail to allocate new rule");
+ parse_err = 1;
+ return;
+ }
+
+ memset(rule, 0, sizeof(*rule));
+ *rule = __sdp_rule;
+ rule->prev = *p_tail;
+ if (!(*p_head)) {
+ *p_head = rule;
+ } else {
+ (*p_tail)->next = rule;
+ } /* if */
+ *p_tail = rule;
+}
+
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 1
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 167 "./config_parser.y"
+{
+ int ival;
+ char *sval;
+}
+/* Line 193 of yacc.c. */
+#line 270 "y.tab.c"
+ YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations. */
+#line 192 "./config_parser.y"
+
+ long __sdp_config_line_num;
+
+
+/* Line 216 of yacc.c. */
+#line 286 "y.tab.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+ int i;
+#endif
+{
+ return i;
+}
+#endif
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list