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

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

?? pooladdr.c

?? RADIUS協議的認證計費服務
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * *      Copyright (c) 1996 Ascend Communications, Inc. *      All rights reserved. * *      Permission to copy, display, distribute and make derivative works *      from this material in whole or in part for any purpose is granted *      provided that the above copyright notice and this paragraph are *      duplicated in all copies.  THIS SOFTWARE IS PROVIDED "AS IS" AND *      WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT *      LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *      FOR A PARTICULAR PURPOSE. * *//* * Copyright [C] The Regents of the University of Michigan and Merit Network, * Inc. 1992, 1993, 1994, 1995, 1996, 1997, 1998 All Rights Reserved * * Permission to use, copy, and modify this software and its documentation  * for any purpose and without fee is hereby granted, provided:  * * 1) that the above copyright notice and this permission notice appear in all *    copies of the software and derivative works or modified versions thereof,  * * 2) that both the copyright notice and this permission and disclaimer notice  *    appear in all supporting documentation, and  * * 3) that all derivative works made from this material are returned to the *    Regents of the University of Michigan and Merit Network, Inc. with *    permission to copy, to display, to distribute, and to make derivative *    works from the provided material in whole or in part for any purpose. * * Users of this code are requested to notify Merit Network, Inc. of such use * by sending email to aaa-admin@merit.edu * * Please also use aaa-admin@merit.edu to inform Merit Network, Inc of any * derivative works. * * Distribution of this software or derivative works or the associated * documentation is not allowed without an additional license. * * Licenses for other uses are available on an individually negotiated * basis.  Contact aaa-license@merit.edu for more information. * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE REGENTS OF THE * UNIVERSITY OF MICHIGAN AND MERIT NETWORK, INC. DO NOT WARRANT THAT THE * FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET LICENSEE'S REQUIREMENTS OR * THAT OPERATION WILL BE UNINTERRUPTED OR ERROR FREE.  The Regents of the * University of Michigan and Merit Network, Inc. shall not be liable for any * special, indirect, incidental or consequential damages with respect to any * claim by Licensee or any third party arising from use of the software. * * Merit AAA Server Support * Merit Network, Inc. * 4251 Plymouth Road, Suite C. * Ann Arbor, Michigan, USA 48105-2785 * * attn:  John Vollbrecht * voice: 734-764-9430 * fax:   734-647-3185 * email: aaa-admin@merit.edu * *//* * * Public entry points in this file: * */static char     rcsid[] = "$Id: pooladdr.c,v 1.1.1.1 2001/08/10 20:49:28 bonze Exp $";#include	<sys/types.h>#include	<sys/param.h>#include	<sys/time.h>#include	<sys/errno.h>#include	<sys/file.h>#include	<sys/wait.h>#include	<sys/socket.h>#include	<net/if.h>#include	<netinet/in.h>#include	<stdio.h>#include	<netdb.h>#include	<errno.h>#include	<signal.h>#include	<memory.h>#include	<syslog.h>#include	"radius.h"#ifndef IP_ADDR_POOLstatic AATV     ip_alloc_aatv = DEF_AATV_DIRECT("IPPOOL", fatal_action);AATVPTR         rad_ip_pool_aatv = & ip_alloc_aatv;#else	/* IP_ADDR_POOL */extern char     recv_buffer[RAD_RECV_BUFFER_SIZE];extern char     send_buffer[RAD_SEND_BUFFER_SIZE];extern int      debug_flag;extern int      spawn_flag;     /* 0 => no spawning, 1 => spawning allowed */extern char    *radius_dir;static int      sockfd = -1;static u_char   timeout;static char     white_space[] = " \t\r\n";static int      ip_address_recv PROTO((UINT4, AUTH_REQ *));static int      ip_address_send PROTO((int, void *, UINT4, ipaddr_t,					ADDRESS_CHUNK *, int));static int      parse_global PROTO((char *, ADDRESS_CHUNK *));static UINT4    parse_hosts PROTO((void));static int      parse_pool PROTO((char *, ADDRESS_CHUNK **));static void     pool_time_out PROTO((int));RADIPA_PACKET  *reorder_integers PROTO((char*));static int      try_connect PROTO((UINT4));UINT4           addr;#define	IP_POOL_TIME	3 * 60 /* Need a response within this time period */static void     pool_init PROTO((AATV *));static int      pool_addr PROTO((AUTH_REQ *, int, char *));static void     pool_cleanup PROTO((void));static AATV     ip_alloc_aatv = DEF_AATV_FREPLY_FULL("IPPOOL", -1, pool_init,							NULL, pool_addr,							pool_cleanup, 0);AATVPTR         rad_ip_pool_aatv = & ip_alloc_aatv;/************************************************************************* * *	Function: pool_init * *	Purpose: Initialize the TCP connection to the RADIPAD daemon. * *************************************************************************/static voidpool_init (unused)AATV   *unused;{	UINT4           addr;	static int      init_count = 0;	static char    *func = "pool_init";	dprintf(2, (LOG_AUTH, LOG_DEBUG, "%s: entered", func));	init_count++;	if (init_count <= 1)	/* Ensure that users file is read into core. */	{		return;	}	if (sockfd == -1)	{		sockfd = socket (AF_INET, SOCK_STREAM, 0); /* for TCP */	}	/* This assumes the users file has been read into memory.  See above. */	if ((addr = parse_hosts ()) == INADDR_ANY)	{		logit (LOG_DAEMON, LOG_ERR,			"%s: No server listed for RADIPAD", func);		return;	}	return;} /* end of pool_init () *//************************************************************************* * *	Function: pool_addr * *	Purpose: This is an AATV action function for the *		 PW_ASCEND_RADIPA_ALLOCATE [50] and *		 PW_ASCEND_RADIPA_RELEASE [51] requests. * *************************************************************************/static intpool_addr (authreq, value, afpar)AUTH_REQ       *authreq;int             value;char           *afpar;{	int             cmd;	int             count;	int             how_many;	int             loop_count;	int             result;	ipaddr_t        addr;	UINT4           daemon;	UINT4           ip_address;	UINT4           router_ip_address;	UINT4           z = (UINT4) 0;	ADDRESS_CHUNK   chunks_0[MAX_ADDRESS_CHUNKS];	ADDRESS_CHUNK  *chunks = chunks_0;	ADDRESS_CHUNK  *payload;	VALUE_PAIR     *vp;	char           *user_name;	struct sockaddr_in sin;	sigset_t        signals;	struct sigaction action;	struct sigaction a_save;	static char    *func = "pool_addr";	dprintf(2, (LOG_AUTH, LOG_DEBUG, "%s: entered", func));	/* Set up alarm and signal handler to bail us out if we take too long */	alarm (IP_POOL_TIME); /* Make it pretty long */	memset ((char *) &action, '\0', sizeof (action));	sigemptyset (&signals);			/* Init signal enable mask */	sigaddset (&signals, SIGALRM);  	action.sa_handler = pool_time_out;	/* Set up our timeout handler */	sigaction (SIGALRM, &action, &a_save);	/* Ready to handle it */	sigprocmask (SIG_UNBLOCK, &signals, NULL);	/* Now allow alarm */	/* If one was pending, we just took it. */	timeout = (u_char) 0;	/* Initing now will ignore any pending alarm */	if ((vp = get_vp (authreq->cur_request, PW_NAS_IP_ADDRESS)) == NULL_VP)	{		missing_attribute (authreq, func, PW_NAS_IP_ADDRESS, NULL);		sigaction (SIGALRM, &a_save, NULL);	/* Restore state. */		return EV_NAK;	}	router_ip_address = vp->lvalue;	if (authreq->code == PW_ASCEND_RADIPA_ALLOCATE)	{		if ((vp = get_vp (authreq->cur_request,					PW_USER_NAME)) == NULL_VP)		{			missing_attribute (authreq, func, PW_USER_NAME, NULL);			sigaction (SIGALRM, &a_save, NULL); /* Restore state. */			return EV_NAK;		}		user_name = vp->strvalue;	/* name of the router */		count = parse_pool (user_name, &chunks);		if (count == 0)		{			dprintf(2, (LOG_AUTH, LOG_DEBUG,				"zero address chunks for %s", func, user_name));			avpair_add (&authreq->cur_request,						PW_FRAMED_IP_ADDRESS, &z, 0);			sigaction (SIGALRM, &a_save, NULL); /* Restore state. */			return EV_ACK;		}	}	else /* was PW_ASCEND_RADIPA_RELEASE */	{		if ((vp = get_vp (authreq->cur_request,					PW_FRAMED_IP_ADDRESS)) == NULL_VP)		{			missing_attribute (authreq, func,						PW_FRAMED_IP_ADDRESS, NULL);			sigaction (SIGALRM, &a_save, NULL); /* Restore state. */			return EV_NAK;		}		ip_address = vp->lvalue;	/* address to release */	}	/* This assumes the users file has been read into memory. */	if ((daemon = parse_hosts ()) == INADDR_ANY)	{		logit (LOG_DAEMON, LOG_ERR,			"%s: No server listed for RADIPAD", func);		sigaction (SIGALRM, &a_save, NULL);	/* Restore state. */		return EV_NAK;	}	if (authreq->code == PW_ASCEND_RADIPA_ALLOCATE)	{		cmd = RADIPA_ALLOCATE;		addr = INADDR_NONE;		payload = chunks;		how_many = count;	}	else /* was PW_ASCEND_RADIPA_RELEASE */	{		cmd = RADIPA_RELEASE;		addr = ip_address;		payload = (ADDRESS_CHUNK *) NULL;		how_many = 0;	} 	loop_count = 0;	do	{		if (ip_address_send (cmd, authreq, router_ip_address,						addr, payload, how_many) < 0)		{			result = try_connect (daemon);			switch (result)			{			    case 1:		/* Address was in use. */				sleep (2);				loop_count++;				break;			    case 0:				loop_count = 3;	/* Indicate done with loop. */				break;			    case -1:		/* Some error occurred. */				/* Restore signal state. */				sigaction (SIGALRM, &a_save, NULL);				return EV_NAK;			}			continue;		} 		break;	} while (loop_count < 2);	for (;;) /* Block for RADIPAD packet in this child process. */	{		if (ip_address_recv (daemon, authreq) < 0)		{			sigaction (SIGALRM, &a_save, NULL); /* Restore state. */			return EV_NAK;		}		sigaction (SIGALRM, &a_save, NULL);	/* Restore state. */		return EV_ACK;		/* It's a success! */	}} /* end of pool_addr () *//************************************************************************* * *	Function: pool_cleanup * *	Purpose: Release the socket file descriptor. * *************************************************************************/static voidpool_cleanup (){	static char    *func = "pool_cleanup";	dprintf(2, (LOG_AUTH, LOG_DEBUG, "%s: entered", func));	close (sockfd);	sockfd = -1;	return;} /* end of pool_cleanup () *//************************************************************************* * *	Function: ip_address_send * *	Purpose: Sends IP address pool requests to RADIPAD. * *	Returns: number of bytes sent, or *		 -1, otherwise. * *************************************************************************/static intip_address_send (code, handle, router_address, ipaddr, chunks, count)int             code;void           *handle;UINT4           router_address;ipaddr_t        ipaddr;ADDRESS_CHUNK  *chunks;int             count;{	int             bytes_sent;	int             total_length;	RADIPA_PACKET  *packet;	static char    *func = "ip_address_send";	dprintf(2, (LOG_DAEMON, LOG_DEBUG, "%s: entered", func));	packet = (RADIPA_PACKET *) send_buffer;	packet->rp_code = (char) code; /* RADIPA_ALLOCATE or RADIPA_RELEASE */	packet->rp_pad = ~0;	packet->rp_count = htons(count);	packet->rp_handle = handle;	packet->rp_router_address = router_address;	packet->rp_ip_address = htonl(ipaddr);	if (code == RADIPA_ALLOCATE)	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品盗摄一区二区三区| 亚洲精品成人悠悠色影视| 国产成人午夜精品5599| 国产欧美日本一区二区三区| 99久久免费国产| 亚洲综合在线观看视频| 欧美性色欧美a在线播放| 婷婷综合在线观看| 日韩精品一区二区三区老鸭窝 | 蜜臀av性久久久久蜜臀aⅴ四虎| 日韩欧美在线123| 国产一区激情在线| 中文字幕第一区综合| 久久一区二区视频| 国产成人亚洲综合a∨猫咪| 综合在线观看色| 欧美日韩国产综合草草| 看片网站欧美日韩| 国产精品女主播av| 欧美日韩免费视频| 精品制服美女丁香| 国产精品福利一区| 欧美日韩黄色一区二区| 国产在线麻豆精品观看| 中文字幕亚洲区| 欧美日韩精品三区| 国产精一区二区三区| 亚洲精品综合在线| 91精品国产综合久久精品app| 国产一区二区三区视频在线播放| 1区2区3区国产精品| 欧美日本在线播放| 国产一区二区三区免费看| 亚洲精品国产一区二区精华液 | 亚洲综合视频在线观看| 精品久久99ma| 一本久道久久综合中文字幕| 青青国产91久久久久久| 中文字幕在线不卡视频| 日韩一级大片在线观看| 99精品视频在线播放观看| 日本不卡免费在线视频| 国产精品久久久久久妇女6080 | 国产在线一区二区综合免费视频| 中文字幕日韩精品一区| 在线综合亚洲欧美在线视频| 国产成人三级在线观看| 日日夜夜免费精品| 中文字幕在线不卡一区二区三区| 日韩网站在线看片你懂的| 99视频精品免费视频| 555夜色666亚洲国产免| 丰满放荡岳乱妇91ww| 日韩专区一卡二卡| 自拍偷拍亚洲综合| 日韩欧美亚洲国产精品字幕久久久| 91小视频免费观看| 寂寞少妇一区二区三区| 亚洲一区二区av在线| 国产欧美精品一区| 日韩视频国产视频| 91成人在线观看喷潮| 国产不卡一区视频| 奇米在线7777在线精品| 亚洲精品菠萝久久久久久久| 欧美激情资源网| 欧美不卡视频一区| 欧美日韩精品一区视频| av中文字幕不卡| 国内精品嫩模私拍在线| 秋霞午夜av一区二区三区| 一区二区三区四区蜜桃 | 亚洲国产精品一区二区久久| 国产精品视频免费| 欧美精品一区二区三区高清aⅴ | 偷拍与自拍一区| 亚洲精品视频在线观看免费 | 一区二区三区成人| 欧美国产日韩一二三区| 26uuu色噜噜精品一区二区| 5566中文字幕一区二区电影| 欧美图区在线视频| 91在线免费视频观看| 国产a视频精品免费观看| 久久国产人妖系列| 婷婷久久综合九色综合伊人色| 亚洲男帅同性gay1069| 国产精品久久久久久久第一福利| 久久精品男人天堂av| 日韩一区二区免费高清| 51午夜精品国产| 欧美精品一级二级三级| 欧美亚洲国产一区二区三区va| 99这里只有精品| 波多野结衣精品在线| 国产凹凸在线观看一区二区| 国产综合一区二区| 久久99国产精品成人| 久久精品国产99国产精品| 免费美女久久99| 日韩av一级片| 蜜桃视频在线一区| 日韩av午夜在线观看| 青青青伊人色综合久久| 免费成人av在线| 麻豆免费看一区二区三区| 日韩国产在线观看一区| 视频在线观看91| 天天操天天色综合| 奇米888四色在线精品| 日本网站在线观看一区二区三区 | 成人综合在线视频| 丁香五精品蜜臀久久久久99网站| 国产v综合v亚洲欧| 久久综合九色综合97婷婷女人 | 亚洲国产精品成人综合| 中文字幕高清不卡| 亚洲欧美一区二区不卡| 樱桃视频在线观看一区| 亚洲在线视频网站| 午夜精品久久一牛影视| 麻豆专区一区二区三区四区五区| 美日韩一级片在线观看| 狠狠狠色丁香婷婷综合激情| 国产91综合网| 99久久伊人网影院| 色婷婷久久久亚洲一区二区三区 | 麻豆成人久久精品二区三区红| 久久精品免费观看| 国产高清精品久久久久| 成人激情开心网| 色婷婷国产精品久久包臀| 欧美日韩国产一级片| 日韩欧美亚洲一区二区| 国产日韩欧美不卡在线| 日韩一区在线看| 偷拍亚洲欧洲综合| 国产呦萝稀缺另类资源| 成人aaaa免费全部观看| 欧美综合亚洲图片综合区| 日韩午夜在线观看视频| 欧美激情在线看| 亚洲免费av网站| 亚洲h动漫在线| 久久精品国产亚洲高清剧情介绍| 成人妖精视频yjsp地址| 99久久久久久| 成人亚洲精品久久久久软件| 日本精品一区二区三区四区的功能| 在线亚洲欧美专区二区| 777午夜精品免费视频| 日韩美一区二区三区| 国产精品久久久久影院色老大| 亚洲欧美aⅴ...| 日韩影视精彩在线| 亚洲成人资源网| 美女网站在线免费欧美精品| 捆绑紧缚一区二区三区视频 | 日本中文字幕一区二区视频| 六月丁香婷婷色狠狠久久| 另类中文字幕网| 成人高清伦理免费影院在线观看| 在线观看日韩毛片| 日韩一区二区三区高清免费看看| 26uuuu精品一区二区| 国产精品家庭影院| 污片在线观看一区二区| 久久99久久99精品免视看婷婷| 91在线国产福利| 911国产精品| 国产欧美日韩激情| 亚洲电影激情视频网站| 日韩成人免费电影| 粉嫩一区二区三区性色av| 在线视频一区二区免费| 精品国产乱码久久久久久蜜臀| 一区二区三区中文在线| 精品一区二区三区视频| 91免费国产在线观看| 91精品国产一区二区三区蜜臀| 最新久久zyz资源站| 免费观看在线色综合| 成人高清免费观看| 欧美一区二区在线免费观看| 亚洲男人电影天堂| 国内成人自拍视频| 在线观看91视频| 精品国产1区二区| 一区二区三区在线播放| 国产精品18久久久久| 欧洲激情一区二区| 日本不卡123| www.一区二区| 日韩视频一区二区三区在线播放 | 亚洲综合一区在线| 成人免费毛片片v| 正在播放亚洲一区| 亚洲啪啪综合av一区二区三区| 激情图片小说一区| 91精品国产乱码|