NCD scripting language, tun2socks proxifier, P2P VPN
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
arpprobe Use badvpn_add_library for all internal libraries. Oct 15, 2014
base Refactoring using MemRef. Nov 26, 2014
blog_generator port to compile with MSVC Jul 24, 2012
bproto port to compile with MSVC Jul 24, 2012
bproto_generator bproto_generator: fix aliasing issues Dec 30, 2012
client Use GNUInstallDirs for controlling install destinations May 24, 2016
cmake/modules system: add a BReactor implementation using the GLib event loop Mar 30, 2012
dhcpclient Use badvpn_add_library for all internal libraries. Oct 15, 2014
dostest add some programs for playing with DoS attacks on TCP Sep 3, 2012
examples ncd: Store the NCDStingIndex pointer in NCDValMem. May 8, 2015
flooder Use GNUInstallDirs for controlling install destinations May 24, 2016
flow compile PIC versions of internal libraries, to be used by NCD plugins Mar 13, 2013
flowextra Use badvpn_add_library for all internal libraries. Oct 15, 2014
generated ncd: Permit functions with have zero arguments. Jan 22, 2015
lemon Add NCD, the Network Configuration Daemon Dec 10, 2010
lime Initial import Oct 25, 2010
lwip tun2socks: Call the other lwip timer functions that should be Sep 26, 2017
misc Fix bug UDP checksum calculation. Mar 12, 2017
ncd-request Use GNUInstallDirs for controlling install destinations May 24, 2016
ncd NCD: Fix evdev event code names with newer headers. Aug 27, 2016
nspr_support Use badvpn_add_library for all internal libraries. Oct 15, 2014
predicate Use badvpn_add_library for all internal libraries. Oct 15, 2014
protocol tun2socks: IPv6 support. Includes updated lwIP version and udpgw prog… Apr 22, 2013
random Use badvpn_add_library for all internal libraries. Oct 15, 2014
scripts scripts/copy_nss: copy programs too Jan 28, 2011
security Use badvpn_add_library for all internal libraries. Oct 15, 2014
server Use GNUInstallDirs for controlling install destinations May 24, 2016
server_connection Use badvpn_add_library for all internal libraries. Oct 15, 2014
socksclient Use badvpn_add_library for all internal libraries. Oct 15, 2014
stringmap Use badvpn_add_library for all internal libraries. Oct 15, 2014
structure structure: Vector: Reduce interface. Nov 9, 2014
system BDatagram: Remove error messages about failed send Sep 26, 2017
tests get rid of some warnings Sep 1, 2012
threadwork Fix possible compile error after switch to pthread_sigmask. Sep 6, 2016
tun2socks tun2socks: Call the other lwip timer functions that should be Sep 26, 2017
tuntap Fix TUN/TAP initialization with newer TAP-Windows. Nov 13, 2016
udevmonitor Use badvpn_add_library for all internal libraries. Oct 15, 2014
udpgw Use GNUInstallDirs for controlling install destinations May 24, 2016
udpgw_client Use badvpn_add_library for all internal libraries. Oct 15, 2014
BUILD-WINDOWS-old.txt Finishing Nix build method for Windows. Nov 18, 2016
BUILD-WINDOWS.md Replace windows build instructions with VS/CMake Jan 2, 2018
CMakeLists.txt Remove badvpn-tunctl Sep 18, 2017
COPYING switch to using the New BSD License Jan 27, 2012
ChangeLog version 1.999.130 Apr 9, 2015
README.md README.md: Remove outdated installation chapter Jan 2, 2018
badvpn-win32.nix Finishing Nix build method for Windows. Nov 18, 2016
badvpn.7 switch to using the New BSD License Jan 27, 2012
badvpn.nix Nix expressions: Separate the package function from the composition. Jan 24, 2015
blog_channels.txt ncd: Implement object reference infrastructure and objref module. Nov 21, 2014
build-win32.nix Finishing Nix build method for Windows. Nov 18, 2016
build.nix Nix expressions: Separate the package function from the composition. Jan 24, 2015
compile-tun2socks.sh Fixup compile-tun2socks.sh, fix name Sep 26, 2017
compile-udpgw.sh Fix udpgw compile script as well Jul 27, 2017
fix_flex.php port to compile with MSVC Jul 24, 2012
generate_files ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} Oct 5, 2012

README.md

BadVPN

Introduction

In this project I host some of my open-source networking software. All of the software is written in C and utilizes a custom-developed framework for event-driven programming. The extensive code sharing is the reason all the software is packaged together. However, it is possible to compile only the required components to avoid extra dependencies.

NCD programming language

NCD (Network Configuration Daemon) is a daemon and programming/scripting language for configuration of network interfaces and other aspects of the operating system. It implements various functionalities as built-in modules, which may be used from an NCD program wherever and for whatever purpose the user needs them. This modularity makes NCD extremely flexible and extensible. It does a very good job with hotplugging in various forms, like USB network interfaces and link detection for wired devices. New features can be added by implementing statements as C-language modules using a straightforward interface.

Tun2socks network-layer proxifier

The tun2socks program "socksifes" TCP connections at the network layer. It implements a TUN device which accepts all incoming TCP connections (regardless of destination IP), and forwards the connections through a SOCKS server. This allows you to forward all connections through SOCKS, without any need for application support. It can be used, for example, to forward connections through a remote SSH server.

Peer-to-peer VPN

The VPN part of this project implements a Layer 2 (Ethernet) network between the peers (VPN nodes). The peers connect to a central server which acts as a communication proxy allowing the peers to establish direct connections between each other (data connections). These connections are used for transferring network data (Ethernet frames), and can be secured with a multitude of mechanisms. Notable features are:

  • UDP and TCP transport
  • Converges very quickly after a new peer joins
  • IGMP snooping to deliver multicasts efficiently (e.g. for IPTV)
  • Double SSL: if SSL is enabled, not only do peers connect to the server with SSL, but they use an additional layer of SSL when exchanging messages through the server
  • Features related to the NAT problem:
    • Can work with multiple layers of NAT (needs configuration)
    • Local peers inside a NAT can communicate directly
    • Relaying as a fallback (needs configuration)

Documentation

  • [NCD] - Introduction to the NCD language.
  • [badvpn] - General description of BadVPN and its features.
  • [Examples] - Quick guide to setting up a working VPN.
  • [badvpn_server], [badvpn_client] - Documentation of individual programs.

Requirements

NCD only works on Linux. Tun2socks works on Linux and Windows. The P2P VPN works on Linux, Windows and FreeBSD (not tested often).

License

The BSD 3-clause license as shown below applies to most of the code.

Copyright (c) 2009, Ambroz Bizjak <ambrop7@gmail.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the author nor the
   names of its contributors may be used to endorse or promote products
   derived from this software without specific prior written permission.

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 AUTHOR 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.

List of third-party code included in the source:

  • lwIP - A Lightweight TCP/IP stack. License: lwip/COPYING