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

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

?? accountingrequest.java

?? TinyRadius is a simple, small and fast Java Radius library capable of sending and receiving Radius
?? JAVA
字號:
/**
 * $Id: AccountingRequest.java,v 1.2 2006/02/17 18:14:54 wuttke Exp $
 * Created on 09.04.2005
 * @author Matthias Wuttke
 * @version $Revision: 1.2 $
 */
package org.tinyradius.packet;

import java.security.MessageDigest;
import java.util.List;

import org.tinyradius.attribute.IntegerAttribute;
import org.tinyradius.attribute.RadiusAttribute;
import org.tinyradius.attribute.StringAttribute;
import org.tinyradius.util.RadiusException;
import org.tinyradius.util.RadiusUtil;

/**
 * This class represents a Radius packet of the type
 * "Accounting-Request".
 */
public class AccountingRequest extends RadiusPacket {
	
	/**
	 * Acct-Status-Type: Start
	 */
	public static final int ACCT_STATUS_TYPE_START = 1;

	/**
	 * Acct-Status-Type: Stop
	 */
	public static final int ACCT_STATUS_TYPE_STOP = 2;

	/**
	 * Acct-Status-Type: Interim Update/Alive
	 */
	public static final int ACCT_STATUS_TYPE_INTERIM_UPDATE = 3;

	/**
	 * Acct-Status-Type: Accounting-On
	 */
	public static final int ACCT_STATUS_TYPE_ACCOUNTING_ON = 7;

	/**
	 * Acct-Status-Type: Accounting-Off
	 */
	public static final int ACCT_STATUS_TYPE_ACCOUNTING_OFF = 8;
	
	/**
	 * Constructs an Accounting-Request packet to be sent to a Radius server.
	 * @param userName user name
	 * @param acctStatusType ACCT_STATUS_TYPE_*
	 */
	public AccountingRequest(String userName, int acctStatusType) {
		super(ACCOUNTING_REQUEST, getNextPacketIdentifier());
		setUserName(userName);
		setAcctStatusType(acctStatusType);
	}
	
	/**
	 * Constructs an empty Accounting-Request to be received by a
	 * Radius client.
	 */
	public AccountingRequest() {
		super();
	}
	
	/**
	 * Sets the User-Name attribute of this Accountnig-Request.
	 * @param userName user name to set
	 */
	public void setUserName(String userName) {
		if (userName == null)
			throw new NullPointerException("user name not set");
		if (userName.length() == 0)
			throw new IllegalArgumentException("empty user name not allowed");
		
		removeAttributes(USER_NAME);
		addAttribute(new StringAttribute(USER_NAME, userName));		
	}
	
	/**
	 * Retrieves the user name from the User-Name attribute.
	 * @return user name
	 */
	public String getUserName() 
	throws RadiusException {
		List attrs = getAttributes(USER_NAME);
		if (attrs.size() < 1 || attrs.size() > 1)
			throw new RuntimeException("exactly one User-Name attribute required");
		
		RadiusAttribute ra = (RadiusAttribute)attrs.get(0);
		return ((StringAttribute)ra).getAttributeValue();
	}

	/**
	 * Sets the Acct-Status-Type attribute of this Accountnig-Request.
	 * @param acctStatusType ACCT_STATUS_TYPE_* to set
	 */
	public void setAcctStatusType(int acctStatusType) {
		if (acctStatusType < 1 || acctStatusType > 15)
			throw new IllegalArgumentException("bad Acct-Status-Type");
		removeAttributes(ACCT_STATUS_TYPE);
		addAttribute(new IntegerAttribute(ACCT_STATUS_TYPE, acctStatusType));
	}

	/**
	 * Retrieves the user name from the User-Name attribute.
	 * @return user name
	 */
	public int getAcctStatusType() 
	throws RadiusException {
		RadiusAttribute ra = getAttribute(ACCT_STATUS_TYPE);
		if (ra == null)
			return -1;
		else
			return ((IntegerAttribute)ra).getAttributeValueInt();
	}

	/**
	 * Calculates the request authenticator as specified by RFC 2866.
	 * @see org.tinyradius.packet.RadiusPacket#updateRequestAuthenticator(java.lang.String, int, byte[])
	 */
	protected byte[] updateRequestAuthenticator(String sharedSecret, int packetLength, byte[] attributes) {
		byte[] authenticator = new byte[16];
		for (int i = 0; i < 16; i++)
			authenticator[i] = 0;
		
		MessageDigest md5 = getMd5Digest();
        md5.reset();
        md5.update((byte)getPacketType());
        md5.update((byte)getPacketIdentifier());
        md5.update((byte)(packetLength >> 8));
        md5.update((byte)(packetLength & 0xff));
        md5.update(authenticator, 0, authenticator.length);
        md5.update(attributes, 0, attributes.length);
        md5.update(RadiusUtil.getUtf8Bytes(sharedSecret));
        return md5.digest();
	}
	
	/**
	 * Checks the received request authenticator as specified by RFC 2866.
	 */
	protected void checkRequestAuthenticator(String sharedSecret, int packetLength, byte[] attributes) throws RadiusException {
		byte[] expectedAuthenticator = updateRequestAuthenticator(sharedSecret, packetLength, attributes);
		byte[] receivedAuth = getAuthenticator();
		for (int i = 0; i < 16; i++)
			if (expectedAuthenticator[i] != receivedAuth[i])
				throw new RadiusException("request authenticator invalid");
	}
	
	/**
	 * Radius User-Name attribute type
	 */
	private static final int USER_NAME = 1;
	
	/**
	 * Radius Acct-Status-Type attribute type
	 */
	private static final int ACCT_STATUS_TYPE = 40;
	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一线二线三线视频| 麻豆极品一区二区三区| 精品一区二区国语对白| 色婷婷综合视频在线观看| 日韩精品一区二区三区中文精品| 亚洲丝袜美腿综合| 国内国产精品久久| 宅男在线国产精品| 亚洲一区日韩精品中文字幕| 成人精品gif动图一区| 久久这里只有精品6| 午夜精品久久久久久久99水蜜桃 | 国产午夜精品久久久久久免费视| 亚洲欧美在线观看| 国产69精品久久99不卡| 精品成人在线观看| 男男gaygay亚洲| 欧洲另类一二三四区| 国产精品成人免费| 成人美女在线观看| 久久九九全国免费| 国产一区欧美一区| 欧美mv日韩mv亚洲| 奇米影视一区二区三区| 欧美精品在线一区二区三区| 一二三区精品视频| 色播五月激情综合网| 亚洲美女区一区| 波多野结衣亚洲一区| 国产精品国产馆在线真实露脸| 国产自产视频一区二区三区| 久久综合狠狠综合久久综合88| 日韩国产精品大片| 日韩免费看的电影| 精品中文字幕一区二区| 久久久亚洲精品一区二区三区| 国产自产2019最新不卡| 久久久亚洲精品石原莉奈 | 麻豆成人av在线| 欧美一区二区三区精品| 麻豆国产精品一区二区三区| 精品欧美乱码久久久久久1区2区| 精彩视频一区二区| 国产喂奶挤奶一区二区三区| 成人影视亚洲图片在线| 亚洲天天做日日做天天谢日日欢 | 精品美女在线观看| 狠狠色丁香久久婷婷综合_中| 欧美tickling挠脚心丨vk| 精品一区二区三区在线观看 | 91在线小视频| 亚洲一二三区在线观看| 欧美一区二区免费观在线| 美女久久久精品| 国产精品福利一区| 欧美色欧美亚洲另类二区| 日韩激情视频在线观看| 国产三级一区二区三区| 97久久人人超碰| 日韩av网站在线观看| 欧美一级专区免费大片| 福利一区二区在线| 亚洲成人精品影院| 精品国产一二三| 91色在线porny| 久久99久久久久| 综合久久给合久久狠狠狠97色 | 色婷婷香蕉在线一区二区| 亚洲第四色夜色| 国产欧美va欧美不卡在线| 日本福利一区二区| 国产一区二区三区在线观看精品 | 欧美精品日韩一区| 国产一区二区不卡| 婷婷久久综合九色综合伊人色| 国产无人区一区二区三区| 欧美三级日韩三级| 成人教育av在线| 蜜臀精品久久久久久蜜臀 | 在线观看视频欧美| 国产精品资源网站| 性感美女极品91精品| 日本一区二区视频在线| 欧美精品一卡两卡| 成人午夜电影网站| 国产一区二区伦理| 亚洲成人一区二区在线观看| 国产欧美日韩激情| 亚洲精品在线一区二区| 欧美久久免费观看| 色欧美片视频在线观看| 成人性生交大合| 精品一区二区三区香蕉蜜桃 | 悠悠色在线精品| 欧美激情综合在线| 精品国产制服丝袜高跟| 日韩一区二区三区三四区视频在线观看 | 国产片一区二区三区| 7777精品伊人久久久大香线蕉完整版| 成人三级在线视频| 国产夫妻精品视频| 国产乱码字幕精品高清av| 麻豆国产精品777777在线| 日韩激情一区二区| 三级在线观看一区二区| 亚洲成人av福利| 亚洲第一久久影院| 亚洲妇熟xx妇色黄| 亚洲午夜在线观看视频在线| 亚洲乱码国产乱码精品精可以看| 国产精品久久网站| 国产精品久久久久三级| 国产精品视频线看| 国产午夜亚洲精品不卡| 欧美激情一区在线观看| 国产精品久久久久久亚洲毛片 | 日韩一级高清毛片| 欧美一区三区二区| 精品国产一区二区三区久久久蜜月| 日韩午夜激情电影| 精品99久久久久久| 亚洲国产成人午夜在线一区| 日本一区二区三区国色天香| 国产精品久久国产精麻豆99网站| 国产精品你懂的在线| 亚洲视频一区在线| 一级日本不卡的影视| 亚洲成a人v欧美综合天堂下载| 天堂va蜜桃一区二区三区漫画版 | 日韩精品中文字幕在线一区| 日韩写真欧美这视频| 久久先锋资源网| 国产精品久久久久久久午夜片| 亚洲视频免费看| 亚洲网友自拍偷拍| 看国产成人h片视频| 国产二区国产一区在线观看| 成人高清在线视频| 欧美性三三影院| 亚洲精品在线三区| 国产精品久久久久久久久动漫| 亚洲精品成人悠悠色影视| 日本在线观看不卡视频| 国产精品1区二区.| 91精品办公室少妇高潮对白| 制服丝袜在线91| 国产精品久久久久久久久果冻传媒| 久久精品72免费观看| 99国内精品久久| 日韩一级黄色片| 亚洲色图欧美激情| 久久精品国产在热久久| caoporen国产精品视频| 欧美一区二区精美| 成人欧美一区二区三区| 免费在线观看成人| 91浏览器在线视频| 玉足女爽爽91| 国产老妇另类xxxxx| 色婷婷久久久亚洲一区二区三区| 日韩午夜激情电影| 亚洲综合色区另类av| 国产一区二区三区蝌蚪| 欧美人xxxx| 国产精品女主播在线观看| 蜜臀av性久久久久蜜臀aⅴ| eeuss鲁片一区二区三区在线看| 日韩欧美国产小视频| 亚洲激情校园春色| 成人国产免费视频| 精品日韩欧美在线| 亚洲国产成人av| 91免费观看视频| 中文字幕一区二区三区蜜月| 国内精品伊人久久久久av影院 | 中文字幕中文字幕中文字幕亚洲无线| 亚洲高清免费在线| 91女人视频在线观看| 久久青草国产手机看片福利盒子| 亚洲国产精品麻豆| 91在线播放网址| 亚洲国产成人午夜在线一区| 久久国产精品一区二区| 欧美精品vⅰdeose4hd| 亚洲男人天堂av网| 99久久伊人网影院| 日本一区二区成人在线| 国产毛片精品国产一区二区三区| 91精品国产综合久久精品麻豆| 亚洲国产日韩a在线播放| 91免费看片在线观看| 椎名由奈av一区二区三区| 国产99久久精品| 国产午夜精品在线观看| 国产91精品露脸国语对白| 久久久精品国产免大香伊| 国产一区二区三区| 国产欧美一区二区三区在线看蜜臀 | 美女在线观看视频一区二区| 717成人午夜免费福利电影|