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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? interfaces.c

?? samba-3.0.22.tar.gz 編譯smb服務(wù)器的源碼
?? C
字號(hào):
/*    Unix SMB/CIFS implementation.   return a list of network interfaces   Copyright (C) Andrew Tridgell 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.*//* working out the interfaces for a OS is an incredibly non-portable   thing. We have several possible implementations below, and autoconf   tries each of them to see what works   Note that this file does _not_ include includes.h. That is so this code   can be called directly from the autoconf tests. That also means   this code cannot use any of the normal Samba debug stuff or defines.   This is standalone code.*/#include <unistd.h>#include <stdio.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <sys/ioctl.h>#include <sys/time.h>#include <net/if.h>#ifdef AUTOCONF_TESTstruct iface_struct {	char name[16];	struct in_addr ip;	struct in_addr netmask;};#else#include "config.h"#include "interfaces.h"#endif#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#endif#ifndef SIOCGIFCONF#ifdef HAVE_SYS_SOCKIO_H#include <sys/sockio.h>#endif#endif#ifdef HAVE_STDLIB_H#include <stdlib.h>#endif#ifdef HAVE_STRING_H#include <string.h>#endif#ifdef HAVE_STRINGS_H#include <strings.h>#endif#ifdef __COMPAR_FN_T#define QSORT_CAST (__compar_fn_t)#endif#ifndef QSORT_CAST#define QSORT_CAST (int (*)(const void *, const void *))#endif#if HAVE_IFACE_IFCONF/* this works for Linux 2.2, Solaris 2.5, SunOS4, HPUX 10.20, OSF1   V4.0, Ultrix 4.4, SCO Unix 3.2, IRIX 6.4 and FreeBSD 3.2.   It probably also works on any BSD style system.  *//****************************************************************************  get the netmask address for a local interface****************************************************************************/static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces){  	struct ifconf ifc;	char buff[8192];	int fd, i, n;	struct ifreq *ifr=NULL;	int total = 0;	struct in_addr ipaddr;	struct in_addr nmask;	char *iname;	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {		return -1;	}  	ifc.ifc_len = sizeof(buff);	ifc.ifc_buf = buff;	if (ioctl(fd, SIOCGIFCONF, &ifc) != 0) {		close(fd);		return -1;	} 	ifr = ifc.ifc_req;  	n = ifc.ifc_len / sizeof(struct ifreq);	/* Loop through interfaces, looking for given IP address */	for (i=n-1;i>=0 && total < max_interfaces;i--) {		if (ioctl(fd, SIOCGIFADDR, &ifr[i]) != 0) {			continue;		}		iname = ifr[i].ifr_name;		ipaddr = (*(struct sockaddr_in *)&ifr[i].ifr_addr).sin_addr;		if (ioctl(fd, SIOCGIFFLAGS, &ifr[i]) != 0) {			continue;		}  		if (!(ifr[i].ifr_flags & IFF_UP)) {			continue;		}		if (ioctl(fd, SIOCGIFNETMASK, &ifr[i]) != 0) {			continue;		}  		nmask = ((struct sockaddr_in *)&ifr[i].ifr_addr)->sin_addr;		strncpy(ifaces[total].name, iname, sizeof(ifaces[total].name)-1);		ifaces[total].name[sizeof(ifaces[total].name)-1] = 0;		ifaces[total].ip = ipaddr;		ifaces[total].netmask = nmask;		total++;	}	close(fd);	return total;}  #elif HAVE_IFACE_IFREQ#ifndef I_STR#include <sys/stropts.h>#endif/****************************************************************************this should cover most of the streams based systemsThanks to Andrej.Borsenkow@mow.siemens.ru for several ideas in this code****************************************************************************/static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces){	struct ifreq ifreq;	struct strioctl strioctl;	char buff[8192];	int fd, i, n;	struct ifreq *ifr=NULL;	int total = 0;	struct in_addr ipaddr;	struct in_addr nmask;	char *iname;	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {		return -1;	}  	strioctl.ic_cmd = SIOCGIFCONF;	strioctl.ic_dp  = buff;	strioctl.ic_len = sizeof(buff);	if (ioctl(fd, I_STR, &strioctl) < 0) {		close(fd);		return -1;	} 	/* we can ignore the possible sizeof(int) here as the resulting	   number of interface structures won't change */	n = strioctl.ic_len / sizeof(struct ifreq);	/* we will assume that the kernel returns the length as an int           at the start of the buffer if the offered size is a           multiple of the structure size plus an int */	if (n*sizeof(struct ifreq) + sizeof(int) == strioctl.ic_len) {		ifr = (struct ifreq *)(buff + sizeof(int));  	} else {		ifr = (struct ifreq *)buff;  	}	/* Loop through interfaces */	for (i = 0; i<n && total < max_interfaces; i++) {		ifreq = ifr[i];  		strioctl.ic_cmd = SIOCGIFFLAGS;		strioctl.ic_dp  = (char *)&ifreq;		strioctl.ic_len = sizeof(struct ifreq);		if (ioctl(fd, I_STR, &strioctl) != 0) {			continue;		}				if (!(ifreq.ifr_flags & IFF_UP)) {			continue;		}		strioctl.ic_cmd = SIOCGIFADDR;		strioctl.ic_dp  = (char *)&ifreq;		strioctl.ic_len = sizeof(struct ifreq);		if (ioctl(fd, I_STR, &strioctl) != 0) {			continue;		}		ipaddr = (*(struct sockaddr_in *) &ifreq.ifr_addr).sin_addr;		iname = ifreq.ifr_name;		strioctl.ic_cmd = SIOCGIFNETMASK;		strioctl.ic_dp  = (char *)&ifreq;		strioctl.ic_len = sizeof(struct ifreq);		if (ioctl(fd, I_STR, &strioctl) != 0) {			continue;		}		nmask = ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr;		strncpy(ifaces[total].name, iname, sizeof(ifaces[total].name)-1);		ifaces[total].name[sizeof(ifaces[total].name)-1] = 0;		ifaces[total].ip = ipaddr;		ifaces[total].netmask = nmask;		total++;	}	close(fd);	return total;}#elif HAVE_IFACE_AIX/****************************************************************************this one is for AIX (tested on 4.2)****************************************************************************/static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces){	char buff[8192];	int fd, i;	struct ifconf ifc;	struct ifreq *ifr=NULL;	struct in_addr ipaddr;	struct in_addr nmask;	char *iname;	int total = 0;	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {		return -1;	}	ifc.ifc_len = sizeof(buff);	ifc.ifc_buf = buff;	if (ioctl(fd, SIOCGIFCONF, &ifc) != 0) {		close(fd);		return -1;	}	ifr = ifc.ifc_req;	/* Loop through interfaces */	i = ifc.ifc_len;	while (i > 0 && total < max_interfaces) {		unsigned inc;		inc = ifr->ifr_addr.sa_len;		if (ioctl(fd, SIOCGIFADDR, ifr) != 0) {			goto next;		}		ipaddr = (*(struct sockaddr_in *) &ifr->ifr_addr).sin_addr;		iname = ifr->ifr_name;		if (ioctl(fd, SIOCGIFFLAGS, ifr) != 0) {			goto next;		}		if (!(ifr->ifr_flags & IFF_UP)) {			goto next;		}		if (ioctl(fd, SIOCGIFNETMASK, ifr) != 0) {			goto next;		}		nmask = ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr;		strncpy(ifaces[total].name, iname, sizeof(ifaces[total].name)-1);		ifaces[total].name[sizeof(ifaces[total].name)-1] = 0;		ifaces[total].ip = ipaddr;		ifaces[total].netmask = nmask;		total++;	next:		/*		 * Patch from Archie Cobbs (archie@whistle.com).  The		 * addresses in the SIOCGIFCONF interface list have a		 * minimum size. Usually this doesn't matter, but if		 * your machine has tunnel interfaces, etc. that have		 * a zero length "link address", this does matter.  */		if (inc < sizeof(ifr->ifr_addr))			inc = sizeof(ifr->ifr_addr);		inc += IFNAMSIZ;		ifr = (struct ifreq*) (((char*) ifr) + inc);		i -= inc;	}  	close(fd);	return total;}#else /* a dummy version */static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces){	return -1;}#endifstatic int iface_comp(struct iface_struct *i1, struct iface_struct *i2){	int r;	r = strcmp(i1->name, i2->name);	if (r) return r;	r = ntohl(i1->ip.s_addr) - ntohl(i2->ip.s_addr);	if (r) return r;	r = ntohl(i1->netmask.s_addr) - ntohl(i2->netmask.s_addr);	return r;}/* this wrapper is used to remove duplicates from the interface list generated   above */int get_interfaces(struct iface_struct *ifaces, int max_interfaces);int get_interfaces(struct iface_struct *ifaces, int max_interfaces){	int total, i, j;	total = _get_interfaces(ifaces, max_interfaces);	if (total <= 0) return total;	/* now we need to remove duplicates */	qsort(ifaces, total, sizeof(ifaces[0]), QSORT_CAST iface_comp);	for (i=1;i<total;) {		if (iface_comp(&ifaces[i-1], &ifaces[i]) == 0) {			for (j=i-1;j<total-1;j++) {				ifaces[j] = ifaces[j+1];			}			total--;		} else {			i++;		}	}	return total;}#ifdef AUTOCONF_TEST/* this is the autoconf driver to test get_interfaces() */#define MAX_INTERFACES 128 int main(){	struct iface_struct ifaces[MAX_INTERFACES];	int total = get_interfaces(ifaces, MAX_INTERFACES);	int i;	printf("got %d interfaces:\n", total);	if (total <= 0) exit(1);	for (i=0;i<total;i++) {		printf("%-10s ", ifaces[i].name);		printf("IP=%s ", inet_ntoa(ifaces[i].ip));		printf("NETMASK=%s\n", inet_ntoa(ifaces[i].netmask));	}	return 0;}#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区a毛片| 视频在线在亚洲| 欧美精品精品一区| 国产曰批免费观看久久久| 亚洲综合在线免费观看| 久久精品欧美日韩| 欧美日韩电影一区| 99re在线视频这里只有精品| 国内国产精品久久| 视频一区视频二区中文字幕| 亚洲欧洲日产国产综合网| 精品成人一区二区三区四区| 欧美日韩一区二区不卡| 99国产精品久久久久久久久久久 | 欧美军同video69gay| 国产成人午夜视频| 老司机午夜精品| 亚洲成av人影院| 亚洲女人小视频在线观看| 国产欧美精品一区| 久久午夜老司机| 日韩美女主播在线视频一区二区三区| 色哟哟国产精品| www.欧美.com| www.久久久久久久久| 国产成人综合亚洲91猫咪| 韩国女主播成人在线| 老司机免费视频一区二区| 午夜av一区二区| 亚洲国产精品综合小说图片区| 自拍视频在线观看一区二区| 亚洲国产高清在线| 国产三级一区二区| 久久精品视频网| 久久久www成人免费毛片麻豆 | 人人超碰91尤物精品国产| 国产一区二区三区免费看| 蜜桃一区二区三区在线观看| 日本午夜精品一区二区三区电影| 亚洲成av人片一区二区梦乃| 亚洲成人你懂的| 天天影视色香欲综合网老头| 午夜久久电影网| 日韩电影一区二区三区四区| 日韩综合在线视频| 日本不卡在线视频| 捆绑紧缚一区二区三区视频| 久久99热狠狠色一区二区| 激情综合色综合久久综合| 国内精品久久久久影院色| 国产一区 二区 三区一级| 国产成人精品亚洲日本在线桃色| 国产精品亚洲第一区在线暖暖韩国| 国产呦精品一区二区三区网站| 国产精品亚洲午夜一区二区三区 | 成人激情图片网| 91女神在线视频| 欧美亚洲日本国产| 欧美一区二区在线看| 精品成人在线观看| 国产精品久久久久久久久免费丝袜| 国产精品丝袜黑色高跟| 亚洲激情图片小说视频| 日韩中文字幕1| 国产一区二区毛片| 91亚洲精华国产精华精华液| 欧美日韩精品一区二区三区蜜桃| 日韩美女主播在线视频一区二区三区| 久久久久久97三级| 亚洲一区在线看| 麻豆91精品视频| www.成人在线| 制服丝袜成人动漫| 欧美国产成人在线| 午夜精品一区二区三区免费视频| 毛片av中文字幕一区二区| 豆国产96在线|亚洲| 欧美日韩一级视频| 久久精品综合网| 性久久久久久久久| 成人午夜av电影| 欧美精品v日韩精品v韩国精品v| 精品国产乱码久久久久久影片| 中文字幕综合网| 老司机午夜精品| 日本乱码高清不卡字幕| 亚洲精品一区二区精华| 亚洲精品大片www| 国产一区二区在线看| 91久久人澡人人添人人爽欧美| 日韩精品一区二| 一二三区精品福利视频| 国产一区二区三区精品视频| 欧美丝袜丝交足nylons图片| 国产婷婷一区二区| 水野朝阳av一区二区三区| 99热精品国产| 精品日韩av一区二区| 夜夜爽夜夜爽精品视频| 成人一区二区三区视频在线观看| 欧美美女一区二区在线观看| 亚洲视频精选在线| 久久夜色精品一区| 香蕉久久一区二区不卡无毒影院 | 欧美激情一区二区| 日本vs亚洲vs韩国一区三区| 色综合色综合色综合色综合色综合| 精品福利二区三区| 日韩激情视频网站| 在线观看一区二区视频| 国产精品麻豆网站| 国产精品中文字幕日韩精品| 91精品国产乱码| 午夜精品一区二区三区电影天堂| 97久久精品人人澡人人爽| 久久日一线二线三线suv| 蜜臀av国产精品久久久久| 欧美日韩亚州综合| 亚洲精品免费电影| 色综合天天综合网天天狠天天 | 日韩欧美在线不卡| 午夜久久久影院| 欧美中文字幕一区| 亚洲精品你懂的| 91色.com| 亚洲精品美国一| 色久综合一二码| 亚洲美女在线国产| 97aⅴ精品视频一二三区| 国产精品久久久久久久久免费桃花 | 欧美精品一区二| 美腿丝袜在线亚洲一区| 欧美一级午夜免费电影| 日本va欧美va瓶| 日韩精品一区二区三区视频播放 | 国产精品欧美一区二区三区| 国产一区二区导航在线播放| 欧美精品一区视频| 国产一区二区三区四| 国产三区在线成人av| 丁香亚洲综合激情啪啪综合| 国产精品理伦片| 91在线码无精品| 一区二区三区精品久久久| 欧美亚洲国产bt| 日韩电影免费一区| 欧美一级一区二区| 国内外精品视频| 国产欧美日韩久久| 99精品视频中文字幕| 一区二区三区欧美日| 欧美日韩视频在线观看一区二区三区 | 亚洲日本乱码在线观看| 色婷婷av一区二区三区大白胸| 亚洲影院免费观看| 欧美一区二区三区在| 九九九久久久精品| 欧美国产成人精品| 日本韩国视频一区二区| 日韩国产一二三区| www一区二区| 色婷婷精品久久二区二区蜜臂av| 一区二区三区四区激情| 日韩限制级电影在线观看| 成人一区二区三区在线观看| 一区二区国产盗摄色噜噜| 欧美一区二区三区白人| 成人午夜碰碰视频| 午夜久久久久久| 国产欧美在线观看一区| 欧美影视一区在线| 精品一区二区三区在线播放| 国产精品国产三级国产有无不卡| 欧洲人成人精品| 国产一区二区三区av电影| 一级女性全黄久久生活片免费| 日韩一区二区三免费高清| www.日韩在线| 美国一区二区三区在线播放| 亚洲视频香蕉人妖| 精品国产乱码久久久久久影片| 91视频一区二区三区| 老司机免费视频一区二区| 亚洲啪啪综合av一区二区三区| 日韩视频一区在线观看| 91年精品国产| 国产一区二区三区四区五区美女| 亚洲一区免费在线观看| 国产日本欧美一区二区| 欧美一区二区三区色| 91天堂素人约啪| 国产一二精品视频| 亚洲成人第一页| 国产精品久久久久久一区二区三区| 欧美精品丝袜久久久中文字幕| 成a人片国产精品| 精品中文字幕一区二区| 亚洲成人免费av| 亚洲欧洲精品一区二区三区| 337p粉嫩大胆噜噜噜噜噜91av |