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

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

?? snmptraptest.java

?? 基于snmp/mib的網絡數據獲取系統設計與實現
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * SNMP Trap Test
 *
 * Copyright (C) 2004, Jonathan Sevy <jsevy@mcs.drexel.edu>
 *
 * This is free software. Redistribution and use in source and binary forms, with
 * or without modification, are permitted provided that the following conditions
 * are met:
 *
 *  1. Redistributions of source code must retain the above copyright notice, this
 *     list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation 
 *     and/or other materials provided with the distribution.
 *  3. The name of the author may not be used to endorse or promote products 
 *     derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */



import java.util.*;
import java.net.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.plaf.*;
import java.awt.event.*;
import java.io.*;
import snmp.*;




public class SNMPTrapTest extends JFrame
                            implements ActionListener, SNMPv1TrapListener, SNMPv2TrapListener, SNMPv2InformRequestListener, Runnable
{
    
    JButton sendv1TrapButton, sendv2TrapButton, sendv2InformRequestButton;
    JButton clearButton;
    JTextArea messagesArea;
    JScrollPane messagesScroll;
    JTextField hostIDField, communityField, OIDField, valueField, enterpriseField, agentField;
    JLabel authorLabel, hostIDLabel, communityLabel, OIDLabel, valueLabel, enterpriseLabel, agentLabel, genericTrapLabel, specificTrapLabel;
    JComboBox valueTypeBox, genericTrapBox, specificTrapBox;
    
    MenuBar theMenubar;
    Menu fileMenu;
    MenuItem aboutItem, quitItem;
    
    
    SNMPTrapReceiverInterface trapReceiverInterface;
    SNMPTrapSenderInterface trapSenderInterface;
    SNMPInformRequestSenderInterface informRequestSenderInterface;
    
    PipedReader errorReader;
    PipedWriter errorWriter;
    Thread readerThread;
    
    
    
    
    // WindowCloseAdapter to catch window close-box closings
    private class WindowCloseAdapter extends WindowAdapter
    { 
        public void windowClosing(WindowEvent e)
        {
            readerThread.interrupt();
            System.exit(0);
        }
    };
            
    
    public SNMPTrapTest() 
    {
        setUpDisplay();
            
        try
        {
            errorReader = new PipedReader();
            errorWriter = new PipedWriter(errorReader);
            
            readerThread = new Thread(this);
            readerThread.start();
            
            trapReceiverInterface = new SNMPTrapReceiverInterface(new PrintWriter(errorWriter));
            trapReceiverInterface.addv1TrapListener(this);
            trapReceiverInterface.addv2TrapListener(this);
            trapReceiverInterface.addv2InformRequestListener(this);
            trapReceiverInterface.startReceiving();
            
            trapSenderInterface = new SNMPTrapSenderInterface();
            informRequestSenderInterface = new SNMPInformRequestSenderInterface();
            
        }
        catch(Exception e)
        {
            messagesArea.append("Problem starting Trap Test: " + e.toString() + "\n");
        }
    }
    
    
    
    private void setUpDisplay()
    {
        
        this.setTitle("SNMP Trap and Inform Test");
            
        this.getRootPane().setBorder(new BevelBorder(BevelBorder.RAISED));
        
        // set fonts to smaller-than-normal size, for compaction!
        FontUIResource appFont = new FontUIResource("SansSerif", Font.PLAIN, 10);
        UIDefaults defaults = UIManager.getLookAndFeelDefaults();
        Enumeration keys = defaults.keys();
        
        while (keys.hasMoreElements())
        {
            String nextKey = (String)(keys.nextElement());
            if ((nextKey.indexOf("font") > -1) || (nextKey.indexOf("Font") > -1))
            {
                UIManager.put(nextKey, appFont);
            }
        }
        
        
        // add WindowCloseAdapter to catch window close-box closings
        addWindowListener(new WindowCloseAdapter());

        
        theMenubar = new MenuBar();
        this.setMenuBar(theMenubar);
        fileMenu = new Menu("File");
        
        aboutItem = new MenuItem("About...");
        aboutItem.setActionCommand("about");
        aboutItem.addActionListener(this);
        fileMenu.add(aboutItem);
        
        fileMenu.addSeparator();
        
        quitItem = new MenuItem("Quit");
        quitItem.setActionCommand("quit");
        quitItem.addActionListener(this);
        fileMenu.add(quitItem);
        
        theMenubar.add(fileMenu);
        
        
        hostIDLabel = new JLabel("Trap receiver address:");
        hostIDField = new JTextField(20);
        hostIDField.setText("10.0.1.1");
        hostIDField.setEditable(true);
        
        OIDLabel = new JLabel("additional variable OID:");
        OIDField = new JTextField(20);
        OIDField.setEditable(true);
        
        valueLabel = new JLabel("Value for additional variable:");
        valueField = new JTextField(20);
        valueField.setEditable(true);
        
        communityLabel = new JLabel("Community:");
        communityField = new JTextField(20);
        communityField.setText("public");
        communityField.setEditable(true);
        
        authorLabel = new JLabel(" Version 1.1        J. Sevy, January 2001 ");
        authorLabel.setFont(new Font("SansSerif", Font.ITALIC, 8));
            
        
        sendv1TrapButton = new JButton("Send v1 trap");
        sendv1TrapButton.setActionCommand("send v1 trap");
        sendv1TrapButton.addActionListener(this);
        
        sendv2TrapButton = new JButton("Send v2 trap");
        sendv2TrapButton.setActionCommand("send v2 trap");
        sendv2TrapButton.addActionListener(this);
        
        sendv2InformRequestButton = new JButton("Send v2 inform request");
        sendv2InformRequestButton.setActionCommand("send v2 inform request");
        sendv2InformRequestButton.addActionListener(this);
        
        clearButton = new JButton("Clear messages");
        clearButton.setActionCommand("clear messages");
        clearButton.addActionListener(this);
        
        messagesArea = new JTextArea(10,60);
        messagesScroll = new JScrollPane(messagesArea);
        
        valueTypeBox = new JComboBox();
        valueTypeBox.addItem("SNMPInteger");
        valueTypeBox.addItem("SNMPCounter32");
        valueTypeBox.addItem("SNMPCounter64");
        valueTypeBox.addItem("SNMPGauge32");
        valueTypeBox.addItem("SNMPOctetString");
        valueTypeBox.addItem("SNMPIPAddress");
        valueTypeBox.addItem("SNMPNSAPAddress");
        valueTypeBox.addItem("SNMPObjectIdentifier");
        valueTypeBox.addItem("SNMPTimeTicks");
        valueTypeBox.addItem("SNMPUInteger32");
        
        
        
        enterpriseLabel = new JLabel("Enterprise OID:");
        enterpriseField = new JTextField(20);
        enterpriseField.setEditable(true);
        
        agentLabel = new JLabel("Agent IP address:");
        agentField = new JTextField(20);
        agentField.setEditable(true);
        
        genericTrapLabel = new JLabel("Generic trap:");
        genericTrapBox = new JComboBox();
        genericTrapBox.addItem("Cold start (0)");
        genericTrapBox.addItem("Warm start (1)");
        genericTrapBox.addItem("Link down (2)");
        genericTrapBox.addItem("Link up (3)");
        genericTrapBox.addItem("Authentication failure (4)");
        genericTrapBox.addItem("EGP neighbor loss (5)");
        genericTrapBox.addItem("Enterprise specific (6)");
        
        
        specificTrapLabel = new JLabel("Specific trap:");
        specificTrapBox = new JComboBox();
        specificTrapBox.addItem("0");
        specificTrapBox.addItem("1");
        specificTrapBox.addItem("2");
        specificTrapBox.addItem("3");
        specificTrapBox.addItem("4");
        specificTrapBox.addItem("4");
        

        
        // now set up display
        
        // set params for layout manager
        GridBagLayout  theLayout = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        
        c.gridwidth = 1;
        c.gridheight = 1;
        c.fill = GridBagConstraints.NONE;
        c.ipadx = 0;
        c.ipady = 0;
        c.insets = new Insets(2,2,2,2);
        c.anchor = GridBagConstraints.CENTER;
        c.weightx = 0;
        c.weighty = 0;
        
        
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(theLayout);
        
        c.gridx = 1;
        c.gridy = 1;
        theLayout.setConstraints(sendv1TrapButton, c);
        buttonPanel.add(sendv1TrapButton);
        
        c.gridx = 2;
        c.gridy = 1;
        theLayout.setConstraints(sendv2TrapButton, c);
        buttonPanel.add(sendv2TrapButton);
        
        c.gridx = 3;
        c.gridy = 1;
        theLayout.setConstraints(sendv2InformRequestButton, c);
        buttonPanel.add(sendv2InformRequestButton);
        
        JPanel hostPanel = new JPanel();
        hostPanel.setLayout(theLayout);
        
        c.gridx = 1;
        c.gridy = 1;
        theLayout.setConstraints(hostIDLabel, c);
        hostPanel.add(hostIDLabel);
        
        c.gridx = 2;
        c.gridy = 1;
        theLayout.setConstraints(hostIDField, c);
        hostPanel.add(hostIDField);
        
        c.gridx = 1;
        c.gridy = 2;
        theLayout.setConstraints(communityLabel, c);
        hostPanel.add(communityLabel);
        
        c.gridx = 2;
        c.gridy = 2;
        theLayout.setConstraints(communityField, c);
        hostPanel.add(communityField);
        
        
        
        JPanel oidPanel = new JPanel();
        oidPanel.setLayout(theLayout);
        
        c.gridx = 1;
        c.gridy = 1;
        theLayout.setConstraints(enterpriseLabel, c);
        oidPanel.add(enterpriseLabel);
        
        c.gridx = 2;
        c.gridy = 1;
        theLayout.setConstraints(enterpriseField, c);
        oidPanel.add(enterpriseField);
        
        c.gridx = 1;
        c.gridy = 2;
        theLayout.setConstraints(agentLabel, c);
        oidPanel.add(agentLabel);
        
        c.gridx = 2;
        c.gridy = 2;
        theLayout.setConstraints(agentField, c);
        oidPanel.add(agentField);
        
        c.gridx = 1;
        c.gridy = 3;
        theLayout.setConstraints(genericTrapLabel, c);
        oidPanel.add(genericTrapLabel);
        
        c.gridx = 2;
        c.gridy = 3;
        theLayout.setConstraints(genericTrapBox, c);
        oidPanel.add(genericTrapBox);
        
        c.gridx = 1;
        c.gridy = 4;
        theLayout.setConstraints(specificTrapLabel, c);
        oidPanel.add(specificTrapLabel);
        
        c.gridx = 2;
        c.gridy = 4;
        theLayout.setConstraints(specificTrapBox, c);
        oidPanel.add(specificTrapBox);
        
        c.gridx = 1;
        c.gridy = 5;
        theLayout.setConstraints(OIDLabel, c);
        oidPanel.add(OIDLabel);
        
        c.gridx = 2;
        c.gridy = 5;
        theLayout.setConstraints(OIDField, c);
        oidPanel.add(OIDField);
        
        c.gridx = 1;
        c.gridy = 6;
        theLayout.setConstraints(valueLabel, c);
        oidPanel.add(valueLabel);
        
        c.gridx = 2;
        c.gridy = 6;
        theLayout.setConstraints(valueField, c);
        oidPanel.add(valueField);
        
        c.gridx = 3;
        c.gridy = 6;
        theLayout.setConstraints(valueTypeBox, c);
        oidPanel.add(valueTypeBox);
        
        
        c.gridwidth = 1;
        c.anchor = GridBagConstraints.CENTER;
        
        
        
        JPanel messagesPanel = new JPanel();
        messagesPanel.setLayout(theLayout);
        
        c.gridx = 1;
        c.gridy = 1;
        c.anchor = GridBagConstraints.WEST;
        JLabel messagesLabel = new JLabel("Received traps:");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丁香婷婷综合网| 91精品国产色综合久久| 国产精品18久久久久久vr| 日本午夜一本久久久综合| 亚洲五码中文字幕| 亚洲一区二区黄色| 亚洲成a人v欧美综合天堂 | 中文字幕中文字幕一区二区| 久久久美女毛片| 久久影院视频免费| 久久久久成人黄色影片| 久久久99免费| 国产三级一区二区三区| 国产女人aaa级久久久级| 日本一区二区三区四区| 国产欧美日韩久久| 最新久久zyz资源站| 亚洲欧美偷拍卡通变态| 亚洲综合另类小说| 日本成人在线一区| 激情文学综合网| 国产999精品久久久久久绿帽| 福利91精品一区二区三区| 不卡视频在线观看| 色吧成人激情小说| 欧美日韩精品一区二区三区| 日韩限制级电影在线观看| 精品日产卡一卡二卡麻豆| 国产亚洲午夜高清国产拍精品 | 香蕉久久夜色精品国产使用方法 | 日本sm残虐另类| 另类小说一区二区三区| 国产精品一区三区| 色综合天天综合狠狠| 欧美日韩在线播放三区四区| 日韩一区二区三区av| 久久综合狠狠综合久久综合88| 国产女同互慰高潮91漫画| 亚洲精品第1页| 日韩和欧美的一区| 国产精品99精品久久免费| 不卡一卡二卡三乱码免费网站| 在线精品视频一区二区三四| 91精品国产日韩91久久久久久| 久久午夜老司机| 亚洲区小说区图片区qvod| 日韩av电影免费观看高清完整版在线观看 | 欧美日韩国产大片| 亚洲精品一区二区三区影院| 国产精品第四页| 日本欧美大码aⅴ在线播放| 国产一区福利在线| 色88888久久久久久影院按摩| 4438亚洲最大| 中文字幕中文字幕一区二区| 天天av天天翘天天综合网 | 波多野结衣在线一区| 欧美片网站yy| 国产精品久久777777| 日本亚洲三级在线| 色综合久久综合网97色综合| 日韩精品在线看片z| 亚洲免费观看视频| 国产精品亚洲а∨天堂免在线| 91成人免费在线视频| 国产欧美一区二区精品性色| 亚洲观看高清完整版在线观看| 国产精品影音先锋| 91麻豆精品国产91久久久资源速度| 国产日韩欧美a| 免费日韩伦理电影| 欧美日韩中字一区| 欧美国产日韩亚洲一区| 久久国产精品色| 久久久久久久久久久电影| 亚洲午夜激情网站| 91在线视频网址| 久久久久99精品国产片| 人人超碰91尤物精品国产| 色久优优欧美色久优优| 国产欧美视频一区二区| 日韩成人av影视| 欧美视频在线观看一区二区| 国产精品区一区二区三区| 狠狠色丁香久久婷婷综合丁香| 欧美日韩国产三级| 一区二区三区日韩欧美| aaa亚洲精品| 亚洲精品在线免费观看视频| 日本亚洲视频在线| 欧美日韩国产综合视频在线观看| 亚洲欧洲国产专区| 成人午夜激情影院| 欧美激情一区二区三区在线| 激情小说欧美图片| 日韩欧美的一区二区| 日本系列欧美系列| 欧美一区午夜视频在线观看 | 色婷婷久久综合| 国产精品国模大尺度视频| 高清不卡一区二区| 国产网红主播福利一区二区| 国产一区二区免费视频| 26uuu色噜噜精品一区二区| 久久99久久99小草精品免视看| 91精品国产综合久久精品app| 图片区小说区国产精品视频| 欧美性生活久久| 亚洲高清久久久| 欧美日韩精品系列| 日本在线播放一区二区三区| 欧美日韩亚洲高清一区二区| 污片在线观看一区二区| 91精品国产91久久久久久一区二区 | 国产精品一区二区久久精品爱涩| 欧美电视剧在线观看完整版| 秋霞午夜鲁丝一区二区老狼| 日韩视频免费直播| 国产一区欧美二区| 国产日韩高清在线| aa级大片欧美| 亚洲第一av色| 日韩写真欧美这视频| 国产尤物一区二区在线| 国产欧美一区二区精品婷婷 | 在线观看国产一区二区| 亚洲成在人线免费| 日韩视频一区二区三区在线播放 | 久久国产精品一区二区| 久久久久久麻豆| 99久久久精品免费观看国产蜜| 亚洲欧美在线另类| 欧美日韩高清影院| 韩国av一区二区| 综合久久国产九一剧情麻豆| 欧美曰成人黄网| 久久国产精品99久久久久久老狼| 久久久久国产精品麻豆| 一本大道久久a久久综合婷婷| 亚洲午夜精品17c| 精品久久99ma| 99久久婷婷国产综合精品电影| 一区二区视频在线| 日韩小视频在线观看专区| 成人综合婷婷国产精品久久蜜臀| 亚洲精品国产a久久久久久| 69av一区二区三区| 粉嫩在线一区二区三区视频| 亚洲美女在线一区| 欧美成人一区二区三区片免费| 成人的网站免费观看| 午夜国产不卡在线观看视频| www精品美女久久久tv| 91看片淫黄大片一级在线观看| 日韩av高清在线观看| 国产精品妹子av| 日韩一级免费一区| 色综合天天性综合| 久草这里只有精品视频| 亚洲人亚洲人成电影网站色| 91麻豆精品国产自产在线| 99视频一区二区三区| 久久精品国产一区二区三区免费看| 国产精品亲子乱子伦xxxx裸| 制服丝袜亚洲播放| av网站免费线看精品| 久久99国产精品免费网站| 一区二区三区资源| 国产日本欧洲亚洲| 欧美一区二区日韩| 在线观看www91| 成人高清视频在线| 裸体一区二区三区| 亚洲韩国精品一区| 中文字幕中文字幕在线一区 | 成人免费视频播放| 久久精品理论片| 午夜欧美一区二区三区在线播放| 一区二区三区鲁丝不卡| 欧美激情一区二区三区在线| 日韩视频国产视频| 欧美三级韩国三级日本一级| 成人一级视频在线观看| 蜜乳av一区二区三区| 天天综合色天天综合| 樱桃国产成人精品视频| 国产精品久久久一本精品| 337p粉嫩大胆噜噜噜噜噜91av| 4438x亚洲最大成人网| 欧美午夜精品久久久久久超碰| www.欧美.com| 夫妻av一区二区| 国产黑丝在线一区二区三区| 麻豆精品在线观看| 免费成人结看片| 日韩国产在线一| 婷婷成人综合网| 性久久久久久久久久久久| 亚洲精品国产精华液| 亚洲人快播电影网|