Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 May 2011 12:50:01 -0700
From:      Mark Atkinson <atkin901@gmail.com>
To:        jyl_2006 <yilinjing2006@gmail.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: SCTP
Message-ID:  <4DD57469.9000607@gmail.com>
In-Reply-To: <1305363576917-4395319.post@n5.nabble.com>
References:  <44A552FA.2030302@cisco.com> <m2u061ogp3.wl%gnn@neville-neil.com>	<20060703094806.689f33ae@marcin> <44A90031.9010308@cisco.com>	<m2wtaril9n.wl%gnn@neville-neil.com> <44AE4814.2020706@cisco.com>	<20060708104718.GA1632@bashibuzuk.net> <44B0D157.8070503@cisco.com> <1305363576917-4395319.post@n5.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----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 <sys/socket.h>
 #include <sys/wait.h>

- -#include <netinet/in.h>
+#include <netinet/sctp.h>

 #include <errno.h>
 #include <netdb.h>
@@ -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 <sys/socket.h>
 # include <netdb.h>
- -# include <netinet/in.h>
+# include <netinet/sctp.h>
 # ifndef __BEOS__
 #  include <arpa/inet.h>
 # 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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DD57469.9000607>