Commit 5719a21d authored by Max Lv's avatar Max Lv

Merge pull request #411 from Mygod/master

Update a lot of dependencies (2)
parents 5bce2ca8 a3fbefa5

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

[submodule "src/main/jni/shadowsocks-libev"]
path = src/main/jni/shadowsocks-libev
url = https://github.com/shadowsocks/shadowsocks-libev
[submodule "src/main/jni/badvpn"]
path = src/main/jni/badvpn
url = https://github.com/shadowsocks/badvpn.git
branch = shadowsocks-android
[submodule "src/main/jni/iptables"]
path = src/main/jni/iptables
url = https://github.com/shadowsocks/iptables.git
branch = shadowsocks-android
[submodule "src/main/jni/libancillary"]
path = src/main/jni/libancillary
url = https://github.com/shadowsocks/libancillary.git
branch = shadowsocks-android
......@@ -28,16 +28,16 @@ libraryDependencies ++= Seq(
"dnsjava" % "dnsjava" % "2.1.7",
"com.github.kevinsawicki" % "http-request" % "6.0",
"commons-net" % "commons-net" % "3.3",
"com.google.zxing" % "android-integration" % "3.1.0",
"com.google.zxing" % "android-integration" % "3.2.1",
"com.joanzapata.android" % "android-iconify" % "1.0.11",
"net.glxn.qrgen" % "android" % "2.0",
"net.simonvt.menudrawer" % "menudrawer" % "3.0.6",
"com.google.android.gms" % "play-services-base" % "8.1.0",
"com.google.android.gms" % "play-services-ads" % "8.1.0",
"com.google.android.gms" % "play-services-analytics" % "8.1.0",
"com.android.support" % "support-v4" % "23.0.1",
"com.github.mrengineer13" % "snackbar" % "0.5.0",
"com.nostra13.universalimageloader" % "universal-image-loader" % "1.8.4",
"com.android.support" % "support-v4" % "23.1.0",
"com.github.mrengineer13" % "snackbar" % "1.2.0",
"com.nostra13.universalimageloader" % "universal-image-loader" % "1.9.4",
"com.j256.ormlite" % "ormlite-core" % "4.48",
"com.j256.ormlite" % "ormlite-android" % "4.48"
)
......
resolvers += Resolver.url("scalasbt releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.5.6")
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.5.8")
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.7.0-SNAPSHOT")
resolvers += Resolver.url("rtimush/sbt-plugin-snapshots", new URL("https://dl.bintray.com/rtimush/sbt-plugin-snapshots/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.9-6-g5a7705c")
......@@ -341,6 +341,7 @@ TUN2SOCKS_SOURCES := \
base/BLog_syslog.c \
system/BReactor_badvpn.c \
system/BSignal.c \
system/BConnection_common.c \
system/BConnection_unix.c \
system/BTime.c \
system/BUnixSignal.c \
......
Subproject commit f9a6a40758bb769e986e5dc0cbe452c4b0d53d1e
This diff is collapsed.
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:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* 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.
Version 1.999.127:
- client, server: implement experimental support for performing SSL operations in worker threads. Currently it's rather inefficient.
- NCD: modules: value: implement value::append() for appending to a list
- NCD: modules: net_iptables: add single-argument form of append and insert commands, allowing for generic use
- NCD: modules: net_iptables: implement net.iptables.insert() and net.ebtables.insert()
- NCD: modules: sys_start_process: implement options, including username, term_on_deinit and deinit_kill_time
- NCD: modules: sys_request_server: implement _caller in request handler
- NCD: modules: add getenv()
- NCD: modules: daemon: implement options, including username option
- NCD: modules: runonce: add new options format with a map, implement username option
- NCD: modules: add buffer(), which exposes a buffer with efficient appending and removing from the beginning.
- NCD: add a new internal string representation called ComposedString. This allows modules to expose the concatenation of multiple memroy buffers as a single string value, efficiently.
- fix many, hopefully all, strict aliasing violations. In particular, this fixes a bug where the DHCP client integrated into NCD won't work correctly, subject to optimization flags.
- NCD: modules: sleep: interpret empty string as no sleeping, add sleep(ms_start) with one argument
- NCD: modules: add log(), log_r() and log_fr() commands for logging via the BLog system
Version 1.999.126:
- NCD: modules: sleep: interpret empty string time as no sleeping, add sleep(ms_start) with one argument
- NCD: modules: add log module for message logging using the BLog system
- NCD: implement the "include" and "include_guard" directives, which allow separating reusable code into files
- NCD: modules: call2: implement call_with_caller_target(), which makes it easier to write reusable code that calls back user-provided code
- NCD: modules: call2: remove call2_if(), call2_ifelse(), embcall2(), embcall2_if(), embcall2_ifelse()
- NCD: modules: add sys.start_process(), which implements starting and controlling external processes and reading/writing their stdout/stdin
- tun2socks: implement SOCKS password authentication
- NCD: track the depth of values and limit the maximum depth. This avoids stack overflow with very deeply nested values.
- NCD: modules: add substr()
- NCD: process_manager: add 2-argument start() method which doesn't take a process identifier
- NCD: process_manager: allow process identifiers to be any value not just strings
- NCD: multidepend, depend_scope: fix immediate effect order when a depend finishes backtracking
- NCD: add depend_scope module to do exactly what the multidepend module does, but with separate non-global dependency name scopes
- NCD: multidepend: allow dependency names to be any value not just strings
- NCD: implement value::insert(what) for appending to a list
- NCD: change the format of addresses in sys.request_server() and sys.request_client() to be the same as in the socket module
- NCD: add socket module (sys.connect() and sys.listen())
- NCD: fix bug where duplicate template/process names would not be detected and weird behaviour would result
- NCD: add backtrack_point() for simple backtracking
- NCD: add file_open() for more complete file I/O
- NCD: implement parse_ipv6_addr() and parse_ipv6_cidr_addr()
- NCD: port to Emscripten/Javascript, for the in-browser demo
- NCD: many performance and memory usage improvements
- NCD: add assert_false()
- NCD: don't link to OpenSSL to for random number generator. Use /dev/urandom instead to generate XIDs for DHCP.
- NCD: deprecate ip_in_network() and instead add net.ipv{4,6}.addr_in_network(), net.ipv{4,6}.ifnot_addr_in_network()
- NCD: implement some IPv6 modules: net.ipv6.addr(), net.ipv6.route()
- NCD: support CIDR style addr/prefix addresses in various modules
- NCD: recognize Elif and Else with capital first letter to be consistent with other reserved keywords
Version 1.999.123:
- NCD: performance improvements related to finding modules for statements
- NCD: performance improvements related to resolving object names
- NCD: performance improvements related to instantiating statement arguments
- NCD: add value::replace_this() and value::replace_this_undo()
- NCD: add value::reset()
- NCD: add value::replace() and value::replace_undo()
- Port to compile with MSVC for Windows.
- NCD: add Foreach clause
- NCD: implement _caller in spawn(), add spawn::join()
- NCD: add explode()
- NCD: add hard_reboot() and hard_poweroff()
- NCD: add file_stat() and file_lstat()
- NCD: fix regex_replace() semantics. It was very broken because it did a complete replacement pass for every regex on the list, so it would match parts that have already been replaced, producing unexpected results.
- NCD: small performance improvement
Version 1.999.121:
- NCD: improve error handling semantics; see http://code.google.com/p/badvpn/source/detail?r=1376
- NCD: fix assertion failure in sys.evdev() if a device error occurs (e.g. device unplugged) while an event is being processed. Similar fix in some other modules, but these may not be reproducable.
- NCD: some more performance improvements
- NCD: some performance improvements (~30% faster interpretation of cpu-bound code)
- NCD: implemented If..elif..else clause.
- NCD: net.backend.wpa_supplicant: fix to work with wpa_supplicant>=1.0
Version 1.999.115:
- NCD: Many improvements; new statements, including call(), alias(), foreach(), choose().
Version 1.999.113:
- NCD: when starting child processes, make sure that file descriptors for standard
streams are always open in the child, by opening /dev/null if they are not.
- Improve build system to allow selective building of components.
By default, everything is built, unless -DBUILD_NOTHING_BY_DEFAULT=1 is given.
Individual components can then be enabled or disabled using -DBUILD_COMPONENT=1
and -DBUILD_COMPONENT=0.
- When starting any BadVPN program, make sure that file descriptors for standard
streams are always open in the child, by opening /dev/null if they are not.
- NCD: net.backend.wpa_supplicant(): add 'bssid' and 'ssid' variables to allow
determining what wireless network wpa_supplicant connected to.
- NCD: net.backend.wpa_supplicant(): do not require the user to start wpa_supplicant via
stdbuf, but do it automatically.
Version 1.999.111:
- Improved protocol such that peers can use SSL when comminicating via the server. This
improves security, as compromising the server will not allow the attacker to see secret
data shared by peers (in particular, encryption keys and OTP seeds when in UDP mode).
Compatibility is preserved if an only if the following conditions are met:
- The server is using the latest version.
- If the network is using SSL, all clients using the new version are using the
"--allow-peer-talk-without-ssl" command line option.
Be aware, however, that using the "--allow-peer-talk-without-ssl" option negates the
security benefits of the new SSL support - not only between pairs of peers where one
peer is using the old version, but also between pairs where both peers are capable
of SSL. This is because the server can re-initialize the pair, telling them not to use
SSL.
Version 1.999.107:
- Added Windows IOCP support, removing the limitation on ~64 connections. This is important
for tun2socks, which may have to handle several hundred connections.
Version 1.999.105.2:
- Fixed an assertion failure in tun2socks related to sending data to SOCKS.
Version 1.999.101.3:
- Fixed UDP transport on Windows 7 which didn't work (was only tested on XP).
Version 1.999.101:
- Fixed a protocol issue present in versions <=1.999.100.3. Compatibility is preserved in
case of a new server and old clients, but it is not possible to connect to an old server
with a new client.
1 Requirements
1.1 Operating system
Linux:
- Linux kernel 2.6. Kernel 2.4 will work, but performance will suffer.
- tested on x86, x86_64 and ARM architectures. Not tested on any big-endian architecture.
Windows:
- Windows XP or newer; tested on Windows XP and Windows 7
FreeBSD:
- Not regularly tested.
Other systems are not supported.
1.2 Compilers
Linux:
- gcc
- clang, except >=3.0 (clang bug http://llvm.org/bugs/show_bug.cgi?id=11535)
Windows:
- gcc from the mingw-w64 project for 32-bit targets
C language features used:
- Standard (all part of C99):
- designated initializers
- stdint.h, inttypes.h, stddef.h
- intermingled declarations and code
- for loop initial declaration
- one-line "//" comments
- Extensions:
- packed structure attribute (to pack a structure and allow unaligned access)
1.3 CMake
The build system uses CMake.
1.4 OpenSSL
Libcrypto (part of OpenSSL) is used for block ciphers, hash functions and random data generation.
1.5 Network Security Services (NSS)
The NSS library from Mozilla is used for TLS support. NSS command-line tools are also needed
for setting up certificates.
1.6 TAP-Win32 (Windows only) (runtime only)
The TAP-Win32 driver, part of OpenVPN.
2 Compilation
2.1 Compiling on Linux
$ tar xf badvpn-<version>.tar.bz2
$ mkdir build
$ cd build
$ cmake ../badvpn-<version> -DCMAKE_INSTALL_PREFIX=/usr/local
$ make
If you want to install it, run as root:
# make install
If you only want NCD or tun2socks and not the VPN system, you can avoid the NSS dependency by passing
the following to the cmake command:
-DBUILD_NCD=1 -DBUILD_TUN2SOCKS=1 -DBUILD_NOTHING_BY_DEFAULT=1
2.2 Compiling for Windows
See the file INSTALL-WINDOWS for detailed instructions.
3 Usage
The primary documentation is on the BadVPN homepage, http://code.google.com/p/badvpn/ .
Additionally, some man pages are installed (badvpn(7), badvpn-server(8), badvpn-client(8)).
There are many ways to build BadVPN for Windows. It can be built with MSVC or GCC compilers,
and it be built natively from Windows or cross-compiled from Linux. However, this document
only describes building natively from Windows using MSVC.
1. Get a MSVC compiler, e.g. from Visual Studio, Visual Studio Express or from the Windows SDK.
2. Choose a directory where built stuff will be installed into; we call it <root>.
3. Build the NSS library.
NOTE: you can also use the prebuilt version in the BadVPN windows download.
- Install MozillaBuild:
http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe .
- Download the NSS source code that includes NSPR. As of the time of writing the latest version was 3.13.5:
https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_13_5_RTM/src/nss-3.13.5-with-nspr-4.9.1.tar.gz .
Extract it to c:\ so that you have C:\mozilla .
- Open a terminal with access to the Visual Studio compilers and other tools. E.g. if you use the Windows SDK,
activate the following start menu item: Programs -> Microsoft Windows SDK v7.1 -> Windows SDK 7.1 Command Prompt.
- In this terminal, run:
> c:\mozilla-build\start-l10n.bat
- Either a new terminal opens with a bash shell, or a bash shell starts in the existing terminal. Either way,
enter the following commands to finally build NSS: (here paths are written as /driveletter/...)
$ export OS_TARGET=WINNT
$ export BUILD_OPT=1
$ cd <nss_source_dir>/mozilla/security/nss
$ make nss_build_all
Now use a script shipped with the BadVPN source to copy the resulting files into appropriate directories within <root>:
$ <badvpn_source_dir>/scripts/copy_nss ../../dist <root>
4. Build the OpenSSL library.
NOTE: you can also use the prebuilt version in the BadVPN windows download.
- Install ActivePerl.
- Download the OpenSSL source code and extract it.
- Open a compiler terminal, as was done when building NSS. Inside it, run:
> cd <openssl_source_dir>
> perl Configure VC-WIN32 --prefix=<root>
> ms\do_ms
> nmake -f ms\ntdll.mak
To copy the results into <root>:
> nmake -f ms\ntdll.mak install
5. Build BadVPN.
- Install CMake. During installation, select the option to include cmake in PATH
to avoid having to type a long path into the terminal.
- Create an empty folder where BadVPN will be built; call it <build>.
- Open a compiler terminal. Inside it, run:
> cd <build>
> cmake <badvpn_source_dir> -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=<root> -DCMAKE_BUILD_TYPE=Release
> nmake
To copy the results into <root>:
> nmake install
This diff is collapsed.
/**
* @file BArpProbe.h
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
#ifndef BADVPN_BARPPROBE_H
#define BADVPN_BARPPROBE_H
#include <stdint.h>
#include <misc/debug.h>
#include <misc/debugerror.h>
#include <misc/arp_proto.h>
#include <misc/ethernet_proto.h>
#include <base/DebugObject.h>
#include <system/BDatagram.h>
#include <system/BReactor.h>
#define BARPPROBE_INITIAL_WAITRECV 1000
#define BARPPROBE_INITIAL_NUM_ATTEMPTS 6
#define BARPPROBE_NOEXIST_WAITRECV 15000
#define BARPPROBE_EXIST_WAITSEND 15000
#define BARPPROBE_EXIST_WAITRECV 10000
#define BARPPROBE_EXIST_NUM_NOREPLY 2
#define BARPPROBE_EXIST_PANIC_WAITRECV 1000
#define BARPPROBE_EXIST_PANIC_NUM_NOREPLY 6
#define BARPPROBE_EVENT_EXIST 1
#define BARPPROBE_EVENT_NOEXIST 2
#define BARPPROBE_EVENT_ERROR 3
typedef void (*BArpProbe_handler) (void *user, int event);
typedef struct {
uint32_t addr;
BReactor *reactor;
void *user;
BArpProbe_handler handler;
BDatagram dgram;
uint8_t if_mac[6];
PacketPassInterface *send_if;
int send_sending;
struct arp_packet send_packet;
PacketRecvInterface *recv_if;
struct arp_packet recv_packet;
BTimer timer;
int state;
int num_missed;
DebugError d_err;
DebugObject d_obj;
} BArpProbe;
int BArpProbe_Init (BArpProbe *o, const char *ifname, uint32_t addr, BReactor *reactor, void *user, BArpProbe_handler handler) WARN_UNUSED;
void BArpProbe_Free (BArpProbe *o);
#endif
add_library(arpprobe BArpProbe.c)
target_link_libraries(arpprobe base system flow)
This diff is collapsed.
/**
* @file BLog.c
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
#include <stdio.h>
#include <stddef.h>
#include "BLog.h"
#ifdef ANDROID
#include <android/log.h>
#endif
#ifndef BADVPN_PLUGIN
struct _BLog_channel blog_channel_list[] = {
#include <generated/blog_channels_list.h>
};
struct _BLog_global blog_global = {
#ifndef NDEBUG
0
#endif
};
#endif
// keep in sync with level numbers in BLog.h!
static char *level_names[] = { NULL, "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG" };
static void stdout_log (int channel, int level, const char *msg)
{
#ifndef ANDROID
fprintf(stdout, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#else
__android_log_print(ANDROID_LOG_DEBUG, "tun2socks",
"%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#endif
}
static void stderr_log (int channel, int level, const char *msg)
{
#ifndef ANDROID
fprintf(stderr, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#else
__android_log_print(ANDROID_LOG_ERROR, "tun2socks",
"%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#endif
}
static void stdout_stderr_free (void)
{
}
void BLog_InitStdout (void)
{
BLog_Init(stdout_log, stdout_stderr_free);
}
void BLog_InitStderr (void)
{
BLog_Init(stderr_log, stdout_stderr_free);
}
This diff is collapsed.
/**
* @file BLog_syslog.c
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
#include <string.h>
#include <stdio.h>
#include <syslog.h>
#include <misc/debug.h>
#include "BLog_syslog.h"
static int resolve_facility (char *str, int *out)
{
if (!strcmp(str, "authpriv")) {
*out = LOG_AUTHPRIV;
}
else if (!strcmp(str, "cron")) {
*out = LOG_CRON;
}
else if (!strcmp(str, "daemon")) {
*out = LOG_DAEMON;
}
else if (!strcmp(str, "ftp")) {
*out = LOG_FTP;
}
else if (!strcmp(str, "local0")) {
*out = LOG_LOCAL0;
}
else if (!strcmp(str, "local1")) {
*out = LOG_LOCAL1;
}
else if (!strcmp(str, "local2")) {
*out = LOG_LOCAL2;
}
else if (!strcmp(str, "local3")) {
*out = LOG_LOCAL3;
}
else if (!strcmp(str, "local4")) {
*out = LOG_LOCAL4;
}
else if (!strcmp(str, "local5")) {
*out = LOG_LOCAL5;
}
else if (!strcmp(str, "local6")) {
*out = LOG_LOCAL6;
}
else if (!strcmp(str, "local7")) {
*out = LOG_LOCAL7;
}
else if (!strcmp(str, "lpr")) {
*out = LOG_LPR;
}
else if (!strcmp(str, "mail")) {
*out = LOG_MAIL;
}
else if (!strcmp(str, "news")) {
*out = LOG_NEWS;
}
else if (!strcmp(str, "syslog")) {
*out = LOG_SYSLOG;
}
else if (!strcmp(str, "user")) {
*out = LOG_USER;
}
else if (!strcmp(str, "uucp")) {
*out = LOG_UUCP;
}
else {
return 0;
}
return 1;
}
static int convert_level (int level)
{
ASSERT(level >= BLOG_ERROR && level <= BLOG_DEBUG)
switch (level) {
case BLOG_ERROR:
return LOG_ERR;
case BLOG_WARNING:
return LOG_WARNING;
case BLOG_NOTICE:
return LOG_NOTICE;
case BLOG_INFO:
return LOG_INFO;
case BLOG_DEBUG:
return LOG_DEBUG;
default:
ASSERT(0)
return 0;
}
}
static struct {
char ident[200];
} syslog_global;
static void syslog_log (int channel, int level, const char *msg)
{
syslog(convert_level(level), "%s: %s", blog_global.channels[channel].name, msg);
}
static void syslog_free (void)
{
closelog();
}
int BLog_InitSyslog (char *ident, char *facility_str)
{
int facility;
if (!resolve_facility(facility_str, &facility)) {
return 0;
}
snprintf(syslog_global.ident, sizeof(syslog_global.ident), "%s", ident);
openlog(syslog_global.ident, 0, facility);
BLog_Init(syslog_log, syslog_free);
return 1;
}
/**
* @file BLog_syslog.h
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*
* @section DESCRIPTION
*
* BLog syslog backend.
*/
#ifndef BADVPN_BLOG_SYSLOG_H
#define BADVPN_BLOG_SYSLOG_H
#include <misc/debug.h>
#include <base/BLog.h>
int BLog_InitSyslog (char *ident, char *facility) WARN_UNUSED;
#endif
/**
* @file BMutex.h
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
#ifndef BADVPN_BMUTEX_H
#define BADVPN_BMUTEX_H
#if !defined(BADVPN_THREAD_SAFE) || (BADVPN_THREAD_SAFE != 0 && BADVPN_THREAD_SAFE != 1)
#error BADVPN_THREAD_SAFE is not defined or incorrect
#endif
#if BADVPN_THREAD_SAFE
#include <pthread.h>
#endif
#include <misc/debug.h>
#include <base/DebugObject.h>
typedef struct {
#if BADVPN_THREAD_SAFE
pthread_mutex_t pthread_mutex;
#endif
DebugObject d_obj;
} BMutex;
static int BMutex_Init (BMutex *o) WARN_UNUSED;
static void BMutex_Free (BMutex *o);
static void BMutex_Lock (BMutex *o);
static void BMutex_Unlock (BMutex *o);
static int BMutex_Init (BMutex *o)
{
#if BADVPN_THREAD_SAFE
if (pthread_mutex_init(&o->pthread_mutex, NULL) != 0) {
return 0;
}
#endif
DebugObject_Init(&o->d_obj);
return 1;
}
static void BMutex_Free (BMutex *o)
{
DebugObject_Free(&o->d_obj);
#if BADVPN_THREAD_SAFE
int res = pthread_mutex_destroy(&o->pthread_mutex);
B_USE(res)
ASSERT(res == 0)
#endif
}
static void BMutex_Lock (BMutex *o)
{
DebugObject_Access(&o->d_obj);
#if BADVPN_THREAD_SAFE
int res = pthread_mutex_lock(&o->pthread_mutex);
B_USE(res)
ASSERT(res == 0)
#endif
}
static void BMutex_Unlock (BMutex *o)
{
DebugObject_Access(&o->d_obj);
#if BADVPN_THREAD_SAFE
int res = pthread_mutex_unlock(&o->pthread_mutex);
B_USE(res)
ASSERT(res == 0)
#endif
}
#endif
/**
* @file BPending.c
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
#include <stddef.h>
#include <misc/debug.h>
#include <misc/offset.h>
#include "BPending.h"
#include "BPending_list.h"
#include <structure/SLinkedList_impl.h>
void BPendingGroup_Init (BPendingGroup *g)
{
// init jobs list
BPending__List_Init(&g->jobs);
// init pending counter
DebugCounter_Init(&g->pending_ctr);
// init debug object
DebugObject_Init(&g->d_obj);
}
void BPendingGroup_Free (BPendingGroup *g)
{
DebugCounter_Free(&g->pending_ctr);
ASSERT(BPending__List_IsEmpty(&g->jobs))
DebugObject_Free(&g->d_obj);
}
int BPendingGroup_HasJobs (BPendingGroup *g)
{
DebugObject_Access(&g->d_obj);
return !BPending__List_IsEmpty(&g->jobs);
}
void BPendingGroup_ExecuteJob (BPendingGroup *g)
{
ASSERT(!BPending__List_IsEmpty(&g->jobs))
DebugObject_Access(&g->d_obj);
// get a job
BSmallPending *p = BPending__List_First(&g->jobs);
ASSERT(p->pending_node.next != p)
ASSERT(p->pending)
// remove from jobs list
BPending__List_Remove(&g->jobs, p);
// set not pending
p->pending_node.next = p;
#ifndef NDEBUG
p->pending = 0;
#endif
// execute job
p->handler(p->user);
return;
}
BSmallPending * BPendingGroup_PeekJob (BPendingGroup *g)
{
DebugObject_Access(&g->d_obj);
return BPending__List_First(&g->jobs);
}
void BSmallPending_Init (BSmallPending *o, BPendingGroup *g, BSmallPending_handler handler, void *user)
{
// init arguments
o->handler = handler;
o->user = user;
// set not pending
o->pending_node.next = o;
#ifndef NDEBUG
o->pending = 0;
#endif
// increment pending counter
DebugCounter_Increment(&g->pending_ctr);
// init debug object
DebugObject_Init(&o->d_obj);
}
void BSmallPending_Free (BSmallPending *o, BPendingGroup *g)
{
DebugCounter_Decrement(&g->pending_ctr);
DebugObject_Free(&o->d_obj);
ASSERT(o->pending == (o->pending_node.next != o))
// remove from jobs list
if (o->pending_node.next != o) {
BPending__List_Remove(&g->jobs, o);
}
}
void BSmallPending_SetHandler (BSmallPending *o, BSmallPending_handler handler, void *user)
{
DebugObject_Access(&o->d_obj);
// set handler
o->handler = handler;
o->user = user;
}
void BSmallPending_Set (BSmallPending *o, BPendingGroup *g)
{
DebugObject_Access(&o->d_obj);
ASSERT(o->pending == (o->pending_node.next != o))
// remove from jobs list
if (o->pending_node.next != o) {
BPending__List_Remove(&g->jobs, o);
}
// insert to jobs list
BPending__List_Prepend(&g->jobs, o);
// set pending
#ifndef NDEBUG
o->pending = 1;
#endif
}
void BSmallPending_Unset (BSmallPending *o, BPendingGroup *g)
{
DebugObject_Access(&o->d_obj);
ASSERT(o->pending == (o->pending_node.next != o))
if (o->pending_node.next != o) {
// remove from jobs list
BPending__List_Remove(&g->jobs, o);
// set not pending
o->pending_node.next = o;
#ifndef NDEBUG
o->pending = 0;
#endif
}
}
int BSmallPending_IsSet (BSmallPending *o)
{
DebugObject_Access(&o->d_obj);
ASSERT(o->pending == (o->pending_node.next != o))
return (o->pending_node.next != o);
}
void BPending_Init (BPending *o, BPendingGroup *g, BPending_handler handler, void *user)
{
BSmallPending_Init(&o->base, g, handler, user);
o->g = g;
}
void BPending_Free (BPending *o)
{
BSmallPending_Free(&o->base, o->g);
}
void BPending_Set (BPending *o)
{
BSmallPending_Set(&o->base, o->g);
}
void BPending_Unset (BPending *o)
{
BSmallPending_Unset(&o->base, o->g);
}
int BPending_IsSet (BPending *o)
{
return BSmallPending_IsSet(&o->base);
}
/**
* @file BPending.h
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*
* @section DESCRIPTION
*
* Module for managing a queue of jobs pending execution.
*/
#ifndef BADVPN_BPENDING_H
#define BADVPN_BPENDING_H
#include <stdint.h>
#include <misc/debugcounter.h>
#include <structure/SLinkedList.h>
#include <base/DebugObject.h>
struct BSmallPending_s;
#include "BPending_list.h"
#include <structure/SLinkedList_decl.h>
/**
* Job execution handler.
* It is guaranteed that the associated {@link BSmallPending} object was
* in set state.
* The {@link BSmallPending} object enters not set state before the handler
* is called.
*
* @param user as in {@link BSmallPending_Init}
*/
typedef void (*BSmallPending_handler) (void *user);
/**
* Job execution handler.
* It is guaranteed that the associated {@link BPending} object was
* in set state.
* The {@link BPending} object enters not set state before the handler
* is called.
*
* @param user as in {@link BPending_Init}
*/
typedef void (*BPending_handler) (void *user);
/**
* Object that contains a list of jobs pending execution.
*/
typedef struct {
BPending__List jobs;
DebugCounter pending_ctr;
DebugObject d_obj;
} BPendingGroup;
/**
* Object for queuing a job for execution.
*/
typedef struct BSmallPending_s {
BPending_handler handler;
void *user;
BPending__ListNode pending_node; // optimization: if not pending, .next is this
#ifndef NDEBUG
uint8_t pending;
#endif
DebugObject d_obj;
} BSmallPending;
/**
* Object for queuing a job for execution. This is a convenience wrapper
* around {@link BSmallPending} with an extra field to remember the
* {@link BPendingGroup} being used.
*/
typedef struct {
BSmallPending base;
BPendingGroup *g;
} BPending;
/**
* Initializes the object.
*
* @param g the object
*/
void BPendingGroup_Init (BPendingGroup *g);
/**
* Frees the object.
* There must be no {@link BPending} or {@link BSmallPending} objects using
* this group.
*
* @param g the object
*/
void BPendingGroup_Free (BPendingGroup *g);
/**
* Checks if there is at least one job in the queue.
*
* @param g the object
* @return 1 if there is at least one job, 0 if not
*/
int BPendingGroup_HasJobs (BPendingGroup *g);
/**
* Executes the top job on the job list.
* The job is removed from the list and enters
* not set state before being executed.
* There must be at least one job in job list.
*
* @param g the object
*/
void BPendingGroup_ExecuteJob (BPendingGroup *g);
/**
* Returns the top job on the job list, or NULL if there are none.
*
* @param g the object
* @return the top job if there is at least one job, NULL if not
*/
BSmallPending * BPendingGroup_PeekJob (BPendingGroup *g);
/**
* Initializes the object.
* The object is initialized in not set state.
*
* @param o the object
* @param g pending group to use
* @param handler job execution handler
* @param user value to pass to handler
*/
void BSmallPending_Init (BSmallPending *o, BPendingGroup *g, BSmallPending_handler handler, void *user);
/**
* Frees the object.
* The execution handler will not be called after the object
* is freed.
*
* @param o the object
* @param g pending group. Must be the same as was used in {@link BSmallPending_Init}.
*/
void BSmallPending_Free (BSmallPending *o, BPendingGroup *g);
/**
* Changes the job execution handler.
*
* @param o the object
* @param handler job execution handler
* @param user value to pass to handler
*/
void BSmallPending_SetHandler (BSmallPending *o, BSmallPending_handler handler, void *user);
/**
* Enables the job, pushing it to the top of the job list.
* If the object was already in set state, the job is removed from its
* current position in the list before being pushed.
* The object enters set state.
*
* @param o the object
* @param g pending group. Must be the same as was used in {@link BSmallPending_Init}.
*/
void BSmallPending_Set (BSmallPending *o, BPendingGroup *g);
/**
* Disables the job, removing it from the job list.
* If the object was not in set state, nothing is done.
* The object enters not set state.
*
* @param o the object
* @param g pending group. Must be the same as was used in {@link BSmallPending_Init}.
*/
void BSmallPending_Unset (BSmallPending *o, BPendingGroup *g);
/**
* Checks if the job is in set state.
*
* @param o the object
* @return 1 if in set state, 0 if not
*/
int BSmallPending_IsSet (BSmallPending *o);
/**
* Initializes the object.
* The object is initialized in not set state.
*
* @param o the object
* @param g pending group to use
* @param handler job execution handler
* @param user value to pass to handler
*/
void BPending_Init (BPending *o, BPendingGroup *g, BPending_handler handler, void *user);
/**
* Frees the object.
* The execution handler will not be called after the object
* is freed.
*
* @param o the object
*/
void BPending_Free (BPending *o);
/**
* Enables the job, pushing it to the top of the job list.
* If the object was already in set state, the job is removed from its
* current position in the list before being pushed.
* The object enters set state.
*
* @param o the object
*/
void BPending_Set (BPending *o);
/**
* Disables the job, removing it from the job list.
* If the object was not in set state, nothing is done.
* The object enters not set state.
*
* @param o the object
*/
void BPending_Unset (BPending *o);
/**
* Checks if the job is in set state.
*
* @param o the object
* @return 1 if in set state, 0 if not
*/
int BPending_IsSet (BPending *o);
#endif
#define SLINKEDLIST_PARAM_NAME BPending__List
#define SLINKEDLIST_PARAM_FEATURE_LAST 0
#define SLINKEDLIST_PARAM_TYPE_ENTRY struct BSmallPending_s
#define SLINKEDLIST_PARAM_MEMBER_NODE pending_node
set(BASE_ADDITIONAL_SOURCES)
if (HAVE_SYSLOG_H)
list(APPEND BASE_ADDITIONAL_SOURCES BLog_syslog.c)
endif ()
set(BASE_SOURCES
DebugObject.c
BLog.c
BPending.c
${BASE_ADDITIONAL_SOURCES}
)
badvpn_add_library(base "" "" "${BASE_SOURCES}")
/**
* @file DebugObject.c
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
#include "DebugObject.h"
#ifndef BADVPN_PLUGIN
#ifndef NDEBUG
DebugCounter debugobject_counter = DEBUGCOUNTER_STATIC;
#if BADVPN_THREAD_SAFE
pthread_mutex_t debugobject_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
#endif
#endif
/**
* @file DebugObject.h
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*
* @section DESCRIPTION
*
* Object used for detecting leaks.
*/
#ifndef BADVPN_DEBUGOBJECT_H
#define BADVPN_DEBUGOBJECT_H
#include <stdint.h>
#if !defined(BADVPN_THREAD_SAFE) || (BADVPN_THREAD_SAFE != 0 && BADVPN_THREAD_SAFE != 1)
#error BADVPN_THREAD_SAFE is not defined or incorrect
#endif
#if BADVPN_THREAD_SAFE
#include <pthread.h>
#endif
#include <misc/debug.h>
#include <misc/debugcounter.h>
#define DEBUGOBJECT_VALID UINT32_C(0x31415926)
/**
* Object used for detecting leaks.
*/
typedef struct {
#ifndef NDEBUG
uint32_t c;
#endif
} DebugObject;
/**
* Initializes the object.
*
* @param obj the object
*/
static void DebugObject_Init (DebugObject *obj);
/**
* Frees the object.
*
* @param obj the object
*/
static void DebugObject_Free (DebugObject *obj);
/**
* Does nothing.
*
* @param obj the object
*/
static void DebugObject_Access (const DebugObject *obj);
/**
* Does nothing.
* There must be no {@link DebugObject}'s initialized.
*/
static void DebugObjectGlobal_Finish (void);
#ifndef NDEBUG
extern DebugCounter debugobject_counter;
#if BADVPN_THREAD_SAFE
extern pthread_mutex_t debugobject_mutex;
#endif
#endif
void DebugObject_Init (DebugObject *obj)
{
#ifndef NDEBUG
obj->c = DEBUGOBJECT_VALID;
#if BADVPN_THREAD_SAFE
ASSERT_FORCE(pthread_mutex_lock(&debugobject_mutex) == 0)
#endif
DebugCounter_Increment(&debugobject_counter);
#if BADVPN_THREAD_SAFE
ASSERT_FORCE(pthread_mutex_unlock(&debugobject_mutex) == 0)
#endif
#endif
}
void DebugObject_Free (DebugObject *obj)
{
ASSERT(obj->c == DEBUGOBJECT_VALID)
#ifndef NDEBUG
obj->c = 0;
#if BADVPN_THREAD_SAFE
ASSERT_FORCE(pthread_mutex_lock(&debugobject_mutex) == 0)
#endif
DebugCounter_Decrement(&debugobject_counter);
#if BADVPN_THREAD_SAFE
ASSERT_FORCE(pthread_mutex_unlock(&debugobject_mutex) == 0)
#endif
#endif
}
void DebugObject_Access (const DebugObject *obj)
{
ASSERT(obj->c == DEBUGOBJECT_VALID)
}
void DebugObjectGlobal_Finish (void)
{
#ifndef NDEBUG
DebugCounter_Free(&debugobject_counter);
#endif
}
#endif
server 4
client 4
flooder 4
tun2socks 4
ncd 4
ncd_var 4
ncd_list 4
ncd_depend 4
ncd_multidepend 4
ncd_dynamic_depend 4
ncd_concat 4
ncd_if 4
ncd_strcmp 4
ncd_regex_match 4
ncd_logical 4
ncd_sleep 4
ncd_print 4
ncd_blocker 4
ncd_run 4
ncd_runonce 4
ncd_daemon 4
ncd_spawn 4
ncd_imperative 4
ncd_ref 4
ncd_index 4
ncd_alias 4
ncd_process_manager 4
ncd_ondemand 4
ncd_foreach 4
ncd_choose 4
ncd_net_backend_waitdevice 4
ncd_net_backend_waitlink 4
ncd_net_backend_badvpn 4
ncd_net_backend_wpa_supplicant 4
ncd_net_backend_rfkill 4
ncd_net_up 4
ncd_net_dns 4
ncd_net_iptables 4
ncd_net_ipv4_addr 4
ncd_net_ipv4_route 4
ncd_net_ipv4_dhcp 4
ncd_net_ipv4_arp_probe 4
ncd_net_watch_interfaces 4
ncd_sys_watch_input 4
ncd_sys_watch_usb 4
ncd_sys_evdev 4
ncd_sys_watch_directory 4
StreamPeerIO 4
DatagramPeerIO 4
BReactor 3
BSignal 3
FragmentProtoAssembler 4
BPredicate 3
ServerConnection 4
Listener 4
DataProto 4
FrameDecider 4
BSocksClient 4
BDHCPClientCore 4
BDHCPClient 4
NCDIfConfig 4
BUnixSignal 4
BProcess 4
PRStreamSink 4
PRStreamSource 4
PacketProtoDecoder 4
DPRelay 4
BThreadWork 4
DPReceive 4
BInputProcess 4
NCDUdevMonitorParser 4
NCDUdevMonitor 4
NCDUdevCache 4
NCDUdevManager 4
BTime 4
BEncryption 4
SPProtoDecoder 4
LineBuffer 4
BTap 4
lwip 4
NCDConfigTokenizer 4
NCDConfigParser 4
NCDValParser 4
nsskey 4
addr 4
PasswordListener 4
NCDInterfaceMonitor 4
NCDRfkillMonitor 4
udpgw 4
UdpGwClient 4
SocksUdpGwClient 4
BNetwork 4
BConnection 4
BSSLConnection 4
BDatagram 4
PeerChat 4
BArpProbe 4
NCDModuleIndex 4
NCDModuleProcess 4
NCDValGenerator 4
ncd_from_string 4
ncd_to_string 4
ncd_value 4
ncd_try 4
ncd_sys_request_server 4
NCDRequest 4
ncd_net_ipv6_wait_dynamic_addr 4
NCDRequestClient 4
ncd_request 4
ncd_sys_request_client 4
ncd_exit 4
ncd_getargs 4
ncd_arithmetic 4
ncd_parse 4
ncd_valuemetic 4
ncd_file 4
ncd_netmask 4
ncd_implode 4
ncd_call2 4
ncd_assert 4
ncd_reboot 4
ncd_explode 4
NCDPlaceholderDb 4
NCDVal 4
ncd_net_ipv6_addr 4
ncd_net_ipv6_route 4
ncd_net_ipv4_addr_in_network 4
ncd_net_ipv6_addr_in_network 4
dostest_server 4
dostest_attacker 4
ncd_timer 4
ncd_file_open 4
ncd_backtrack 4
ncd_socket 4
ncd_depend_scope 4
ncd_substr 4
ncd_sys_start_process 4
NCDBuildProgram 4
ncd_log 4
ncd_log_msg 4
ncd_buffer 4
ncd_getenv 4
BThreadSignal 4
BLockReactor 4
ncd_load_module 4
<?php
require_once "blog_functions.php";
function assert_failure ($script, $line, $message)
{
if ($message == "") {
fatal_error("Assertion failure at {$script}:{$line}");
} else {
fatal_error("Assertion failure at {$script}:{$line}: {$message}");
}
}
assert_options(ASSERT_CALLBACK, "assert_failure");
function print_help ($name)
{
echo <<<EOD
Usage: {$name}
--input-file <file> Input channels file.
--output-dir <dir> Destination directory for generated files.
EOD;
}
$input_file = "";
$output_dir = "";
for ($i = 1; $i < $argc;) {
$arg = $argv[$i++];
switch ($arg) {
case "--input-file":
$input_file = $argv[$i++];
break;
case "--output-dir":
$output_dir = $argv[$i++];
break;
case "--help":
print_help($argv[0]);
exit(0);
default:
fatal_error("Unknown option: {$arg}");
}
}
if ($input_file == "") {
fatal_error("--input-file missing");
}
if ($output_dir == "") {
fatal_error("--output-dir missing");
}
if (($data = file_get_contents($input_file)) === FALSE) {
fatal_error("Failed to read input file");
}
if (!tokenize($data, $tokens)) {
fatal_error("Failed to tokenize");
}
$i = 0;
$channels_defines = "";
$channels_list = "";
reset($tokens);
while (1) {
if (($ch_name = current($tokens)) === FALSE) {
break;
}
next($tokens);
if (($ch_priority = current($tokens)) === FALSE) {
fatal_error("missing priority");
}
next($tokens);
if ($ch_name[0] != "name") {
fatal_error("name is not a name");
}
if ($ch_priority[0] != "number") {
fatal_error("priority is not a number");
}
$channel_file = <<<EOD
#ifdef BLOG_CURRENT_CHANNEL
#undef BLOG_CURRENT_CHANNEL
#endif
#define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_{$ch_name[1]}
EOD;
$channels_defines .= <<<EOD
#define BLOG_CHANNEL_{$ch_name[1]} {$i}
EOD;
$channels_list .= <<<EOD
{"{$ch_name[1]}", {$ch_priority[1]}},
EOD;
if (file_put_contents("{$output_dir}/blog_channel_{$ch_name[1]}.h", $channel_file) === NULL) {
fatal_error("{$input_file}: Failed to write channel file");
}
$i++;
}
$channels_defines .= <<<EOD
#define BLOG_NUM_CHANNELS {$i}
EOD;
if (file_put_contents("{$output_dir}/blog_channels_defines.h", $channels_defines) === NULL) {
fatal_error("{$input_file}: Failed to write channels defines file");
}
if (file_put_contents("{$output_dir}/blog_channels_list.h", $channels_list) === NULL) {
fatal_error("{$input_file}: Failed to write channels list file");
}
<?php
function tokenize ($str, &$out) {
$out = array();
while (strlen($str) > 0) {
if (preg_match('/^\\/\\/.*/', $str, $matches)) {
$str = substr($str, strlen($matches[0]));
}
else if (preg_match('/^\\s+/', $str, $matches)) {
$str = substr($str, strlen($matches[0]));
}
else if (preg_match('/^[0-9]+/', $str, $matches)) {
$out[] = array('number', $matches[0]);
$str = substr($str, strlen($matches[0]));
}
else if (preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*/', $str, $matches)) {
$out[] = array('name', $matches[0]);
$str = substr($str, strlen($matches[0]));
}
else {
return FALSE;
}
}
return TRUE;
}
function fatal_error ($message)
{
fwrite(STDERR, "Fatal error: $message\n");
ob_get_clean();
exit(1);
}
/**
* @file BProto.h
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*
* @section DESCRIPTION
*
* Definitions for BProto serialization.
*/
#ifndef BADVPN_BPROTO_BPROTO_H
#define BADVPN_BPROTO_BPROTO_H
#include <stdint.h>
#include <misc/packed.h>
#define BPROTO_TYPE_UINT8 1
#define BPROTO_TYPE_UINT16 2
#define BPROTO_TYPE_UINT32 3
#define BPROTO_TYPE_UINT64 4
#define BPROTO_TYPE_DATA 5
#define BPROTO_TYPE_CONSTDATA 6
B_START_PACKED
struct BProto_header_s {
uint16_t id;
uint16_t type;
} B_PACKED;
B_END_PACKED
B_START_PACKED
struct BProto_uint8_s {
uint8_t v;
} B_PACKED;
B_END_PACKED
B_START_PACKED
struct BProto_uint16_s {
uint16_t v;
} B_PACKED;
B_END_PACKED
B_START_PACKED
struct BProto_uint32_s {
uint32_t v;
} B_PACKED;
B_END_PACKED
B_START_PACKED
struct BProto_uint64_s {
uint64_t v;
} B_PACKED;
B_END_PACKED
B_START_PACKED
struct BProto_data_header_s {
uint32_t len;
} B_PACKED;
B_END_PACKED
#endif
%class ProtoParser
%start file
file =
directives messages {
$$ = array(
"directives" => $1,
"messages" => $2
);
}.
directives =
{
$$ = array();
} |
directive semicolon directives {
$$ = array_merge(array($1), $3);
}.
directive =
include string {
$$ = array(
"type" => "include",
"file" => $2
);
}.
messages =
msgspec {
$$ = array($1);
} |
msgspec messages {
$$ = array_merge(array($1), $2);
}.
msgspec =
message name spar entries epar semicolon {
$$ = array(
"name" => $2,
"entries" => $4
);
}.
entries =
entry {
$$ = array($1);
} |
entry entries {
$$ = array_merge(array($1), $2);
}.
entry =
cardinality type name equals number semicolon {
$$ = array(
"cardinality" => $1,
"type" => $2,
"name" => $3,
"id" => $5
);
}.
cardinality =
repeated {
$$ = "repeated";
} |
optional {
$$ = "optional";
} |
required {
$$ = "required";
} |
required repeated {
$$ = "required repeated";
}.
type =
uint {
$$ = array(
"type" => "uint",
"size" => $1
);
} |
data {
$$ = array(
"type" => "data"
);
} |
data srpar string erpar {
$$ = array(
"type" => "constdata",
"size" => $3
);
} |
message name {
$$ = array(
"type" => "message",
"message" => $2
);
}.
<?php
/*
DON'T EDIT THIS FILE!
This file was automatically generated by the Lime parser generator.
The real source code you should be looking at is in one or more
grammar files in the Lime format.
THE ONLY REASON TO LOOK AT THIS FILE is to see where in the grammar
file that your error happened, because there are enough comments to
help you debug your grammar.
If you ignore this warning, you're shooting yourself in the brain,
not the foot.
*/
class ProtoParser extends lime_parser {
var $qi = 0;
var $i = array (
0 =>
array (
'directives' => 's 1',
'directive' => 's 30',
'include' => 's 33',
'file' => 's 35',
'\'start\'' => 'a \'start\'',
'message' => 'r 1',
),
1 =>
array (
'messages' => 's 2',
'msgspec' => 's 3',
'message' => 's 5',
),
2 =>
array (
'#' => 'r 0',
),
3 =>
array (
'msgspec' => 's 3',
'messages' => 's 4',
'message' => 's 5',
'#' => 'r 4',
),
4 =>
array (
'#' => 'r 5',
),
5 =>
array (
'name' => 's 6',
),
6 =>
array (
'spar' => 's 7',
),
7 =>
array (
'entries' => 's 8',
'entry' => 's 11',
'cardinality' => 's 13',
'repeated' => 's 26',
'optional' => 's 27',
'required' => 's 28',
),
8 =>
array (
'epar' => 's 9',
),
9 =>
array (
'semicolon' => 's 10',
),
10 =>
array (
'message' => 'r 6',
'#' => 'r 6',
),
11 =>
array (
'entry' => 's 11',
'entries' => 's 12',
'cardinality' => 's 13',
'repeated' => 's 26',
'optional' => 's 27',
'required' => 's 28',
'epar' => 'r 7',
),
12 =>
array (
'epar' => 'r 8',
),
13 =>
array (
'type' => 's 14',
'uint' => 's 19',
'data' => 's 20',
'message' => 's 24',
),
14 =>
array (
'name' => 's 15',
),
15 =>
array (
'equals' => 's 16',
),
16 =>
array (
'number' => 's 17',
),
17 =>
array (
'semicolon' => 's 18',
),
18 =>
array (
'repeated' => 'r 9',
'optional' => 'r 9',
'required' => 'r 9',
'epar' => 'r 9',
),
19 =>
array (
'name' => 'r 14',
),
20 =>
array (
'srpar' => 's 21',
'name' => 'r 15',
),
21 =>
array (
'string' => 's 22',
),
22 =>
array (
'erpar' => 's 23',
),
23 =>
array (
'name' => 'r 16',
),
24 =>
array (
'name' => 's 25',
),
25 =>
array (
'name' => 'r 17',
),
26 =>
array (
'uint' => 'r 10',
'data' => 'r 10',
'message' => 'r 10',
),
27 =>
array (
'uint' => 'r 11',
'data' => 'r 11',
'message' => 'r 11',
),
28 =>
array (
'repeated' => 's 29',
'uint' => 'r 12',
'data' => 'r 12',
'message' => 'r 12',
),
29 =>
array (
'uint' => 'r 13',
'data' => 'r 13',
'message' => 'r 13',
),
30 =>
array (
'semicolon' => 's 31',
),
31 =>
array (
'directive' => 's 30',
'directives' => 's 32',
'include' => 's 33',
'message' => 'r 1',
),
32 =>
array (
'message' => 'r 2',
),
33 =>
array (
'string' => 's 34',
),
34 =>
array (
'semicolon' => 'r 3',
),
35 =>
array (
'#' => 'r 18',
),
);
function reduce_0_file_1($tokens, &$result) {
#
# (0) file := directives messages
#
$result = reset($tokens);
$result = array(
"directives" => $tokens[0],
"messages" => $tokens[1]
);
}
function reduce_1_directives_1($tokens, &$result) {
#
# (1) directives :=
#
$result = reset($tokens);
$result = array();
}
function reduce_2_directives_2($tokens, &$result) {
#
# (2) directives := directive semicolon directives
#
$result = reset($tokens);
$result = array_merge(array($tokens[0]), $tokens[2]);
}
function reduce_3_directive_1($tokens, &$result) {
#
# (3) directive := include string
#
$result = reset($tokens);
$result = array(
"type" => "include",
"file" => $tokens[1]
);
}
function reduce_4_messages_1($tokens, &$result) {
#
# (4) messages := msgspec
#
$result = reset($tokens);
$result = array($tokens[0]);
}
function reduce_5_messages_2($tokens, &$result) {
#
# (5) messages := msgspec messages
#
$result = reset($tokens);
$result = array_merge(array($tokens[0]), $tokens[1]);
}
function reduce_6_msgspec_1($tokens, &$result) {
#
# (6) msgspec := message name spar entries epar semicolon
#
$result = reset($tokens);
$result = array(
"name" => $tokens[1],
"entries" => $tokens[3]
);
}
function reduce_7_entries_1($tokens, &$result) {
#
# (7) entries := entry
#
$result = reset($tokens);
$result = array($tokens[0]);
}
function reduce_8_entries_2($tokens, &$result) {
#
# (8) entries := entry entries
#
$result = reset($tokens);
$result = array_merge(array($tokens[0]), $tokens[1]);
}
function reduce_9_entry_1($tokens, &$result) {
#
# (9) entry := cardinality type name equals number semicolon
#
$result = reset($tokens);
$result = array(
"cardinality" => $tokens[0],
"type" => $tokens[1],
"name" => $tokens[2],
"id" => $tokens[4]
);
}
function reduce_10_cardinality_1($tokens, &$result) {
#
# (10) cardinality := repeated
#
$result = reset($tokens);
$result = "repeated";
}
function reduce_11_cardinality_2($tokens, &$result) {
#
# (11) cardinality := optional
#
$result = reset($tokens);
$result = "optional";
}
function reduce_12_cardinality_3($tokens, &$result) {
#
# (12) cardinality := required
#
$result = reset($tokens);
$result = "required";
}
function reduce_13_cardinality_4($tokens, &$result) {
#
# (13) cardinality := required repeated
#
$result = reset($tokens);
$result = "required repeated";
}
function reduce_14_type_1($tokens, &$result) {
#
# (14) type := uint
#
$result = reset($tokens);
$result = array(
"type" => "uint",
"size" => $tokens[0]
);
}
function reduce_15_type_2($tokens, &$result) {
#
# (15) type := data
#
$result = reset($tokens);
$result = array(
"type" => "data"
);
}
function reduce_16_type_3($tokens, &$result) {
#
# (16) type := data srpar string erpar
#
$result = reset($tokens);
$result = array(
"type" => "constdata",
"size" => $tokens[2]
);
}
function reduce_17_type_4($tokens, &$result) {
#
# (17) type := message name
#
$result = reset($tokens);
$result = array(
"type" => "message",
"message" => $tokens[1]
);
}
function reduce_18_start_1($tokens, &$result) {
#
# (18) 'start' := file
#
$result = reset($tokens);
}
var $method = array (
0 => 'reduce_0_file_1',
1 => 'reduce_1_directives_1',
2 => 'reduce_2_directives_2',
3 => 'reduce_3_directive_1',
4 => 'reduce_4_messages_1',
5 => 'reduce_5_messages_2',
6 => 'reduce_6_msgspec_1',
7 => 'reduce_7_entries_1',
8 => 'reduce_8_entries_2',
9 => 'reduce_9_entry_1',
10 => 'reduce_10_cardinality_1',
11 => 'reduce_11_cardinality_2',
12 => 'reduce_12_cardinality_3',
13 => 'reduce_13_cardinality_4',
14 => 'reduce_14_type_1',
15 => 'reduce_15_type_2',
16 => 'reduce_16_type_3',
17 => 'reduce_17_type_4',
18 => 'reduce_18_start_1',
);
var $a = array (
0 =>
array (
'symbol' => 'file',
'len' => 2,
'replace' => true,
),
1 =>
array (
'symbol' => 'directives',
'len' => 0,
'replace' => true,
),
2 =>
array (
'symbol' => 'directives',
'len' => 3,
'replace' => true,
),
3 =>
array (
'symbol' => 'directive',
'len' => 2,
'replace' => true,
),
4 =>
array (
'symbol' => 'messages',
'len' => 1,
'replace' => true,
),
5 =>
array (
'symbol' => 'messages',
'len' => 2,
'replace' => true,
),
6 =>
array (
'symbol' => 'msgspec',
'len' => 6,
'replace' => true,
),
7 =>
array (
'symbol' => 'entries',
'len' => 1,
'replace' => true,
),
8 =>
array (
'symbol' => 'entries',
'len' => 2,
'replace' => true,
),
9 =>
array (
'symbol' => 'entry',
'len' => 6,
'replace' => true,
),
10 =>
array (
'symbol' => 'cardinality',
'len' => 1,
'replace' => true,
),
11 =>
array (
'symbol' => 'cardinality',
'len' => 1,
'replace' => true,
),
12 =>
array (
'symbol' => 'cardinality',
'len' => 1,
'replace' => true,
),
13 =>
array (
'symbol' => 'cardinality',
'len' => 2,
'replace' => true,
),
14 =>
array (
'symbol' => 'type',
'len' => 1,
'replace' => true,
),
15 =>
array (
'symbol' => 'type',
'len' => 1,
'replace' => true,
),
16 =>
array (
'symbol' => 'type',
'len' => 4,
'replace' => true,
),
17 =>
array (
'symbol' => 'type',
'len' => 2,
'replace' => true,
),
18 =>
array (
'symbol' => '\'start\'',
'len' => 1,
'replace' => true,
),
);
}
<?php
/**
* @file bproto.php
* @author Ambroz Bizjak <ambrop7@gmail.com>
*
* @section LICENSE
*
* 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.
*/
require_once "lime/parse_engine.php";
require_once "ProtoParser.php";
require_once "bproto_functions.php";
function assert_failure ($script, $line, $message)
{
if ($message == "") {
fatal_error("Assertion failure at {$script}:{$line}");
} else {
fatal_error("Assertion failure at {$script}:{$line}: {$message}");
}
}
assert_options(ASSERT_CALLBACK, "assert_failure");
function print_help ($name)
{
echo <<<EOD
Usage: {$name}
--name <string> Output file prefix.
--input-file <file> Message file to generate source for.
--output-dir <dir> Destination directory for generated files.
EOD;
}
$name = "";
$input_file = "";
$output_dir = "";
for ($i = 1; $i < $argc;) {
$arg = $argv[$i++];
switch ($arg) {
case "--name":
$name = $argv[$i++];
break;
case "--input-file":
$input_file = $argv[$i++];
break;
case "--output-dir":
$output_dir = $argv[$i++];
break;
case "--help":
print_help($argv[0]);
exit(0);
default:
fatal_error("Unknown option: {$arg}");
}
}
if ($name == "") {
fatal_error("--name missing");
}
if ($input_file == "") {
fatal_error("--input-file missing");
}
if ($output_dir == "") {
fatal_error("--output-dir missing");
}
if (($data = file_get_contents($input_file)) === FALSE) {
fatal_error("Failed to read input file");
}
if (!tokenize($data, $tokens)) {
fatal_error("Failed to tokenize");
}
$parser = new parse_engine(new ProtoParser());
try {
foreach ($tokens as $token) {
$parser->eat($token[0], $token[1]);
}
$parser->eat_eof();
} catch (parse_error $e) {
fatal_error("$input_file: Parse error: ".$e->getMessage());
}
$data = generate_header($name, $parser->semantic["directives"], $parser->semantic["messages"]);
if (file_put_contents("{$output_dir}/{$name}.h", $data) === NULL) {
fatal_error("{$input_file}: Failed to write .h file");
}
add_executable(badvpn-client
client.c
StreamPeerIO.c
DatagramPeerIO.c
PasswordListener.c
DataProto.c
FrameDecider.c
DPRelay.c
DPReceive.c
FragmentProtoDisassembler.c
FragmentProtoAssembler.c
SPProtoEncoder.c
SPProtoDecoder.c
DataProtoKeepaliveSource.c
PeerChat.c
SCOutmsgEncoder.c
SimpleStreamBuffer.c
SinglePacketSource.c
)
target_link_libraries(badvpn-client system flow flowextra tuntap server_conection security threadwork ${NSPR_LIBRARIES} ${NSS_LIBRARIES})
install(
TARGETS badvpn-client
RUNTIME DESTINATION bin
)
install(
FILES badvpn-client.8
DESTINATION share/man/man8
)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#define SAVL_PARAM_NAME FPAFramesTree
#define SAVL_PARAM_FEATURE_COUNTS 0
#define SAVL_PARAM_FEATURE_NOKEYS 0
#define SAVL_PARAM_TYPE_ENTRY struct FragmentProtoAssembler_frame
#define SAVL_PARAM_TYPE_KEY fragmentproto_frameid
#define SAVL_PARAM_TYPE_ARG int
#define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->id, (entry2)->id)
#define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2)->id)
#define SAVL_PARAM_MEMBER_NODE tree_node
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#define SAVL_PARAM_NAME FDGroupsTree
#define SAVL_PARAM_FEATURE_COUNTS 0
#define SAVL_PARAM_FEATURE_NOKEYS 0
#define SAVL_PARAM_TYPE_ENTRY struct _FrameDecider_group_entry
#define SAVL_PARAM_TYPE_KEY uint32_t
#define SAVL_PARAM_TYPE_ARG int
#define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->group, (entry2)->group)
#define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2)->group)
#define SAVL_PARAM_MEMBER_NODE tree_node
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment