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

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

?? sys-linux.c

?? unix and linux net driver
?? C
?? 第 1 頁 / 共 5 頁
字號:
	    &ifreq.ifr_hwaddr,	    sizeof (struct sockaddr));    SYSDEBUG ((LOG_DEBUG,	   "proxy arp: found hwaddr %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",		(int) ((unsigned char *) &hwaddr->sa_data)[0],		(int) ((unsigned char *) &hwaddr->sa_data)[1],		(int) ((unsigned char *) &hwaddr->sa_data)[2],		(int) ((unsigned char *) &hwaddr->sa_data)[3],		(int) ((unsigned char *) &hwaddr->sa_data)[4],		(int) ((unsigned char *) &hwaddr->sa_data)[5],		(int) ((unsigned char *) &hwaddr->sa_data)[6],		(int) ((unsigned char *) &hwaddr->sa_data)[7]));    return 1;}/******************************************************************** * * Return user specified netmask, modified by any mask we might determine * for address `addr' (in network byte order). * Here we scan through the system's list of interfaces, looking for * any non-point-to-point interfaces which might appear to be on the same * network as `addr'.  If we find any, we OR in their netmask to the * user-specified netmask. */u_int32_t GetMask (u_int32_t addr){    u_int32_t mask, nmask, ina;    struct ifreq *ifr, *ifend, ifreq;    struct ifconf ifc;    struct ifreq ifs[MAX_IFS];    addr = ntohl(addr);        if (IN_CLASSA(addr))	/* determine network mask for address class */	nmask = IN_CLASSA_NET;    else if (IN_CLASSB(addr))	    nmask = IN_CLASSB_NET;    else	    nmask = IN_CLASSC_NET;        /* class D nets are disallowed by bad_ip_adrs */    mask = netmask | htonl(nmask);/* * Scan through the system's network interfaces. */    ifc.ifc_len = sizeof(ifs);    ifc.ifc_req = ifs;    if (ioctl(sock_fd, SIOCGIFCONF, &ifc) < 0) {	if ( ! ok_error ( errno ))	    warn("ioctl(SIOCGIFCONF): %m(%d)", errno);	return mask;    }        ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);    for (ifr = ifc.ifc_req; ifr < ifend; ifr++) {/* * Check the interface's internet address. */	if (ifr->ifr_addr.sa_family != AF_INET)	    continue;	ina = SIN_ADDR(ifr->ifr_addr);	if (((ntohl(ina) ^ addr) & nmask) != 0)	    continue;/* * Check that the interface is up, and not point-to-point nor loopback. */	strlcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));	if (ioctl(sock_fd, SIOCGIFFLAGS, &ifreq) < 0)	    continue;		if (((ifreq.ifr_flags ^ FLAGS_GOOD) & FLAGS_MASK) != 0)	    continue;/* * Get its netmask and OR it into our mask. */	if (ioctl(sock_fd, SIOCGIFNETMASK, &ifreq) < 0)	    continue;	mask |= SIN_ADDR(ifreq.ifr_addr);	break;    }    return mask;}/******************************************************************** * * Internal routine to decode the version.modification.patch level */static void decode_version (char *buf, int *version,			    int *modification, int *patch){    *version      = (int) strtoul (buf, &buf, 10);    *modification = 0;    *patch        = 0;        if (*buf == '.') {	++buf;	*modification = (int) strtoul (buf, &buf, 10);	if (*buf == '.') {	    ++buf;	    *patch = (int) strtoul (buf, &buf, 10);	}    }        if (*buf != '\0') {	*version      =	*modification =	*patch        = 0;    }}/******************************************************************** * * Procedure to determine if the PPP line discipline is registered. */static intppp_registered(void){    int local_fd;    int mfd = -1;    int ret = 0;    char slave[16];    /*     * We used to open the serial device and set it to the ppp line     * discipline here, in order to create a ppp unit.  But that is     * not a good idea - the user might have specified a device that     * they can't open (permission, or maybe it doesn't really exist).     * So we grab a pty master/slave pair and use that.     */    if (!get_pty(&mfd, &local_fd, slave, 0)) {	no_ppp_msg = "Couldn't determine if PPP is supported (no free ptys)";	return 0;    }    /*     * Try to put the device into the PPP discipline.     */    if (ioctl(local_fd, TIOCSETD, &ppp_disc) < 0) {	error("ioctl(TIOCSETD(PPP)): %m(%d)", errno);    } else	ret = 1;        close(local_fd);    close(mfd);    return ret;}/******************************************************************** * * ppp_available - check whether the system has any ppp interfaces * (in fact we check whether we can do an ioctl on ppp0). */int ppp_available(void){    int s, ok, fd;    struct ifreq ifr;    int    size;    int    my_version, my_modification, my_patch;    int osmaj, osmin, ospatch;    no_ppp_msg = 	"This system lacks kernel support for PPP.  This could be because\n"	"the PPP kernel module could not be loaded, or because PPP was not\n"	"included in the kernel configuration.  If PPP was included as a\n"	"module, try `/sbin/modprobe -v ppp'.  If that fails, check that\n"	"ppp.o exists in /lib/modules/`uname -r`/net.\n"	"See README.linux file in the ppp distribution for more details.\n";    /* get the kernel version now, since we are called before sys_init */    uname(&utsname);    osmaj = osmin = ospatch = 0;    sscanf(utsname.release, "%d.%d.%d", &osmaj, &osmin, &ospatch);    kernel_version = KVERSION(osmaj, osmin, ospatch);    if (kernel_version >= KVERSION(2,3,13)) {	fd = open("/dev/ppp", O_RDWR);	if (fd < 0 && errno == ENOENT) {	    /* try making it and see if that helps. */	    if (mknod("/dev/ppp", S_IFCHR | S_IRUSR | S_IWUSR,		      makedev(108, 0)) >= 0) {		fd = open("/dev/ppp", O_RDWR);		if (fd >= 0)		    info("Created /dev/ppp device node");		else		    unlink("/dev/ppp");	/* didn't work, undo the mknod */	    } else if (errno == EEXIST) {		fd = open("/dev/ppp", O_RDWR);	    }	}	if (fd >= 0) {	    new_style_driver = 1;	    /* XXX should get from driver */	    driver_version = 2;	    driver_modification = 4;	    driver_patch = 0;	    close(fd);	    return 1;	}    }/* * Open a socket for doing the ioctl operations. */        s = socket(AF_INET, SOCK_DGRAM, 0);    if (s < 0)	return 0;        strlcpy (ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name));    ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0;/* * If the device did not exist then attempt to create one by putting the * current tty into the PPP discipline. If this works then obtain the * flags for the device again. */    if (!ok) {	if (ppp_registered()) {	    strlcpy (ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name));	    ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0;	}    }/* * Ensure that the hardware address is for PPP and not something else */    if (ok)        ok = ioctl (s, SIOCGIFHWADDR, (caddr_t) &ifr) >= 0;    if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))        ok = 0;/* *  This is the PPP device. Validate the version of the driver at this *  point to ensure that this program will work with the driver. */    if (ok) {	char   abBuffer [1024];	ifr.ifr_data = abBuffer;	size = ioctl (s, SIOCGPPPVER, (caddr_t) &ifr);	if (size < 0) {	    error("Couldn't read driver version: %m");	    ok = 0;	    no_ppp_msg = "Sorry, couldn't verify kernel driver version\n";	} else {	    decode_version(abBuffer,			   &driver_version,			   &driver_modification,			   &driver_patch);/* * Validate the version of the driver against the version that we used. */	    decode_version(VERSION,			   &my_version,			   &my_modification,			   &my_patch);	    /* The version numbers must match */	    if (driver_version != my_version)		ok = 0;      	    /* The modification levels must be legal */	    if (driver_modification < 3) {		if (driver_modification >= 2) {		    /* we can cope with 2.2.0 and above */		    driver_is_old = 1;		} else {		    ok = 0;		}	    }	    close (s);	    if (!ok) {		slprintf(route_buffer, sizeof(route_buffer),			 "Sorry - PPP driver version %d.%d.%d is out of date\n",			 driver_version, driver_modification, driver_patch);		no_ppp_msg = route_buffer;	    }	}    }    return ok;}/******************************************************************** * * Update the wtmp file with the appropriate user name and tty device. */void logwtmp (const char *line, const char *name, const char *host){    struct utmp ut, *utp;    pid_t  mypid = getpid();#if __GLIBC__ < 2    int    wtmp;#endif/* * Update the signon database for users. * Christoph Lameter: Copied from poeigl-1.36 Jan 3, 1996 */    utmpname(_PATH_UTMP);    setutent();    while ((utp = getutent()) && (utp->ut_pid != mypid))        /* nothing */;    /* Is this call really necessary? There is another one after the 'put' */    endutent();        if (utp)	memcpy(&ut, utp, sizeof(ut));    else	/* some gettys/telnetds don't initialize utmp... */	memset(&ut, 0, sizeof(ut));    if (ut.ut_id[0] == 0)	strncpy(ut.ut_id, line + 3, sizeof(ut.ut_id));	    strncpy(ut.ut_user, name, sizeof(ut.ut_user));    strncpy(ut.ut_line, line, sizeof(ut.ut_line));    time(&ut.ut_time);    ut.ut_type = USER_PROCESS;    ut.ut_pid  = mypid;    /* Insert the host name if one is supplied */    if (*host)	strncpy (ut.ut_host, host, sizeof(ut.ut_host));    /* Insert the IP address of the remote system if IP is enabled */    if (ipcp_protent.enabled_flag && ipcp_hisoptions[0].neg_addr)	memcpy(&ut.ut_addr, (char *) &ipcp_hisoptions[0].hisaddr,		 sizeof(ut.ut_addr));	    /* CL: Makes sure that the logout works */    if (*host == 0 && *name==0)	ut.ut_host[0]=0;    pututline(&ut);    endutent();/* * Update the wtmp file. */#if __GLIBC__ >= 2    updwtmp(_PATH_WTMP, &ut);#else    wtmp = open(_PATH_WTMP, O_APPEND|O_WRONLY);    if (wtmp >= 0) {	flock(wtmp, LOCK_EX);	if (write (wtmp, (char *)&ut, sizeof(ut)) != sizeof(ut))	    warn("error writing %s: %m", _PATH_WTMP);	flock(wtmp, LOCK_UN);	close (wtmp);    }#endif}/******************************************************************** * * sifvjcomp - config tcp header compression */int sifvjcomp (int u, int vjcomp, int cidcomp, int maxcid){    u_int x = get_flags(ppp_dev_fd);    if (vjcomp) {        if (ioctl (ppp_dev_fd, PPPIOCSMAXCID, (caddr_t) &maxcid) < 0) {	    if (! ok_error (errno))		error("ioctl(PPPIOCSMAXCID): %m(%d)", errno);	    vjcomp = 0;	}    }    x = vjcomp  ? x | SC_COMP_TCP     : x &~ SC_COMP_TCP;    x = cidcomp ? x & ~SC_NO_TCP_CCID : x | SC_NO_TCP_CCID;    set_flags (ppp_dev_fd, x);    return 1;}/******************************************************************** * * sifup - Config the interface up and enable IP packets to pass. */int sifup(int u){    struct ifreq ifr;    memset (&ifr, '\0', sizeof (ifr));    strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name));    if (ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) {	if (! ok_error (errno))	    error("ioctl (SIOCGIFFLAGS): %m(%d)", errno);	return 0;    }    ifr.ifr_flags |= (IFF_UP | IFF_POINTOPOINT);    if (ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) {	if (! ok_error (errno))	    error("ioctl(SIOCSIFFLAGS): %m(%d)", errno);	return 0;    }    if_is_up++;    return 1;}/******************************************************************** * * sifdown - Disable the indicated protocol and config the interface *	     down if there are no remaining protocols. */int sifdown (int u){    struct ifreq ifr;    if (if_is_up && --if_is_up > 0)	return 1;    memset (&ifr, '\0', sizeof (ifr));    strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name));    if (ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) {	if (! ok_error (errno))	    error("ioctl (SIOCGIFFLAGS): %m(%d)", errno);	return 0;    }    ifr.ifr_flags &= ~IFF_UP;    ifr.ifr_flags |= IFF_POINTOPOINT;    if (ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) {	if (! ok_error (errno))	    error("ioctl(SIOCSIFFLAGS): %m(%d)", errno);	return 0;    }    return 1;}/******************************************************************** * * sifaddr - Config the interface IP addresses and netmask. */int sifaddr (int unit, u_int32_t our_adr, u_int32_t his_adr,	     u_int32_t net_mask){    struct ifreq   ifr;     struct rtentry rt;        memset (&ifr, '\0', sizeof (ifr));    memset (&rt,  '\0', sizeof (rt));        SET_SA_FAMILY (ifr.ifr_addr,    AF_INET);     SET_SA_FAMILY (ifr.ifr_dstaddr, AF_INET);     SET_SA_FAMILY (ifr.ifr_netmask, AF_INET);     strlcpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));/* *  Set our IP address */    SIN_ADDR(ifr.ifr_addr) = our_adr;    if (ioctl(sock_fd, SIOCSIFADDR, (caddr_t) &ifr) < 0) {	if (errno != EEXIST) {	    if (! ok_error (errno))		error("ioctl(SIOCSIFADDR): %m(%d)", errno);	}        else {	    warn("ioctl(SIOCSIFADDR): Address already exists");	}        return (0);    }/* *  Set the gateway address */    SIN_ADDR(ifr.ifr_dstaddr) = his_adr;    if (ioctl(sock_fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) {	if (! ok_error (errno))	    error("ioctl(SIOCSIFDSTADDR): %m(%d)", errno); 	return (0);    } /* *  Set the netmask. *  For recent kernels, force the netmask to 255.255.255.255. */    if (kernel_version >= KVERSION(2,1,16))	net_mask = ~0L;    if (net_mask != 0) {	SIN_ADDR(ifr.ifr_netmask) = net_mask;	if (ioctl(sock_fd, SIOCSIFNETMASK, (caddr_t) &ifr) < 0) {	    if (! ok_error (errno))		error("ioctl(SIOCSIFNETMASK): %m(%d)", errno); 	    return (0);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久免费| 欧美国产综合色视频| 亚洲一区二区三区四区在线 | 亚洲成人av一区二区三区| 99re视频精品| 亚洲天堂2016| 一本一本久久a久久精品综合麻豆| 国产农村妇女精品| 国产成人av电影| 国产精品白丝在线| 99视频在线精品| 亚洲欧美一区二区不卡| 91丨九色丨尤物| 亚洲猫色日本管| 在线观看亚洲专区| 亚洲午夜精品在线| 欧美乱妇一区二区三区不卡视频| 午夜欧美视频在线观看| 制服丝袜国产精品| 美美哒免费高清在线观看视频一区二区 | 99久久精品国产一区| 最新久久zyz资源站| 91网站最新网址| 一区二区三区日韩精品| 欧美最新大片在线看| 五月婷婷另类国产| 日韩视频免费观看高清完整版 | 裸体一区二区三区| 久久夜色精品国产噜噜av| 国产成人精品免费一区二区| 国产精品久久久久久久久久免费看| 成人av电影免费在线播放| 亚洲精品一卡二卡| 欧美日韩国产美女| 久久精品国产色蜜蜜麻豆| 2021中文字幕一区亚洲| youjizz国产精品| 一区二区三区丝袜| 欧美大片在线观看一区| 国产成人在线视频网站| 亚洲天堂av老司机| 91.麻豆视频| 国产综合成人久久大片91| 国产精品热久久久久夜色精品三区| 91亚洲男人天堂| 石原莉奈在线亚洲三区| 欧美精品一区二区高清在线观看| 岛国一区二区三区| 亚洲宅男天堂在线观看无病毒| 91精品国产一区二区三区香蕉| 精品一区二区三区免费视频| 国产精品欧美综合在线| 欧美视频第二页| 狠狠色丁香久久婷婷综| 日韩码欧中文字| 欧美狂野另类xxxxoooo| 国产一区二区电影| 亚洲精品日韩综合观看成人91| 日韩午夜精品视频| 不卡免费追剧大全电视剧网站| 亚洲h在线观看| 国产色产综合色产在线视频| 欧美影院午夜播放| 国产麻豆精品久久一二三| 亚洲一区二区三区在线播放| 久久午夜羞羞影院免费观看| 在线视频国内自拍亚洲视频| 国产在线乱码一区二区三区| 亚洲色图制服丝袜| 欧美成人在线直播| 色欧美片视频在线观看| 激情小说欧美图片| 一区二区三区四区蜜桃| 久久这里都是精品| 欧美三级电影一区| 丰满岳乱妇一区二区三区| 天堂va蜜桃一区二区三区| 亚洲国产精品ⅴa在线观看| 91精品国产综合久久福利| 91蜜桃免费观看视频| 久久电影网站中文字幕| 亚洲在线一区二区三区| 国产日韩精品一区| 91精品国产高清一区二区三区| 成人av网站在线观看免费| 久久精品国产99国产| 亚洲一级二级在线| 国产精品美女视频| 精品久久久三级丝袜| 在线观看不卡视频| 成人av资源在线| 黄色成人免费在线| 亚洲国产精品影院| 亚洲色图在线看| 亚洲国产精品黑人久久久| 日韩欧美高清一区| 欧美日韩一二三区| 91免费国产在线| 成人免费看视频| 国产综合久久久久影院| 美日韩黄色大片| 五月婷婷久久综合| 亚洲一区二区在线免费观看视频| 国产精品色呦呦| 久久久不卡网国产精品一区| 日韩欧美专区在线| 欧美乱熟臀69xxxxxx| 欧美丝袜丝交足nylons| 一本大道av伊人久久综合| 成人综合婷婷国产精品久久免费| 久久国内精品自在自线400部| 午夜亚洲福利老司机| 一级日本不卡的影视| 综合亚洲深深色噜噜狠狠网站| 国产精品三级视频| 亚洲国产高清不卡| 国产欧美一区视频| 久久这里只精品最新地址| 精品日韩av一区二区| 欧美一区二区播放| 91麻豆精品国产自产在线| 欧美人动与zoxxxx乱| 欧美色图第一页| 欧美亚洲禁片免费| 欧美色图片你懂的| 欧美日韩电影一区| 欧美日韩国产bt| 69p69国产精品| 91精品中文字幕一区二区三区| 欧美日韩国产123区| 欧美日韩国产影片| 欧美一区二区久久| 日韩精品一区二区三区蜜臀| 日韩免费性生活视频播放| 日韩三级电影网址| 精品久久久久久久久久久久久久久久久 | 日韩一区二区三区免费看 | 91精品婷婷国产综合久久性色| 欧美日韩日日夜夜| 欧美日本韩国一区二区三区视频 | 99久久国产免费看| 91影视在线播放| 日本二三区不卡| 欧美日韩精品三区| 欧美一区在线视频| 日韩女优毛片在线| 国产网红主播福利一区二区| 亚洲国产精品精华液2区45| 国产精品乱人伦一区二区| 亚洲色图丝袜美腿| 亚洲电影在线播放| 美女网站色91| 国产成人免费在线观看不卡| 成人高清免费在线播放| 一本色道久久综合亚洲aⅴ蜜桃| 色悠悠久久综合| 欧美日本一道本| 精品国产免费一区二区三区四区| 国产校园另类小说区| 国产精品的网站| 亚洲成人激情社区| 久久er99精品| 高清不卡在线观看av| 色综合久久中文字幕| 91精品国产综合久久久久久久久久 | 高清不卡一区二区| 日本精品免费观看高清观看| 欧美电影在线免费观看| 精品国产第一区二区三区观看体验| 国产欧美日韩在线| 一区二区三区欧美| 久久av老司机精品网站导航| 粉嫩高潮美女一区二区三区| 色一区在线观看| 日韩亚洲欧美成人一区| 欧美国产精品专区| 亚洲韩国精品一区| 激情综合网天天干| 色综合中文字幕| 日韩西西人体444www| 中文字幕在线观看一区二区| 香蕉久久夜色精品国产使用方法| 久久国产精品72免费观看| 91免费视频大全| 欧美电影免费提供在线观看| 中文字幕一区二区三中文字幕| 午夜欧美电影在线观看| 国产成人亚洲精品狼色在线| 欧美综合色免费| 久久久蜜桃精品| 亚洲一二三区视频在线观看| 国产乱码一区二区三区| 在线免费观看成人短视频| 久久综合色8888| 亚洲一区二区三区四区五区黄| 国产精品一区二区三区乱码| 欧美日韩你懂得| 中文字幕一区二区三区蜜月 | aaa欧美大片| 日韩一区二区三区四区|