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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? interface.c

?? MC Linux/Unix 終端下文件管理器
?? C
字號:
/*    Unix SMB/Netbios implementation.   Version 1.9.   multiple interface handling   Copyright (C) Andrew Tridgell 1992-1998      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; if not, write to the Free Software   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#include "includes.h"extern int DEBUGLEVEL;struct in_addr ipzero;struct in_addr allones_ip;struct in_addr loopback_ip;static struct in_addr default_ip;static struct in_addr default_bcast;static struct in_addr default_nmask;static BOOL got_ip=False;static BOOL got_bcast=False;static BOOL got_nmask=False;static struct interface *local_interfaces  = NULL;struct interface *last_iface;#define ALLONES  ((uint32)0xFFFFFFFF)#define MKBCADDR(_IP, _NM) ((_IP & _NM) | (_NM ^ ALLONES))/****************************************************************************calculate the default netmask for an address****************************************************************************/static void default_netmask(struct in_addr *inm, struct in_addr *iad){	/*	** Guess a netmask based on the class of the IP address given.	*/	switch((ntohl(iad->s_addr) & 0xE0000000)) {        case 0x00000000:     /* Class A addr */        case 0x20000000:        case 0x40000000:        case 0x60000000:		inm->s_addr = htonl(0xFF000000);		break;			case 0x80000000:	/* Class B addr */        case 0xA0000000:		inm->s_addr = htonl(0xFFFF0000);		break;			case 0xC0000000:	/* Class C addr */		inm->s_addr = htonl(0xFFFFFF00);		break;			default:		/* ??? */		inm->s_addr = htonl(0xFFFFFFF0);        }}/****************************************************************************  get the broadcast address for our address (troyer@saifr00.ateng.az.honeywell.com)****************************************************************************/static void get_broadcast(struct in_addr *if_ipaddr,			  struct in_addr *if_bcast,			  struct in_addr *if_nmask){  	uint32 nm;	short onbc;	short offbc;	/* get a default netmask and broadcast */	default_netmask(if_nmask, if_ipaddr);	get_netmask(if_ipaddr, if_nmask);	/* sanity check on the netmask */	nm = ntohl(if_nmask->s_addr);	onbc = 0;	offbc = 0;	while((onbc + offbc) < 32) {		if(nm & 0x80000000) {			onbc++;			if(offbc) {				/* already found an off bit, so mask                                   is wrong */				onbc = 34;			}		} else {			offbc++;		}		nm <<= 1;	}	if ((onbc < 8)||(onbc == 34)) {		DEBUG(0,("Impossible netmask %s - using defaults\n",			 inet_ntoa(*if_nmask)));		default_netmask(if_nmask, if_ipaddr);      	}	/* derive the broadcast assuming a 1's broadcast, as this is what	   all MS operating systems do, we have to comply even if the unix	   box is setup differently */	if_bcast->s_addr = MKBCADDR(if_ipaddr->s_addr, if_nmask->s_addr);  	DEBUG(4,("Derived broadcast address %s\n", inet_ntoa(*if_bcast)));}/****************************************************************************load a list of network interfaces****************************************************************************/static void interpret_interfaces(char *s, struct interface **interfaces,		char *description){  char *ptr;  fstring token;  struct interface *iface;  struct in_addr ip;  ptr = s;  ipzero = *interpret_addr2("0.0.0.0");  allones_ip = *interpret_addr2("255.255.255.255");  loopback_ip = *interpret_addr2("127.0.0.1");  while (next_token(&ptr,token,NULL,sizeof(token))) {    /* parse it into an IP address/netmasklength pair */    char *p = strchr(token,'/');    if (p) *p++ = 0;    ip = *interpret_addr2(token);    /* maybe we already have it listed */    {      struct interface *i;      for (i=(*interfaces);i;i=i->next)	if (ip_equal(ip,i->ip)) break;      if (i) continue;    }    iface = (struct interface *)malloc(sizeof(*iface));    if (!iface) return;    iface->ip = ip;    if (p) {      if (strlen(p) > 2)       iface->nmask = *interpret_addr2(p);      else       iface->nmask.s_addr = htonl(((ALLONES >> atoi(p)) ^ ALLONES));    } else {      default_netmask(&iface->nmask,&iface->ip);    }    iface->bcast.s_addr = MKBCADDR(iface->ip.s_addr, iface->nmask.s_addr);    iface->next = NULL;    if (!(*interfaces)) {      (*interfaces) = iface;    } else {      last_iface->next = iface;    }    last_iface = iface;    DEBUG(2,("Added %s ip=%s ",description,inet_ntoa(iface->ip)));    DEBUG(2,("bcast=%s ",inet_ntoa(iface->bcast)));    DEBUG(2,("nmask=%s\n",inet_ntoa(iface->nmask)));	       }  if (*interfaces) return;  /* setup a default interface */  iface = (struct interface *)malloc(sizeof(*iface));  if (!iface) return;  iface->next = NULL;  if (got_ip) {    iface->ip = default_ip;  } else {    get_myname(NULL,&iface->ip);  }  if (got_bcast) {    iface->bcast = default_bcast;  } else {    get_broadcast(&iface->ip,&iface->bcast,&iface->nmask);  }  if (got_nmask) {    iface->nmask = default_nmask;    iface->bcast.s_addr = MKBCADDR(iface->ip.s_addr, iface->nmask.s_addr);  }  if (iface->bcast.s_addr != MKBCADDR(iface->ip.s_addr, iface->nmask.s_addr)) {    DEBUG(2,("Warning: inconsistant interface %s\n",inet_ntoa(iface->ip)));  }  iface->next = NULL;  (*interfaces) = last_iface = iface;  DEBUG(2,("Added interface ip=%s ",inet_ntoa(iface->ip)));  DEBUG(2,("bcast=%s ",inet_ntoa(iface->bcast)));  DEBUG(2,("nmask=%s\n",inet_ntoa(iface->nmask)));	     }/****************************************************************************load the remote and local interfaces****************************************************************************/void load_interfaces(void){  /* add the machine's interfaces to local interface structure*/  interpret_interfaces(lp_interfaces(), &local_interfaces,"interface");}/****************************************************************************  override the defaults  **************************************************************************/void iface_set_default(char *ip,char *bcast,char *nmask){  if (ip) {    got_ip = True;    default_ip = *interpret_addr2(ip);  }  if (bcast) {    got_bcast = True;    default_bcast = *interpret_addr2(bcast);  }  if (nmask) {    got_nmask = True;    default_nmask = *interpret_addr2(nmask);  }}/****************************************************************************  check if an IP is one of mine  **************************************************************************/BOOL ismyip(struct in_addr ip){  struct interface *i;  for (i=local_interfaces;i;i=i->next)    if (ip_equal(i->ip,ip)) return True;  return False;}/****************************************************************************  check if a packet is from a local (known) net  **************************************************************************/BOOL is_local_net(struct in_addr from){  struct interface *i;  for (i=local_interfaces;i;i=i->next)    if((from.s_addr & i->nmask.s_addr) == (i->ip.s_addr & i->nmask.s_addr))      return True;  return False;}/****************************************************************************  how many interfaces do we have  **************************************************************************/int iface_count(void){  int ret = 0;  struct interface *i;  for (i=local_interfaces;i;i=i->next)    ret++;  return ret;}/**************************************************************************** True if we have two or more interfaces.  **************************************************************************/BOOL we_are_multihomed(void){  static int multi = -1;  if(multi == -1)    multi = (iface_count() > 1 ? True : False);  return multi;}/****************************************************************************  return the Nth interface  **************************************************************************/struct interface *get_interface(int n){   struct interface *i;    for (i=local_interfaces;i && n;i=i->next)    n--;  if (i) return i;  return NULL;}/****************************************************************************  return IP of the Nth interface  **************************************************************************/struct in_addr *iface_n_ip(int n){  struct interface *i;    for (i=local_interfaces;i && n;i=i->next)    n--;  if (i) return &i->ip;  return NULL;}/****************************************************************************Try and find an interface that matches an ip. If we cannot, return NULL  **************************************************************************/static struct interface *iface_find(struct in_addr ip){  struct interface *i;  if (zero_ip(ip)) return local_interfaces;  for (i=local_interfaces;i;i=i->next)    if (same_net(i->ip,ip,i->nmask)) return i;  return NULL;}/****************************************************************************this function provides a simple hash of the configured interfaces. It isused to detect a change in interfaces to tell us whether to discardthe current wins.dat file.Note that the result is independent of the order of the interfaces  **************************************************************************/unsigned iface_hash(void){	unsigned ret = 0;	struct interface *i;	for (i=local_interfaces;i;i=i->next) {		unsigned x1 = (unsigned)str_checksum(inet_ntoa(i->ip));		unsigned x2 = (unsigned)str_checksum(inet_ntoa(i->nmask));		ret ^= (x1 ^ x2);	}	return ret;}/* these 3 functions return the ip/bcast/nmask for the interface   most appropriate for the given ip address. If they can't find   an appropriate interface they return the requested field of the   first known interface. */struct in_addr *iface_bcast(struct in_addr ip){  struct interface *i = iface_find(ip);  return(i ? &i->bcast : &local_interfaces->bcast);}struct in_addr *iface_ip(struct in_addr ip){  struct interface *i = iface_find(ip);  return(i ? &i->ip : &local_interfaces->ip);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲综合另类| 日韩一区欧美二区| 美女mm1313爽爽久久久蜜臀| 麻豆精品视频在线观看免费| 9191国产精品| 国产欧美在线观看一区| 日本一区二区在线不卡| 懂色av噜噜一区二区三区av| 99re66热这里只有精品3直播| 91蝌蚪porny九色| 精品国产制服丝袜高跟| 一区二区三区日韩精品视频| 激情综合网天天干| 欧美日韩在线三区| 中文字幕日本乱码精品影院| 久久99精品久久久久婷婷| 26uuu国产一区二区三区| 午夜影院久久久| 91免费看`日韩一区二区| 亚洲一区二区三区视频在线 | 91网站黄www| 亚洲国产精品久久艾草纯爱| 99久久er热在这里只有精品15| 亚洲特黄一级片| 不卡av电影在线播放| 久久婷婷色综合| 91丨九色porny丨蝌蚪| 亚洲成av人**亚洲成av**| 久久综合网色—综合色88| 99久久伊人精品| 日韩电影在线观看一区| 欧美一区二区三区四区高清| 亚洲国产视频a| 精品国产成人系列| 91老司机福利 在线| 蜜臂av日日欢夜夜爽一区| 中日韩av电影| 99久久精品费精品国产一区二区| 亚洲va在线va天堂| 国产精品免费视频观看| 7777精品伊人久久久大香线蕉的| 国产高清在线观看免费不卡| www激情久久| 欧美在线看片a免费观看| 亚洲国产日韩精品| 欧美韩日一区二区三区| 岛国一区二区三区| 亚洲女同女同女同女同女同69| 色综合色狠狠天天综合色| 日韩理论片一区二区| 欧美一卡二卡三卡四卡| 色悠悠久久综合| 国产电影一区二区三区| 日本vs亚洲vs韩国一区三区 | 午夜日韩在线电影| 欧美一区二区三区思思人| 91麻豆免费看片| 国产福利一区二区三区视频在线| 日韩福利视频导航| 国产成人免费视频一区| 久久精品国产色蜜蜜麻豆| 精品国产凹凸成av人网站| 欧美日韩一本到| 在线一区二区视频| 免费成人在线观看| 亚洲福利电影网| 一区二区三区av电影| 最近日韩中文字幕| 国产精品家庭影院| 欧美一级免费观看| 免费在线看成人av| 丝袜美腿亚洲色图| 亚洲电影你懂得| 亚洲国产精品一区二区www | 亚洲人成网站色在线观看| 欧美国产在线观看| 欧美激情一区二区三区全黄| 久久久www成人免费毛片麻豆| 色婷婷精品大在线视频| 97久久超碰国产精品| av不卡免费电影| 麻豆视频一区二区| 美女视频黄 久久| 麻豆精品一区二区| 极品美女销魂一区二区三区 | 国产精品亚洲一区二区三区妖精| 亚洲欧洲美洲综合色网| 国产精品久久久久一区| 国产精品福利影院| 中文字幕制服丝袜一区二区三区| 国产精品久久夜| 成人免费在线视频| 亚洲午夜一区二区| 丝袜美腿亚洲一区二区图片| 奇米精品一区二区三区在线观看一| 婷婷开心激情综合| 麻豆91免费观看| 国产精品资源网| 成人ar影院免费观看视频| 91色porny| 欧美人与z0zoxxxx视频| 不卡视频一二三| 91香蕉国产在线观看软件| 欧美性大战久久久久久久| 欧美一区二区三区男人的天堂| 欧美电视剧在线观看完整版| 欧美日韩精品二区第二页| 日韩小视频在线观看专区| 久久九九久久九九| 日韩免费视频线观看| 久久久久久毛片| 亚洲日本乱码在线观看| 午夜精品一区在线观看| 黄色日韩三级电影| 精品一区二区三区的国产在线播放| 国产成人精品亚洲午夜麻豆| 日本高清视频一区二区| 欧美不卡123| 欧美大肚乱孕交hd孕妇| 中日韩av电影| 视频一区二区三区在线| 福利一区福利二区| 欧美美女直播网站| 69堂成人精品免费视频| 国产三级久久久| 亚洲777理论| 国产成人精品三级| 欧美日韩视频在线第一区| 国产婷婷色一区二区三区四区| 亚洲精品久久嫩草网站秘色| 亚洲精品一二三四区| 麻豆成人91精品二区三区| 91污片在线观看| 久久综合九色综合97_久久久| 一区二区在线看| 国产成人亚洲综合a∨婷婷图片| 在线视频欧美精品| 日本一区二区三区高清不卡| 婷婷久久综合九色国产成人| av在线这里只有精品| 欧美成人官网二区| 亚洲第一在线综合网站| 99精品视频一区二区三区| 精品久久久久久久久久久院品网| 一区二区三区丝袜| 成人午夜精品在线| 久久毛片高清国产| 免费观看久久久4p| 欧美色国产精品| 一区免费观看视频| 国产成人免费av在线| 日韩精品中文字幕一区二区三区| 一区二区三区精品在线观看| 成人一级片在线观看| 亚洲精品一区二区精华| 日本aⅴ免费视频一区二区三区 | 欧美视频你懂的| 国产精品久久国产精麻豆99网站| 国产精品原创巨作av| 精品伦理精品一区| 日韩高清一区在线| 欧美日韩dvd在线观看| 亚洲精品高清在线观看| 91香蕉国产在线观看软件| 中文欧美字幕免费| 成人午夜视频在线观看| 久久精品夜色噜噜亚洲aⅴ| 老司机精品视频一区二区三区| 欧美日韩一区二区电影| 亚洲国产aⅴ成人精品无吗| 在线观看日韩电影| 亚洲激情一二三区| 在线观看av一区二区| 亚洲精品亚洲人成人网| 欧美综合色免费| 亚洲18色成人| 国产精品国产三级国产普通话三级 | 一区2区3区在线看| 欧洲国产伦久久久久久久| 亚洲免费av网站| 欧亚洲嫩模精品一区三区| 亚洲成av人综合在线观看| 91精品国产综合久久久久久久| 蜜桃视频第一区免费观看| 久久综合九色欧美综合狠狠 | 粉嫩av一区二区三区在线播放| 久久久久97国产精华液好用吗| 国产乱子伦视频一区二区三区 | 天天影视色香欲综合网老头| 欧美精品欧美精品系列| 日韩国产欧美在线播放| 精品国产乱码久久久久久免费 | 中文字幕一区不卡| 欧美影视一区在线| 麻豆91在线播放免费| 国产清纯白嫩初高生在线观看91 | 欧美中文字幕一区| 免费成人在线影院| 国产精品日产欧美久久久久| 欧美在线视频你懂得|