亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tun.c

?? OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authe
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* *  OpenVPN -- An application to securely tunnel IP networks *             over a single TCP/UDP port, with support for SSL/TLS-based *             session authentication and key exchange, *             packet encryption, packet authentication, and *             packet compression. * *  Copyright (C) 2002-2004 James Yonan <jim@yonan.net> * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program (see the file COPYING included with this *  distribution); if not, write to the Free Software Foundation, Inc., *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *//* * Support routines for configuring and accessing TUN/TAP * virtual network adapters. * * This file is based on the TUN/TAP driver interface routines * from VTun by Maxim Krasnyansky <max_mk@yahoo.com>. */#ifdef WIN32#include "config-win32.h"#else#include "config.h"#endif#include "syshead.h"#include "tun.h"#include "fdmisc.h"#include "common.h"#include "misc.h"#include "socket.h"#include "memdbg.h"boolis_dev_type (const char *dev, const char *dev_type, const char *match_type){  ASSERT (match_type);  if (!dev)    return false;  if (dev_type)    return !strcmp (dev_type, match_type);  else    return !strncmp (dev, match_type, strlen (match_type));}intdev_type_enum (const char *dev, const char *dev_type){  if (is_dev_type (dev, dev_type, "tun"))    return DEV_TYPE_TUN;  else if (is_dev_type (dev, dev_type, "tap"))    return DEV_TYPE_TAP;  else if (is_dev_type (dev, dev_type, "null"))    return DEV_TYPE_NULL;  else    return DEV_TYPE_UNDEF;}const char *dev_type_string (const char *dev, const char *dev_type){  switch (dev_type_enum (dev, dev_type))    {    case DEV_TYPE_TUN:      return "tun";    case DEV_TYPE_TAP:      return "tap";    case DEV_TYPE_NULL:      return "null";    default:      return "[unknown-dev-type]";    }}const char *dev_component_in_dev_node (const char *dev_node){  const char *ret;  const int dirsep = OS_SPECIFIC_DIRSEP;  if (dev_node)    {      ret = strrchr (dev_node, dirsep);      if (ret && *ret)	++ret;      else	ret = dev_node;      if (*ret)	return ret;    }  return NULL;}/* * Try to predict the actual TUN/TAP device instance name, * before the device is actually opened. */const char *guess_tuntap_dev (const char *dev,		  const char *dev_type,		  const char *dev_node,		  struct gc_arena *gc){#ifdef WIN32  struct buffer out = alloc_buf_gc (256, gc);  get_device_guid (dev_node, BPTR (&out), buf_forward_capacity (&out), gc);  return BSTR (&out);#else/* default case */  return dev;#endif}/* * Called by the open_tun function of OSes to check if we * explicitly support IPv6. * * In this context, explicit means that the OS expects us to * do something special to the tun socket in order to support * IPv6, i.e. it is not transparent. * * ipv6_explicitly_supported should be set to false if we don't * have any explicit IPv6 code in the tun device handler. * * If ipv6_explicitly_supported is true, then we have explicit * OS-specific tun dev code for handling IPv6.  If so, tt->ipv6 * is set according to the --tun-ipv6 command line option. */static voidipv6_support (bool ipv6, bool ipv6_explicitly_supported, struct tuntap* tt){  tt->ipv6 = false;  if (ipv6_explicitly_supported)    tt->ipv6 = ipv6;  else if (ipv6)    msg (M_WARN, "NOTE: explicit support for IPv6 tun devices is not provided for this OS");}/* * If !tun, make sure ifconfig_remote_netmask looks *  like a netmask. * * If tun, make sure ifconfig_remote_netmask looks *  like an IPv4 address. */static voidifconfig_sanity_check (bool tun, in_addr_t addr){  struct gc_arena gc = gc_new ();  const bool looks_like_netmask = ((addr & 0xFF000000) == 0xFF000000);  if (tun)    {      if (looks_like_netmask)	msg (M_WARN, "WARNING: Since you are using --dev tun, the second argument to --ifconfig must be an IP address.  You are using something (%s) that looks more like a netmask.", print_in_addr_t (addr, false, &gc));    }  else /* tap */    {      if (!looks_like_netmask)	msg (M_WARN, "WARNING: Since you are using --dev tap, the second argument to --ifconfig must be a netmask, for example something like 255.255.255.0.");    }  gc_free (&gc);}/* * For TAP-style devices, generate a broadcast address. */static in_addr_tgenerate_ifconfig_broadcast_addr (in_addr_t local,				  in_addr_t netmask){  return local | ~netmask;}/* * Check that --local and --remote addresses do not * clash with ifconfig addresses or subnet. */static voidcheck_addr_clash (const char *name,		  int type,		  in_addr_t public,		  in_addr_t local,		  in_addr_t remote_netmask){  struct gc_arena gc = gc_new ();#if 0  msg (M_INFO, "CHECK_ADDR_CLASH type=%d public=%s local=%s, remote_netmask=%s",       type,       print_in_addr_t (public, false, &gc),       print_in_addr_t (local, false, &gc),       print_in_addr_t (remote_netmask, false, &gc));#endif  if (public)    {      if (type == DEV_TYPE_TUN)	{	  const in_addr_t test_netmask = 0xFFFFFF00;	  const in_addr_t public_net = public & test_netmask;	  const in_addr_t local_net = local & test_netmask;	  const in_addr_t remote_net = remote_netmask & test_netmask;	  if (public == local || public == remote_netmask)	    msg (M_WARN,		 "WARNING: --%s address [%s] conflicts with --ifconfig address pair [%s, %s]",		 name,		 print_in_addr_t (public, false, &gc),		 print_in_addr_t (local, false, &gc),		 print_in_addr_t (remote_netmask, false, &gc));	  if (public_net == local_net || public_net == remote_net)	    msg (M_WARN,		 "WARNING: potential conflict between --%s address [%s] and --ifconfig address pair [%s, %s] -- this is a warning only that is triggered when local/remote addresses exist within the same /24 subnet as --ifconfig endpoints",		 name,		 print_in_addr_t (public, false, &gc),		 print_in_addr_t (local, false, &gc),		 print_in_addr_t (remote_netmask, false, &gc));	}      else if (type == DEV_TYPE_TAP)	{	  const in_addr_t public_network = public & remote_netmask;	  const in_addr_t virtual_network = local & remote_netmask;	  if (public_network == virtual_network)	    msg (M_WARN,		 "WARNING: --%s address [%s] conflicts with --ifconfig subnet [%s, %s] -- local and remote addresses cannot be inside of the --ifconfig subnet",		 name,		 print_in_addr_t (public, false, &gc),		 print_in_addr_t (local, false, &gc),		 print_in_addr_t (remote_netmask, false, &gc));	}    }  gc_free (&gc);}/* * Complain if --dev tap and --ifconfig is used on an OS for which * we don't have a custom tap ifconfig template below. */static voidno_tap_ifconfig (){  msg (M_FATAL, "Sorry but you cannot use --dev tap and --ifconfig together on this OS because I have not yet been programmed to understand the appropriate ifconfig syntax to use for TAP-style devices on this OS.  Your best alternative is to use an --up script and do the ifconfig command manually.");}/* * Return a string to be used for options compatibility check * between peers. */const char *ifconfig_options_string (const struct tuntap* tt, bool remote, bool disable, struct gc_arena *gc){  struct buffer out = alloc_buf_gc (256, gc);  if (tt->did_ifconfig_setup && !disable)    {      if (tt->type == DEV_TYPE_TUN)	{	  const char *l, *r;	  if (remote)	    {	      r = print_in_addr_t (tt->local, false, gc);	      l = print_in_addr_t (tt->remote_netmask, false, gc);	    }	  else	    {	      l = print_in_addr_t (tt->local, false, gc);	      r = print_in_addr_t (tt->remote_netmask, false, gc);	    }	  buf_printf (&out, "%s %s", r, l);	}      else if (tt->type == DEV_TYPE_TAP)	{	  buf_printf (&out, "%s %s",		      print_in_addr_t (tt->local & tt->remote_netmask, false, gc),		      print_in_addr_t (tt->remote_netmask, false, gc));	}      else	buf_printf (&out, "[undef]");    }  return BSTR (&out);}/* * Return a status string describing wait state. */const char *tun_stat (const struct tuntap *tt, unsigned int rwflags, struct gc_arena *gc){  struct buffer out = alloc_buf_gc (64, gc);  if (tt)    {      if (rwflags & EVENT_READ)	{	  buf_printf (&out, "T%s",		      (tt->rwflags & EVENT_READ) ? "R" : "r");#ifdef WIN32	  buf_printf (&out, "%s",		      overlapped_io_state_ascii (&tt->reads));#endif	}      if (rwflags & EVENT_WRITE)	{	  buf_printf (&out, "T%s",		      (tt->rwflags & EVENT_WRITE) ? "W" : "w");#ifdef WIN32	  buf_printf (&out, "%s",		      overlapped_io_state_ascii (&tt->writes));#endif	}    }  else    {      buf_printf (&out, "T?");    }  return BSTR (&out);}/* * Init tun/tap object. * * Set up tuntap structure for ifconfig, * but don't execute yet. */struct tuntap *init_tun (const char *dev,       /* --dev option */	  const char *dev_type,  /* --dev-type option */	  const char *ifconfig_local_parm,          /* --ifconfig parm 1 */	  const char *ifconfig_remote_netmask_parm, /* --ifconfig parm 2 */	  in_addr_t local_public,	  in_addr_t remote_public){  struct gc_arena gc = gc_new ();  struct tuntap *tt;  ALLOC_OBJ (tt, struct tuntap);  clear_tuntap (tt);  tt->type = dev_type_enum (dev, dev_type);  if (ifconfig_local_parm && ifconfig_remote_netmask_parm)    {      bool tun = false;      const char *ifconfig_local = NULL;      const char *ifconfig_remote_netmask = NULL;      const char *ifconfig_broadcast = NULL;      /*       * We only handle TUN/TAP devices here, not --dev null devices.       */      if (tt->type == DEV_TYPE_TUN)	tun = true;      else if (tt->type == DEV_TYPE_TAP)	tun = false;      else	msg (M_FATAL, "'%s' is not a TUN/TAP device.  The --ifconfig option works only for TUN/TAP devices.", dev);      /*       * Convert arguments to binary IPv4 addresses.       */      tt->local = getaddr (			   GETADDR_RESOLVE			   | GETADDR_FATAL			   | GETADDR_HOST_ORDER			   | GETADDR_FATAL_ON_SIGNAL,			   ifconfig_local_parm,			   0,			   NULL,			   NULL);      tt->remote_netmask = getaddr (				    (tun ? GETADDR_RESOLVE : 0)				    | GETADDR_FATAL				    | GETADDR_HOST_ORDER				    | GETADDR_FATAL_ON_SIGNAL,				    ifconfig_remote_netmask_parm,				    0,				    NULL,				    NULL);      ifconfig_sanity_check (tun, tt->remote_netmask);      /*       * If local_public or remote_public addresses are defined,       * make sure they do not clash with our virtual subnet.       */      check_addr_clash ("local",			tt->type,			local_public,			tt->local,			tt->remote_netmask);      check_addr_clash ("remote",			tt->type,			remote_public,			tt->local,			tt->remote_netmask);      /*       * Set ifconfig parameters       */      ifconfig_local = print_in_addr_t (tt->local, false, &gc);      ifconfig_remote_netmask = print_in_addr_t (tt->remote_netmask, false, &gc);      /*       * If TAP-style interface, generate broadcast address.       */      if (!tun)	{	  tt->broadcast = generate_ifconfig_broadcast_addr (tt->local, tt->remote_netmask);	  ifconfig_broadcast = print_in_addr_t (tt->broadcast, false, &gc);	}      /*       * Set environmental variables with ifconfig parameters.       */      setenv_str ("ifconfig_local", ifconfig_local);      if (tun)	{	  setenv_str ("ifconfig_remote", ifconfig_remote_netmask);	}      else	{	  setenv_str ("ifconfig_netmask", ifconfig_remote_netmask);	  setenv_str ("ifconfig_broadcast", ifconfig_broadcast);	}      tt->did_ifconfig_setup = true;    }  gc_free (&gc);  return tt;}/* * Platform specific tun initializations */voidinit_tun_post (struct tuntap *tt,	       const struct frame *frame,	       const struct tuntap_options *options){  tt->options = *options;#ifdef WIN32  overlapped_io_init (&tt->reads, frame, FALSE, true);  overlapped_io_init (&tt->writes, frame, TRUE, true);  tt->rw_handle.read = tt->reads.overlapped.hEvent;  tt->rw_handle.write = tt->writes.overlapped.hEvent;#endif}/* execute the ifconfig command through the shell */voiddo_ifconfig (struct tuntap *tt,	     const char *actual,    /* actual device name */	     int tun_mtu){  struct gc_arena gc = gc_new ();  if (tt->did_ifconfig_setup)    {      bool tun = false;      const char *ifconfig_local = NULL;      const char *ifconfig_remote_netmask = NULL;      const char *ifconfig_broadcast = NULL;      char command_line[512];      /*       * We only handle TUN/TAP devices here, not --dev null devices.       */      if (tt->type == DEV_TYPE_TUN)	tun = true;      else if (tt->type == DEV_TYPE_TAP)	tun = false;      else	ASSERT (0); /* should have been caught in init_tun */      /*       * Set ifconfig parameters       */      ifconfig_local = print_in_addr_t (tt->local, false, &gc);      ifconfig_remote_netmask = print_in_addr_t (tt->remote_netmask, false, &gc);      /*       * If TAP-style device, generate broadcast address.       */      if (!tun)	ifconfig_broadcast = print_in_addr_t (tt->broadcast, false, &gc);#if defined(TARGET_LINUX)#ifdef CONFIG_FEATURE_IPROUTE	/*	 * Set the MTU for the device

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品在线观看播放| 蜜桃av噜噜一区| av福利精品导航| 中文字幕国产一区| 99久久精品久久久久久清纯| 亚洲免费在线电影| 欧美午夜精品电影| 日韩vs国产vs欧美| 久久色中文字幕| 成人免费毛片a| 亚洲精品乱码久久久久久| 在线观看日韩毛片| 美国十次综合导航| 国产欧美精品在线观看| 97se亚洲国产综合自在线 | 国产成人午夜精品影院观看视频 | 久久夜色精品国产欧美乱极品| 国产一区二区在线看| 国产精品久久久久久久久动漫| 色综合一区二区三区| 天天色天天爱天天射综合| 久久综合色8888| 91女厕偷拍女厕偷拍高清| 亚洲国产成人av| 国产片一区二区三区| 色素色在线综合| 久久国产人妖系列| 亚洲九九爱视频| 日韩精品一区二| 99久久99久久精品免费观看| 日韩av二区在线播放| 国产欧美日本一区视频| 色88888久久久久久影院按摩| 久热成人在线视频| 综合网在线视频| 久久综合国产精品| 欧美日韩国产精选| 成人免费黄色在线| 免播放器亚洲一区| 一区二区三区在线视频免费| 久久久影视传媒| 在线电影一区二区三区| 95精品视频在线| 国产在线视频不卡二| 水蜜桃久久夜色精品一区的特点| 国产日韩高清在线| 欧美一区二区三区喷汁尤物| 91久久精品一区二区三区| 韩国一区二区在线观看| 午夜影院久久久| 一区二区三区在线高清| 欧美经典三级视频一区二区三区| 欧美日韩三级在线| 91丨九色丨尤物| 成人午夜免费电影| 国产一区二区三区最好精华液| 亚洲成av人综合在线观看| 成人欧美一区二区三区小说| 国产亚洲精品bt天堂精选| 日韩欧美黄色影院| 欧美福利视频一区| 欧美体内she精视频| 色哟哟在线观看一区二区三区| 高清beeg欧美| 亚洲精品国产成人久久av盗摄| 蜜臀久久久99精品久久久久久| 中文字幕在线不卡国产视频| 精品剧情v国产在线观看在线| 欧美午夜免费电影| 欧美视频你懂的| 欧美四级电影网| 欧洲一区在线观看| 色婷婷狠狠综合| 色系网站成人免费| 在线免费av一区| 欧美亚州韩日在线看免费版国语版 | 成人永久免费视频| 国产一区二区三区日韩| 免费av网站大全久久| 日本特黄久久久高潮| 欧美aaaaa成人免费观看视频| 日本不卡一二三| 日本不卡的三区四区五区| 青娱乐精品视频| 精品在线亚洲视频| 国产成人免费9x9x人网站视频| 国产一区二区91| av亚洲精华国产精华精华| 99久久99久久精品免费看蜜桃| 一本大道久久a久久精品综合| 91国模大尺度私拍在线视频| 在线观看成人免费视频| 欧美日韩国产小视频| 欧美一级夜夜爽| 国产片一区二区三区| 一区二区三区日韩精品视频| 亚洲成年人网站在线观看| 久久99久国产精品黄毛片色诱| 国产精品一卡二| 91麻豆产精品久久久久久| 欧美日韩dvd在线观看| 精品国产一二三区| 亚洲日本丝袜连裤袜办公室| 亚洲愉拍自拍另类高清精品| 日韩av不卡一区二区| 国产剧情一区在线| 一本久久a久久免费精品不卡| 欧美狂野另类xxxxoooo| 久久婷婷国产综合精品青草| 亚洲欧美国产77777| 久久精品国产亚洲高清剧情介绍| 不卡视频在线看| 8x福利精品第一导航| 国产欧美中文在线| 亚洲二区在线视频| 成人黄色免费短视频| 欧美日韩国产影片| 日本一区二区三区免费乱视频| 亚洲国产一区二区三区青草影视| 极品少妇xxxx精品少妇| 色综合天天在线| 精品少妇一区二区三区免费观看| 中文字幕亚洲在| 极品销魂美女一区二区三区| 91久久精品日日躁夜夜躁欧美| 精品国产第一区二区三区观看体验| 亚洲视频免费观看| 韩国视频一区二区| 欧美日韩在线播放三区四区| 国产调教视频一区| 免费国产亚洲视频| 欧美性生交片4| 国产精品久久久久四虎| 精品影院一区二区久久久| 91久久精品一区二区二区| 国产片一区二区| 麻豆91在线播放| 欧美日韩高清在线| 亚洲女爱视频在线| caoporn国产一区二区| 日韩你懂的电影在线观看| 亚洲一二三区视频在线观看| a级精品国产片在线观看| 精品久久久久久最新网址| 无吗不卡中文字幕| 色网站国产精品| 亚洲婷婷在线视频| gogo大胆日本视频一区| 国产清纯白嫩初高生在线观看91 | 欧美一区二区女人| 一个色综合av| 91偷拍与自偷拍精品| 国产精品毛片大码女人| 国产成人午夜视频| 国产日产欧产精品推荐色 | 亚洲人成在线观看一区二区| 国产成人精品一区二区三区四区| 欧美成人一区二区三区| 亚洲成人福利片| 色综合久久综合网97色综合| 国产精品久久久久桃色tv| www.日韩大片| 中文字幕精品一区| 成人国产精品免费观看视频| 欧美国产日产图区| 国产91丝袜在线播放九色| 国产午夜精品久久久久久免费视 | 高清国产一区二区三区| 久久久精品2019中文字幕之3| 国产精品一区二区黑丝| 久久久久久综合| 国产福利一区在线| 中文字幕av在线一区二区三区| 国产91露脸合集magnet| 国产欧美精品在线观看| 91在线精品一区二区三区| 依依成人精品视频| 欧美午夜宅男影院| 免费观看在线综合| 久久久久国产精品麻豆| 成人免费黄色大片| 一区二区三区免费在线观看| 欧美少妇一区二区| 免费看黄色91| 中文字幕不卡在线观看| 91麻豆免费视频| 亚洲不卡在线观看| 欧美tk—视频vk| 成人黄色网址在线观看| 亚洲综合在线电影| 欧美一区三区四区| 国产传媒日韩欧美成人| 亚洲精品中文字幕乱码三区| 欧美精品 国产精品| 国产一区二区看久久| 亚洲女同女同女同女同女同69| 欧美电影影音先锋| 国产91丝袜在线观看| 亚洲国产视频一区| 国产偷国产偷亚洲高清人白洁 |