├── .gitignore ├── OpenVPN ├── Dependencies │ └── liblzo │ │ ├── Makefile │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── compr1b.h │ │ ├── compr1c.h │ │ ├── config1.h │ │ ├── config1a.h │ │ ├── config1b.h │ │ ├── config1c.h │ │ ├── config1f.h │ │ ├── config1x.h │ │ ├── config1y.h │ │ ├── config1z.h │ │ ├── config2a.h │ │ ├── lzo │ │ ├── lzo1.h │ │ ├── lzo1a.h │ │ ├── lzo1b.h │ │ ├── lzo1c.h │ │ ├── lzo1f.h │ │ ├── lzo1x.h │ │ ├── lzo1y.h │ │ ├── lzo1z.h │ │ ├── lzo2a.h │ │ ├── lzo_asm.h │ │ ├── lzoconf.h │ │ ├── lzodefs.h │ │ └── lzoutil.h │ │ ├── lzo1.c │ │ ├── lzo1_99.c │ │ ├── lzo1_cm.ch │ │ ├── lzo1_d.ch │ │ ├── lzo1a.c │ │ ├── lzo1a_99.c │ │ ├── lzo1a_cm.ch │ │ ├── lzo1a_cr.ch │ │ ├── lzo1a_de.h │ │ ├── lzo1b_1.c │ │ ├── lzo1b_2.c │ │ ├── lzo1b_3.c │ │ ├── lzo1b_4.c │ │ ├── lzo1b_5.c │ │ ├── lzo1b_6.c │ │ ├── lzo1b_7.c │ │ ├── lzo1b_8.c │ │ ├── lzo1b_9.c │ │ ├── lzo1b_99.c │ │ ├── lzo1b_9x.c │ │ ├── lzo1b_c.ch │ │ ├── lzo1b_cc.c │ │ ├── lzo1b_cc.h │ │ ├── lzo1b_cm.ch │ │ ├── lzo1b_cr.ch │ │ ├── lzo1b_d.ch │ │ ├── lzo1b_d1.c │ │ ├── lzo1b_d2.c │ │ ├── lzo1b_de.h │ │ ├── lzo1b_r.ch │ │ ├── lzo1b_rr.c │ │ ├── lzo1b_sm.ch │ │ ├── lzo1b_tm.ch │ │ ├── lzo1b_xx.c │ │ ├── lzo1c_1.c │ │ ├── lzo1c_2.c │ │ ├── lzo1c_3.c │ │ ├── lzo1c_4.c │ │ ├── lzo1c_5.c │ │ ├── lzo1c_6.c │ │ ├── lzo1c_7.c │ │ ├── lzo1c_8.c │ │ ├── lzo1c_9.c │ │ ├── lzo1c_99.c │ │ ├── lzo1c_9x.c │ │ ├── lzo1c_cc.c │ │ ├── lzo1c_cc.h │ │ ├── lzo1c_d1.c │ │ ├── lzo1c_d2.c │ │ ├── lzo1c_rr.c │ │ ├── lzo1c_xx.c │ │ ├── lzo1f_1.c │ │ ├── lzo1f_9x.c │ │ ├── lzo1f_d.ch │ │ ├── lzo1f_d1.c │ │ ├── lzo1f_d2.c │ │ ├── lzo1x_1.c │ │ ├── lzo1x_1k.c │ │ ├── lzo1x_1l.c │ │ ├── lzo1x_1o.c │ │ ├── lzo1x_9x.c │ │ ├── lzo1x_c.ch │ │ ├── lzo1x_d.ch │ │ ├── lzo1x_d1.c │ │ ├── lzo1x_d2.c │ │ ├── lzo1x_d3.c │ │ ├── lzo1x_o.c │ │ ├── lzo1x_oo.ch │ │ ├── lzo1y_1.c │ │ ├── lzo1y_9x.c │ │ ├── lzo1y_d1.c │ │ ├── lzo1y_d2.c │ │ ├── lzo1y_d3.c │ │ ├── lzo1y_o.c │ │ ├── lzo1z_9x.c │ │ ├── lzo1z_d1.c │ │ ├── lzo1z_d2.c │ │ ├── lzo1z_d3.c │ │ ├── lzo2a_9x.c │ │ ├── lzo2a_d.ch │ │ ├── lzo2a_d1.c │ │ ├── lzo2a_d2.c │ │ ├── lzo_conf.h │ │ ├── lzo_crc.c │ │ ├── lzo_dict.h │ │ ├── lzo_dll.ch │ │ ├── lzo_func.ch │ │ ├── lzo_func.h │ │ ├── lzo_init.c │ │ ├── lzo_mchw.ch │ │ ├── lzo_ptr.c │ │ ├── lzo_ptr.h │ │ ├── lzo_str.c │ │ ├── lzo_supp.h │ │ ├── lzo_swd.ch │ │ ├── lzo_util.c │ │ ├── miniacc.h │ │ ├── stats1a.h │ │ ├── stats1b.h │ │ └── stats1c.h ├── Info.plist ├── OpenVPN.h └── OpenVPN │ ├── base64.c │ ├── base64.h │ ├── basic.h │ ├── buffer.c │ ├── buffer.h │ ├── circ_list.h │ ├── clinat.c │ ├── clinat.h │ ├── common.h │ ├── compat-stdbool.h │ ├── config.h │ ├── console.c │ ├── console.h │ ├── crypto.c │ ├── crypto.h │ ├── crypto_backend.h │ ├── crypto_openssl.c │ ├── crypto_openssl.h │ ├── crypto_polarssl.c │ ├── crypto_polarssl.h │ ├── cryptoapi.c │ ├── cryptoapi.h │ ├── dhcp.c │ ├── dhcp.h │ ├── errlevel.h │ ├── error.c │ ├── error.h │ ├── event.c │ ├── event.h │ ├── fdmisc.c │ ├── fdmisc.h │ ├── forward-inline.h │ ├── forward.c │ ├── forward.h │ ├── fragment.c │ ├── fragment.h │ ├── gremlin.c │ ├── gremlin.h │ ├── helper.c │ ├── helper.h │ ├── httpdigest.c │ ├── httpdigest.h │ ├── include │ └── openvpn-plugin.h │ ├── init.c │ ├── init.h │ ├── integer.h │ ├── interval.c │ ├── interval.h │ ├── list.c │ ├── list.h │ ├── lladdr.c │ ├── lladdr.h │ ├── lzo.c │ ├── lzo.h │ ├── manage.c │ ├── manage.h │ ├── mbuf.c │ ├── mbuf.h │ ├── memdbg.h │ ├── misc.c │ ├── misc.h │ ├── mroute.c │ ├── mroute.h │ ├── mss.c │ ├── mss.h │ ├── mstats.c │ ├── mstats.h │ ├── mtcp.c │ ├── mtcp.h │ ├── mtu.c │ ├── mtu.h │ ├── mudp.c │ ├── mudp.h │ ├── multi.c │ ├── multi.h │ ├── ntlm.c │ ├── ntlm.h │ ├── occ-inline.h │ ├── occ.c │ ├── occ.h │ ├── openvpn.c │ ├── openvpn.h │ ├── options.c │ ├── options.h │ ├── otime.c │ ├── otime.h │ ├── packet_id.c │ ├── packet_id.h │ ├── perf.c │ ├── perf.h │ ├── pf-inline.h │ ├── pf.c │ ├── pf.h │ ├── ping-inline.h │ ├── ping.c │ ├── ping.h │ ├── pkcs11.c │ ├── pkcs11.h │ ├── pkcs11_backend.h │ ├── pkcs11_openssl.c │ ├── pkcs11_polarssl.c │ ├── platform.c │ ├── platform.h │ ├── plugin.c │ ├── plugin.h │ ├── pool.c │ ├── pool.h │ ├── proto.c │ ├── proto.h │ ├── proxy.c │ ├── proxy.h │ ├── ps.c │ ├── ps.h │ ├── push.c │ ├── push.h │ ├── pushlist.h │ ├── reliable.c │ ├── reliable.h │ ├── route.c │ ├── route.h │ ├── schedule.c │ ├── schedule.h │ ├── session_id.c │ ├── session_id.h │ ├── shaper.c │ ├── shaper.h │ ├── sig.c │ ├── sig.h │ ├── socket.c │ ├── socket.h │ ├── socks.c │ ├── socks.h │ ├── ssl.c │ ├── ssl.h │ ├── ssl_backend.h │ ├── ssl_common.h │ ├── ssl_openssl.c │ ├── ssl_openssl.h │ ├── ssl_polarssl.c │ ├── ssl_polarssl.h │ ├── ssl_verify.c │ ├── ssl_verify.h │ ├── ssl_verify_backend.h │ ├── ssl_verify_openssl.c │ ├── ssl_verify_openssl.h │ ├── ssl_verify_polarssl.c │ ├── ssl_verify_polarssl.h │ ├── status.c │ ├── status.h │ ├── syshead.h │ ├── tun.c │ ├── tun.h │ ├── win32.c │ └── win32.h ├── OpenVPNSample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── OpenVPNSample.xcworkspace └── contents.xcworkspacedata ├── OpenVPNSample ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── OpenVPNSample.entitlements ├── ViewController.h ├── ViewController.m └── main.m ├── OpenVPNTunnelProvider ├── Info.plist ├── OpenVPNTunnelProvider.entitlements ├── PacketTunnelProvider.h └── PacketTunnelProvider.m └── Podfile /.gitignore: -------------------------------------------------------------------------------- 1 | *xcuserdata* 2 | *.DS_Store* 3 | Pods* 4 | Podfile.lock 5 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to create Makefile.in 2 | # 3 | # Copyright (C) 1996-2008 Markus F.X.J. Oberhumer 4 | # 5 | 6 | VPATH = @srcdir@@LZO_ASM_VPATH@ 7 | SUFFIXES = .S 8 | 9 | INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) 10 | CPPFLAGS = $(LZO_CPPFLAGS) $(configure_CPPFLAGS) $(LZO_EXTRA_CPPFLAGS) 11 | CFLAGS = $(LZO_CFLAGS) $(configure_CFLAGS) $(LZO_EXTRA_CFLAGS) 12 | 13 | lib_LTLIBRARIES = liblzo2.la 14 | 15 | liblzo2_la_LDFLAGS = -version-info 2:0:0 16 | 17 | liblzo2_la_SOURCES = \ 18 | lzo_crc.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \ 19 | lzo1.c lzo1_99.c \ 20 | lzo1a.c lzo1a_99.c \ 21 | lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \ 22 | lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \ 23 | lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \ 24 | lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \ 25 | lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \ 26 | lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \ 27 | lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \ 28 | lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \ 29 | lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \ 30 | lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \ 31 | lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \ 32 | lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c 33 | 34 | EXTRA_DIST = \ 35 | lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \ 36 | lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \ 37 | lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \ 38 | lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch \ 39 | lzo_dll.ch lzo_mchw.ch lzo_swd.ch \ 40 | compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \ 41 | config1f.h config1x.h config1y.h config1z.h config2a.h \ 42 | lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \ 43 | lzo_ptr.h stats1a.h stats1b.h stats1c.h miniacc.h 44 | 45 | liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS) 46 | liblzo2_la_DEPENDENCIES = $(liblzo2_la_LIBADD) 47 | 48 | 49 | # /*********************************************************************** 50 | # // assembler support 51 | # ************************************************************************/ 52 | 53 | if LZO_USE_ASM 54 | 55 | LZO_ASM_OBJECTS = \ 56 | lzo1c_s1.lo lzo1c_s2.lo \ 57 | lzo1f_f1.lo lzo1f_f2.lo \ 58 | lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \ 59 | lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo 60 | 61 | .S.o: 62 | $(CC) -c $< 63 | 64 | .S.lo: 65 | $(LIBTOOL) --mode=compile $(CC) -c $< 66 | 67 | endif 68 | 69 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/compr1b.h: -------------------------------------------------------------------------------- 1 | /* compr1b.h -- 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define LZO_NEED_DICT_H 1 30 | #include "config1b.h" 31 | 32 | 33 | #if !defined(COMPRESS_ID) 34 | #define COMPRESS_ID LZO_PP_ECONCAT2(DD_BITS,CLEVEL) 35 | #endif 36 | 37 | 38 | #include "lzo1b_c.ch" 39 | 40 | 41 | /*********************************************************************** 42 | // 43 | ************************************************************************/ 44 | 45 | #define LZO_COMPRESS \ 46 | LZO_PP_ECONCAT3(lzo1b_,COMPRESS_ID,_compress) 47 | 48 | #define LZO_COMPRESS_FUNC \ 49 | LZO_PP_ECONCAT3(_lzo1b_,COMPRESS_ID,_compress_func) 50 | 51 | 52 | 53 | /*********************************************************************** 54 | // 55 | ************************************************************************/ 56 | 57 | const lzo_compress_t LZO_COMPRESS_FUNC = do_compress; 58 | 59 | LZO_PUBLIC(int) 60 | LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len, 61 | lzo_bytep out, lzo_uintp out_len, 62 | lzo_voidp wrkmem ) 63 | { 64 | return _lzo1b_do_compress(in,in_len,out,out_len,wrkmem,do_compress); 65 | } 66 | 67 | 68 | /* vim:set ts=4 sw=4 et: */ 69 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/compr1c.h: -------------------------------------------------------------------------------- 1 | /* compr1c.h -- 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define LZO_NEED_DICT_H 1 30 | #include "config1c.h" 31 | 32 | 33 | #if !defined(COMPRESS_ID) 34 | #define COMPRESS_ID LZO_PP_ECONCAT2(DD_BITS,CLEVEL) 35 | #endif 36 | 37 | 38 | #include "lzo1b_c.ch" 39 | 40 | 41 | /*********************************************************************** 42 | // 43 | ************************************************************************/ 44 | 45 | #define LZO_COMPRESS \ 46 | LZO_PP_ECONCAT3(lzo1c_,COMPRESS_ID,_compress) 47 | 48 | #define LZO_COMPRESS_FUNC \ 49 | LZO_PP_ECONCAT3(_lzo1c_,COMPRESS_ID,_compress_func) 50 | 51 | 52 | 53 | /*********************************************************************** 54 | // 55 | ************************************************************************/ 56 | 57 | const lzo_compress_t LZO_COMPRESS_FUNC = do_compress; 58 | 59 | LZO_PUBLIC(int) 60 | LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len, 61 | lzo_bytep out, lzo_uintp out_len, 62 | lzo_voidp wrkmem ) 63 | { 64 | return _lzo1c_do_compress(in,in_len,out,out_len,wrkmem,do_compress); 65 | } 66 | 67 | 68 | /* vim:set ts=4 sw=4 et: */ 69 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/config1.h: -------------------------------------------------------------------------------- 1 | /* config1.h -- configuration for the LZO1 algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | #ifndef __LZO_CONFIG1_H 35 | #define __LZO_CONFIG1_H 1 36 | 37 | #include "lzo_conf.h" 38 | #include 39 | 40 | #define LZO_NO_R1 1 41 | #include "config1a.h" 42 | 43 | #endif /* already included */ 44 | 45 | 46 | /* vim:set ts=4 sw=4 et: */ 47 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/config1f.h: -------------------------------------------------------------------------------- 1 | /* config1f.h -- configuration for the LZO1F algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #ifndef __LZO_CONFIG1F_H 36 | #define __LZO_CONFIG1F_H 1 37 | 38 | #include "lzo_conf.h" 39 | #include 40 | 41 | 42 | /*********************************************************************** 43 | // 44 | ************************************************************************/ 45 | 46 | #define LZO_EOF_CODE 1 47 | #undef LZO_DETERMINISTIC 48 | 49 | #define M2_MAX_OFFSET 0x0800 50 | #define M3_MAX_OFFSET 0x3fff 51 | 52 | #define M2_MIN_LEN 3 53 | #define M2_MAX_LEN 8 54 | #define M3_MIN_LEN 3 55 | #define M3_MAX_LEN 33 56 | 57 | #define M3_MARKER 224 58 | 59 | 60 | /*********************************************************************** 61 | // 62 | ************************************************************************/ 63 | 64 | #ifndef MIN_LOOKAHEAD 65 | #define MIN_LOOKAHEAD (M2_MAX_LEN + 1) 66 | #endif 67 | 68 | #if defined(LZO_NEED_DICT_H) 69 | 70 | #ifndef LZO_HASH 71 | #define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A 72 | #endif 73 | #define DL_MIN_LEN M2_MIN_LEN 74 | #include "lzo_dict.h" 75 | 76 | #endif 77 | 78 | 79 | 80 | #endif /* already included */ 81 | 82 | 83 | /* vim:set ts=4 sw=4 et: */ 84 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/config1y.h: -------------------------------------------------------------------------------- 1 | /* config1y.h -- configuration for the LZO1Y algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #ifndef __LZO_CONFIG1Y_H 36 | #define __LZO_CONFIG1Y_H 1 37 | 38 | #if !defined(LZO1Y) 39 | # define LZO1Y 1 40 | #endif 41 | 42 | #include "lzo_conf.h" 43 | #include 44 | 45 | #define M2_MAX_LEN 14 46 | #define M2_MAX_OFFSET 0x0400 47 | #include "config1x.h" 48 | 49 | #endif /* already included */ 50 | 51 | 52 | /* vim:set ts=4 sw=4 et: */ 53 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/config1z.h: -------------------------------------------------------------------------------- 1 | /* config1z.h -- configuration for the LZO1Z algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #ifndef __LZO_CONFIG1Z_H 36 | #define __LZO_CONFIG1Z_H 1 37 | 38 | #if !defined(LZO1Z) 39 | # define LZO1Z 1 40 | #endif 41 | 42 | #include "lzo_conf.h" 43 | #include 44 | 45 | #define M2_MAX_OFFSET 0x0700 46 | #include "config1x.h" 47 | 48 | #endif /* already included */ 49 | 50 | 51 | /* vim:set ts=4 sw=4 et: */ 52 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo/lzo1.h: -------------------------------------------------------------------------------- 1 | /* lzo1.h -- public interface of the LZO1 compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #ifndef __LZO1_H_INCLUDED 30 | #define __LZO1_H_INCLUDED 1 31 | 32 | #ifndef __LZOCONF_H_INCLUDED 33 | #include 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | 41 | /*********************************************************************** 42 | // 43 | ************************************************************************/ 44 | 45 | /* Memory required for the wrkmem parameter. 46 | * When the required size is 0, you can also pass a NULL pointer. 47 | */ 48 | 49 | #define LZO1_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t)) 50 | #define LZO1_MEM_DECOMPRESS (0) 51 | 52 | 53 | LZO_EXTERN(int) 54 | lzo1_compress ( const lzo_bytep src, lzo_uint src_len, 55 | lzo_bytep dst, lzo_uintp dst_len, 56 | lzo_voidp wrkmem ); 57 | 58 | LZO_EXTERN(int) 59 | lzo1_decompress ( const lzo_bytep src, lzo_uint src_len, 60 | lzo_bytep dst, lzo_uintp dst_len, 61 | lzo_voidp wrkmem /* NOT USED */ ); 62 | 63 | 64 | /*********************************************************************** 65 | // better compression ratio at the cost of more memory and time 66 | ************************************************************************/ 67 | 68 | #define LZO1_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t)) 69 | 70 | LZO_EXTERN(int) 71 | lzo1_99_compress ( const lzo_bytep src, lzo_uint src_len, 72 | lzo_bytep dst, lzo_uintp dst_len, 73 | lzo_voidp wrkmem ); 74 | 75 | 76 | 77 | #ifdef __cplusplus 78 | } /* extern "C" */ 79 | #endif 80 | 81 | #endif /* already included */ 82 | 83 | 84 | /* vim:set ts=4 sw=4 et: */ 85 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo/lzo1a.h: -------------------------------------------------------------------------------- 1 | /* lzo1a.h -- public interface of the LZO1A compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #ifndef __LZO1A_H_INCLUDED 30 | #define __LZO1A_H_INCLUDED 1 31 | 32 | #ifndef __LZOCONF_H_INCLUDED 33 | #include 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | 41 | /*********************************************************************** 42 | // 43 | ************************************************************************/ 44 | 45 | /* Memory required for the wrkmem parameter. 46 | * When the required size is 0, you can also pass a NULL pointer. 47 | */ 48 | 49 | #define LZO1A_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t)) 50 | #define LZO1A_MEM_DECOMPRESS (0) 51 | 52 | 53 | LZO_EXTERN(int) 54 | lzo1a_compress ( const lzo_bytep src, lzo_uint src_len, 55 | lzo_bytep dst, lzo_uintp dst_len, 56 | lzo_voidp wrkmem ); 57 | 58 | LZO_EXTERN(int) 59 | lzo1a_decompress ( const lzo_bytep src, lzo_uint src_len, 60 | lzo_bytep dst, lzo_uintp dst_len, 61 | lzo_voidp wrkmem /* NOT USED */ ); 62 | 63 | 64 | /*********************************************************************** 65 | // better compression ratio at the cost of more memory and time 66 | ************************************************************************/ 67 | 68 | #define LZO1A_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t)) 69 | 70 | LZO_EXTERN(int) 71 | lzo1a_99_compress ( const lzo_bytep src, lzo_uint src_len, 72 | lzo_bytep dst, lzo_uintp dst_len, 73 | lzo_voidp wrkmem ); 74 | 75 | 76 | 77 | #ifdef __cplusplus 78 | } /* extern "C" */ 79 | #endif 80 | 81 | #endif /* already included */ 82 | 83 | 84 | /* vim:set ts=4 sw=4 et: */ 85 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo/lzo2a.h: -------------------------------------------------------------------------------- 1 | /* lzo2a.h -- public interface of the LZO2A compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #ifndef __LZO2A_H_INCLUDED 30 | #define __LZO2A_H_INCLUDED 1 31 | 32 | #ifndef __LZOCONF_H_INCLUDED 33 | #include 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | 41 | /*********************************************************************** 42 | // 43 | ************************************************************************/ 44 | 45 | #define LZO2A_MEM_DECOMPRESS (0) 46 | 47 | /* decompression */ 48 | LZO_EXTERN(int) 49 | lzo2a_decompress ( const lzo_bytep src, lzo_uint src_len, 50 | lzo_bytep dst, lzo_uintp dst_len, 51 | lzo_voidp wrkmem /* NOT USED */ ); 52 | 53 | /* safe decompression with overrun testing */ 54 | LZO_EXTERN(int) 55 | lzo2a_decompress_safe ( const lzo_bytep src, lzo_uint src_len, 56 | lzo_bytep dst, lzo_uintp dst_len, 57 | lzo_voidp wrkmem /* NOT USED */ ); 58 | 59 | 60 | /*********************************************************************** 61 | // better compression ratio at the cost of more memory and time 62 | ************************************************************************/ 63 | 64 | #define LZO2A_999_MEM_COMPRESS ((lzo_uint32_t) (8 * 16384L * sizeof(short))) 65 | 66 | LZO_EXTERN(int) 67 | lzo2a_999_compress ( const lzo_bytep src, lzo_uint src_len, 68 | lzo_bytep dst, lzo_uintp dst_len, 69 | lzo_voidp wrkmem ); 70 | 71 | 72 | 73 | #ifdef __cplusplus 74 | } /* extern "C" */ 75 | #endif 76 | 77 | #endif /* already included */ 78 | 79 | 80 | /* vim:set ts=4 sw=4 et: */ 81 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo/lzoutil.h: -------------------------------------------------------------------------------- 1 | /* lzoutil.h -- utility functions for use by applications 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #ifndef __LZOUTIL_H_INCLUDED 30 | #define __LZOUTIL_H_INCLUDED 1 31 | 32 | #ifndef __LZOCONF_H_INCLUDED 33 | #include 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | 41 | /*********************************************************************** 42 | // LZO-v1 deprecated macros (which were used in the old example programs) 43 | // 44 | // THIS FILE IS DEPRECATED. DO NOT USE. 45 | ************************************************************************/ 46 | 47 | #define lzo_alloc(a,b) (malloc((a)*(b))) 48 | #define lzo_malloc(a) (malloc(a)) 49 | #define lzo_free(a) (free(a)) 50 | 51 | #define lzo_fread(f,b,s) (fread(b,1,s,f)) 52 | #define lzo_fwrite(f,b,s) (fwrite(b,1,s,f)) 53 | 54 | 55 | #ifdef __cplusplus 56 | } /* extern "C" */ 57 | #endif 58 | 59 | #endif /* already included */ 60 | 61 | 62 | /* vim:set ts=4 sw=4 et: */ 63 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1_cm.ch: -------------------------------------------------------------------------------- 1 | /* lzo1_cm.ch -- implementation of the LZO1 compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #include "lzo1a_cm.ch" 36 | 37 | 38 | /* vim:set ts=4 sw=4 et: */ 39 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_1.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_1.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 1 30 | 31 | #define DDBITS 0 32 | #define CLEVEL 1 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_2.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_2.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 2 30 | 31 | #define DDBITS 0 32 | #define CLEVEL 2 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_3.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_3.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 3 30 | 31 | #define DDBITS 0 32 | #define CLEVEL 3 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_4.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_4.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 4 30 | 31 | #define DDBITS 1 32 | #define CLEVEL 2 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_5.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_5.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 5 30 | 31 | #define DDBITS 1 32 | #define CLEVEL 3 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_6.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_6.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 6 30 | 31 | #define DDBITS 1 32 | #define CLEVEL 5 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_7.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_7.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 7 30 | 31 | #define DDBITS 2 32 | #define CLEVEL 3 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_8.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_8.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 8 30 | 31 | #define DDBITS 2 32 | #define CLEVEL 8 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_9.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_9.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 9 30 | 31 | #define DDBITS 2 32 | #define CLEVEL 9 33 | #include "compr1b.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_99.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_99.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 99 30 | 31 | #define DDBITS 3 32 | #define CLEVEL 9 33 | 34 | #define D_BITS 16 35 | #define MATCH_IP_END in_end 36 | #include "compr1b.h" 37 | 38 | /* vim:set ts=4 sw=4 et: */ 39 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_cc.h: -------------------------------------------------------------------------------- 1 | /* lzo1b_cc.h -- definitions for the the LZO1B compression driver 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #ifndef __LZO1B_CC_H 36 | #define __LZO1B_CC_H 1 37 | 38 | 39 | /*********************************************************************** 40 | // 41 | ************************************************************************/ 42 | 43 | extern const lzo_compress_t _lzo1b_1_compress_func; 44 | extern const lzo_compress_t _lzo1b_2_compress_func; 45 | extern const lzo_compress_t _lzo1b_3_compress_func; 46 | extern const lzo_compress_t _lzo1b_4_compress_func; 47 | extern const lzo_compress_t _lzo1b_5_compress_func; 48 | extern const lzo_compress_t _lzo1b_6_compress_func; 49 | extern const lzo_compress_t _lzo1b_7_compress_func; 50 | extern const lzo_compress_t _lzo1b_8_compress_func; 51 | extern const lzo_compress_t _lzo1b_9_compress_func; 52 | 53 | extern const lzo_compress_t _lzo1b_99_compress_func; 54 | 55 | 56 | /*********************************************************************** 57 | // 58 | ************************************************************************/ 59 | 60 | LZO_LOCAL_DECL(lzo_bytep ) 61 | _lzo1b_store_run ( lzo_bytep const oo, const lzo_bytep const ii, 62 | lzo_uint r_len); 63 | 64 | #define STORE_RUN _lzo1b_store_run 65 | 66 | 67 | LZO_LOCAL_DECL(int) 68 | _lzo1b_do_compress ( const lzo_bytep in, lzo_uint in_len, 69 | lzo_bytep out, lzo_uintp out_len, 70 | lzo_voidp wrkmem, 71 | lzo_compress_t func ); 72 | 73 | 74 | #endif /* already included */ 75 | 76 | 77 | /* vim:set ts=4 sw=4 et: */ 78 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_d1.c -- LZO1B decompression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1b.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo1b_decompress 33 | 34 | #include "lzo1b_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_d2.c -- LZO1B decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1b.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo1b_decompress_safe 33 | 34 | #include "lzo1b_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_rr.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_rr.c -- literal run handling 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1b.h" 30 | 31 | #include "lzo1b_r.ch" 32 | 33 | /* vim:set ts=4 sw=4 et: */ 34 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_tm.ch: -------------------------------------------------------------------------------- 1 | /* lzo1b_tm.ch -- implementation of the LZO1B compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | 36 | /*********************************************************************** 37 | // test for a potential match 38 | ************************************************************************/ 39 | 40 | 41 | #if (DD_BITS == 0) 42 | 43 | try_match: 44 | #if !defined(NDEBUG) && (LZO_DICT_USE_PTR) 45 | #if (LZO_DETERMINISTIC) 46 | assert(m_pos == NULL || m_pos >= in); 47 | assert(m_pos == NULL || m_pos < ip); 48 | #endif 49 | m_pos_sav = m_pos; 50 | #endif 51 | if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2]) 52 | { 53 | m_pos += 3; 54 | goto match; 55 | } 56 | 57 | 58 | #else /* (DD_BITS == 0) */ 59 | 60 | 61 | /* test potential match */ 62 | 63 | if (m_len > M2_MIN_LEN) 64 | goto match; 65 | if (m_len == M2_MIN_LEN) 66 | { 67 | #if (_MAX_OFFSET == _M2_MAX_OFFSET) 68 | goto match; 69 | #else 70 | if (m_off <= M2_MAX_OFFSET) 71 | goto match; 72 | #if 0 && (M3_MIN_LEN == M2_MIN_LEN) 73 | if (ip == ii) 74 | goto match; 75 | #endif 76 | #endif 77 | } 78 | goto literal; 79 | 80 | 81 | #endif /* (DD_BITS == 0) */ 82 | 83 | 84 | /* vim:set ts=4 sw=4 et: */ 85 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1b_xx.c: -------------------------------------------------------------------------------- 1 | /* lzo1b_xx.c -- LZO1B compression public entry point 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1b.h" 30 | 31 | 32 | /*********************************************************************** 33 | // 34 | ************************************************************************/ 35 | 36 | static const lzo_compress_t * const c_funcs [9] = 37 | { 38 | &_lzo1b_1_compress_func, 39 | &_lzo1b_2_compress_func, 40 | &_lzo1b_3_compress_func, 41 | &_lzo1b_4_compress_func, 42 | &_lzo1b_5_compress_func, 43 | &_lzo1b_6_compress_func, 44 | &_lzo1b_7_compress_func, 45 | &_lzo1b_8_compress_func, 46 | &_lzo1b_9_compress_func 47 | }; 48 | 49 | 50 | static lzo_compress_t lzo1b_get_compress_func(int clevel) 51 | { 52 | const lzo_compress_t *f; 53 | 54 | if (clevel < LZO1B_BEST_SPEED || clevel > LZO1B_BEST_COMPRESSION) 55 | { 56 | if (clevel == LZO1B_DEFAULT_COMPRESSION) 57 | clevel = LZO1B_BEST_SPEED; 58 | else 59 | return (lzo_compress_t) 0; 60 | } 61 | f = c_funcs[clevel-1]; 62 | assert(f && *f); 63 | return *f; 64 | } 65 | 66 | 67 | LZO_PUBLIC(int) 68 | lzo1b_compress ( const lzo_bytep src, lzo_uint src_len, 69 | lzo_bytep dst, lzo_uintp dst_len, 70 | lzo_voidp wrkmem, 71 | int clevel ) 72 | { 73 | lzo_compress_t f; 74 | 75 | f = lzo1b_get_compress_func(clevel); 76 | if (!f) 77 | return LZO_E_ERROR; 78 | return _lzo1b_do_compress(src,src_len,dst,dst_len,wrkmem,f); 79 | } 80 | 81 | 82 | /* vim:set ts=4 sw=4 et: */ 83 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_1.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_1.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 1 30 | 31 | #define DDBITS 0 32 | #define CLEVEL 1 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_2.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_2.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 2 30 | 31 | #define DDBITS 0 32 | #define CLEVEL 2 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_3.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_3.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 3 30 | 31 | #define DDBITS 0 32 | #define CLEVEL 3 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_4.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_4.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 4 30 | 31 | #define DDBITS 1 32 | #define CLEVEL 2 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_5.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_5.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 5 30 | 31 | #define DDBITS 1 32 | #define CLEVEL 3 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_6.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_6.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 6 30 | 31 | #define DDBITS 1 32 | #define CLEVEL 5 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_7.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_7.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 7 30 | 31 | #define DDBITS 2 32 | #define CLEVEL 3 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_8.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_8.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 8 30 | 31 | #define DDBITS 2 32 | #define CLEVEL 8 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_9.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_9.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 9 30 | 31 | #define DDBITS 2 32 | #define CLEVEL 9 33 | #include "compr1c.h" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_99.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_99.c -- main internal configuration file for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define COMPRESS_ID 99 30 | 31 | #define DDBITS 3 32 | #define CLEVEL 9 33 | 34 | #define D_BITS 16 35 | #define MATCH_IP_END in_end 36 | #include "compr1c.h" 37 | 38 | /* vim:set ts=4 sw=4 et: */ 39 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_cc.h: -------------------------------------------------------------------------------- 1 | /* lzo1c_cc.h -- definitions for the the LZO1C compression driver 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #ifndef __LZO1C_CC_H 36 | #define __LZO1C_CC_H 1 37 | 38 | 39 | /*********************************************************************** 40 | // 41 | ************************************************************************/ 42 | 43 | extern const lzo_compress_t _lzo1c_1_compress_func; 44 | extern const lzo_compress_t _lzo1c_2_compress_func; 45 | extern const lzo_compress_t _lzo1c_3_compress_func; 46 | extern const lzo_compress_t _lzo1c_4_compress_func; 47 | extern const lzo_compress_t _lzo1c_5_compress_func; 48 | extern const lzo_compress_t _lzo1c_6_compress_func; 49 | extern const lzo_compress_t _lzo1c_7_compress_func; 50 | extern const lzo_compress_t _lzo1c_8_compress_func; 51 | extern const lzo_compress_t _lzo1c_9_compress_func; 52 | 53 | extern const lzo_compress_t _lzo1c_99_compress_func; 54 | 55 | 56 | /*********************************************************************** 57 | // 58 | ************************************************************************/ 59 | 60 | LZO_LOCAL_DECL(lzo_bytep ) 61 | _lzo1c_store_run ( lzo_bytep const oo, const lzo_bytep const ii, 62 | lzo_uint r_len); 63 | 64 | #define STORE_RUN _lzo1c_store_run 65 | 66 | 67 | LZO_LOCAL_DECL(int) 68 | _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len, 69 | lzo_bytep out, lzo_uintp out_len, 70 | lzo_voidp wrkmem, 71 | lzo_compress_t func ); 72 | 73 | 74 | #endif /* already included */ 75 | 76 | 77 | /* vim:set ts=4 sw=4 et: */ 78 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_d1.c -- LZO1C decompression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1c.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo1c_decompress 33 | 34 | #include "lzo1b_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_d2.c -- LZO1C decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1c.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo1c_decompress_safe 33 | 34 | #include "lzo1b_d.ch" 35 | 36 | #if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM) 37 | LZO_EXTERN(int) lzo1c_decompress_asm_safe 38 | (const lzo_bytep src, lzo_uint src_len, 39 | lzo_bytep dst, lzo_uintp dst_len, 40 | lzo_voidp wrkmem); 41 | LZO_PUBLIC(int) lzo1c_decompress_asm_safe 42 | (const lzo_bytep src, lzo_uint src_len, 43 | lzo_bytep dst, lzo_uintp dst_len, 44 | lzo_voidp wrkmem) 45 | { 46 | return lzo1c_decompress_safe(src, src_len, dst, dst_len, wrkmem); 47 | } 48 | #endif 49 | 50 | /* vim:set ts=4 sw=4 et: */ 51 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_rr.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_rr.c -- literal run handling 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1c.h" 30 | 31 | #include "lzo1b_r.ch" 32 | 33 | /* vim:set ts=4 sw=4 et: */ 34 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1c_xx.c: -------------------------------------------------------------------------------- 1 | /* lzo1c_xx.c -- LZO1C compression public entry point 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1c.h" 30 | 31 | 32 | /*********************************************************************** 33 | // 34 | ************************************************************************/ 35 | 36 | static const lzo_compress_t * const c_funcs [9] = 37 | { 38 | &_lzo1c_1_compress_func, 39 | &_lzo1c_2_compress_func, 40 | &_lzo1c_3_compress_func, 41 | &_lzo1c_4_compress_func, 42 | &_lzo1c_5_compress_func, 43 | &_lzo1c_6_compress_func, 44 | &_lzo1c_7_compress_func, 45 | &_lzo1c_8_compress_func, 46 | &_lzo1c_9_compress_func 47 | }; 48 | 49 | 50 | static lzo_compress_t lzo1c_get_compress_func(int clevel) 51 | { 52 | const lzo_compress_t *f; 53 | 54 | if (clevel < LZO1C_BEST_SPEED || clevel > LZO1C_BEST_COMPRESSION) 55 | { 56 | if (clevel == LZO1C_DEFAULT_COMPRESSION) 57 | clevel = LZO1C_BEST_SPEED; 58 | else 59 | return (lzo_compress_t) 0; 60 | } 61 | f = c_funcs[clevel-1]; 62 | assert(f && *f); 63 | return *f; 64 | } 65 | 66 | 67 | LZO_PUBLIC(int) 68 | lzo1c_compress ( const lzo_bytep src, lzo_uint src_len, 69 | lzo_bytep dst, lzo_uintp dst_len, 70 | lzo_voidp wrkmem, 71 | int clevel ) 72 | { 73 | lzo_compress_t f; 74 | 75 | f = lzo1c_get_compress_func(clevel); 76 | if (!f) 77 | return LZO_E_ERROR; 78 | return _lzo1c_do_compress(src,src_len,dst,dst_len,wrkmem,f); 79 | } 80 | 81 | 82 | /* vim:set ts=4 sw=4 et: */ 83 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1f_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo1f_d1.c -- LZO1F decompression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1f.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo1f_decompress 33 | 34 | #include "lzo1f_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1f_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo1f_d2.c -- LZO1F decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1f.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo1f_decompress_safe 33 | 34 | #include "lzo1f_d.ch" 35 | 36 | #if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM) 37 | LZO_EXTERN(int) lzo1f_decompress_asm_fast_safe 38 | (const lzo_bytep src, lzo_uint src_len, 39 | lzo_bytep dst, lzo_uintp dst_len, 40 | lzo_voidp wrkmem); 41 | LZO_PUBLIC(int) lzo1f_decompress_asm_fast_safe 42 | (const lzo_bytep src, lzo_uint src_len, 43 | lzo_bytep dst, lzo_uintp dst_len, 44 | lzo_voidp wrkmem) 45 | { 46 | return lzo1f_decompress_safe(src, src_len, dst, dst_len, wrkmem); 47 | } 48 | #endif 49 | 50 | /* vim:set ts=4 sw=4 et: */ 51 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_1.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_1.c -- LZO1X-1 compression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | #if 1 && defined(UA_GET_LE32) 31 | #undef LZO_DICT_USE_PTR 32 | #define LZO_DICT_USE_PTR 0 33 | #undef lzo_dict_t 34 | #define lzo_dict_t lzo_uint16_t 35 | #endif 36 | 37 | #define LZO_NEED_DICT_H 1 38 | #ifndef D_BITS 39 | #define D_BITS 14 40 | #endif 41 | #define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) 42 | #define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) 43 | #if 1 44 | #define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) 45 | #else 46 | #define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) 47 | #endif 48 | #include "config1x.h" 49 | #define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) 50 | 51 | #ifndef DO_COMPRESS 52 | #define DO_COMPRESS lzo1x_1_compress 53 | #endif 54 | 55 | #include "lzo1x_c.ch" 56 | 57 | /* vim:set ts=4 sw=4 et: */ 58 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_1k.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_1k.c -- LZO1X-1(11) compression (needs only 8kB work memory) 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | #if 1 && defined(UA_GET_LE32) 31 | #undef LZO_DICT_USE_PTR 32 | #define LZO_DICT_USE_PTR 0 33 | #undef lzo_dict_t 34 | #define lzo_dict_t lzo_uint16_t 35 | #endif 36 | 37 | #define LZO_NEED_DICT_H 1 38 | #ifndef D_BITS 39 | #define D_BITS 11 40 | #endif 41 | #define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,3,5)) >> 5) 42 | #define D_INDEX2(d,p) d = d ^ D_MASK 43 | #if 1 44 | #define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) 45 | #else 46 | #define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) 47 | #endif 48 | #include "config1x.h" 49 | #define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) 50 | 51 | #ifndef DO_COMPRESS 52 | #define DO_COMPRESS lzo1x_1_11_compress 53 | #endif 54 | 55 | #include "lzo1x_c.ch" 56 | 57 | /* vim:set ts=4 sw=4 et: */ 58 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_1l.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_1l.c -- LZO1X-1(12) compression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | #if 1 && defined(UA_GET_LE32) 31 | #undef LZO_DICT_USE_PTR 32 | #define LZO_DICT_USE_PTR 0 33 | #undef lzo_dict_t 34 | #define lzo_dict_t lzo_uint16_t 35 | #endif 36 | 37 | #define LZO_NEED_DICT_H 1 38 | #ifndef D_BITS 39 | #define D_BITS 12 40 | #endif 41 | #define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,4,5)) >> 5) 42 | #define D_INDEX2(d,p) d = d ^ D_MASK 43 | #if 1 44 | #define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) 45 | #else 46 | #define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) 47 | #endif 48 | #include "config1x.h" 49 | #define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) 50 | 51 | #ifndef DO_COMPRESS 52 | #define DO_COMPRESS lzo1x_1_12_compress 53 | #endif 54 | 55 | #include "lzo1x_c.ch" 56 | 57 | /* vim:set ts=4 sw=4 et: */ 58 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_1o.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_1o.c -- LZO1X-1(15) compression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | #if 1 && defined(UA_GET_LE32) 31 | #undef LZO_DICT_USE_PTR 32 | #define LZO_DICT_USE_PTR 0 33 | #undef lzo_dict_t 34 | #define lzo_dict_t lzo_uint16_t 35 | #define D_BITS 13 36 | #endif 37 | 38 | #define LZO_NEED_DICT_H 1 39 | #ifndef D_BITS 40 | #define D_BITS 15 41 | #endif 42 | #define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) 43 | #define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) 44 | #if 1 45 | #define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) 46 | #else 47 | #define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) 48 | #endif 49 | #include "config1x.h" 50 | #define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) 51 | 52 | #ifndef DO_COMPRESS 53 | #define DO_COMPRESS lzo1x_1_15_compress 54 | #endif 55 | 56 | #include "lzo1x_c.ch" 57 | 58 | /* vim:set ts=4 sw=4 et: */ 59 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_d1.c -- LZO1X decompression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1x.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo1x_decompress 33 | 34 | #include "lzo1x_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_d2.c -- LZO1X decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1x.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo1x_decompress_safe 33 | 34 | #include "lzo1x_d.ch" 35 | 36 | #if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM) 37 | LZO_EXTERN(int) lzo1x_decompress_asm_safe 38 | (const lzo_bytep src, lzo_uint src_len, 39 | lzo_bytep dst, lzo_uintp dst_len, 40 | lzo_voidp wrkmem); 41 | LZO_PUBLIC(int) lzo1x_decompress_asm_safe 42 | (const lzo_bytep src, lzo_uint src_len, 43 | lzo_bytep dst, lzo_uintp dst_len, 44 | lzo_voidp wrkmem) 45 | { 46 | return lzo1x_decompress_safe(src, src_len, dst, dst_len, wrkmem); 47 | } 48 | LZO_EXTERN(int) lzo1x_decompress_asm_fast_safe 49 | (const lzo_bytep src, lzo_uint src_len, 50 | lzo_bytep dst, lzo_uintp dst_len, 51 | lzo_voidp wrkmem); 52 | LZO_PUBLIC(int) lzo1x_decompress_asm_fast_safe 53 | (const lzo_bytep src, lzo_uint src_len, 54 | lzo_bytep dst, lzo_uintp dst_len, 55 | lzo_voidp wrkmem) 56 | { 57 | return lzo1x_decompress_safe(src, src_len, dst, dst_len, wrkmem); 58 | } 59 | #endif 60 | 61 | /* vim:set ts=4 sw=4 et: */ 62 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1x_o.c: -------------------------------------------------------------------------------- 1 | /* lzo1x_o.c -- LZO1X compressed data optimizer 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1x.h" 30 | 31 | #define DO_OPTIMIZE lzo1x_optimize 32 | 33 | #include "lzo1x_oo.ch" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1y_1.c: -------------------------------------------------------------------------------- 1 | /* lzo1y_1.c -- LZO1Y-1 compression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | #if 1 && defined(UA_GET_LE32) 31 | #undef LZO_DICT_USE_PTR 32 | #define LZO_DICT_USE_PTR 0 33 | #undef lzo_dict_t 34 | #define lzo_dict_t lzo_uint16_t 35 | #endif 36 | 37 | #define LZO_NEED_DICT_H 1 38 | #ifndef D_BITS 39 | #define D_BITS 14 40 | #endif 41 | #define D_INDEX1(d,p) d = DX3(p,5,5,6); d += d >> 5; d = DM(d) 42 | #define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) 43 | #if 1 44 | #define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) 45 | #else 46 | #define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) 47 | #endif 48 | #include "config1y.h" 49 | #define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) 50 | 51 | #ifndef DO_COMPRESS 52 | #define DO_COMPRESS lzo1y_1_compress 53 | #endif 54 | 55 | #include "lzo1x_c.ch" 56 | 57 | /* vim:set ts=4 sw=4 et: */ 58 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1y_9x.c: -------------------------------------------------------------------------------- 1 | /* lzo1y_9x.c -- implementation of the LZO1Y-999 compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define LZO1Y 1 30 | #include "lzo1x_9x.c" 31 | 32 | /* vim:set ts=4 sw=4 et: */ 33 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1y_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo1y_d1.c -- LZO1Y decompression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1y.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo1y_decompress 33 | 34 | #include "lzo1x_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1y_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo1y_d2.c -- LZO1Y decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1y.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo1y_decompress_safe 33 | 34 | #include "lzo1x_d.ch" 35 | 36 | #if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM) 37 | LZO_EXTERN(int) lzo1y_decompress_asm_safe 38 | (const lzo_bytep src, lzo_uint src_len, 39 | lzo_bytep dst, lzo_uintp dst_len, 40 | lzo_voidp wrkmem); 41 | LZO_PUBLIC(int) lzo1y_decompress_asm_safe 42 | (const lzo_bytep src, lzo_uint src_len, 43 | lzo_bytep dst, lzo_uintp dst_len, 44 | lzo_voidp wrkmem) 45 | { 46 | return lzo1y_decompress_safe(src, src_len, dst, dst_len, wrkmem); 47 | } 48 | LZO_EXTERN(int) lzo1y_decompress_asm_fast_safe 49 | (const lzo_bytep src, lzo_uint src_len, 50 | lzo_bytep dst, lzo_uintp dst_len, 51 | lzo_voidp wrkmem); 52 | LZO_PUBLIC(int) lzo1y_decompress_asm_fast_safe 53 | (const lzo_bytep src, lzo_uint src_len, 54 | lzo_bytep dst, lzo_uintp dst_len, 55 | lzo_voidp wrkmem) 56 | { 57 | return lzo1y_decompress_safe(src, src_len, dst, dst_len, wrkmem); 58 | } 59 | #endif 60 | 61 | /* vim:set ts=4 sw=4 et: */ 62 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1y_d3.c: -------------------------------------------------------------------------------- 1 | /* lzo1y_d3.c -- LZO1Y decompression with preset dictionary 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1y.h" 30 | 31 | #define lzo1x_decompress_dict_safe lzo1y_decompress_dict_safe 32 | 33 | #include "lzo1x_d3.c" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1y_o.c: -------------------------------------------------------------------------------- 1 | /* lzo1y_o.c -- LZO1Y compressed data optimizer 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1y.h" 30 | 31 | #define DO_OPTIMIZE lzo1y_optimize 32 | 33 | #include "lzo1x_oo.ch" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1z_9x.c: -------------------------------------------------------------------------------- 1 | /* lzo1z_9x.c -- implementation of the LZO1Z-999 compression algorithm 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #define LZO1Z 1 30 | #include "lzo1x_9x.c" 31 | 32 | /* vim:set ts=4 sw=4 et: */ 33 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1z_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo1z_d1.c -- LZO1Z decompression 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1z.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo1z_decompress 33 | 34 | #include "lzo1x_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1z_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo1z_d2.c -- LZO1Z decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1z.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo1z_decompress_safe 33 | 34 | #include "lzo1x_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo1z_d3.c: -------------------------------------------------------------------------------- 1 | /* lzo1z_d3.c -- LZO1Z decompression with preset dictionary 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config1z.h" 30 | 31 | #define lzo1x_decompress_dict_safe lzo1z_decompress_dict_safe 32 | 33 | #include "lzo1x_d3.c" 34 | 35 | /* vim:set ts=4 sw=4 et: */ 36 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo2a_d1.c: -------------------------------------------------------------------------------- 1 | /* lzo2a_d1.c -- LZO2A decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config2a.h" 30 | 31 | #undef LZO_TEST_OVERRUN 32 | #define DO_DECOMPRESS lzo2a_decompress 33 | 34 | #include "lzo2a_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo2a_d2.c: -------------------------------------------------------------------------------- 1 | /* lzo2a_d2.c -- LZO2A decompression with overrun testing 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "config2a.h" 30 | 31 | #define LZO_TEST_OVERRUN 1 32 | #define DO_DECOMPRESS lzo2a_decompress_safe 33 | 34 | #include "lzo2a_d.ch" 35 | 36 | /* vim:set ts=4 sw=4 et: */ 37 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo_dll.ch: -------------------------------------------------------------------------------- 1 | /* lzo_dll.ch -- DLL initialization of the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /*********************************************************************** 30 | // Windows 16 bit + Watcom C + DLL 31 | ************************************************************************/ 32 | 33 | #if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD) 34 | 35 | /* don't pull in - we don't need it */ 36 | #if 0 37 | BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment, 38 | WORD wHeapSize, LPSTR lpszCmdLine ) 39 | #else 40 | int __far __pascal LibMain ( int a, short b, short c, long d ) 41 | #endif 42 | { 43 | LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d); 44 | return 1; 45 | } 46 | 47 | #endif 48 | 49 | 50 | /* vim:set ts=4 sw=4 et: */ 51 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo_ptr.c: -------------------------------------------------------------------------------- 1 | /* lzo_ptr.c -- low-level pointer constructs 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | 31 | 32 | /*********************************************************************** 33 | // 34 | ************************************************************************/ 35 | 36 | LZO_PUBLIC(lzo_uintptr_t) 37 | __lzo_ptr_linear(const lzo_voidp ptr) 38 | { 39 | lzo_uintptr_t p; 40 | 41 | #if (LZO_ARCH_I086) 42 | #error "LZO_ARCH_I086 is unsupported" 43 | #elif (LZO_MM_PVP) 44 | #error "LZO_MM_PVP is unsupported" 45 | #else 46 | p = (lzo_uintptr_t) PTR_LINEAR(ptr); 47 | #endif 48 | 49 | return p; 50 | } 51 | 52 | 53 | /*********************************************************************** 54 | // 55 | ************************************************************************/ 56 | 57 | LZO_PUBLIC(unsigned) 58 | __lzo_align_gap(const lzo_voidp ptr, lzo_uint size) 59 | { 60 | #if (__LZO_UINTPTR_T_IS_POINTER) 61 | #error "__LZO_UINTPTR_T_IS_POINTER is unsupported" 62 | #else 63 | lzo_uintptr_t p, n; 64 | if (size < 2) return 0; 65 | p = __lzo_ptr_linear(ptr); 66 | #if 0 67 | n = (((p + size - 1) / size) * size) - p; 68 | #else 69 | if ((size & (size - 1)) != 0) 70 | return 0; 71 | n = size; n = ((p + n - 1) & ~(n - 1)) - p; 72 | #endif 73 | #endif 74 | assert((long)n >= 0); 75 | assert(n <= size); 76 | return (unsigned)n; 77 | } 78 | 79 | 80 | /* vim:set ts=4 sw=4 et: */ 81 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/lzo_str.c: -------------------------------------------------------------------------------- 1 | /* lzo_str.c -- string functions for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | #include "lzo_conf.h" 30 | 31 | #undef lzo_memcmp 32 | #undef lzo_memcpy 33 | #undef lzo_memmove 34 | #undef lzo_memset 35 | 36 | 37 | /*********************************************************************** 38 | // slow but portable stuff, only used in assertions 39 | ************************************************************************/ 40 | 41 | #define lzo_hsize_t lzo_uint 42 | #define lzo_hvoid_p lzo_voidp 43 | #define lzo_hbyte_p lzo_bytep 44 | #define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f 45 | #ifndef __LZOLIB_FUNCNAME 46 | #define __LZOLIB_FUNCNAME(f) f 47 | #endif 48 | #define lzo_hmemcmp __LZOLIB_FUNCNAME(lzo_memcmp) 49 | #define lzo_hmemcpy __LZOLIB_FUNCNAME(lzo_memcpy) 50 | #define lzo_hmemmove __LZOLIB_FUNCNAME(lzo_memmove) 51 | #define lzo_hmemset __LZOLIB_FUNCNAME(lzo_memset) 52 | #define LZO_WANT_ACCLIB_HMEMCPY 1 53 | #include "lzo_supp.h" 54 | #undef LZOLIB_PUBLIC 55 | 56 | 57 | /* vim:set ts=4 sw=4 et: */ 58 | -------------------------------------------------------------------------------- /OpenVPN/Dependencies/liblzo/stats1c.h: -------------------------------------------------------------------------------- 1 | /* stats1c.h -- statistics for the the LZO library 2 | 3 | This file is part of the LZO real-time data compression library. 4 | 5 | Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer 6 | All Rights Reserved. 7 | 8 | The LZO library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of 11 | the License, or (at your option) any later version. 12 | 13 | The LZO library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with the LZO library; see the file COPYING. 20 | If not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | Markus F.X.J. Oberhumer 24 | 25 | http://www.oberhumer.com/opensource/lzo/ 26 | */ 27 | 28 | 29 | /* WARNING: this file should *not* be used by applications. It is 30 | part of the implementation of the library and is subject 31 | to change. 32 | */ 33 | 34 | 35 | #ifndef __LZO_STATS1C_H 36 | #define __LZO_STATS1C_H 1 37 | 38 | #define lzo1b_stats_t lzo1c_stats_t 39 | #define lzo1b_stats lzo1c_stats 40 | #define _lzo1b_stats_init _lzo1c_stats_init 41 | #define _lzo1b_stats_calc _lzo1c_stats_calc 42 | 43 | #include "stats1b.h" 44 | 45 | #endif /* already included */ 46 | 47 | 48 | /* vim:set ts=4 sw=4 et: */ 49 | -------------------------------------------------------------------------------- /OpenVPN/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenVPN.h 3 | // OpenVPN 4 | // 5 | // Created by Katekov Anton on 03.11.15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for OpenVPN. 12 | FOUNDATION_EXPORT double OpenVPNVersionNumber; 13 | 14 | //! Project version string for OpenVPN. 15 | FOUNDATION_EXPORT const unsigned char OpenVPNVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan 3 | * (Royal Institute of Technology, Stockholm, Sweden). 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * 3. Neither the name of the Institute nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef _BASE64_H_ 35 | #define _BASE64_H_ 36 | 37 | #if defined(ENABLE_HTTP_PROXY) || defined(ENABLE_PKCS11) || defined(ENABLE_CLIENT_CR) || defined(MANAGMENT_EXTERNAL_KEY) 38 | 39 | int openvpn_base64_encode(const void *data, int size, char **str); 40 | int openvpn_base64_decode(const char *str, void *data, int size); 41 | 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/basic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef BASIC_H 26 | #define BASIC_H 27 | 28 | #define BOOL_CAST(x) ((x) ? (true) : (false)) 29 | 30 | /* size of an array */ 31 | #define SIZE(x) (sizeof(x)/sizeof(x[0])) 32 | 33 | /* clear an object */ 34 | #define CLEAR(x) memset(&(x), 0, sizeof(x)) 35 | 36 | #define IPV4_NETMASK_HOST 0xffffffffU 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/circ_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef CIRC_LIST_H 26 | #define CIRC_LIST_H 27 | 28 | #include "basic.h" 29 | #include "integer.h" 30 | #include "error.h" 31 | 32 | #define CIRC_LIST(name, type) \ 33 | struct name { \ 34 | int x_head; \ 35 | int x_size; \ 36 | int x_cap; \ 37 | int x_sizeof; \ 38 | type x_list[EMPTY_ARRAY_SIZE]; \ 39 | } 40 | 41 | #define CIRC_LIST_PUSH(obj, item) \ 42 | { \ 43 | (obj)->x_head = modulo_add ((obj)->x_head, -1, (obj)->x_cap); \ 44 | (obj)->x_list[(obj)->x_head] = (item); \ 45 | (obj)->x_size = min_int ((obj)->x_size + 1, (obj)->x_cap); \ 46 | } 47 | 48 | #define CIRC_LIST_SIZE(obj) \ 49 | ((obj)->x_size) 50 | 51 | #define CIRC_LIST_INDEX(obj, index) \ 52 | modulo_add ((obj)->x_head, \ 53 | index_verify ((index), (obj)->x_size, __FILE__, __LINE__), \ 54 | (obj)->x_cap) 55 | 56 | #define CIRC_LIST_ITEM(obj, index) \ 57 | ((obj)->x_list[CIRC_LIST_INDEX((obj), (index))]) 58 | 59 | #define CIRC_LIST_RESET(obj) \ 60 | { \ 61 | (obj)->x_head = 0; \ 62 | (obj)->x_size = 0; \ 63 | } 64 | 65 | #define CIRC_LIST_ALLOC(dest, list_type, size) \ 66 | { \ 67 | const int so = sizeof (list_type) + sizeof ((dest)->x_list[0]) * (size); \ 68 | (dest) = (list_type *) malloc (so); \ 69 | check_malloc_return (dest); \ 70 | memset ((dest), 0, so); \ 71 | (dest)->x_cap = size; \ 72 | (dest)->x_sizeof = so; \ 73 | } 74 | 75 | #define CIRC_LIST_FREE(dest) \ 76 | free (dest) 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/clinat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #if !defined(CLINAT_H) && defined(ENABLE_CLIENT_NAT) 26 | #define CLINAT_H 27 | 28 | #include "buffer.h" 29 | 30 | #define MAX_CLIENT_NAT 64 31 | 32 | #define CN_OUTGOING 0 33 | #define CN_INCOMING 1 34 | 35 | struct client_nat_entry { 36 | # define CN_SNAT 0 37 | # define CN_DNAT 1 38 | int type; 39 | in_addr_t network; 40 | in_addr_t netmask; 41 | in_addr_t foreign_network; 42 | }; 43 | 44 | struct client_nat_option_list { 45 | int n; 46 | struct client_nat_entry entries[MAX_CLIENT_NAT]; 47 | }; 48 | 49 | struct client_nat_option_list *new_client_nat_list (struct gc_arena *gc); 50 | struct client_nat_option_list *clone_client_nat_option_list (const struct client_nat_option_list *src, struct gc_arena *gc); 51 | void copy_client_nat_option_list (struct client_nat_option_list *dest, const struct client_nat_option_list *src); 52 | void print_client_nat_list(const struct client_nat_option_list *list, int msglevel); 53 | 54 | void add_client_nat_to_option_list (struct client_nat_option_list *dest, 55 | const char *type, 56 | const char *network, 57 | const char *netmask, 58 | const char *foreign_network, 59 | int msglevel); 60 | 61 | void client_nat_transform (const struct client_nat_option_list *list, 62 | struct buffer *ipbuf, 63 | const int direction); 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/compat-stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPAT_STDBOOL_H 2 | #define __COMPAT_STDBOOL_H 3 | 4 | #ifdef HAVE_STDBOOL_H 5 | #include 6 | #else 7 | typedef int bool; 8 | #define false 0 9 | #define true 1 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef CONSOLE_H 26 | #define CONSOLE_H 27 | 28 | #include "basic.h" 29 | 30 | bool 31 | get_console_input (const char *prompt, const bool echo, char *input, const int capacity); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/crypto_openssl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * Copyright (C) 2010 Fox Crypto B.V. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License version 2 13 | * as published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program (see the file COPYING included with this 22 | * distribution); if not, write to the Free Software Foundation, Inc., 23 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | */ 25 | 26 | /** 27 | * @file Data Channel Cryptography OpenSSL-specific backend interface 28 | */ 29 | 30 | #ifndef CRYPTO_OPENSSL_H_ 31 | #define CRYPTO_OPENSSL_H_ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | /** Generic cipher key type %context. */ 38 | typedef EVP_CIPHER cipher_kt_t; 39 | 40 | /** Generic message digest key type %context. */ 41 | typedef EVP_MD md_kt_t; 42 | 43 | /** Generic cipher %context. */ 44 | typedef EVP_CIPHER_CTX cipher_ctx_t; 45 | 46 | /** Generic message digest %context. */ 47 | typedef EVP_MD_CTX md_ctx_t; 48 | 49 | /** Generic HMAC %context. */ 50 | typedef HMAC_CTX hmac_ctx_t; 51 | 52 | /** Maximum length of an IV */ 53 | #define OPENVPN_MAX_IV_LENGTH EVP_MAX_IV_LENGTH 54 | 55 | /** Cipher is in CBC mode */ 56 | #define OPENVPN_MODE_CBC EVP_CIPH_CBC_MODE 57 | 58 | /** Cipher is in OFB mode */ 59 | #define OPENVPN_MODE_OFB EVP_CIPH_OFB_MODE 60 | 61 | /** Cipher is in CFB mode */ 62 | #define OPENVPN_MODE_CFB EVP_CIPH_CFB_MODE 63 | 64 | /** Cipher should encrypt */ 65 | #define OPENVPN_OP_ENCRYPT 1 66 | 67 | /** Cipher should decrypt */ 68 | #define OPENVPN_OP_DECRYPT 0 69 | 70 | #define DES_KEY_LENGTH 8 71 | #define MD4_DIGEST_LENGTH 16 72 | 73 | #endif /* CRYPTO_OPENSSL_H_ */ 74 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/cryptoapi.h: -------------------------------------------------------------------------------- 1 | #ifndef _CRYPTOAPI_H_ 2 | #define _CRYPTOAPI_H_ 3 | 4 | int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop); 5 | 6 | 7 | #endif /* !_CRYPTOAPI_H_ */ 8 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/fdmisc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifdef HAVE_CONFIG_H 26 | #include "config.h" 27 | #elif defined(_MSC_VER) 28 | #include "config-msvc.h" 29 | #endif 30 | 31 | #include "syshead.h" 32 | 33 | #include "fdmisc.h" 34 | #include "error.h" 35 | 36 | #include "memdbg.h" 37 | 38 | /* Set a file descriptor to non-blocking */ 39 | bool 40 | set_nonblock_action (int fd) 41 | { 42 | #ifdef WIN32 43 | u_long arg = 1; 44 | if (ioctlsocket (fd, FIONBIO, &arg)) 45 | return false; 46 | #else 47 | if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) 48 | return false; 49 | #endif 50 | return true; 51 | } 52 | 53 | /* Set a file descriptor to not be passed across execs */ 54 | bool 55 | set_cloexec_action (int fd) 56 | { 57 | #ifndef WIN32 58 | if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0) 59 | return false; 60 | #endif 61 | return true; 62 | } 63 | 64 | /* Set a file descriptor to non-blocking */ 65 | void 66 | set_nonblock (int fd) 67 | { 68 | if (!set_nonblock_action (fd)) 69 | msg (M_ERR, "Set socket to non-blocking mode failed"); 70 | } 71 | 72 | /* Set a file descriptor to not be passed across execs */ 73 | void 74 | set_cloexec (int fd) 75 | { 76 | if (!set_cloexec_action (fd)) 77 | msg (M_ERR, "Set FD_CLOEXEC flag on file descriptor failed"); 78 | } 79 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/fdmisc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #include "basic.h" 26 | 27 | bool set_nonblock_action (int fd); 28 | bool set_cloexec_action (int fd); 29 | 30 | void set_nonblock (int fd); 31 | void set_cloexec (int fd); 32 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/gremlin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef GREMLIN_H 26 | #define GREMLIN_H 27 | 28 | #ifdef ENABLE_DEBUG 29 | 30 | /* 31 | * Gremlin options, presented as bitmask argument to --gremlin directive 32 | */ 33 | 34 | #define GREMLIN_CONNECTION_FLOOD_SHIFT (0) 35 | #define GREMLIN_CONNECTION_FLOOD_MASK (0x07) 36 | 37 | #define GREMLIN_PACKET_FLOOD_SHIFT (3) 38 | #define GREMLIN_PACKET_FLOOD_MASK (0x03) 39 | 40 | #define GREMLIN_CORRUPT_SHIFT (5) 41 | #define GREMLIN_CORRUPT_MASK (0x03) 42 | 43 | #define GREMLIN_UP_DOWN_SHIFT (7) 44 | #define GREMLIN_UP_DOWN_MASK (0x03) 45 | 46 | /* 512:1/500 1024:1/100 1536:1/50 */ 47 | 48 | #define GREMLIN_DROP_SHIFT (9) 49 | #define GREMLIN_DROP_MASK (0x03) 50 | 51 | /* extract gremlin parms */ 52 | 53 | #define GREMLIN_CONNECTION_FLOOD_LEVEL(x) (((x)>>GREMLIN_CONNECTION_FLOOD_SHIFT) & GREMLIN_CONNECTION_FLOOD_MASK) 54 | #define GREMLIN_PACKET_FLOOD_LEVEL(x) (((x)>>GREMLIN_PACKET_FLOOD_SHIFT) & GREMLIN_PACKET_FLOOD_MASK) 55 | #define GREMLIN_CORRUPT_LEVEL(x) (((x)>>GREMLIN_CORRUPT_SHIFT) & GREMLIN_CORRUPT_MASK) 56 | #define GREMLIN_UP_DOWN_LEVEL(x) (((x)>>GREMLIN_UP_DOWN_SHIFT) & GREMLIN_UP_DOWN_MASK) 57 | #define GREMLIN_DROP_LEVEL(x) (((x)>>GREMLIN_DROP_SHIFT) & GREMLIN_DROP_MASK) 58 | 59 | #include "buffer.h" 60 | 61 | struct packet_flood_parms 62 | { 63 | int n_packets; 64 | int packet_size; 65 | }; 66 | 67 | bool ask_gremlin (int flags); 68 | void corrupt_gremlin (struct buffer* buf, int flags); 69 | struct packet_flood_parms get_packet_flood_parms (int level); 70 | 71 | #endif 72 | #endif 73 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * Process helper directives such as server, client, and keepalive. 27 | */ 28 | 29 | #ifndef HELPER_H 30 | #define HELPER_H 31 | 32 | #include "options.h" 33 | 34 | void helper_keepalive (struct options *o); 35 | void helper_client_server (struct options *o); 36 | void helper_tcp_nodelay (struct options *o); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/httpdigest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #if PROXY_DIGEST_AUTH 26 | 27 | #define HASHLEN 16 28 | typedef unsigned char HASH[HASHLEN]; 29 | #define HASHHEXLEN 32 30 | typedef unsigned char HASHHEX[HASHHEXLEN+1]; 31 | #undef IN 32 | #undef OUT 33 | #define IN const 34 | #define OUT 35 | 36 | /* calculate H(A1) as per HTTP Digest spec */ 37 | void DigestCalcHA1( 38 | IN char * pszAlg, 39 | IN char * pszUserName, 40 | IN char * pszRealm, 41 | IN char * pszPassword, 42 | IN char * pszNonce, 43 | IN char * pszCNonce, 44 | OUT HASHHEX SessionKey 45 | ); 46 | 47 | /* calculate request-digest/response-digest as per HTTP Digest spec */ 48 | void DigestCalcResponse( 49 | IN HASHHEX HA1, /* H(A1) */ 50 | IN char * pszNonce, /* nonce from server */ 51 | IN char * pszNonceCount, /* 8 hex digits */ 52 | IN char * pszCNonce, /* client nonce */ 53 | IN char * pszQop, /* qop-value: "", "auth", "auth-int" */ 54 | IN char * pszMethod, /* method from the request */ 55 | IN char * pszDigestUri, /* requested URL */ 56 | IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ 57 | OUT HASHHEX Response /* request-digest or response-digest */ 58 | ); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/interval.c: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifdef HAVE_CONFIG_H 26 | #include "config.h" 27 | #elif defined(_MSC_VER) 28 | #include "config-msvc.h" 29 | #endif 30 | 31 | #include "syshead.h" 32 | 33 | #include "interval.h" 34 | 35 | #include "memdbg.h" 36 | 37 | void 38 | interval_init (struct interval *top, int horizon, int refresh) 39 | { 40 | CLEAR (*top); 41 | top->refresh = refresh; 42 | top->horizon = horizon; 43 | } 44 | 45 | bool 46 | event_timeout_trigger (struct event_timeout *et, 47 | struct timeval *tv, 48 | const int et_const_retry) 49 | { 50 | bool ret = false; 51 | const time_t local_now = now; 52 | 53 | if (et->defined) 54 | { 55 | int wakeup = (int) et->last + et->n - local_now; 56 | if (wakeup <= 0) 57 | { 58 | #if INTERVAL_DEBUG 59 | dmsg (D_INTERVAL, "EVENT event_timeout_trigger (%d) etcr=%d", et->n, et_const_retry); 60 | #endif 61 | if (et_const_retry < 0) 62 | { 63 | et->last = local_now; 64 | wakeup = et->n; 65 | ret = true; 66 | } 67 | else 68 | { 69 | wakeup = et_const_retry; 70 | } 71 | } 72 | 73 | if (tv && wakeup < tv->tv_sec) 74 | { 75 | #if INTERVAL_DEBUG 76 | dmsg (D_INTERVAL, "EVENT event_timeout_wakeup (%d/%d) etcr=%d", wakeup, et->n, et_const_retry); 77 | #endif 78 | tv->tv_sec = wakeup; 79 | tv->tv_usec = 0; 80 | } 81 | } 82 | return ret; 83 | } 84 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/lladdr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Support routine for configuring link layer address 3 | */ 4 | 5 | #ifdef HAVE_CONFIG_H 6 | #include "config.h" 7 | #elif defined(_MSC_VER) 8 | #include "config-msvc.h" 9 | #endif 10 | 11 | #include "syshead.h" 12 | #include "error.h" 13 | #include "misc.h" 14 | 15 | int set_lladdr(const char *ifname, const char *lladdr, 16 | const struct env_set *es) 17 | { 18 | struct argv argv = argv_new (); 19 | int r; 20 | 21 | if (!ifname || !lladdr) 22 | return -1; 23 | 24 | #if defined(TARGET_LINUX) 25 | #ifdef ENABLE_IPROUTE 26 | argv_printf (&argv, 27 | "%s link set addr %s dev %s", 28 | iproute_path, lladdr, ifname); 29 | #else 30 | argv_printf (&argv, 31 | "%s %s hw ether %s", 32 | IFCONFIG_PATH, 33 | ifname, lladdr); 34 | #endif 35 | #elif defined(TARGET_SOLARIS) 36 | argv_printf (&argv, 37 | "%s %s ether %s", 38 | IFCONFIG_PATH, 39 | ifname, lladdr); 40 | #elif defined(TARGET_OPENBSD) 41 | argv_printf (&argv, 42 | "%s %s lladdr %s", 43 | IFCONFIG_PATH, 44 | ifname, lladdr); 45 | #elif defined(TARGET_DARWIN) 46 | argv_printf (&argv, 47 | "%s %s lladdr %s", 48 | IFCONFIG_PATH, 49 | ifname, lladdr); 50 | #elif defined(TARGET_FREEBSD) 51 | argv_printf (&argv, 52 | "%s %s ether %s", 53 | IFCONFIG_PATH, 54 | ifname, lladdr); 55 | #else 56 | msg (M_WARN, "Sorry, but I don't know how to configure link layer addresses on this operating system."); 57 | return -1; 58 | #endif 59 | 60 | argv_msg (M_INFO, &argv); 61 | r = openvpn_execve_check (&argv, es, M_WARN, "ERROR: Unable to set link layer address."); 62 | if (r) 63 | msg (M_INFO, "TUN/TAP link layer address set to %s", lladdr); 64 | 65 | argv_reset (&argv); 66 | return r; 67 | } 68 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/lladdr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Support routine for configuring link layer address 3 | */ 4 | 5 | #include "misc.h" 6 | 7 | int set_lladdr(const char *ifname, const char *lladdr, 8 | const struct env_set *es); 9 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/mss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef MSS_H 26 | #define MSS_H 27 | 28 | #include "proto.h" 29 | #include "error.h" 30 | 31 | void mss_fixup_ipv4 (struct buffer *buf, int maxmss); 32 | void mss_fixup_ipv6 (struct buffer *buf, int maxmss); 33 | void mss_fixup_dowork (struct buffer *buf, uint16_t maxmss); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/mstats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2011 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * Maintain usage stats in a memory-mapped file 27 | */ 28 | 29 | #if !defined(OPENVPN_MEMSTATS_H) && defined(ENABLE_MEMSTATS) 30 | #define OPENVPN_MEMSTATS_H 31 | 32 | #include "basic.h" 33 | 34 | /* this struct is mapped to the file */ 35 | struct mmap_stats { 36 | counter_type link_read_bytes; /* counter_type can be assumed to be a uint64_t */ 37 | counter_type link_write_bytes; 38 | int n_clients; 39 | 40 | # define MSTATS_UNDEF 0 41 | # define MSTATS_ACTIVE 1 42 | # define MSTATS_EXPIRED 2 43 | int state; 44 | }; 45 | 46 | extern volatile struct mmap_stats *mmap_stats; /* GLOBAL */ 47 | 48 | void mstats_open(const char *fn); 49 | void mstats_close(void); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/mtcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * TCP specific code for --mode server 27 | */ 28 | 29 | #ifndef MTCP_H 30 | #define MTCP_H 31 | 32 | #if P2MP_SERVER 33 | 34 | #include "event.h" 35 | 36 | /* 37 | * Extra state info needed for TCP mode 38 | */ 39 | struct multi_tcp 40 | { 41 | struct event_set *es; 42 | struct event_set_return *esr; 43 | int n_esr; 44 | int maxevents; 45 | unsigned int tun_rwflags; 46 | #ifdef ENABLE_MANAGEMENT 47 | unsigned int management_persist_flags; 48 | #endif 49 | }; 50 | 51 | struct multi_instance; 52 | struct context; 53 | 54 | struct multi_tcp *multi_tcp_init (int maxevents, int *maxclients); 55 | void multi_tcp_free (struct multi_tcp *mtcp); 56 | void multi_tcp_dereference_instance (struct multi_tcp *mtcp, struct multi_instance *mi); 57 | 58 | bool multi_tcp_instance_specific_init (struct multi_context *m, struct multi_instance *mi); 59 | void multi_tcp_instance_specific_free (struct multi_instance *mi); 60 | 61 | void multi_tcp_link_out_deferred (struct multi_context *m, struct multi_instance *mi); 62 | 63 | 64 | /**************************************************************************/ 65 | /** 66 | * Main event loop for OpenVPN in TCP server mode. 67 | * @ingroup eventloop 68 | * 69 | * @param top - Top-level context structure. 70 | */ 71 | void tunnel_server_tcp (struct context *top); 72 | 73 | 74 | void multi_tcp_delete_event (struct multi_tcp *mtcp, event_t event); 75 | 76 | #endif 77 | #endif 78 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/mudp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * UDP specific code for --mode server 27 | */ 28 | 29 | #ifndef MUDP_H 30 | #define MUDP_H 31 | 32 | #if P2MP_SERVER 33 | 34 | struct context; 35 | struct multi_context; 36 | 37 | 38 | /**************************************************************************/ 39 | /** 40 | * Main event loop wrapper function for OpenVPN in UDP server mode. 41 | * @ingroup eventloop 42 | * 43 | * This function simply calls \c tunnel_server_udp_single_threaded(). 44 | * 45 | * @param top - Top-level context structure. 46 | */ 47 | void tunnel_server_udp (struct context *top); 48 | 49 | 50 | /**************************************************************************/ 51 | /** 52 | * Get, and if necessary create, the multi_instance associated with a 53 | * packet's source address. 54 | * @ingroup external_multiplexer 55 | * 56 | * This function extracts the source address of a recently read packet 57 | * from \c m->top.c2.from and uses that source address as a hash key for 58 | * the hash table \c m->hash. If an entry exists, this function returns 59 | * it. If no entry exists, this function handles its creation, and if 60 | * successful, returns the newly created instance. 61 | * 62 | * @param m - The single multi_context structure. 63 | * 64 | * @return A pointer to a multi_instance if one already existed for the 65 | * packet's source address or if one was a newly created successfully. 66 | * NULL if one did not yet exist and a new one was not created. 67 | */ 68 | struct multi_instance *multi_get_create_instance_udp (struct multi_context *m); 69 | 70 | #endif 71 | #endif 72 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/ntlm.h: -------------------------------------------------------------------------------- 1 | #ifndef NTLM_H 2 | #define NTLM_H 3 | 4 | #if NTLM 5 | 6 | const char *ntlm_phase_1 (const struct http_proxy_info *p, struct gc_arena *gc); 7 | const char *ntlm_phase_3 (const struct http_proxy_info *p, const char *phase_2, struct gc_arena *gc); 8 | 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/occ-inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef OCC_INLINE_H 26 | #define OCC_INLINE_H 27 | 28 | #ifdef ENABLE_OCC 29 | 30 | /* 31 | * Inline functions 32 | */ 33 | 34 | static inline int 35 | occ_reset_op () 36 | { 37 | return -1; 38 | } 39 | 40 | /* 41 | * Should we send an OCC_REQUEST message? 42 | */ 43 | static inline void 44 | check_send_occ_req (struct context *c) 45 | { 46 | void check_send_occ_req_dowork (struct context *c); 47 | if (event_timeout_defined (&c->c2.occ_interval) 48 | && event_timeout_trigger (&c->c2.occ_interval, 49 | &c->c2.timeval, 50 | (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0)) 51 | check_send_occ_req_dowork (c); 52 | } 53 | 54 | /* 55 | * Should we send an MTU load test? 56 | */ 57 | static inline void 58 | check_send_occ_load_test (struct context *c) 59 | { 60 | void check_send_occ_load_test_dowork (struct context *c); 61 | if (event_timeout_defined (&c->c2.occ_mtu_load_test_interval) 62 | && event_timeout_trigger (&c->c2.occ_mtu_load_test_interval, 63 | &c->c2.timeval, 64 | (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0)) 65 | check_send_occ_load_test_dowork (c); 66 | } 67 | 68 | /* 69 | * Should we send an OCC message? 70 | */ 71 | static inline void 72 | check_send_occ_msg (struct context *c) 73 | { 74 | void check_send_occ_msg_dowork (struct context *c); 75 | if (c->c2.occ_op >= 0) 76 | { 77 | if (!TO_LINK_DEF(c)) 78 | check_send_occ_msg_dowork (c); 79 | else 80 | tv_clear (&c->c2.timeval); /* ZERO-TIMEOUT */ 81 | } 82 | } 83 | 84 | #endif 85 | #endif 86 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * The interval_ routines are designed to optimize the calling of a routine 27 | * (normally tls_multi_process()) which can be called less frequently 28 | * between triggers. 29 | */ 30 | 31 | #ifndef PERF_H 32 | #define PERF_H 33 | 34 | /*#define ENABLE_PERFORMANCE_METRICS*/ 35 | 36 | /* 37 | * Metrics 38 | */ 39 | #define PERF_BIO_READ_PLAINTEXT 0 40 | #define PERF_BIO_WRITE_PLAINTEXT 1 41 | #define PERF_BIO_READ_CIPHERTEXT 2 42 | #define PERF_BIO_WRITE_CIPHERTEXT 3 43 | #define PERF_TLS_MULTI_PROCESS 4 44 | #define PERF_IO_WAIT 5 45 | #define PERF_EVENT_LOOP 6 46 | #define PERF_MULTI_CREATE_INSTANCE 7 47 | #define PERF_MULTI_CLOSE_INSTANCE 8 48 | #define PERF_MULTI_SHOW_STATS 9 49 | #define PERF_MULTI_BCAST 10 50 | #define PERF_MULTI_MCAST 11 51 | #define PERF_SCRIPT 12 52 | #define PERF_READ_IN_LINK 13 53 | #define PERF_PROC_IN_LINK 14 54 | #define PERF_READ_IN_TUN 15 55 | #define PERF_PROC_IN_TUN 16 56 | #define PERF_PROC_OUT_LINK 17 57 | #define PERF_PROC_OUT_TUN 18 58 | #define PERF_PROC_OUT_TUN_MTCP 19 59 | #define PERF_N 20 60 | 61 | #ifdef ENABLE_PERFORMANCE_METRICS 62 | 63 | #include "basic.h" 64 | 65 | /* 66 | * Stack size 67 | */ 68 | #define STACK_N 64 69 | 70 | void perf_push (int type); 71 | void perf_pop (void); 72 | void perf_output_results (void); 73 | 74 | #else 75 | 76 | static inline void perf_push (int type) {} 77 | static inline void perf_pop (void) {} 78 | static inline void perf_output_results (void) {} 79 | 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/pf-inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #if defined(ENABLE_PF) && !defined(PF_INLINE_H) 26 | #define PF_INLINE_H 27 | 28 | /* 29 | * Inline functions 30 | */ 31 | 32 | #define PCT_SRC 1 33 | #define PCT_DEST 2 34 | static inline bool 35 | pf_c2c_test (const struct context *src, const struct context *dest, const char *prefix) 36 | { 37 | bool pf_cn_test (struct pf_set *pfs, const struct tls_multi *tm, const int type, const char *prefix); 38 | return (!src->c2.pf.enabled || pf_cn_test (src->c2.pf.pfs, dest->c2.tls_multi, PCT_DEST, prefix)) 39 | && (!dest->c2.pf.enabled || pf_cn_test (dest->c2.pf.pfs, src->c2.tls_multi, PCT_SRC, prefix)); 40 | } 41 | 42 | static inline bool 43 | pf_addr_test (const struct context *src, const struct mroute_addr *dest, const char *prefix) 44 | { 45 | bool pf_addr_test_dowork (const struct context *src, const struct mroute_addr *dest, const char *prefix); 46 | 47 | if (src->c2.pf.enabled) 48 | return pf_addr_test_dowork (src, dest, prefix); 49 | else 50 | return true; 51 | } 52 | 53 | static inline bool 54 | pf_kill_test (const struct pf_set *pfs) 55 | { 56 | return pfs->kill; 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/pf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* packet filter functions */ 26 | 27 | #if defined(ENABLE_PF) && !defined(OPENVPN_PF_H) 28 | #define OPENVPN_PF_H 29 | 30 | #include "list.h" 31 | #include "mroute.h" 32 | 33 | #define PF_MAX_LINE_LEN 256 34 | 35 | struct context; 36 | 37 | struct ipv4_subnet { 38 | bool exclude; 39 | in_addr_t network; 40 | in_addr_t netmask; 41 | }; 42 | 43 | struct pf_subnet { 44 | struct pf_subnet *next; 45 | struct ipv4_subnet rule; 46 | }; 47 | 48 | struct pf_subnet_set { 49 | bool default_allow; 50 | struct pf_subnet *list; 51 | }; 52 | 53 | struct pf_cn { 54 | bool exclude; 55 | char *cn; 56 | }; 57 | 58 | struct pf_cn_elem { 59 | struct pf_cn_elem *next; 60 | struct pf_cn rule; 61 | }; 62 | 63 | struct pf_cn_set { 64 | bool default_allow; 65 | struct pf_cn_elem *list; 66 | struct hash *hash_table; 67 | }; 68 | 69 | struct pf_set { 70 | bool kill; 71 | struct pf_subnet_set sns; 72 | struct pf_cn_set cns; 73 | }; 74 | 75 | struct pf_context { 76 | bool enabled; 77 | struct pf_set *pfs; 78 | #ifdef PLUGIN_PF 79 | char *filename; 80 | time_t file_last_mod; 81 | unsigned int n_check_reload; 82 | struct event_timeout reload; 83 | #endif 84 | }; 85 | 86 | void pf_init_context (struct context *c); 87 | 88 | void pf_destroy_context (struct pf_context *pfc); 89 | 90 | #ifdef PLUGIN_PF 91 | void pf_check_reload (struct context *c); 92 | #endif 93 | 94 | #ifdef MANAGEMENT_PF 95 | bool pf_load_from_buffer_list (struct context *c, const struct buffer_list *config); 96 | #endif 97 | 98 | #ifdef ENABLE_DEBUG 99 | void pf_context_print (const struct pf_context *pfc, const char *prefix, const int lev); 100 | #endif 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/ping-inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef PING_INLINE_H 26 | #define PING_INLINE_H 27 | 28 | /* 29 | * Should we exit or restart due to ping (or other authenticated packet) 30 | * not received in n seconds? 31 | */ 32 | static inline void 33 | check_ping_restart (struct context *c) 34 | { 35 | void check_ping_restart_dowork (struct context *c); 36 | if (c->options.ping_rec_timeout 37 | && event_timeout_trigger (&c->c2.ping_rec_interval, 38 | &c->c2.timeval, 39 | (!c->options.ping_timer_remote 40 | || link_socket_actual_defined (&c->c1.link_socket_addr.actual)) 41 | ? ETT_DEFAULT : 15)) 42 | check_ping_restart_dowork (c); 43 | } 44 | 45 | /* 46 | * Should we ping the remote? 47 | */ 48 | static inline void 49 | check_ping_send (struct context *c) 50 | { 51 | void check_ping_send_dowork (struct context *c); 52 | if (c->options.ping_send_timeout 53 | && event_timeout_trigger (&c->c2.ping_send_interval, 54 | &c->c2.timeval, 55 | !TO_LINK_DEF(c) ? ETT_DEFAULT : 1)) 56 | check_ping_send_dowork (c); 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/ping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef PING_H 26 | #define PING_H 27 | 28 | #include "init.h" 29 | #include "forward.h" 30 | 31 | /* 32 | * Initial default --ping-restart before --pull 33 | */ 34 | #define PRE_PULL_INITIAL_PING_RESTART 120 /* in seconds */ 35 | 36 | extern const uint8_t ping_string[]; 37 | 38 | /* PING_STRING_SIZE must be sizeof (ping_string) */ 39 | #define PING_STRING_SIZE 16 40 | 41 | static inline bool 42 | is_ping_msg (const struct buffer* buf) 43 | { 44 | return buf_string_match (buf, ping_string, PING_STRING_SIZE); 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/pkcs11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef OPENVPN_PKCS11_H 26 | #define OPENVPN_PKCS11_H 27 | 28 | #if defined(ENABLE_PKCS11) 29 | 30 | #include "ssl_common.h" 31 | 32 | bool 33 | pkcs11_initialize ( 34 | const bool fProtectedAuthentication, 35 | const int nPINCachePeriod 36 | ); 37 | 38 | void 39 | pkcs11_terminate (); 40 | 41 | bool 42 | pkcs11_addProvider ( 43 | const char * const provider, 44 | const bool fProtectedAuthentication, 45 | const unsigned private_mode, 46 | const bool fCertIsPrivate 47 | ); 48 | 49 | int 50 | pkcs11_logout(); 51 | 52 | int 53 | pkcs11_management_id_count (); 54 | 55 | bool 56 | pkcs11_management_id_get ( 57 | const int index, 58 | char ** id, 59 | char **base64 60 | ); 61 | 62 | int 63 | tls_ctx_use_pkcs11 ( 64 | struct tls_root_ctx * const ssl_ctx, 65 | bool pkcs11_id_management, 66 | const char * const pkcs11_id 67 | ); 68 | 69 | void 70 | show_pkcs11_ids ( 71 | const char * const provider, 72 | bool cert_private 73 | ); 74 | 75 | #endif /* ENABLE_PKCS11 */ 76 | 77 | #endif /* OPENVPN_PKCS11H_H */ 78 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/pkcs11_backend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * Copyright (C) 2010 Fox Crypto B.V. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License version 2 13 | * as published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program (see the file COPYING included with this 22 | * distribution); if not, write to the Free Software Foundation, Inc., 23 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | */ 25 | 26 | /** 27 | * @file PKCS #11 SSL library-specific backend 28 | */ 29 | 30 | #ifndef PKCS11_BACKEND_H_ 31 | #define PKCS11_BACKEND_H_ 32 | 33 | #include "syshead.h" 34 | 35 | #if defined(ENABLE_PKCS11) 36 | 37 | #include "ssl_common.h" 38 | 39 | #include 40 | 41 | /** 42 | * Retrieve PKCS #11 Certificate's DN in a printable format. 43 | * 44 | * @param certificate The PKCS #11 helper certificate object 45 | * @param gc Garbage collection pool to allocate memory in 46 | * 47 | * @return Certificate's DN on success, NULL on failure 48 | */ 49 | char * pkcs11_certificate_dn (pkcs11h_certificate_t certificate, struct gc_arena *gc); 50 | 51 | /** 52 | * Retrieve PKCS #11 Certificate's serial number in a printable format. 53 | * 54 | * @param certificate The PKCS #11 helper certificate object 55 | * @param serial Buffer that the certificate's serial will be placed in. 56 | * @param serial_len Size of said buffer. 57 | * 58 | * @return 1 on failure, 0 on success 59 | */ 60 | int pkcs11_certificate_serial (pkcs11h_certificate_t certificate, char *serial, 61 | size_t serial_len); 62 | 63 | /** 64 | * Load PKCS #11 Certificate's information into the given TLS context 65 | * 66 | * @param certificate The PKCS #11 helper certificate object 67 | * @param ssl_ctx TLS context to use. 68 | * 69 | * @return 1 on failure, 0 on success 70 | */ 71 | int pkcs11_init_tls_session(pkcs11h_certificate_t certificate, 72 | struct tls_root_ctx * const ssl_ctx); 73 | 74 | #endif /* defined(ENABLE_PKCS11) */ 75 | #endif /* PKCS11_BACKEND_H_ */ 76 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/ps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef PS_H 26 | #define PS_H 27 | 28 | #if PORT_SHARE 29 | 30 | #include "basic.h" 31 | #include "buffer.h" 32 | #include "ssl.h" 33 | 34 | typedef void (*post_fork_cleanup_func_t)(void *arg); 35 | 36 | struct port_share { 37 | /* Foreground's socket to background process */ 38 | socket_descriptor_t foreground_fd; 39 | 40 | /* Process ID of background process */ 41 | pid_t background_pid; 42 | }; 43 | 44 | extern struct port_share *port_share; 45 | 46 | struct port_share *port_share_open (const char *host, 47 | const int port, 48 | const int max_initial_buf, 49 | const char *journal_dir); 50 | 51 | void port_share_close (struct port_share *ps); 52 | void port_share_abort (struct port_share *ps); 53 | 54 | bool is_openvpn_protocol (const struct buffer *buf); 55 | 56 | void port_share_redirect (struct port_share *ps, const struct buffer *head, socket_descriptor_t sd); 57 | 58 | #endif 59 | #endif 60 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/push.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifndef PUSH_H 26 | #define PUSH_H 27 | 28 | #if P2MP 29 | 30 | #include "forward.h" 31 | 32 | #define PUSH_MSG_ERROR 0 33 | #define PUSH_MSG_REQUEST 1 34 | #define PUSH_MSG_REPLY 2 35 | #define PUSH_MSG_REQUEST_DEFERRED 3 36 | #define PUSH_MSG_AUTH_FAILURE 4 37 | #define PUSH_MSG_CONTINUATION 5 38 | #define PUSH_MSG_ALREADY_REPLIED 6 39 | 40 | void incoming_push_message (struct context *c, 41 | const struct buffer *buffer); 42 | 43 | int process_incoming_push_msg (struct context *c, 44 | const struct buffer *buffer, 45 | bool honor_received_options, 46 | unsigned int permission_mask, 47 | unsigned int *option_types_found); 48 | 49 | bool send_push_request (struct context *c); 50 | 51 | void receive_auth_failed (struct context *c, const struct buffer *buffer); 52 | 53 | void server_pushed_signal (struct context *c, const struct buffer *buffer, const bool restart, const int adv); 54 | 55 | #if P2MP_SERVER 56 | 57 | void clone_push_list (struct options *o); 58 | 59 | void push_option (struct options *o, const char *opt, int msglevel); 60 | void push_options (struct options *o, char **p, int msglevel, struct gc_arena *gc); 61 | 62 | void push_reset (struct options *o); 63 | 64 | bool send_push_reply (struct context *c); 65 | 66 | void remove_iroutes_from_push_route_list (struct options *o); 67 | 68 | void send_auth_failed (struct context *c, const char *client_reason); 69 | 70 | void send_restart (struct context *c, const char *kill_msg); 71 | 72 | #endif 73 | #endif 74 | #endif 75 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/pushlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #if !defined(PUSHLIST_H) && P2MP && P2MP_SERVER 26 | #define PUSHLIST_H 27 | 28 | /* parameters to be pushed to peer */ 29 | 30 | struct push_entry { 31 | struct push_entry *next; 32 | bool enable; 33 | const char *option; 34 | }; 35 | 36 | struct push_list { 37 | struct push_entry *head; 38 | struct push_entry *tail; 39 | }; 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/session_id.c: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * Each session is identified by a random 8-byte session identifier. 27 | * 28 | * For efficiency, the session id is only transmitted over the control 29 | * channel (which only sees traffic occasionally when keys are being 30 | * negotiated). The data channel sees a smaller version of the session-id -- 31 | * it is called the key_id and is currently 2 bits long. 32 | */ 33 | 34 | #ifdef HAVE_CONFIG_H 35 | #include "config.h" 36 | #elif defined(_MSC_VER) 37 | #include "config-msvc.h" 38 | #endif 39 | 40 | #include "syshead.h" 41 | 42 | #if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) 43 | 44 | #include "error.h" 45 | #include "common.h" 46 | #include "crypto.h" 47 | #include "session_id.h" 48 | 49 | #include "memdbg.h" 50 | 51 | const struct session_id x_session_id_zero; 52 | 53 | void 54 | session_id_random (struct session_id *sid) 55 | { 56 | prng_bytes (sid->id, SID_SIZE); 57 | } 58 | 59 | const char * 60 | session_id_print (const struct session_id *sid, struct gc_arena *gc) 61 | { 62 | return format_hex (sid->id, SID_SIZE, 0, gc); 63 | } 64 | 65 | #else 66 | static void dummy(void) {} 67 | #endif /* ENABLE_CRYPTO && ENABLE_SSL*/ 68 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/session_id.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * Each session is identified by a random 8-byte session identifier. 27 | * 28 | * For efficiency, the session id is only transmitted over the control 29 | * channel (which only sees traffic occasionally when keys are being 30 | * negotiated). 31 | */ 32 | 33 | #if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) 34 | 35 | #ifndef SESSION_ID_H 36 | #define SESSION_ID_H 37 | 38 | #include "basic.h" 39 | #include "buffer.h" 40 | 41 | struct session_id 42 | { 43 | uint8_t id[8]; 44 | }; 45 | 46 | extern const struct session_id x_session_id_zero; 47 | 48 | #define SID_SIZE (sizeof (x_session_id_zero.id)) 49 | 50 | static inline bool 51 | session_id_equal (const struct session_id *sid1, 52 | const struct session_id *sid2) 53 | { 54 | return !memcmp (sid1->id, sid2->id, SID_SIZE); 55 | } 56 | 57 | static inline bool 58 | session_id_defined (const struct session_id *sid1) 59 | { 60 | return memcmp (sid1->id, &x_session_id_zero.id, SID_SIZE) != 0; 61 | } 62 | 63 | static inline bool 64 | session_id_read (struct session_id *sid, struct buffer *buf) 65 | { 66 | return buf_read (buf, sid->id, SID_SIZE); 67 | } 68 | 69 | static inline bool 70 | session_id_write_prepend (const struct session_id *sid, struct buffer *buf) 71 | { 72 | return buf_write_prepend (buf, sid->id, SID_SIZE); 73 | } 74 | 75 | static inline bool 76 | session_id_write (const struct session_id *sid, struct buffer *buf) 77 | { 78 | return buf_write (buf, sid->id, SID_SIZE); 79 | } 80 | 81 | void session_id_random (struct session_id *sid); 82 | 83 | const char *session_id_print (const struct session_id *sid, struct gc_arena *gc); 84 | 85 | #endif /* SESSION_ID_H */ 86 | #endif /* ENABLE_CRYPTO && ENABLE_SSL */ 87 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/shaper.c: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | #ifdef HAVE_CONFIG_H 26 | #include "config.h" 27 | #elif defined(_MSC_VER) 28 | #include "config-msvc.h" 29 | #endif 30 | 31 | #include "syshead.h" 32 | #include "shaper.h" 33 | #include "memdbg.h" 34 | 35 | #ifdef ENABLE_FEATURE_SHAPER 36 | 37 | /* 38 | * We want to wake up in delay microseconds. If timeval is larger 39 | * than delay, set timeval to delay. 40 | */ 41 | bool 42 | shaper_soonest_event (struct timeval *tv, int delay) 43 | { 44 | bool ret = false; 45 | if (delay < 1000000) 46 | { 47 | if (tv->tv_sec) 48 | { 49 | tv->tv_sec = 0; 50 | tv->tv_usec = delay; 51 | ret = true; 52 | } 53 | else if (delay < tv->tv_usec) 54 | { 55 | tv->tv_usec = delay; 56 | ret = true; 57 | } 58 | } 59 | else 60 | { 61 | const int sec = delay / 1000000; 62 | const int usec = delay % 1000000; 63 | 64 | if (sec < tv->tv_sec) 65 | { 66 | tv->tv_sec = sec; 67 | tv->tv_usec = usec; 68 | ret = true; 69 | } 70 | else if (sec == tv->tv_sec) 71 | { 72 | if (usec < tv->tv_usec) 73 | { 74 | tv->tv_usec = usec; 75 | ret = true; 76 | } 77 | } 78 | } 79 | #ifdef SHAPER_DEBUG 80 | dmsg (D_SHAPER_DEBUG, "SHAPER shaper_soonest_event sec=%d usec=%d ret=%d", 81 | (int)tv->tv_sec, (int)tv->tv_usec, (int)ret); 82 | #endif 83 | return ret; 84 | } 85 | 86 | void 87 | shaper_reset_wakeup (struct shaper *s) 88 | { 89 | CLEAR (s->wakeup); 90 | } 91 | 92 | void 93 | shaper_msg (struct shaper *s) 94 | { 95 | msg (M_INFO, "Output Traffic Shaping initialized at %d bytes per second", 96 | s->bytes_per_second); 97 | } 98 | 99 | #else 100 | static void dummy(void) {} 101 | #endif /* ENABLE_FEATURE_SHAPER */ 102 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/socks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | 25 | /* 26 | * 2004-01-30: Added Socks5 proxy support 27 | * (Christof Meerwald, http://cmeerw.org) 28 | */ 29 | 30 | #ifndef SOCKS_H 31 | #define SOCKS_H 32 | 33 | #ifdef ENABLE_SOCKS 34 | 35 | #include "buffer.h" 36 | 37 | struct openvpn_sockaddr; 38 | struct link_socket_actual; 39 | 40 | struct socks_proxy_info { 41 | bool defined; 42 | bool retry; 43 | 44 | char server[128]; 45 | int port; 46 | char authfile[256]; 47 | }; 48 | 49 | void socks_adjust_frame_parameters (struct frame *frame, int proto); 50 | 51 | struct socks_proxy_info *socks_proxy_new (const char *server, 52 | int port, 53 | const char *authfile, 54 | bool retry); 55 | 56 | void socks_proxy_close (struct socks_proxy_info *sp); 57 | 58 | void establish_socks_proxy_passthru (struct socks_proxy_info *p, 59 | socket_descriptor_t sd, /* already open to proxy */ 60 | const char *host, /* openvpn server remote */ 61 | const int port, /* openvpn server port */ 62 | volatile int *signal_received); 63 | 64 | void establish_socks_proxy_udpassoc (struct socks_proxy_info *p, 65 | socket_descriptor_t ctrl_sd, /* already open to proxy */ 66 | socket_descriptor_t udp_sd, 67 | struct openvpn_sockaddr *relay_addr, 68 | volatile int *signal_received); 69 | 70 | void socks_process_incoming_udp (struct buffer *buf, 71 | struct link_socket_actual *from); 72 | 73 | int socks_process_outgoing_udp (struct buffer *buf, 74 | const struct link_socket_actual *to); 75 | 76 | #endif 77 | #endif 78 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/ssl_openssl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * Copyright (C) 2010 Fox Crypto B.V. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License version 2 13 | * as published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program (see the file COPYING included with this 22 | * distribution); if not, write to the Free Software Foundation, Inc., 23 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | */ 25 | 26 | /** 27 | * @file Control Channel OpenSSL Backend 28 | */ 29 | 30 | #ifndef SSL_OPENSSL_H_ 31 | #define SSL_OPENSSL_H_ 32 | 33 | #include 34 | 35 | /** 36 | * SSL_OP_NO_TICKET tells OpenSSL to disable "stateless session resumption", 37 | * as this is something we do not want nor need, but could potentially be 38 | * used for a future attack. For compatibility reasons, in the 2.3.x 39 | * series, we keep building if the OpenSSL version is too old to support 40 | * this. 2.4 requires it and will fail configure if not present. 41 | */ 42 | #ifndef SSL_OP_NO_TICKET 43 | # define SSL_OP_NO_TICKET 0 44 | #endif 45 | 46 | 47 | /** 48 | * Structure that wraps the TLS context. Contents differ depending on the 49 | * SSL library used. 50 | */ 51 | struct tls_root_ctx { 52 | SSL_CTX *ctx; 53 | }; 54 | 55 | struct key_state_ssl { 56 | SSL *ssl; /* SSL object -- new obj created for each new key */ 57 | BIO *ssl_bio; /* read/write plaintext from here */ 58 | BIO *ct_in; /* write ciphertext to here */ 59 | BIO *ct_out; /* read ciphertext from here */ 60 | }; 61 | 62 | /** 63 | * Allocate space in SSL objects in which to store a struct tls_session 64 | * pointer back to parent. 65 | */ 66 | extern int mydata_index; /* GLOBAL */ 67 | 68 | void openssl_set_mydata_index (void); 69 | 70 | #endif /* SSL_OPENSSL_H_ */ 71 | -------------------------------------------------------------------------------- /OpenVPN/OpenVPN/ssl_polarssl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenVPN -- An application to securely tunnel IP networks 3 | * over a single TCP/UDP port, with support for SSL/TLS-based 4 | * session authentication and key exchange, 5 | * packet encryption, packet authentication, and 6 | * packet compression. 7 | * 8 | * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. 9 | * Copyright (C) 2010 Fox Crypto B.V. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License version 2 13 | * as published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program (see the file COPYING included with this 22 | * distribution); if not, write to the Free Software Foundation, Inc., 23 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | */ 25 | 26 | /** 27 | * @file Control Channel PolarSSL Backend 28 | */ 29 | 30 | #ifndef SSL_POLARSSL_H_ 31 | #define SSL_POLARSSL_H_ 32 | 33 | #include "syshead.h" 34 | 35 | #include 36 | 37 | #if defined(ENABLE_PKCS11) 38 | #include 39 | #endif 40 | 41 | typedef struct _buffer_entry buffer_entry; 42 | 43 | struct _buffer_entry { 44 | size_t length; 45 | uint8_t *data; 46 | buffer_entry *next_block; 47 | }; 48 | 49 | typedef struct { 50 | size_t data_start; 51 | buffer_entry *first_block; 52 | buffer_entry *last_block; 53 | } endless_buffer; 54 | 55 | /** 56 | * Structure that wraps the TLS context. Contents differ depending on the 57 | * SSL library used. 58 | * 59 | * Either \c priv_key_pkcs11 or \c priv_key must be filled in. 60 | */ 61 | struct tls_root_ctx { 62 | bool initialised; /**< True if the context has been initialised */ 63 | 64 | int endpoint; /**< Whether or not this is a server or a client */ 65 | 66 | dhm_context *dhm_ctx; /**< Diffie-Helmann-Merkle context */ 67 | x509_cert *crt_chain; /**< Local Certificate chain */ 68 | x509_cert *ca_chain; /**< CA chain for remote verification */ 69 | rsa_context *priv_key; /**< Local private key */ 70 | #if defined(ENABLE_PKCS11) 71 | pkcs11_context *priv_key_pkcs11; /**< PKCS11 private key */ 72 | #endif 73 | #ifdef MANAGMENT_EXTERNAL_KEY 74 | struct external_context *external_key; /**< Management external key */ 75 | #endif 76 | int * allowed_ciphers; /**< List of allowed ciphers for this connection */ 77 | }; 78 | 79 | struct key_state_ssl { 80 | ssl_context *ctx; 81 | endless_buffer *ct_in; 82 | endless_buffer *ct_out; 83 | }; 84 | 85 | 86 | #endif /* SSL_POLARSSL_H_ */ 87 | -------------------------------------------------------------------------------- /OpenVPNSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OpenVPNSample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OpenVPNSample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OpenVPNSample 4 | // 5 | // Created by Katekov Anton on 03.11.15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /OpenVPNSample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OpenVPNSample 4 | // 5 | // Created by Katekov Anton on 03.11.15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OpenVPNSample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "ipad", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "ipad", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "ipad", 15 | "size" : "40x40", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "40x40", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "76x76", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "76x76", 31 | "scale" : "2x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /OpenVPNSample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OpenVPNSample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /OpenVPNSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /OpenVPNSample/OpenVPNSample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.networking.networkextension 6 | 7 | packet-tunnel-provider 8 | app-proxy-provider 9 | content-filter-provider 10 | 11 | keychain-access-groups 12 | 13 | com.apple.managed.vpn.shared 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /OpenVPNSample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OpenVPNSample 4 | // 5 | // Created by Katekov Anton on 03.11.15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OpenVPNSample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OpenVPNSample 4 | // 5 | // Created by Katekov Anton on 03.11.15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #include 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenVPNSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OpenVPNSample 4 | // 5 | // Created by Katekov Anton on 03.11.15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /OpenVPNTunnelProvider/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | OpenVPNTunnelProvider 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSExtension 26 | 27 | NSExtensionPointIdentifier 28 | com.apple.networkextension.packet-tunnel 29 | NSExtensionPrincipalClass 30 | PacketTunnelProvider 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /OpenVPNTunnelProvider/OpenVPNTunnelProvider.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keychain-access-groups 6 | 7 | com.apple.managed.vpn.shared 8 | 9 | com.apple.developer.networking.networkextension 10 | 11 | packet-tunnel-provider 12 | app-proxy-provider 13 | content-filter-provider 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /OpenVPNTunnelProvider/PacketTunnelProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // PacketTunnelProvider.h 3 | // OpenVPNTunnelProvider 4 | // 5 | // Created by Evgenii Gubenko on 11/10/15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | @import NetworkExtension; 10 | 11 | @interface PacketTunnelProvider : NEPacketTunnelProvider 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OpenVPNTunnelProvider/PacketTunnelProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // PacketTunnelProvider.m 3 | // OpenVPNTunnelProvider 4 | // 5 | // Created by Evgenii Gubenko on 11/10/15. 6 | // Copyright © 2015 katekovanton. All rights reserved. 7 | // 8 | 9 | #import "PacketTunnelProvider.h" 10 | 11 | @implementation PacketTunnelProvider 12 | 13 | - (void)startTunnelWithOptions:(NSDictionary *)options completionHandler:(void (^)(NSError *))completionHandler 14 | { 15 | // Add code here to start the process of connecting the tunnel. 16 | } 17 | 18 | - (void)stopTunnelWithReason:(NEProviderStopReason)reason completionHandler:(void (^)(void))completionHandler 19 | { 20 | // Add code here to start the process of stopping the tunnel. 21 | completionHandler(); 22 | } 23 | 24 | - (void)handleAppMessage:(NSData *)messageData completionHandler:(void (^)(NSData *))completionHandler 25 | { 26 | // Add code here to handle the message. 27 | } 28 | 29 | - (void)sleepWithCompletionHandler:(void (^)(void))completionHandler 30 | { 31 | // Add code here to get ready to sleep. 32 | completionHandler(); 33 | } 34 | 35 | - (void)wake 36 | { 37 | // Add code here to wake up. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | 2 | xcodeproj 'OpenVPNSample.xcodeproj' 3 | platform :ios, '9.0' 4 | 5 | pod 'OpenSSL-iOS' --------------------------------------------------------------------------------