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

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

?? hash.c

?? 用來作為linux中SIP SERVER,完成VOIP網絡電話中服務器的功能
?? C
字號:
/* * Hash functions for cached trusted table * * Copyright (C) 2003 Juha Heinanen * * This file is part of ser, a free SIP server. * * ser 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 * * For a license to use the ser software under conditions * other than those described here, or to purchase support for this * software, please contact iptel.org by e-mail at the following addresses: *    info@iptel.org * * ser 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 */#include <sys/types.h>#include <regex.h>#include "../../mem/shm_mem.h"#include "../../parser/parse_from.h"#include "../../ut.h"#include "hash.h"/* * Create and initialize a hash table */struct trusted_list** new_hash_table(void){	struct trusted_list** ptr;	     /* Initializing hash tables and hash table variable */	ptr = (struct trusted_list **)shm_malloc(sizeof(struct trusted_list*) * HASH_SIZE);	if (!ptr) {		LOG(L_ERR, "new_hash_table(): No memory for hash table\n");		return 0;	}	memset(ptr, 0, sizeof(struct trusted_list*) * HASH_SIZE);	return ptr;}/* * Release all memory allocated for a hash table */void free_hash_table(struct trusted_list** table){	if (table) {	        empty_hash_table(table);	}	shm_free(table);}/*  * String hash function  */static unsigned int hash(str* src_ip){	char *p;	unsigned int h = 0;	unsigned int len;	unsigned int i;		p = src_ip->s;	len = src_ip->len;		for (i = 0; i < len; i++) {		h = ( h << 5 ) - h + *(p + i);	}	return h % HASH_SIZE;}/*  * Add <src_ip, proto, pattern> into hash table, where proto is integer * representation of string argument proto. */int hash_table_insert(struct trusted_list** hash_table, char* src_ip, char* proto, char* pattern){	struct trusted_list *np;	unsigned int hash_val;	np = (struct trusted_list *) shm_malloc(sizeof(*np));	if (np == NULL) {		LOG(L_CRIT, "hash_table_insert(): Cannot allocate memory for table entry\n");		return -1;	}	np->src_ip.len = strlen(src_ip);	np->src_ip.s = (char *) shm_malloc(np->src_ip.len);	if (np->src_ip.s == NULL) {		LOG(L_CRIT, "hash_table_insert(): Cannot allocate memory for src_ip string\n");		return -1;	}	(void) strncpy(np->src_ip.s, src_ip, np->src_ip.len);	if (strcmp(proto, "any") == 0) {		np->proto = PROTO_NONE;	} else if (strcmp(proto, "udp") == 0) {		np->proto = PROTO_UDP;	} else if (strcmp(proto, "tcp") == 0) {		np->proto = PROTO_TCP;	} else if (strcmp(proto, "tls") == 0) {		np->proto = PROTO_TLS;	} else if (strcmp(proto, "sctp") == 0) {		np->proto = PROTO_SCTP;	} else {		LOG(L_CRIT, "hash_table_insert(): Unknown protocol\n");		return -1;	}			np->pattern = (char *) shm_malloc(strlen(pattern)+1);	if (np->pattern == NULL) {		LOG(L_CRIT, "hash_table_insert(): Cannot allocate memory for pattern string\n");		return -1;	}	(void) strcpy(np->pattern, pattern);	hash_val = hash(&(np->src_ip));	np->next = hash_table[hash_val];	hash_table[hash_val] = np;	return 1;}/*  * Check if an entry exists in hash table that has given src_ip and protocol * value and pattern that matches to From URI. */int match_hash_table(struct trusted_list** table, struct sip_msg* msg){	str uri;	char uri_string[MAX_URI_SIZE + 1];	regex_t preg;	struct trusted_list *np;	str src_ip;	src_ip.s = ip_addr2a(&msg->rcv.src_ip);	src_ip.len = strlen(src_ip.s);	if (parse_from_header(msg) < 0) return -1;	uri = get_from(msg)->uri;	if (uri.len > MAX_URI_SIZE) {		LOG(L_ERR, "match_hash_table(): From URI too large\n");		return -1;	}	memcpy(uri_string, uri.s, uri.len);	uri_string[uri.len] = (char)0;	for (np = table[hash(&src_ip)]; np != NULL; np = np->next) {		if ((np->src_ip.len == src_ip.len) && 		    (strncasecmp(np->src_ip.s, src_ip.s, src_ip.len) == 0) &&		    ((np->proto == PROTO_NONE) || (np->proto == msg->rcv.proto))) {			if (regcomp(&preg, np->pattern, REG_NOSUB)) {				LOG(L_ERR, "match_hash_table(): Error in regular expression\n");				return -1;			}			if (regexec(&preg, uri_string, 0, (regmatch_t *)0, 0)) {				regfree(&preg);			} else {				regfree(&preg);				return 1;			}		}	}	return -1;}/*  * Print domains stored in hash table  */void hash_table_print(struct trusted_list** hash_table, FILE* reply_file){	int i;	struct trusted_list *np;	for (i = 0; i < HASH_SIZE; i++) {		np = hash_table[i];		while (np) {			fprintf(reply_file, "%4d <%.*s, %d, %s>\n", i,				np->src_ip.len, ZSW(np->src_ip.s),				np->proto,				np->pattern);			np = np->next;		}	}}/*  * Free contents of hash table, it doesn't destroy the * hash table itself */void empty_hash_table(struct trusted_list **hash_table){	int i;	struct trusted_list *np, *next;	for (i = 0; i < HASH_SIZE; i++) {		np = hash_table[i];		while (np) {			shm_free(np->src_ip.s);			shm_free(np->pattern);			next = np->next;			shm_free(np);			np = next;		}		hash_table[i] = 0;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女视频| 在线视频欧美精品| 久久精品国产99| 亚洲一区二区美女| 亚洲精品国久久99热| 国产精品久久久久影院亚瑟| 国产亚洲一二三区| 精品国产亚洲一区二区三区在线观看| 欧美一级二级三级蜜桃| 欧美一区二视频| 久久亚洲综合色一区二区三区| 精品99999| 中文天堂在线一区| 亚洲视频免费在线| 亚洲一区在线播放| 日本欧美韩国一区三区| 久久精品99国产精品日本| 国模冰冰炮一区二区| 国产乱码精品一区二区三| 成人精品一区二区三区四区| 97se亚洲国产综合自在线观| 欧美视频在线一区| 日韩精品中文字幕一区| 日本一区二区三区在线不卡 | 91免费在线播放| 欧美视频中文字幕| 精品国产91乱码一区二区三区| 久久网站最新地址| 一区二区三区.www| 精品一区二区在线视频| 成人免费福利片| 欧美日本韩国一区| 久久久激情视频| 亚洲一卡二卡三卡四卡| 看电视剧不卡顿的网站| av中文字幕一区| 日韩一区二区精品| 国产精品成人一区二区三区夜夜夜| 亚洲一区二区美女| 国产九九视频一区二区三区| 色综合夜色一区| 欧美精品一区二区在线观看| 亚洲欧美日韩电影| 国产一区视频网站| 色婷婷av一区二区三区软件| 日韩美女一区二区三区四区| 亚洲老司机在线| 国产99久久久久久免费看农村| 在线观看视频一区二区| 国产欧美日韩激情| 日韩经典一区二区| 欧洲精品在线观看| 日本一区二区三区在线不卡 | 日日夜夜精品视频免费| 成人性生交大片| 日韩一区二区三区视频| 亚洲综合久久久久| av不卡在线播放| 国产婷婷精品av在线| 免费高清视频精品| 欧美性淫爽ww久久久久无| 国产精品麻豆网站| 国产麻豆视频一区二区| 欧美一区二区三区视频| 综合av第一页| 99久久国产免费看| 国产精品丝袜久久久久久app| 麻豆极品一区二区三区| 91精品国产一区二区三区蜜臀 | 久久久久综合网| 蜜桃久久av一区| 日韩一区二区免费视频| 亚洲bt欧美bt精品| 欧美日韩成人综合天天影院 | 欧美亚洲自拍偷拍| 亚洲区小说区图片区qvod| www.性欧美| 亚洲天堂2014| av一区二区三区黑人| 亚洲欧美综合另类在线卡通| av爱爱亚洲一区| 伊人一区二区三区| 在线一区二区三区| 亚洲一区二区三区中文字幕在线| 91国偷自产一区二区三区成为亚洲经典| 国产精品日产欧美久久久久| 不卡一区二区在线| 亚洲一区二区三区在线播放| 欧美亚洲国产bt| 蜜桃传媒麻豆第一区在线观看| 91精品国产全国免费观看| 寂寞少妇一区二区三区| 精品福利一区二区三区免费视频| 国产酒店精品激情| 成人欧美一区二区三区| 在线观看不卡视频| 蜜桃av噜噜一区| 欧美激情综合网| 在线看一区二区| 日本麻豆一区二区三区视频| 精品av久久707| 99国产精品一区| 亚洲成a人在线观看| 欧美不卡视频一区| 国产宾馆实践打屁股91| 亚洲综合精品久久| 精品国产免费一区二区三区四区| 成人午夜在线视频| 日韩中文字幕麻豆| 久久精品人人做| 欧美在线综合视频| 国产精品一区二区在线观看不卡| 亚洲三级小视频| 欧美不卡视频一区| 在线中文字幕一区二区| 国内外精品视频| 亚洲制服丝袜一区| 国产午夜精品福利| 欧美日韩在线播放三区| 国产v综合v亚洲欧| 日韩高清不卡一区二区三区| 国产精品免费看片| 91精品国产入口| 日本韩国视频一区二区| 国产成人亚洲综合a∨婷婷图片| 亚洲成av人片www| 日本一区二区电影| 欧美videofree性高清杂交| 97精品电影院| 大美女一区二区三区| 蜜桃视频免费观看一区| 亚洲精品久久7777| 国产精品久久久久久久久搜平片 | 国产精品资源网| 午夜亚洲国产au精品一区二区| 中文字幕一区在线| 国产午夜亚洲精品羞羞网站| 日韩精品在线网站| 欧美一区二区三区人| 色视频一区二区| 色综合久久中文字幕| 成人性色生活片免费看爆迷你毛片| 久久99精品国产麻豆婷婷洗澡| 亚洲成av人片在www色猫咪| 亚洲欧美成人一区二区三区| 中文字幕制服丝袜一区二区三区| 精品电影一区二区| 欧美一区二区三区成人| 欧美三级在线视频| 91久久线看在观草草青青| 成人免费毛片高清视频| 国产成人亚洲精品青草天美| 国内成+人亚洲+欧美+综合在线| 美女网站视频久久| 久久99热这里只有精品| 免费成人结看片| 精品一区二区三区的国产在线播放 | 欧美一级精品大片| 欧美日韩美少妇| 欧美精选在线播放| 欧美一区二区视频在线观看2022| 678五月天丁香亚洲综合网| 7777精品伊人久久久大香线蕉超级流畅| 色8久久精品久久久久久蜜| 欧美自拍偷拍一区| 欧美日韩五月天| 日韩欧美国产综合一区| 26uuu成人网一区二区三区| 日韩女优毛片在线| 亚洲国产成人自拍| 亚洲女爱视频在线| 亚洲va欧美va人人爽| 美腿丝袜一区二区三区| 国产一区二区三区四区五区入口| 国产精一区二区三区| 色综合久久久久综合99| 欧美久久久久久久久| 久久久综合网站| 亚洲影院久久精品| 蜜臀av在线播放一区二区三区| 成人小视频在线观看| 精品视频在线免费| 337p日本欧洲亚洲大胆色噜噜| 中文字幕日韩欧美一区二区三区| 亚洲一二三区在线观看| 激情另类小说区图片区视频区| 成人三级在线视频| 欧美日韩综合一区| 欧美精品一区二区三区视频| 亚洲天堂久久久久久久| 老司机午夜精品| 91丨九色丨国产丨porny| 91精品在线一区二区| 国产精品久久久久桃色tv| 男男视频亚洲欧美| 99久久国产综合精品麻豆| 日韩欧美一级二级三级| 一区二区三区在线免费观看| 黄页网站大全一区二区| 欧美日韩在线综合|