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

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

?? trans.c

?? 打魔獸戰(zhàn)網(wǎng)的都知道他是什么
?? C
字號:
/* * Copyright (C) 2004  CreepLord (creeplord@pvpgn.org) * * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */#define TRANS_INTERNAL_ACCESS#include "common/setup_before.h"#include <stdio.h>#ifdef HAVE_STDDEF_H# include <stddef.h>#else# ifndef NULL#  define NULL ((void *)0)# endif#endif#ifdef STDC_HEADERS# include <stdlib.h>#else# ifdef HAVE_MALLOC_H#  include <malloc.h># endif#endif#ifdef HAVE_STRING_H# include <string.h>#else# ifdef HAVE_STRINGS_H#  include <strings.h># endif#endif#include "compat/strrchr.h"#include <errno.h>#include "compat/strerror.h"#include "common/eventlog.h"#include "common/list.h"#include "common/addr.h"#include "common/util.h"#include "common/xalloc.h"#include "trans.h"#include "common/setup_after.h"#define DEBUG_TRANSstatic t_list * trans_head=NULL;extern int trans_load(char const * filename, int program){    FILE		*fp;    unsigned int	line;    unsigned int	pos;    char		*buff;    char		*temp;    char const		*input;    char const		*output;    char const		*exclude;    char const		*include;    unsigned int	npos;    char		*network;    char		*tmp;    char 		tmp1[32];    char		tmp2[32];    char		tmp3[32];    t_trans		*entry;        if (!filename) {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL filename");        return -1;    }    if (!(fp = fopen(filename,"r"))) {        eventlog(eventlog_level_error,__FUNCTION__,"could not open file \"%s\" for reading (fopen: %s)",filename,pstrerror(errno));        return -1;    }    trans_head = list_create();    for (line=1; (buff = file_get_line(fp)); line++) {	for (pos=0; buff[pos]=='\t' || buff[pos]==' '; pos++);	if (buff[pos]=='\0' || buff[pos]=='#') {            continue;        }        if ((temp = strrchr(buff,'#'))) {	    unsigned int len;	    unsigned int endpos;	                *temp = '\0';	    len = strlen(buff)+1;            for (endpos=len-1; buff[endpos]=='\t' || buff[endpos]==' '; endpos--);            buff[endpos+1] = '\0';        }	if (!(input = strtok(buff," \t"))) { /* strtok modifies the string it is passed */	    eventlog(eventlog_level_error,__FUNCTION__,"missing input line %u of file \"%s\"",line,filename);	    continue;	}	/* check for port number - this tells us what programs will use this entry */	if (!(temp = strrchr(input,':'))) {	    eventlog(eventlog_level_error,__FUNCTION__,"missing port # on input line %u of file \"%s\"",line,filename);	    continue;	}	temp++;	/* bnetd doesn't want the port 4000 entries */	if (program==TRANS_BNETD  && strcmp(temp,"4000")==0) {#ifdef DEBUG_TRANS	    eventlog(eventlog_level_debug,__FUNCTION__,"d2gs input (ignoring) \"%s\"",input);#endif	    continue;	}	/* d2cs only wants the port 4000 entries */	if (program==TRANS_D2CS && strcmp(temp,"4000")!=0) {#ifdef DEBUG_TRANS	    eventlog(eventlog_level_debug,__FUNCTION__,"non d2gs input (ignoring) \"%s\"",input);#endif	    continue;	}	if (!(output = strtok(NULL," \t"))) {	    eventlog(eventlog_level_error,__FUNCTION__,"missing output on line %u of file \"%s\"",line,filename);	    continue;	}	if (!(exclude = strtok(NULL," \t"))) {	    eventlog(eventlog_level_error,__FUNCTION__,"missing exclude on line %u of file \"%s\"",line,filename);	    continue;	}	if (!(include = strtok(NULL," \t"))) {	    eventlog(eventlog_level_error,__FUNCTION__,"missing include on line %u of file \"%s\"",line,filename);	    continue;	}	/* add exlude networks */	tmp = xstrdup(exclude);	npos=0;	while (tmp[npos]) {	    network = &tmp[npos];	    for (; tmp[npos]!=',' && tmp[npos]!='\0'; npos++);	    if (tmp[npos]=='\0')		npos--;	    else		tmp[npos]='\0';	    if (strcmp(network,"NONE")==0) {		npos++;		continue;	    }	    entry = xmalloc(sizeof(t_trans));	    if (!(entry->input = addr_create_str(input,0,0))) {		eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for input address");		xfree(entry);		npos++;		continue;	    }	    if (!(entry->output = addr_create_str(input,0,0))) {		eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for output address");		addr_destroy(entry->input);		xfree(entry);		npos++;		continue;	    }	    if (strcmp(network,"ANY")==0) {		if (!(entry->network = netaddr_create_str("0.0.0.0/0"))) {		    eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");		    addr_destroy(entry->output);		    addr_destroy(entry->input);		    xfree(entry);		    npos++;		    continue;		}	    } else { 		if (!(entry->network = netaddr_create_str(network))) {		    eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");		    addr_destroy(entry->output);		    addr_destroy(entry->input);		    xfree(entry);		    npos++;		    continue;		}	    }#ifdef DEBUG_TRANS	    eventlog(eventlog_level_debug,__FUNCTION__,		"Adding Host -> %s, Output -> %s, Network %s - (exclude)",		addr_get_addr_str(entry->input,tmp1,sizeof(tmp1)),		addr_get_addr_str(entry->output,tmp2,sizeof(tmp2)),		netaddr_get_addr_str(entry->network,tmp3,sizeof(tmp3)));#endif	    list_append_data(trans_head,entry);	    npos++;	}	xfree(tmp);	/* add include networks */	tmp = xstrdup(include);	npos=0;	while (tmp[npos]) {	    network = &tmp[npos];	    for (; tmp[npos]!=',' && tmp[npos]!='\0'; npos++);	    if (tmp[npos]=='\0')		npos--;	    else		tmp[npos]='\0';	    if (strcmp(network,"NONE")==0) {		npos++;		continue;	    }	    entry = xmalloc(sizeof(t_trans));	    if (!(entry->input = addr_create_str(input,0,0))) {		eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for input address");		xfree(entry);		npos++;		continue;	    }	    if (!(entry->output = addr_create_str(output,0,0))) {		eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for output address");		addr_destroy(entry->input);		xfree(entry);		npos++;		continue;	    }	    if (strcmp(network,"ANY")==0) {		if (!(entry->network = netaddr_create_str("0.0.0.0/0"))) {		    eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");		    addr_destroy(entry->output);		    addr_destroy(entry->input);		    xfree(entry);		    npos++;		    continue;		}	    } else { 		if (!(entry->network = netaddr_create_str(network))) {		    eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");		    addr_destroy(entry->output);		    addr_destroy(entry->input);		    xfree(entry);		    npos++;		    continue;		}	    }#ifdef DEBUG_TRANS	    eventlog(eventlog_level_debug,__FUNCTION__,		"Adding Host -> %s, Output -> %s, Network %s - (include)",		addr_get_addr_str(entry->input,tmp1,sizeof(tmp1)),		addr_get_addr_str(entry->output,tmp2,sizeof(tmp2)),		netaddr_get_addr_str(entry->network,tmp3,sizeof(tmp3)));#endif	    list_append_data(trans_head,entry);	    npos++;	}	xfree(tmp);    }    file_get_line(NULL); // clear file_get_line buffer    fclose(fp);    eventlog(eventlog_level_info,__FUNCTION__,"trans file loaded");    return 0;}extern int trans_unload(void){    t_elem	*curr;    t_trans	*entry;        if (trans_head) {	LIST_TRAVERSE(trans_head,curr)	{	    if (!(entry = elem_get_data(curr))) {		eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list");	    } else {		netaddr_destroy(entry->network);		addr_destroy(entry->output);		addr_destroy(entry->input);		xfree(entry);	    }	    list_remove_elem(trans_head,&curr);	}	list_destroy(trans_head);	trans_head = NULL;    }    return 0;}extern int trans_reload(char const * filename, int program){    trans_unload();    if(trans_load(filename,program)<0) return -1;    return 0;}extern int trans_net(unsigned int clientaddr, unsigned int *addr, unsigned short *port){    t_elem const *curr;    t_trans	 *entry;    char	 temp1[32];    char         temp2[32];    char         temp3[32];    char	 temp4[32];    #ifdef DEBUG_TRANS    eventlog(eventlog_level_debug,__FUNCTION__,"checking %s for client %s ...",	addr_num_to_addr_str(*addr, *port),	addr_num_to_ip_str(clientaddr));#endif    if (trans_head) {	LIST_TRAVERSE_CONST(trans_head,curr)	{	    if (!(entry = elem_get_data(curr))) {		eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list");		continue;	    }	    #ifdef DEBUG_TRANS	    eventlog(eventlog_level_debug,__FUNCTION__,"against entry -> %s output %s network %s",		addr_get_addr_str(entry->input,temp1,sizeof(temp1)),		addr_get_addr_str(entry->output,temp2,sizeof(temp2)),		netaddr_get_addr_str(entry->network,temp3,sizeof(temp3)));#endif			    if (addr_get_ip(entry->input)!=*addr || addr_get_port(entry->input)!=*port) {#ifdef DEBUG_TRANS		eventlog(eventlog_level_debug,__FUNCTION__,"entry does match input address");#endif		continue;	    }	    if (netaddr_contains_addr_num(entry->network,clientaddr)==0) {#ifdef DEBUG_TRANS		eventlog(eventlog_level_debug,__FUNCTION__,"client is not in the correct network");#endif		continue;	    }#ifdef DEBUG_TRANS	    eventlog(eventlog_level_debug,__FUNCTION__,"%s translated to %s",		addr_num_to_addr_str(*addr, *port),		addr_get_addr_str(entry->output,temp4,sizeof(temp4)));#endif	    *addr = addr_get_ip(entry->output);	    *port = addr_get_port(entry->output);	    return 1; /* match found in list */	}    }#ifdef DEBUG_TRANS    eventlog(eventlog_level_debug,__FUNCTION__,"no match found for %s (not translated)",	addr_num_to_addr_str(*addr, *port));#endif    return 0; /* no match found in list */}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜三级在线| 国产精品乱码人人做人人爱| 亚洲成人一二三| 国产欧美日韩视频在线观看| 亚洲一区二区在线视频| 色视频一区二区| 香蕉久久夜色精品国产使用方法| 欧美夫妻性生活| 久久精品噜噜噜成人88aⅴ | 欧美综合视频在线观看| 亚洲国产va精品久久久不卡综合| 欧美日韩精品一区二区三区蜜桃| 丝袜美腿亚洲一区二区图片| 日韩美女视频在线| 成人午夜大片免费观看| 亚洲图片欧美色图| 久久网站热最新地址| 不卡av在线免费观看| 亚洲成av人片在线| 久久综合九色综合欧美亚洲| 色婷婷精品久久二区二区蜜臀av| 天堂蜜桃91精品| 欧美激情一区在线观看| 欧美三级蜜桃2在线观看| 精久久久久久久久久久| 亚洲色图.com| 26uuu欧美| 欧美亚洲国产一区二区三区| 国产在线视频精品一区| 亚洲综合视频在线观看| 久久这里只有精品首页| 欧美午夜精品一区| 国产精品资源在线| 午夜精品久久久久| 国产精品高清亚洲| 久久综合色之久久综合| 欧美少妇bbb| www.视频一区| 精品午夜久久福利影院| 亚洲一二三级电影| 日本一区二区三区免费乱视频 | 国产精品久久久久桃色tv| 欧美群妇大交群中文字幕| 不卡在线观看av| 美女久久久精品| 亚洲制服丝袜一区| 国产精品日产欧美久久久久| 欧美电影精品一区二区| 2023国产精品视频| 欧美日韩国产精品自在自线| proumb性欧美在线观看| 国产自产高清不卡| 日韩电影免费一区| 一区二区三区日韩精品| 国产精品亲子乱子伦xxxx裸| 2023国产一二三区日本精品2022| 欧美猛男男办公室激情| 色婷婷综合久久久久中文| 国产成人av电影在线播放| 久久精品国产第一区二区三区| 亚洲大片免费看| 亚洲精品中文在线观看| 成人免费在线观看入口| 国产精品欧美极品| 久久蜜桃av一区精品变态类天堂| 国产精品白丝在线| 欧美精品在线观看播放| 亚洲图片激情小说| 这里是久久伊人| 91香蕉视频在线| 99精品在线观看视频| 天堂影院一区二区| 日韩精品一区二| 毛片一区二区三区| 久久久久久毛片| 欧洲国内综合视频| 国产成人免费在线观看不卡| 亚洲综合一区二区三区| 亚洲特级片在线| 日韩欧美一级精品久久| 成人黄色一级视频| 亚洲视频中文字幕| 欧美日韩免费不卡视频一区二区三区| 久久精品国产免费看久久精品| 国产精品乱码久久久久久| 久久综合九色综合欧美98| 美女被吸乳得到大胸91| 日韩视频免费观看高清在线视频| 奇米精品一区二区三区在线观看一| 国产成人免费在线视频| 亚洲免费电影在线| 欧美成人三级在线| 99精品视频中文字幕| 国产一区二区精品久久| 天天色综合成人网| 香蕉成人伊视频在线观看| 精品欧美乱码久久久久久| 3d动漫精品啪啪1区2区免费 | 亚洲成人av在线电影| 久久久久9999亚洲精品| 欧美国产一区二区| 日韩美女视频在线| 欧美精品1区2区3区| 日韩精品一区二区三区视频播放| 精品美女一区二区| 国产精品系列在线| 亚洲成人精品影院| 久久99久久99| 99久久久国产精品免费蜜臀| 欧美三级午夜理伦三级中视频| 欧美一区二区播放| 国产精品美女一区二区三区| 亚洲综合视频在线观看| 精品写真视频在线观看| 91无套直看片红桃| 日韩免费成人网| 亚洲日本va午夜在线影院| 日日摸夜夜添夜夜添亚洲女人| 国产精品66部| 欧美午夜精品免费| 久久看人人爽人人| 午夜视黄欧洲亚洲| 国产成人午夜精品影院观看视频| 欧洲国产伦久久久久久久| 日韩视频永久免费| 最新欧美精品一区二区三区| 免费成人美女在线观看| 69堂成人精品免费视频| 久久免费视频色| 天堂蜜桃一区二区三区| 91在线播放网址| 日韩精品中文字幕在线一区| 亚洲三级电影网站| 国产精品综合av一区二区国产馆| 在线观看亚洲一区| 国产日韩欧美不卡| 麻豆精品视频在线| 欧美亚洲动漫另类| 国产精品久久三区| 国产在线乱码一区二区三区| 欧美精品久久天天躁| 自拍偷拍亚洲综合| 成人午夜在线播放| 精品国产一区二区三区久久久蜜月 | 欧美一区二区三区成人| 亚洲欧洲制服丝袜| 成人动漫在线一区| 久久婷婷一区二区三区| 老司机精品视频导航| 欧美电影一区二区三区| 亚洲一区国产视频| 色偷偷一区二区三区| 亚洲欧洲国产专区| 高清国产一区二区三区| 精品成人私密视频| 美日韩一区二区| 欧美一卡2卡三卡4卡5免费| 亚洲在线免费播放| 欧美亚洲综合久久| 亚洲免费观看高清| 欧洲精品中文字幕| 亚洲成在线观看| 欧美日韩一区二区三区视频| 亚洲综合色婷婷| 欧美亚洲日本一区| 亚洲香肠在线观看| 欧美日韩精品高清| 性欧美疯狂xxxxbbbb| 欧美妇女性影城| 亚洲成人自拍偷拍| 91精品国产综合久久福利| 日韩精品一级二级 | 国产日韩三级在线| 国产精品888| 一区在线中文字幕| 色综合天天综合狠狠| 亚洲欧美精品午睡沙发| 在线中文字幕一区二区| 亚洲小少妇裸体bbw| 制服丝袜中文字幕一区| 免费成人在线视频观看| 26uuu精品一区二区三区四区在线| 黄色日韩三级电影| 国产欧美日韩综合| 91污片在线观看| 天天色综合成人网| 久久免费看少妇高潮| www.久久精品| 天天做天天摸天天爽国产一区| 亚洲欧美综合色| 日本韩国欧美三级| 日韩电影免费一区| 国产欧美视频一区二区| 色综合久久综合网欧美综合网 | 自拍偷拍欧美精品| 欧美日韩视频在线第一区| 久久不见久久见免费视频7| 国产午夜亚洲精品不卡| 91原创在线视频| 日本最新不卡在线|