From owner-freebsd-net@FreeBSD.ORG Thu May 19 20:18:25 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D7D5106564A for ; Thu, 19 May 2011 20:18:25 +0000 (UTC) (envelope-from atkin901@gmail.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.212.176]) by mx1.freebsd.org (Postfix) with ESMTP id DBAF28FC15 for ; Thu, 19 May 2011 20:18:24 +0000 (UTC) Received: by pxi11 with SMTP id 11so2441872pxi.7 for ; Thu, 19 May 2011 13:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version :newsgroups:to:cc:subject:references:in-reply-to:x-enigmail-version :content-type:content-transfer-encoding; bh=xSv+l8U+0/LPoGHO0ixHHGFH8r35q2XombbDmnD7nwU=; b=uIEajdE9+oT82JYp8Vf4Dm9Grul5AnyJKA0ujKf0ssrK8nbphOFaY5aIsPBD57WhjY 8wAqmC1JB6CWkKlJZlicu7B7/WKCN3kAtDC3j2XZ6v8+G/GzMOUh+u9tNb4AGtmLnvYM mAcRRoEzLyM76PmDN32vb5hyEkkuX70kA9fzs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=B3XeR8mYgO/R4aPJvoaEloIFbsmadvu9DWNyPWbzjIR1qf4n9RTIxafdE2aA1YXNUb KUfAVqYSJ9j4HNfwlDTK6Bb3g8kyQVnXCijxwo+wSKSVwpYGY7Ku8u6jsNrULQ2JNuz0 V3fNOvxK7R88vaX+KH4qnBEzIQTDaAN5CKmyw= Received: by 10.68.15.229 with SMTP id a5mr5045392pbd.42.1305834611930; Thu, 19 May 2011 12:50:11 -0700 (PDT) Received: from moby.pdsea.f5net.com (207.155.204.151.ptr.us.xo.net [207.155.204.151]) by mx.google.com with ESMTPS id l3sm1939238pbq.75.2011.05.19.12.50.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2011 12:50:10 -0700 (PDT) Message-ID: <4DD57469.9000607@gmail.com> Date: Thu, 19 May 2011 12:50:01 -0700 From: Mark Atkinson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.17) Gecko/20110502 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: gmane.os.freebsd.devel.net To: jyl_2006 References: <44A552FA.2030302@cisco.com> <20060703094806.689f33ae@marcin> <44A90031.9010308@cisco.com> <44AE4814.2020706@cisco.com> <20060708104718.GA1632@bashibuzuk.net> <44B0D157.8070503@cisco.com> <1305363576917-4395319.post@n5.nabble.com> In-Reply-To: <1305363576917-4395319.post@n5.nabble.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: SCTP X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 20:18:25 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/14/2011 01:59, jyl_2006 wrote: > I have download files from http://www.sctp.org/app.tar.bz2,and when I input > gmake, > It shows that: > cc:../user/FreeBSD/libsctpuser.a:No such file or directory. > I have tryed to search file named "libsctpuser.a",but nothing have found. > Anyone who can help me? SCTP on FreeBSD is easier than the ancient SCTP demo code. 1. Take any regular TCP app source and find the socket calls in it. 2. change netinet/in.h to netinet/sctp.h 3. change protocol IPPROTO_SCTP 4. compile and launch. example change from port swww/bozohttpd. - --- ./daemon-bozo.c 2010-09-20 15:49:42.000000000 -0700 +++ /usr/ports/www/bozohttpd-sctp/work/bozohttpd-20100920/daemon-bozo.c 2011-04-28 08:03:22.000000000 -0700 @@ -36,7 +36,7 @@ #include #include - -#include +#include #include #include @@ -98,7 +98,7 @@ httpd->sock = bozomalloc(httpd, httpd->nsock * sizeof(*httpd->sock)); httpd->fds = bozomalloc(httpd, httpd->nsock * sizeof(*httpd->fds)); for (i = 0, r = r0; r != NULL; r = r->ai_next) { - - httpd->sock[i] = socket(r->ai_family, SOCK_STREAM, 0); + httpd->sock[i] = socket(r->ai_family, SOCK_STREAM, IPPROTO_SCTP); if (httpd->sock[i] == -1) continue; if (setsockopt(httpd->sock[i], SOL_SOCKET, SO_REUSEADDR, &on, example change to wget: - --- wget-svn/wget/src/connect.c 2007-07-23 14:31:01.000000000 -0700 +++ wget-sctp/wget/src/connect.c 2011-05-12 07:01:04.000000000 -0700 @@ -39,7 +39,7 @@ #ifndef WINDOWS # include # include - -# include +# include # ifndef __BEOS__ # include # endif @@ -275,7 +275,7 @@ sockaddr_set_data (sa, ip, port); /* Create the socket of the family appropriate for the address. */ - - sock = socket (sa->sa_family, SOCK_STREAM, 0); + sock = socket (sa->sa_family, SOCK_STREAM, IPPROTO_SCTP); if (sock < 0) goto err; @@ -423,7 +423,7 @@ void *setopt_ptr = (void *)&setopt_val; socklen_t setopt_size = sizeof (setopt_val); - - sock = socket (bind_address->family, SOCK_STREAM, 0); + sock = socket (bind_address->family, SOCK_STREAM, IPPROTO_SCTP); if (sock < 0) return -1; -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3VdGkACgkQrDN5kXnx8ybfxQCfW53+CBn0L/V+MW3rRyxRx5hp IZEAn0iRjxj2LH2atgIBjImWbSlDmt84 =6Aja -----END PGP SIGNATURE-----