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

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

?? snmpcontextv3.java

?? 無線網絡管理
?? JAVA
字號:
// NAME//      $RCSfile: SnmpContextv3.java,v $// DESCRIPTION//      [given below in javadoc format]// DELTA//      $Revision: 3.30 $// CREATED//      $Date: 2006/11/29 16:23:33 $// COPYRIGHT//      Westhawk Ltd// TO DO///* * Copyright (C) 2000 - 2006 by Westhawk Ltd * <a href="www.westhawk.co.uk">www.westhawk.co.uk</a> * * Permission to use, copy, modify, and distribute this software * for any purpose and without fee is hereby granted, provided * that the above copyright notices appear in all copies and that * both the copyright notice and this permission notice appear in * supporting documentation. * This software is provided "as is" without express or implied * warranty. */package uk.co.westhawk.snmp.stack;import java.net.*;import java.io.*;import java.util.*;import uk.co.westhawk.snmp.pdu.*;import uk.co.westhawk.snmp.util.*;import uk.co.westhawk.snmp.event.*;import uk.co.westhawk.snmp.beans.*;/** * This class contains the SNMP v3 context that is needed by every PDU to * send a SNMP v3 request. * Most of the work is done by SnmpContextv3Basis, like doing discovery.  * * <p> * Now that the stack can send traps and receive requests,  * it needs to be able to act as an * authoritative SNMP engine. This is done via the interface UsmAgent. * The DefaultUsmAgent is not guaranteed to work; agents (or rather  * authoritative engines) <em>should</em> provide a better implementation. * </p> * * <p> * This class adds a UsmBeingDiscoveredBean as listener. This bean * handles any incoming discovery PDU. Only when acting as * authoritative engine should there be any discovery PDU. * </p> * * @see SnmpContextv3Face * @see SnmpContextv3Pool * @see TimeWindow * @see DefaultUsmAgent * @see UsmAgent * @see #setUsmAgent(UsmAgent) * @see uk.co.westhawk.snmp.beans.UsmDiscoveryBean * * @author <a href="mailto:snmp@westhawk.co.uk">Birgit Arkesteijn</a> * @version $Revision: 3.30 $ $Date: 2006/11/29 16:23:33 $ */public class SnmpContextv3 extends SnmpContextv3Basis{    private static final String     version_id =        "@(#)$Id: SnmpContextv3.java,v 3.30 2006/11/29 16:23:33 birgit Exp $ Copyright Westhawk Ltd";    private UsmBeingDiscoveredBean myDiscBean = null;/** * Constructor. * * @param host The host to which the PDU will be sent * @param port The port where the SNMP server will be * @see AbstractSnmpContext#AbstractSnmpContext(String, int) */public SnmpContextv3(String host, int port) throws java.io.IOException{    super(host, port);}/** * Constructor. * * @param host The host to which the Pdu will be sent * @param port The port where the SNMP server will be * @param typeSocketA The local address the server will bind to * * @see AbstractSnmpContext#AbstractSnmpContext(String, int, String) */public SnmpContextv3(String host, int port, String typeSocketA) throws java.io.IOException{    super(host, port, typeSocketA);}/** * Constructor. * * @param host The host to which the PDU will be sent * @param port The port where the SNMP server will be * @param bindAddress The local address the server will bind to * @param typeSocketA The type of socket to use.  * * @see AbstractSnmpContext#AbstractSnmpContext(String, int, String, String) * @see SnmpContextBasisFace#STANDARD_SOCKET * @see SnmpContextBasisFace#TCP_SOCKET * @since 4_14 */public SnmpContextv3(String host, int port, String bindAddress, String typeSocketA) throws java.io.IOException{    super(host, port, bindAddress, typeSocketA);}/** * Makes sure the UsmBeingDiscoveredBean is added as RequestPduListener, * so that discovery requests are handled. When listening for incoming * requests, the stack become authoritative. You have (!) to create a * proper usmAgent so the stack can be discovered. * * <p> * Don't use the TCP_SOCKET when listening for request PDUs. It doesn't * provide functionality to send a response back.  * </p> * * @see #removeRequestPduListener(RequestPduListener, ListeningContextPool) * @see UsmBeingDiscoveredBean * @see SnmpContextv3Basis#setUsmAgent(UsmAgent) * * @param l The request PDU listener  * @param lcontext The listening context */public void addRequestPduListener(RequestPduListener l, ListeningContextPool lcontext)throws java.io.IOException{    super.addRequestPduListener(l, lcontext);    if (myDiscBean == null)    {        myDiscBean = new UsmBeingDiscoveredBean(this, usmAgent);    }    myDiscBean.addRequestPduListener(lcontext);}/** * Removes the UsmBeingDiscoveredBean as listener. * * @see #addRequestPduListener(RequestPduListener, ListeningContextPool) * * @param l The request PDU listener  * @param lcontext The listening context */public void removeRequestPduListener(RequestPduListener l, ListeningContextPool lcontext) throws java.io.IOException{    super.removeRequestPduListener(l, lcontext);    if (myDiscBean != null)    {        myDiscBean.removeRequestPduListener(lcontext);        myDiscBean.freeResources();        myDiscBean = null;    }}/** * Processes an incoming PDU, that is <em>not</em> a Discovery PDU. * <p> * See <a href="http://www.ietf.org/rfc/rfc3414.txt">SNMP-USER-BASED-SM-MIB</a>. * </p> * * <p> * This method calls first processPotentialTrap and then * processPotentialRequest. The reason this code is split up is because * in one case the stack acts as authoritative engine and as non * authoritative engine in the other.. * </p> * * @see #rawPduReceived * @see #processPotentialTrap * @see #processPotentialRequest */public Pdu processIncomingPdu(byte [] message) throws DecodingException, IOException{    String msg = checkContextSanity();    if (msg != null)    {        throw new DecodingException(msg);    }    int l = message.length;    byte [] copyOfMessage1 = new byte[l];    byte [] copyOfMessage2 = new byte[l];    System.arraycopy(message, 0, copyOfMessage1, 0, l);    System.arraycopy(message, 0, copyOfMessage2, 0, l);    AsnDecoderv3 rpdu = new AsnDecoderv3();    ByteArrayInputStream in = new ByteArrayInputStream(message);    AsnSequence asnTopSeq = rpdu.DecodeSNMPv3(in);    int msgId = rpdu.getMsgId(asnTopSeq);    Pdu pdu = null;    DecodingException encryptionDecodingException1 = null;    IOException encryptionIOException1 = null;    try    {        pdu = processPotentialTrap(rpdu, asnTopSeq, copyOfMessage1);    }    catch(DecodingException exc)    {        encryptionDecodingException1 = exc;        if (AsnObject.debug > 3)        {            System.out.println(getClass().getName()                 + ".processPotentialTrap(): DecodingException: "                 + exc.getMessage());        }    }    catch(IOException exc)    {        encryptionIOException1 = exc;        if (AsnObject.debug > 3)        {            System.out.println(getClass().getName()                 + ".processPotentialTrap(): IOException: "                 + exc.getMessage());        }    }    DecodingException encryptionDecodingException2 = null;    IOException encryptionIOException2 = null;    if (pdu == null)    {        try        {            pdu = processPotentialRequest(rpdu, asnTopSeq, copyOfMessage2);        }        catch(DecodingException exc)        {            encryptionDecodingException2 = exc;            if (AsnObject.debug > 3)            {                System.out.println(getClass().getName()                     + ".processPotentialRequest(): DecodingException: "                     + exc.getMessage());            }        }        catch(IOException exc)        {            encryptionIOException2 = exc;            if (AsnObject.debug > 3)            {                System.out.println(getClass().getName()                     + ".processPotentialRequest(): IOException: "                     + exc.getMessage());            }        }    }    if (pdu != null)    {        pdu.snmpv3MsgId = new Integer(msgId);    }    else    {        if (encryptionIOException2 != null)        {            throw encryptionIOException2;        }        if (encryptionDecodingException2 != null)        {            throw encryptionDecodingException2;        }        if (encryptionIOException1 != null)        {            throw encryptionIOException1;        }        if (encryptionDecodingException1 != null)        {            throw encryptionDecodingException1;        }    }    return pdu;}/** * Processes an incoming PDU, to see if it is a Trap. * This method is called by processIncomingPdu. * * When receiving traps the stack is non authoritative. * * @see #processIncomingPdu * @see #processPotentialRequest * @since 4_14 */public Pdu processPotentialTrap(AsnDecoderv3 rpdu, AsnSequence asnTopSeq,     byte [] message) throws DecodingException, IOException{    // decode as Non Authoratative engine    AsnPduSequence pduSeq = rpdu.processSNMPv3(this, asnTopSeq, message, false);    Pdu pdu = null;    if (pduSeq != null)    {        byte type = pduSeq.getRespType();        if (type == SnmpConstants.TRPV2_REQ_MSG)        {            pdu = new uk.co.westhawk.snmp.stack.TrapPduv2(this);            pdu.fillin(pduSeq);            if (AsnObject.debug > 3)            {                System.out.println(getClass().getName()                     + ".processPotentialTrap(): PDU received with type "                     + pduSeq.getRespTypeString()                    + ". Not ignoring it!");            }        }        else        {            if (AsnObject.debug > 3)            {                System.out.println(getClass().getName()                     + ".processPotentialTrap(): PDU received is not TRPV2_REQ_MSG"                     + ". Ignoring it.");            }        }    }    else    {        if (AsnObject.debug > 3)        {            System.out.println(getClass().getName()                 + ".processPotentialTrap(): pduSeq == null"                 + ". Ignoring it.");        }    }    return pdu;}/** * Processes an incoming PDU, to see if it is a Request. * This method is called by processIncomingPdu. * * When receiving pdu requests the stack is authoritative. * * @see #processIncomingPdu * @see #processPotentialTrap * @since 4_14 */public Pdu processPotentialRequest(AsnDecoderv3 rpdu, AsnSequence asnTopSeq,     byte [] message) throws DecodingException, IOException{    // decode as Authoratative engine    AsnPduSequence pduSeq = rpdu.processSNMPv3(this, asnTopSeq, message, true);    Pdu pdu = null;    if (pduSeq != null)    {        byte type = pduSeq.getRespType();        if (type == SnmpConstants.GET_REQ_MSG && pduSeq.isSnmpv3Discovery() == true)        {            if (AsnObject.debug > 3)            {                System.out.println(getClass().getName()                     + ".ProcessIncomingPdu(): received discovery pdu"                     + ". Ignoring it.");            }        }        else        {            switch (type)            {                case SnmpConstants.GET_REQ_MSG:                    pdu = new uk.co.westhawk.snmp.stack.GetPdu(this);                    pdu.fillin(pduSeq);                    break;                case SnmpConstants.GETNEXT_REQ_MSG:                    pdu = new uk.co.westhawk.snmp.stack.GetNextPdu(this);                    pdu.fillin(pduSeq);                    break;                case SnmpConstants.SET_REQ_MSG:                    pdu = new uk.co.westhawk.snmp.stack.SetPdu(this);                    pdu.fillin(pduSeq);                    break;                case SnmpConstants.GETBULK_REQ_MSG:                    pdu = new uk.co.westhawk.snmp.stack.GetBulkPdu(this);                    pdu.fillin(pduSeq);                    break;                case SnmpConstants.INFORM_REQ_MSG:                    pdu = new uk.co.westhawk.snmp.stack.InformPdu(this);                    pdu.fillin(pduSeq);                    break;                //case SnmpConstants.GET_RSP_MSG:                //  A lonely response should never be received here.                //  They should come in via the processIncomingResponse                //  route.                //case SnmpConstants.GET_RPRT_MSG:                //  Reports are part of v3 timeliness communication.                //case SnmpConstants.TRPV2_REQ_MSG:                //  Traps should have been decoded in                //  processPotentialTrap() above                default:                    if (AsnObject.debug > 3)                    {                        System.out.println(getClass().getName()                             + ".processPotentialRequest(): PDU received with type "                             + pduSeq.getRespTypeString()                            + ". Ignoring it.");                    }            }                        if (pdu != null)            {                if (AsnObject.debug > 3)                {                    System.out.println(getClass().getName()                         + ".processPotentialRequest(): PDU received with type "                         + pduSeq.getRespTypeString()                        + ". Not ignoring it!");                }            }        }    }    else    {        if (AsnObject.debug > 3)        {            System.out.println(getClass().getName()                 + "..processPotentialRequest(): pduSeq == null"                 + ". Ignoring it.");        }    }    return pdu;}/** * Returns a clone of this SnmpContextv3. * * @exception CloneNotSupportedException Thrown when the constructor * generates an IOException */public Object clone() throws CloneNotSupportedException{    SnmpContextv3 clContext = null;    try    {        clContext = new SnmpContextv3(hostname, hostPort, bindAddr, typeSocket);        clContext = (SnmpContextv3) cloneParameters(clContext);    }    catch (java.io.IOException exc)    {        throw new CloneNotSupportedException("IOException "             + exc.getMessage());    }    return clContext;}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
555www色欧美视频| 成人午夜av电影| 一卡二卡三卡日韩欧美| **欧美大码日韩| 中文字幕一区二区三区不卡| 国产欧美日韩中文久久| 国产精品美女久久久久久久网站| 欧美国产欧美综合| 国产精品久久久久永久免费观看 | 欧美色视频一区| 欧美视频一区二区在线观看| 欧美性做爰猛烈叫床潮| 51午夜精品国产| 欧美大片国产精品| 欧美国产1区2区| 一区二区三区国产精华| 亚洲成人激情自拍| 老司机午夜精品| 成人一级视频在线观看| 91啪亚洲精品| 欧美顶级少妇做爰| 国产嫩草影院久久久久| 亚洲人成网站色在线观看| 亚洲综合视频网| 黑人巨大精品欧美一区| 色天天综合色天天久久| 日韩亚洲国产中文字幕欧美| 中文乱码免费一区二区| 亚洲成人免费视频| 国产白丝精品91爽爽久久| 色婷婷亚洲一区二区三区| 欧美一级夜夜爽| 成人欧美一区二区三区小说 | 亚洲成人av福利| 激情五月婷婷综合网| 97se亚洲国产综合自在线观| 日韩欧美国产一区在线观看| 国产精品久久久久久户外露出 | 亚洲自拍与偷拍| 国产呦萝稀缺另类资源| 91福利视频网站| 久久精品视频在线免费观看| 一区二区三区精品| 大桥未久av一区二区三区中文| 欧美日韩成人综合在线一区二区 | 色综合久久久久久久| 欧美α欧美αv大片| 亚洲三级电影网站| 国产91丝袜在线18| 欧美大肚乱孕交hd孕妇| 亚洲一区精品在线| 成人中文字幕合集| 精品久久久久久久久久久久包黑料 | 国产欧美一区二区精品久导航| 亚洲午夜免费视频| 97精品视频在线观看自产线路二| 日韩精品在线一区二区| 午夜久久久影院| 在线观看亚洲专区| 国产精品少妇自拍| 粉嫩av亚洲一区二区图片| 日韩美女主播在线视频一区二区三区| 尤物av一区二区| 99久久99久久综合| 国产精品视频第一区| 国产一区二区三区免费在线观看| 3atv在线一区二区三区| 亚洲电影中文字幕在线观看| 一本色道综合亚洲| 亚洲麻豆国产自偷在线| 99久久精品免费精品国产| 国产欧美视频在线观看| 国产一区二区导航在线播放| 精品99999| 国产自产2019最新不卡| 久久久不卡网国产精品一区| 国内外成人在线| 久久久久国产成人精品亚洲午夜| 国产一区 二区| 欧美国产日韩在线观看| av中文一区二区三区| 自拍偷拍亚洲综合| 在线观看国产精品网站| 亚洲va在线va天堂| 91精品国产aⅴ一区二区| 老司机一区二区| 中文字幕免费一区| 色综合欧美在线视频区| 夜夜精品视频一区二区| 91精品免费观看| 国产一区二区三区在线观看免费视频| 精品91自产拍在线观看一区| 成熟亚洲日本毛茸茸凸凹| 亚洲人123区| 欧美高清性hdvideosex| 精品一区二区三区久久| 欧美激情一区二区在线| 欧美在线色视频| 美腿丝袜在线亚洲一区| 国产亚洲短视频| 日本高清无吗v一区| 免费成人av在线| 中文字幕国产精品一区二区| 欧美日韩在线精品一区二区三区激情| 免费高清视频精品| 国产精品久久久久久久久图文区 | 欧美色综合久久| 久久99国产精品麻豆| 中文字幕 久热精品 视频在线| 色哦色哦哦色天天综合| 麻豆久久久久久| 亚洲精品日韩一| 久久综合九色综合欧美亚洲| 在线视频一区二区三| 国内精品写真在线观看| 亚洲精品亚洲人成人网在线播放| 日韩视频在线永久播放| 99精品欧美一区二区三区综合在线| 日韩精品国产欧美| 亚洲另类春色校园小说| 久久久综合精品| 欧美日韩亚洲综合在线| 国产99精品在线观看| 日本不卡免费在线视频| 亚洲免费av网站| 国产精品福利一区二区| 欧美成人高清电影在线| 欧美日韩一区二区不卡| 91在线porny国产在线看| 国产精品一区二区久激情瑜伽 | 国产99久久精品| 免费成人你懂的| 亚洲成av人片在www色猫咪| 国产精品亲子乱子伦xxxx裸| 亚洲精品在线电影| 337p亚洲精品色噜噜| 欧美综合欧美视频| 一本色道久久综合亚洲91| 岛国一区二区三区| 国产凹凸在线观看一区二区| 国内精品写真在线观看| 麻豆91精品视频| 日本女人一区二区三区| 午夜亚洲福利老司机| 亚洲图片有声小说| 亚洲久草在线视频| 亚洲色图欧洲色图婷婷| 亚洲欧美日韩国产一区二区三区| 亚洲国产高清不卡| 国产精品色一区二区三区| 国产精品久久久久四虎| 一区二区中文视频| 国产精品三级av| 亚洲欧洲日韩综合一区二区| 国产精品入口麻豆原神| 日韩美女视频一区二区| 亚洲欧洲制服丝袜| 一区二区三区高清| 香蕉乱码成人久久天堂爱免费| 亚洲一区二区av在线| 偷偷要91色婷婷| 久久国产精品第一页| 国产精品一级在线| 成人免费视频一区| 91猫先生在线| 欧美日韩国产综合一区二区 | 国产一区二区日韩精品| 国产精品影视网| 91在线视频在线| 欧美性猛交xxxxxx富婆| 日韩一区和二区| 久久久亚洲精品石原莉奈| 国产精品视频看| 亚洲成人一区二区在线观看| 日韩电影在线一区二区三区| 精品亚洲成a人在线观看| 成人国产电影网| 欧美日韩不卡一区| 久久精品视频免费观看| 日韩美女啊v在线免费观看| 首页国产欧美久久| 成人在线一区二区三区| 在线观看三级视频欧美| 日韩精品在线一区二区| 亚洲日本一区二区三区| 久久精品噜噜噜成人88aⅴ| 东方欧美亚洲色图在线| 欧美日韩黄视频| 国产亚洲人成网站| 亚洲国产一区二区视频| 国产精品 欧美精品| 欧美三级三级三级| 国产亚洲欧美日韩俺去了| 亚洲一区二区三区四区的| 国产尤物一区二区| 欧美乱妇20p| 亚洲黄色小视频| 东方aⅴ免费观看久久av| 日韩美女天天操| 亚洲成人动漫在线免费观看|