Git Product home page Git Product logo

sassembla / sctp-refimpl Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 58.93 MB

Automatically exported from code.google.com/p/sctp-refimpl

License: BSD 2-Clause "Simplified" License

Shell 3.30% Prolog 1.04% C 88.46% Perl 0.87% Assembly 0.01% R 0.01% Ruby 0.08% C++ 3.18% HTML 0.32% JavaScript 0.31% Groff 1.27% PostScript 0.41% OpenEdge ABL 0.01% Objective-C 0.01% Makefile 0.01% Java 0.01% Bison 0.07% Erlang 0.01% TeX 0.64% Diff 0.01%

sctp-refimpl's Introduction

README for SCTP stack for KAME

Description
-----------
This SCTP stack is a kernel implementation which fully supports RFC 2960
as well as updates and enhancements from the following Internet Drafts:
   draft-ietf-tsvwg-sctpcsum-05.txt
   draft-ietf-tsvwg-sctpimpguide-05.txt
   draft-ietf-tsvwg-sctpsocket-04.txt
   draft-ietf-tsvwg-addip-sctp-05.txt
   draft-stewart-prsctp-00.txt
   draft-stewart-tsvwg-sctpipv6-00.txt
   draft-iyengar-sctp-cacc-00.txt

A small user-space library addition to 'libc' is used to provide the new
system calls that SCTP provides (see draft-ietf-tsvwg-sctpsocket-03.txt
for details).

Both IPv4 and IPv6 are supported-- e.g. it is a dual-stack implementation.
Provisions are given for passing either IPv4-mapped or native IPv4 addresses
over PF_INET6 sockets.

The SCTP stack has been integrated and tested with KAME releases of
FreeBSD 4.5 and NetBSD 1.5.2. This release has been compiled with
the KAME release for OpenBSD on a Ultra-sparc however it could
not be tested due to alignment problems in the base IPv6 code with
the 64 bit processor. We hope to test OpenBSD on x86 soon.


Configuring and Building the Kernel
-----------------------------------
Get the KAME source for your target platform (eg. freebsd4, netbsd152, 
openbsd3) and "prepare" the source (see 'INSTALL' at the top of the 
KAME source tree)

Run 'prepare.sh' at the top of the sctpBsd source tree if
you have a seperate SCTP/KAME installation. Newer
versions of KAME include the SCTP stack so you do not
need to get the seperate tar image and run prepare.sh

[FIX ME - remove this since the source will be part of KAME now...]

The following kernel options have been added for SCTP:
options	      SCTP		       # adds SCTP stack to kernel
options	      SCTP_DEBUG	       # adds debugging support for SCTP
options	      SCTP_TCP_MODEL_SUPPORT   # adds TCP model support
options	      SCTP_USE_ADLER32	       # use obsolete Adler32 checksum,
				       # instead of CRC-32c
				       # this may be removed in the future

Add 'SCTP' at a minimum to your kernel configuration file, and build as
directed for the appropriate target platform (e.g. see 'freebsd4/INSTALL')

After configuring the kernel above, goto {$TARGET}/sys/kern in the KAME
distribution and do make init_sysent.c'.  This will generate the following
files:
   {$TARGET}/sys/kern/syscalls.c
   {$TARGET}/sys/kern/init_sysent.c
   {$TARGET}/sys/sys/sysproto.h
   {$TARGET}/sys/sys/syscall.h
   {$TARGET}/sys/sys/syscall.mk
   {$TARGET}/sys/sys/syscall-hide.h

You will need to copy the .h files when building libc to
/usr/src/sys/sys.

and you should also copy them to /usr/include/sys
as well.



Configuring and Building the user library portion
-------------------------------------------------
0. Kernel must be configured and built before proceeding.

1. Copy files from usr.lib to /usr/src/lib/libc/net:
      sctp_sys_calls.c

2. Copy files from the KAME distribution into /usr/src/lib/libc/net:
      kame/kame/libinet6/getaddrinfo.3
      kame/kame/libinet6/getaddrinfo.c
      kame/kame/libinet6/rthdr.c
      kame/kame/libinet6/resolv/res_send.c

3. Add sctp_sys_calls.c to SRCS in /usr/src/lib/libc/net/Makefile.inc

4. Copy the syscall related header files created during kernel configuration
   and build into the non-KAME kernel build tree (eg. from KAME's
   {$TARGET}/sys/sys/ to /usr/src/sys/sys/)

4.a For netbsd you will also need to /usr/src/lib/libc/sys/Makefile.inc
    by adding sctp_peeloff.o to the ASM line (near select.o).

5. Rebuild the library from /usr/src/lib/libc and install


Multi-homing considerations
---------------------------
The SCTP stack provides full support of multi-homed platforms by adding
support for multiple default gateway routes and alternate route selection
to the routing subsystem.

This feature is added to the routing subsystem when SCTP is compiled in
and is currently required.


Application development considerations
--------------------------------------
The following are the only header files that are normally required by
the application to add SCTP support:
   <netinet/sctp.h>
   <netinet/sctp_uio.h>

See Internet Draft draft-ietf-tsvwg-sctpsocket-04.txt for details.

>>> Undocumented Socket Options <<<
IPv4-mapped addresses vs. the default IPv4 addresses on PF_INET6 sockets
  Note: KAME kernel tunable must also be appropriately set to enable mapped
  addresses support

>>> PR-SCTP "timeout" types <<<
time
available buffer space

Test application
----------------
The sctp_test_app can be built from the top of the 
current SCTP tree. [we will need to move this
into the kame tree somewhere]. It builds two libraries
under the directories baselib and user. The app directory
holds the actual sctp_test_app. Note the libc.a must be
rebuilt with the sctp_peeloff and other library functions.



sctp-refimpl's People

Watchers

 avatar

sctp-refimpl's Issues

Memory leak: usrsctp_conninput doesn't free mbuf *m

There is a memory leak in usrsctp/usrsctplib/user_socket.c in function 
usrsctp_conninput
The memory allocated here:
"if ((m = sctp_get_mbuf_for_msg(length, 1, M_NOWAIT, 0, MT_DATA)) == NULL)" 
(line 3200 in current rev)
is never released

I think a simple sctp_m_freem before the return would fix it, but I'm not very 
familiar with the code

Original issue reported on code.google.com by [email protected] on 6 Jan 2014 at 3:32

Add support for building with clang-cl

I have a patch to work around http://llvm.org/bugs/show_bug.cgi?id=20177 and 
http://llvm.org/bugs/show_bug.cgi?id=20178 in order to fix building SCTP with 
clang-cl for Firefox.

Original issue reported on code.google.com by [email protected] on 2 Jul 2014 at 6:23

Attachments:

Not working while using alias IP in windows for IPv6

What steps will reproduce the problem?
1.Add an alias IPv6 to an interface in some windows machine
2.Create socket for IPv6 and bind using the alias ip
3.Try to establish connection in client mode with some other SCTP server

What is the expected output? What do you see instead?
== The initial INIT packet should originate from the alias IPv6 used during 
bind, but the source IPv6 found to be the primary IPv6 of that interface and 
eventually it aborts the connection after receiving INIT_ACK from the peer node.

What version of the product are you using? On what operating system?
== I am using the revision 9168 (latest as of now) of the product in Windows 7 
ultimate 64-bit machine.

Please provide any additional information below.
== The library works fine for alias IPs when used for IPv4

Original issue reported on code.google.com by [email protected] on 18 Feb 2015 at 3:53

cosmetic issue: printf format warning for tv.tv_usec in usrsctplib/user_socket.c

What steps will reproduce the problem?
1. bootstrap/configure/make KERN/usrsctp on mint linux (based on ubuntu 12.10)
2. Compilation fails in usrsctplib/user_socket.c
user_socket.c: In function 'usrsctp_dumppacket':
user_socket.c:3122:11: error: format '%d' expects argument of type 'int', but 
argument 8 has type '__suseconds_t' [-Werror=format]

tv_usec is suseconds_t which may be defined differently on different platforms. 
One way to deal with this is to print tv_usec as %jd and typecast argument to 
intmax_t. See attached patch.



Original issue reported on code.google.com by [email protected] on 7 Jan 2013 at 10:46

Attachments:

Overflow with memcpy() in Win_getifaddrs()

sctp_userspace.c 144

struct sockaddr_in *addr;
...
addr = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in));
...
memcpy(&addr, &pAdapt->FirstUnicastAddress->Address.lpSockaddr, sizeof(struct 
sockaddr_in));

I think should be:
memcpy(addr, &pAdapt->FirstUnicastAddress->Address.lpSockaddr, sizeof(struct 
sockaddr_in));

--------------------------
Same with
#if defined(INET6)
        struct sockaddr_in6 *addr6;
#endif

Original issue reported on code.google.com by [email protected] on 14 Apr 2014 at 10:01

Build failure on linux with musl libc

The attached patches fix 3 build issues on a linux system with musl libc 
(http://musl-libc.org)

- musl is linux but does not have <sys/queue.h> by default. The first patch 
let's autoconf detect the presence of <sys/queue.h> and uses the fallback 
currently only used for Windows when not found

- musl does not have <sys/cdefs.h>. The header has mainly been used for macros 
for compatibility with pre-ANSI-C compilers. These macros (__BEGIN_DECLS, 
__END_DECLS and __P) are only used for FreeBSD. So make the include conditional 
on FreeBSD. It would also make sense to remove this cruft alltogether.

- musl follows POSIX and declares IPPORT_RESERVED in <netdb.h>. But <netdb.h> 
is never included in the source.


Original issue reported on code.google.com by janda.felix on 25 Feb 2015 at 9:04

Attachments:

libusrsctp is not building for iOS

What steps will reproduce the problem?
1. Try to compile using attached buildiOS.sh that has iOS build setup

What is the expected output? What do you see instead?
Expect library to compile, instead get an error of missing include:

In file included from user_socket.c:35:
In file included from ./netinet/sctp_os.h:72:
./netinet/sctp_os_userspace.h:491:10: fatal error: 'netinet/ip_icmp.h' file not 
found
#include <netinet/ip_icmp.h>

What version of the product are you using? On what operating system?

Latest SVN checkout as of Feb 11 2015

Please provide any additional information below.

Diff file below fixes the problem. It disables include when not using inet and 
inet6.
Also people might find handy the build script for iOs

Original issue reported on code.google.com by [email protected] on 11 Feb 2015 at 6:26

Attachments:

Documentation of the client example program misses the local port number parameter

What steps will reproduce the problem?
1. Compile under windows
2. Run example echo_server and client

What is the expected output? What do you see instead?
Client is getting stuck on usrsctp_connect, no connection attempt appears to be 
sent and no error is returned from the call. 

What version of the product are you using? On what operating system?
Windows 7 64 bit

Please provide any additional information below.
compiled and tested on 2 different machines, the same problem occurs. 

Original issue reported on code.google.com by [email protected] on 11 Dec 2014 at 4:21

INET INET6 and similar defines are not included in the userspace library header

What steps will reproduce the problem?
1. Compile usrscpt with INET and INET6
2. Link library in Xcode
3. Stack of some functions/callbacks will be corrupted due to INET and INET6 
not being defined in Xcode. For example sctp_sockstore will be inconsistent.

What is the expected output? What do you see instead?
I think it is expected from the library to define symbols like INET and INET6 
with library prefix, i.e. REFSCTP_INET REFSCTP_INET6 and include the symbol in 
the user header file. Otherwise one has no idea what flags were used to 
configure and build the library.

What version of the product are you using? On what operating system?
Revision 9168 on OSX

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 19 Feb 2015 at 4:15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.