Squashed 'third_party/rawrtc/re/' changes from f3163ce8b..9384f3a5f

9384f3a5f Merge branch 'meson' into rawrtc-patched
9283ee693 Fix version
d9708ac30 Merge branch 'meson' into rawrtc-patched
f0cd32702 Remove unneeded define
bd224386a Rename library to avoid clashes
66b398f16 Fix comment
fe728e6db Fix 'fallthrough' warnings
f0da48e84 Generate pkg-config file
520a6c4b1 Allow to use as a Meson subproject
06786bb40 Update Meson build files
1f5b2b0f3 Fix Windows dependencies
a812e4ae4 Enhance ifaddrs.h check for Android
bf45d1b85 Enhance resolv.h check for Android
5183ad041 Add minimum Meson version
b2aed7ca6 Add Meson build system support
4681816b6 Merge branch 'master' into rawrtc-patched
7d837903a Merge branch 'tls-set-dh-params' into rawrtc-patched
485ee70f7 Merge branch 'support-fmt-h' into rawrtc-patched
954b25444 Merge branch 'pipe-epoll-fix' into rawrtc-patched
3a376df0c Merge branch 'dtls-socketless' into rawrtc-patched
7b52ff035 Merge branch 'dtls-configurable-headroom' into rawrtc-patched
762f98f51 Merge branch 'master' into rawrtc-patched
4deed71e1 Fix use `long` for `SSL_CTX_set_ecdh_auto` and `SSL_CTX_set_tmp_ecdh` return values
8c9828284 Explicitly use `long` as value for `SSL_CTX_set_ecdh_auto` call
3d990f602 Add the possibility to set Diffie-Hellman parameters Add `tls_set_dh_params_pem` and `tls_set_dh_params_der` function
631c8802b Handle %h prefixed (short) types in formatter functions
9db018131 Raise FD_EXCEPT on EPOLLHUP (fixes closed pipes)
97f455c17 Make headroom of an outgoing DTLS packet configurable
53ee9fab4 Return whether the packet has been handled in `dtls_receive`.
fcb10a0f1 Make it possible to create a DTLS socket without having an UDP socket underneath. Add `dtls_send_h` and `dtls_mtu_h` for DTLS in UDP socketless mode Add `dtls_socketless` and `dtls_receive` function Add `sendh` and `mtuh` fields to `struct dtls_socket`
9d1ba44a9 Merge branch 'dtls-configurable-headroom' into rawrtc-patched
3a6d31425 Make headroom of an outgoing DTLS packet configurable
6c90041a1 Merge branch 'dtls-socketless' into rawrtc-patched
244e02fbe Return whether the packet has been handled in `dtls_receive`.
cf8bceafa Merge branch 'master' into rawrtc-patched
f01cf0c84 Merge branch 'sdp-media-exclude-ldir' into rawrtc-patched
640b305c2 Merge branch 'sdp-media-address' into rawrtc-patched
ab1d110a4 Merge branch 'dtls-socketless' into rawrtc-patched
96110a7b8 Merge branch 'pipe-epoll-fix' into rawrtc-patched
0616c5ed5 Allow to exclude direction attribute
625c78750 Allow 'c='-line in SPD media to be explicitly set to unspecified
e2c464edb Allow 'c='-line in SPD media to be explicitly set to unspecified
57ca16a93 Make it possible to create a DTLS socket without having an UDP socket underneath. Add `dtls_send_h` and `dtls_mtu_h` for DTLS in UDP socketless mode Add `dtls_socketless` and `dtls_receive` function Add `sendh` and `mtuh` fields to `struct dtls_socket`
1c365017a Raise FD_EXCEPT on EPOLLHUP (fixes closed pipes)
585f196d9 Merge branch 'makefile-improvements' into rawrtc-patched
93b3fa3d9 Remove `install-static` target
728577bba Use `PREFIX ?= ...` instead of `ifndef`
3844e14f2 Less code duplication
c12309ad6 Use `PREFIX ?= ...` instead of `ifndef`
35f6d0bfc Less code duplication
6f1f67a56 Merge branch 'sdp-media-exclude-ldir' into rawrtc-patched
8aca84a34 Allow to exclude direction attribute
c70962258 Merge branch 'sdp-media-address' into rawrtc-patched
5bedf3b2c Allow 'c='-line in SPD media to be explicitly set to unspecified
d52e2df85 Merge branch 'support-fmt-h' into rawrtc-patched
ecc1a62f5 Handle %h prefixed (short) types in formatter functions
12ae81dc4 Merge branch 'tls-set-dh-params' into rawrtc-patched
3762eb8d0 Fix use `long` for `SSL_CTX_set_ecdh_auto` and `SSL_CTX_set_tmp_ecdh` return values
0fc077c02 Merge branch 'tls-set-dh-params' into rawrtc-patched
6abcc92ed Explicitly use `long` as value for `SSL_CTX_set_ecdh_auto` call
adbe6a67b Merge branch 'makefile-improvements' into rawrtc-patched
29b5a2b75 Remove `OPENSSL_SYSROOT` (`SYSROOT_ALT` should be sufficient)
df950db68 Merge branch 'makefile-improvements' into rawrtc-patched
0071283e0 Fix add include and libs directory when using `OPENSSL_SYSROOT`
114883ed2 Merge branch 'makefile-improvements' into rawrtc-patched
24ac34c83 Print OpenSSL sysroot on make info
b614d2eac Merge branch 'makefile-improvements' into rawrtc-patched
69da9f16f Add install-static option to Makefile
0ac7a62e2 Merge branch 'tls-set-dh-params' into rawrtc-patched
00a094574 Merge branch 'pipe-epoll-fix' into rawrtc-patched
8bf8b729b Merge branch 'dtls-socketless' into rawrtc-patched
ddc1ab1c9 Add Libs.private to pkg-config file Allow users to specify `PREFIX` in Makefile Allow users to specify the OpenSSL sysroot as `OPENSSL_SYSROOT` in Makefile
f05afb5be Add the possibility to set Diffie-Hellman parameters Add `tls_set_dh_params_pem` and `tls_set_dh_params_der` function
b3beb212e Raise FD_EXCEPT on EPOLLHUP (fixes closed pipes)
d7ee97f18 Make it possible to create a DTLS socket without having an UDP socket underneath. Add `dtls_send_h` and `dtls_mtu_h` for DTLS in UDP socketless mode Add `dtls_socketless` and `dtls_receive` function Add `sendh` and `mtuh` fields to `struct dtls_socket`

Change-Id: I389057b1a1e5685528a8bee9b65c03f3e083ef98
git-subtree-dir: third_party/rawrtc/re
git-subtree-split: 9384f3a5f38a03c871270fda566045b3bf57bbee
60 files changed
tree: d04055c2b16cf6aa7e144fe49cb25cd2f5dac455
  1. debian/
  2. docs/
  3. include/
  4. mk/
  5. rpm/
  6. src/
  7. .gitignore
  8. .travis.yml
  9. Makefile
  10. meson.build
  11. README.md
README.md

libre README

libre is a Generic library for real-time communications with async IO support. Copyright (C) 2010 - 2019 Creytiv.com

Build Status

Features

  • SIP Stack (RFC 3261)
  • SDP
  • RTP and RTCP
  • SRTP and SRTCP (Secure RTP)
  • DNS-Client
  • STUN/TURN/ICE stack
  • BFCP
  • HTTP-stack with client/server
  • Websockets
  • Jitter-buffer
  • Async I/O (poll, epoll, select, kqueue)
  • UDP/TCP/TLS/DTLS transport
  • JSON parser
  • Real Time Messaging Protocol (RTMP)

Building

libre is using GNU makefiles. Make and OpenSSL development headers must be installed before building.

Build with debug enabled

$ make
$ sudo make install
$ sudo ldconfig

Build with release

$ make RELEASE=1
$ sudo make RELEASE=1 install
$ sudo ldconfig

Build with clang compiler

$ make CC=clang
$ sudo make CC=clang install
$ sudo ldconfig

Documentation

The online documentation generated with doxygen is available in the main website

Examples

Coding examples are available from the redemo project

License

The libre project is using the BSD license.

Contributing

Patches can sent via Github Pull-Requests or to the RE devel mailing-list. Currently we only accept small patches. Please send private feedback to libre [at] creytiv.com

Design goals

  • Portable POSIX source code (ANSI C89 and ISO C99 standard)
  • Robust, fast, low memory footprint
  • RFC compliance
  • IPv4 and IPv6 support

Modules

NameStatusDescription
aesunstableAES (Advanced Encryption Standard)
base64testingBase-64 encoding/decoding functions
bfcpunstableThe Binary Floor Control Protocol (BFCP)
conftestingConfiguration file parser
crc32testing32-bit CRC defined in ITU V.42
dbgtestingDebug printing
dnsstableDNS resolving (NAPTR, SRV, A)
fmttestingFormatted printing and regular expression
hashtestingHashmap table
hmactestingHMAC: Keyed-Hashing for Message Authentication
httpunstableHTTP parser (RFC 2616)
httpauthtestingHTTP-based Authentication (RFC 2617)
iceunstableInteractive Connectivity Establishment (ICE)
jbuftestingJitter buffer
jsonunstableJavaScript Object Notation (JSON)
liststableSortable doubly-linked list handling
locktestingResource locking functions
maintestingMain poll loop
mbufstableLinear memory buffers
md5stableThe MD5 Message-Digest Algorithm (RFC 1321)
memstableMemory referencing
modtestingRun-time module loading
mqueuetestingThread-safe message queue
msgunstableGeneric message component library
natbdunstableNAT Behavior Discovery using STUN
nettestingNetworking routines
odictunstableOrdered Dictionary
rtmpunstableReal Time Messaging Protocol
rtptestingReal-time Transport Protocol
sastableSocket Address functions
sdptestingSession Description Protocol
shatestingSecure Hash Standard, NIST, FIPS PUB 180-1
sipstableCore SIP library
sipeventtestingSIP Event framework
sipregstableSIP register client
sipsessstableSIP Sessions
srtpunstableSecure Real-time Transport Protocol (SRTP)
stunstableSession Traversal Utilities for NAT (STUN)
systestingSystem information
tcptestingTCP transport
televtestingTelephony Events (RFC 4733)
tlsunstableTransport Layer Security
tmrstableTimer handling
turnstableObtaining Relay Addresses from STUN (TURN)
udptestingUDP transport
uritestingGeneric URI library
websockunstableWebSocket Client and Server

legend:

  • stable - code complete; stable code and stable API
  • testing - code complete, but API might change
  • unstable - code complete but not completely tested
  • development - code is under development

Features

  • RFC 1321 - The MD5 Message-Digest Algorithm
  • RFC 1886 - DNS Extensions to support IP version 6
  • RFC 2032 - RTP Payload Format for H.261 Video Streams
  • RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1
  • RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication
  • RFC 2782 - A DNS RR for Specifying the Location of Services (DNS SRV)
  • RFC 2915 - The Naming Authority Pointer (NAPTR) DNS Resource Record
  • RFC 3261 - SIP: Session Initiation Protocol
  • RFC 3263 - Locating SIP Servers
  • RFC 3264 - An Offer/Answer Model with SDP
  • RFC 3265 - SIP-Specific Event Notification
  • RFC 3327 - SIP Extension Header Field for Registering Non-Adjacent Contacts
  • RFC 3428 - SIP Extension for Instant Messaging
  • RFC 3489 - STUN - Simple Traversal of UDP Through NATs
  • RFC 3515 - The SIP Refer Method
  • RFC 3550 - RTP: A Transport Protocol for Real-Time Applications
  • RFC 3551 - RTP Profile for Audio and Video Conferences with Minimal Control
  • RFC 3555 - MIME Type Registration of RTP Payload Formats
  • RFC 3556 - SDP Bandwidth Modifiers for RTCP Bandwidth
  • RFC 3581 - An Extension to SIP for Symmetric Response Routing
  • RFC 3605 - RTCP attribute in SDP
  • RFC 3711 - The Secure Real-time Transport Protocol (SRTP)
  • RFC 3969 - The IANA URI Parameter Registry for SIP
  • RFC 3994 - Indication of Message Composition for Instant Messaging
  • RFC 4346 - The TLS Protocol Version 1.1
  • RFC 4566 - SDP: Session Description Protocol
  • RFC 4582 - The Binary Floor Control Protocol (BFCP)
  • RFC 4582bis - The Binary Floor Control Protocol (BFCP)
  • RFC 4585 - Extended RTP Profile for RTCP-Based Feedback
  • RFC 4733 - RTP Payload for DTMF Digits, Telephony Tones, and Teleph. Signals
  • RFC 4961 - Symmetric RTP / RTP Control Protocol (RTCP)
  • RFC 5118 - SIP Torture Test Messages for IPv6
  • RFC 5245 - Interactive Connectivity Establishment (ICE)
  • RFC 5389 - Session Traversal Utilities for NAT (STUN)
  • RFC 5626 - Managing Client-Initiated Connections in SIP
  • RFC 5761 - Multiplexing RTP Data and Control Packets on a Single Port
  • RFC 5766 - Traversal Using Relays around NAT (TURN)
  • RFC 5768 - Indicating Support for ICE in SIP
  • RFC 5769 - Test vectors for STUN
  • RFC 5780 - NAT Behaviour Discovery Using STUN
  • RFC 6026 - Correct Transaction Handling for 2xx Resp. to SIP INVITE Requests
  • RFC 6156 - TURN Extension for IPv6
  • RFC 6188 - The Use of AES-192 and AES-256 in Secure RTP
  • RFC 6455 - The WebSocket Protocol
  • RFC 7159 - JavaScript Object Notation (JSON)
  • RFC 7350 - DTLS as Transport for STUN
  • RFC 7714 - AES-GCM Authenticated Encryption in SRTP

Supported platforms

  • Linux
  • FreeBSD
  • OpenBSD
  • NetBSD
  • Solaris 11
  • Windows
  • Apple Mac OS X and iOS
  • Android (5.0 or later)

Supported versions of C Standard library

  • Android bionic
  • BSD libc
  • GNU C Library (glibc)
  • Windows C Run-Time Libraries (CRT)
  • uClibc

Supported compilers:

  • gcc 3.x
  • gcc 4.x
  • gcc 5.x
  • gcc 6.x
  • ms vc2003 compiler
  • clang

Supported versions of OpenSSL

  • OpenSSL version 1.0.1
  • OpenSSL version 1.0.2
  • OpenSSL version 1.1.0 (supported since version 0.5.0)
  • LibreSSL version 2.x

Coding guidelines

  • Use enum for constants where appropriate
  • Use const as much as possible (where appropriate)
  • Use C99 data types (intN_t, uintN_t, bool)
  • Hide data-types in .c files where possible (use struct foo)
  • Avoid malloc/free, use mem_alloc/mem_deref instead
  • CVS/svn/git tags are NOT allowed in the code!
  • Avoid bit-fields in structs which are not portable
  • Use dummy handlers for timing-critical callbacks
  • return err, return alloced objects as pointer-pointers
  • in allocating functions, first arg is always double pointer
  • Use POSIX error-codes; EINVAL for invalid args, EBADMSG for parse errors and EPROTO for protocol errors

Transport protocols

TCPUDPTLSDTLS
BFCP-yes--
DNSyesyes--
HTTPyesn/ayesn/a
ICE-yes--
RTP-yes--
RTCP-yes--
RTMPyes---
SIPyesyesyes-
STUNyesyesyesyes
TURNyesyesyesyes
WEBSOCKyesn/ayesn/a

Related projects

References

http://creytiv.com/re.html

https://github.com/creytiv/re

http://lists.creytiv.com/mailman/listinfo/re-devel