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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? snmpget.cpp

?? JdonFramework need above jdk 1.4.0 This version has passed under Tomcat 4.x/5.x JBoss 3.x/JBoss 4.0
?? CPP
字號(hào):
/*_############################################################################  _##   _##  snmpGet.cpp    _##  _##  SNMP++v3.2.21a  _##  -----------------------------------------------  _##  Copyright (c) 2001-2006 Jochen Katz, Frank Fock  _##  _##  This software is based on SNMP++2.6 from Hewlett Packard:  _##    _##    Copyright (c) 1996  _##    Hewlett-Packard Company  _##    _##  ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.  _##  Permission to use, copy, modify, distribute and/or sell this software   _##  and/or its documentation is hereby granted without fee. User agrees   _##  to display the above copyright notice and this license notice in all   _##  copies of the software and any documentation of the software. User   _##  agrees to assume all liability for the use of the software;   _##  Hewlett-Packard and Jochen Katz make no representations about the   _##  suitability of this software for any purpose. It is provided   _##  "AS-IS" without warranty of any kind, either express or implied. User   _##  hereby grants a royalty-free license to any and all derivatives based  _##  upon this software code base.   _##    _##  Stuttgart, Germany, Tue Nov 21 22:12:16 CET 2006   _##    _##########################################################################*//*  snmpGet.cpp   Copyright (c) 1996  Hewlett-Packard Company  ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.  Permission to use, copy, modify, distribute and/or sell this software  and/or its documentation is hereby granted without fee. User agrees  to display the above copyright notice and this license notice in all  copies of the software and any documentation of the software. User  agrees to assume all liability for the use of the software; Hewlett-Packard  makes no representations about the suitability of this software for any  purpose. It is provided "AS-IS" without warranty of any kind,either express  or implied. User hereby grants a royalty-free license to any and all  derivatives based upon this software code base.  Peter E. Mellquist*/char snmpget_cpp_version[]="@(#) SNMP++ $Id: snmpGet.cpp,v 1.9 2006/06/16 20:53:15 fock Exp $";#include "snmp_pp/snmp_pp.h"#include <stdlib.h>#include <stdio.h>#ifdef SNMP_PP_NAMESPACEusing namespace Snmp_pp;#endif#if (__GNUC__ > 2)#include <iostream>using std::cerr;using std::cout;using std::endl;using std::flush;#else#include <iostream.h>#endifint main(int argc, char **argv){   //---------[ check the arg count ]----------------------------------------   if ( argc < 2) {	  cout << "Usage:\n";	  cout << argv[0] << " IpAddress | DNSName [Oid] [options]\n";	  cout << "Oid: sysDescr object is default\n";	  cout << "options: -vN , use SNMP version 1, 2 or 3, default is 1\n";	  cout << "         -PPort , remote port to use\n";	  cout << "         -CCommunity_name, specify community default is 'public' \n";	  cout << "         -rN , retries default is N = 1 retry\n";	  cout << "         -tN , timeout in hundredths of seconds; default is N = 100\n";#ifdef _SNMPv3          cout << "         -snSecurityName, " << endl;          cout << "         -slN , securityLevel to use, default N = 3 = authPriv" << endl;          cout << "         -smN , securityModel to use, only default N = 3 = USM possible\n";          cout << "         -cnContextName, default empty string" << endl;          cout << "         -ceContextEngineID, as hex e.g. 800007E580, default empty string" << endl;          cout << "         -authPROT, use authentication protocol NONE, SHA or MD5\n";          cout << "         -privPROT, use privacy protocol NONE, DES, 3DESEDE, IDEA, AES128, AES192 or AES256\n";          cout << "         -uaAuthPassword\n";          cout << "         -upPrivPassword\n";#endif	  return 1;   }   Snmp::socket_startup();  // Initialize socket subsystem   //---------[ make a GenAddress and Oid object to retrieve ]---------------   UdpAddress address( argv[1]);      // make a SNMP++ Generic address   if ( !address.valid()) {           // check validity of address	  cout << "Invalid Address or DNS Name, " << argv[1] << "\n";	  return 1;   }   Oid oid("1.3.6.1.2.1.1.1.0");      // default is sysDescr   if ( argc >= 3) {                  // if 3 args, then use the callers Oid	  if ( strstr( argv[2],"-")==0) {	     oid = argv[2];	     if ( !oid.valid()) {            // check validity of user oid		    cout << "Invalid Oid, " << argv[2] << "\n";		    return 1;         }      }   }   //---------[ determine options to use ]-----------------------------------   snmp_version version=version1;                  // default is v1   int retries=1;                                  // default retries is 1   int timeout=100;                                // default is 1 second   u_short port=161;                               // default snmp port is 161   OctetStr community("public");                   // community name#ifdef _SNMPv3   OctetStr privPassword("");   OctetStr authPassword("");   OctetStr securityName("");   int securityModel = SecurityModel_USM;   int securityLevel = SecurityLevel_authPriv;   OctetStr contextName("");   OctetStr contextEngineID("");   long authProtocol = SNMPv3_usmNoAuthProtocol;   long privProtocol = SNMPv3_usmNoPrivProtocol;   v3MP *v3_MP;#endif   char *ptr;   for(int x=1;x<argc;x++) {                           // parse for version     if ( strstr( argv[x],"-v2")!= 0) {       version = version2c;       continue;     }     if ( strstr( argv[x],"-r")!= 0) {                 // parse for retries       ptr = argv[x]; ptr++; ptr++;       retries = atoi(ptr);       if (( retries<0)|| (retries>5)) retries=1;        continue;     }     if ( strstr( argv[x], "-t")!=0) {                 // parse for timeout       ptr = argv[x]; ptr++; ptr++;       timeout = atoi( ptr);       if (( timeout < 100)||( timeout>500)) timeout=100;       continue;     }     if ( strstr( argv[x],"-C")!=0) {       ptr = argv[x]; ptr++; ptr++;       community = ptr;       continue;     }     if ( strstr( argv[x],"-P")!=0) {       ptr = argv[x]; ptr++; ptr++;       sscanf(ptr, "%hu", &port);       continue;     }#ifdef _SNMPv3     if ( strstr( argv[x],"-v3")!= 0) {       version = version3;       continue;     }     if ( strstr( argv[x],"-auth") != 0) {       ptr = argv[x]; ptr+=5;       if (strcasecmp(ptr, "SHA") == 0)	   authProtocol = SNMP_AUTHPROTOCOL_HMACSHA;       else if (strcasecmp(ptr, "MD5") == 0)	   authProtocol = SNMP_AUTHPROTOCOL_HMACMD5;       else	   authProtocol = SNMP_AUTHPROTOCOL_NONE;       continue;     }     if ( strstr( argv[x],"-priv") != 0) {       ptr = argv[x]; ptr+=5;       if (strcasecmp(ptr, "DES") == 0)	   privProtocol = SNMP_PRIVPROTOCOL_DES;       else if (strcasecmp(ptr, "3DESEDE") == 0)	   privProtocol = SNMP_PRIVPROTOCOL_3DESEDE;       else if (strcasecmp(ptr, "IDEA") == 0)	   privProtocol = SNMP_PRIVPROTOCOL_IDEA;       else if (strcasecmp(ptr, "AES128") == 0)	   privProtocol = SNMP_PRIVPROTOCOL_AES128;       else if (strcasecmp(ptr, "AES192") == 0)	   privProtocol = SNMP_PRIVPROTOCOL_AES192;       else if (strcasecmp(ptr, "AES256") == 0)	   privProtocol = SNMP_PRIVPROTOCOL_AES256;       else	   privProtocol = SNMP_PRIVPROTOCOL_NONE;       printf("\n\nPrivProt : %ld\n", privProtocol);       continue;     }     if ( strstr( argv[x],"-sn")!=0) {       ptr = argv[x]; ptr+=3;       securityName = ptr;       continue;      }     if ( strstr( argv[x], "-sl")!=0) {       ptr = argv[x]; ptr+=3;       securityLevel = atoi( ptr);       if (( securityLevel < SecurityLevel_noAuthNoPriv) ||           ( securityLevel > SecurityLevel_authPriv))         securityLevel = SecurityLevel_authPriv;       continue;     }     if ( strstr( argv[x], "-sm")!=0) {       ptr = argv[x]; ptr+=3;       securityModel = atoi( ptr);       if (( securityModel < SecurityModel_v1) ||           ( securityModel > SecurityModel_USM))         securityModel = SecurityModel_USM;       continue;     }     if ( strstr( argv[x],"-cn")!=0) {       ptr = argv[x]; ptr+=3;       contextName = ptr;       continue;     }     if ( strstr( argv[x],"-ce")!=0) {       ptr = argv[x]; ptr+=3;       contextEngineID = OctetStr::from_hex_string(ptr);       continue;     }     if ( strstr( argv[x],"-ua")!=0) {       ptr = argv[x]; ptr+=3;       authPassword = ptr;       continue;     }     if ( strstr( argv[x],"-up")!=0) {       ptr = argv[x]; ptr+=3;       privPassword = ptr;       continue;     }#endif  }   //----------[ create a SNMP++ session ]-----------------------------------   int status;   // bind to any port and use IPv6 if needed   Snmp snmp(status, 0, (address.get_ip_version() == Address::version_ipv6));   if ( status != SNMP_CLASS_SUCCESS) {      cout << "SNMP++ Session Create Fail, " << snmp.error_msg(status) << "\n";      return 1;   }   //---------[ init SnmpV3 ]--------------------------------------------#ifdef _SNMPv3   if (version == version3) {     char *engineId = "snmpGet";     char *filename = "snmpv3_boot_counter";     unsigned int snmpEngineBoots = 0;     int status;     status = getBootCounter(filename, engineId, snmpEngineBoots);     if ((status != SNMPv3_OK) && (status < SNMPv3_FILEOPEN_ERROR))     {       cout << "Error loading snmpEngineBoots counter: " << status << endl;       return 1;     }     snmpEngineBoots++;     status = saveBootCounter(filename, engineId, snmpEngineBoots);     if (status != SNMPv3_OK)     {       cout << "Error saving snmpEngineBoots counter: " << status << endl;       return 1;     }     int construct_status;     v3_MP = new v3MP(engineId, snmpEngineBoots, construct_status);     USM *usm = v3_MP->get_usm();     usm->add_usm_user(securityName,		       authProtocol, privProtocol,		       authPassword, privPassword);   }   else   {     // MUST create a dummy v3MP object if _SNMPv3 is enabled!     int construct_status;     v3_MP = new v3MP("dummy", 0, construct_status);   }#endif   //--------[ build up SNMP++ object needed ]-------------------------------   Pdu pdu;                               // construct a Pdu object   Vb vb;                                 // construct a Vb object   vb.set_oid( oid);                      // set the Oid portion of the Vb   pdu += vb;                             // add the vb to the Pdu   address.set_port(port);   CTarget ctarget( address);             // make a target using the address#ifdef _SNMPv3   UTarget utarget( address);   if (version == version3) {     utarget.set_version( version);          // set the SNMP version SNMPV1 or V2 or V3     utarget.set_retry( retries);            // set the number of auto retries     utarget.set_timeout( timeout);          // set timeout     utarget.set_security_model( securityModel);     utarget.set_security_name( securityName);     pdu.set_security_level( securityLevel);     pdu.set_context_name (contextName);     pdu.set_context_engine_id(contextEngineID);   }   else {#endif     ctarget.set_version( version);         // set the SNMP version SNMPV1 or V2     ctarget.set_retry( retries);           // set the number of auto retries     ctarget.set_timeout( timeout);         // set timeout     ctarget.set_readcommunity( community); // set the read community name#ifdef _SNMPv3   }#endif   //-------[ issue the request, blocked mode ]-----------------------------   cout << "SNMP++ Get to " << argv[1] << " SNMPV" #ifdef _SNMPv3        << ((version==version3) ? (version) : (version+1))#else        << (version+1)#endif        << " Retries=" << retries        << " Timeout=" << timeout * 10 <<"ms";#ifdef _SNMPv3   if (version == version3)     cout << endl          << "securityName= " << securityName.get_printable()          << ", securityLevel= " << securityLevel          << ", securityModel= " << securityModel << endl          << "contextName= " << contextName.get_printable()          << ", contextEngineID= " << contextEngineID.get_printable()          << endl;   else#endif     cout << " Community=" << community.get_printable() << endl << flush;   SnmpTarget *target;#ifdef _SNMPv3   if (version == version3)     target = &utarget;   else#endif     target = &ctarget;   status = snmp.get( pdu, *target);   if (status == SNMP_CLASS_SUCCESS)   {     pdu.get_vb( vb,0);#ifdef _SNMPv3     if (pdu.get_type() == REPORT_MSG) {       cout << "Received a report pdu: "            << snmp.error_msg(vb.get_printable_oid()) << endl;     }#endif     cout << "Oid = " << vb.get_printable_oid() << endl          << "Value = " << vb.get_printable_value() << endl;     if ((vb.get_syntax() == sNMP_SYNTAX_ENDOFMIBVIEW) ||         (vb.get_syntax() == sNMP_SYNTAX_NOSUCHINSTANCE) ||         (vb.get_syntax() == sNMP_SYNTAX_NOSUCHOBJECT))       cout << "Exception: " << vb.get_syntax() << " occured." << endl;   }   else   {     cout << "SNMP++ Get Error, " << snmp.error_msg( status)	  << " (" << status <<")" << endl;   }   Snmp::socket_cleanup();  // Shut down socket subsystem}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区高清在线观看| 欧美一区二区啪啪| 日韩福利视频导航| 国产精品第四页| 欧美一级日韩免费不卡| 一本到不卡精品视频在线观看| 日韩高清中文字幕一区| 亚洲精品你懂的| 欧美高清在线一区二区| 欧美一二区视频| 欧美综合在线视频| 97精品电影院| 成人性视频免费网站| 久久精品国产在热久久| 亚洲成人777| 一区二区三区精品在线| 国产精品国产三级国产普通话三级 | 欧美成人女星排行榜| 欧美性受极品xxxx喷水| 99久久亚洲一区二区三区青草| 精品亚洲欧美一区| 久久精品国产亚洲高清剧情介绍| 亚洲国产精品一区二区www在线| 亚洲欧洲日产国产综合网| 久久久噜噜噜久噜久久综合| 精品久久久久久最新网址| 91麻豆精品国产91久久久| 欧美日本免费一区二区三区| 欧美在线制服丝袜| 色噜噜偷拍精品综合在线| 91蜜桃传媒精品久久久一区二区| 国产91丝袜在线播放| 粉嫩一区二区三区性色av| 国产一区二区三区国产| 国产精品一卡二卡| 国产精品综合一区二区| 国产精品一区免费视频| 国产一区激情在线| 韩国精品在线观看| 国产精品一区二区视频| 国产成人精品一区二区三区四区| 国模冰冰炮一区二区| 国产乱码精品一区二区三区五月婷| 麻豆精品久久精品色综合| 九九精品视频在线看| 国产一区二区三区蝌蚪| 成人理论电影网| 色猫猫国产区一区二在线视频| 91免费在线视频观看| 日本高清不卡一区| 欧美日韩黄色影视| 精品免费一区二区三区| 久久久不卡影院| 亚洲色图在线播放| 一区二区免费在线播放| 亚洲一区av在线| 日本中文字幕一区二区有限公司| 麻豆精品一区二区| 国产成a人无v码亚洲福利| 大胆欧美人体老妇| 在线精品视频小说1| 91精品久久久久久久99蜜桃| 久久色中文字幕| 国产精品理伦片| 国产一区二区三区香蕉| 91小视频在线观看| 日韩免费看的电影| 国产精品天美传媒| 亚洲国产精品一区二区久久| 久久精品国产色蜜蜜麻豆| 成人一级片网址| 欧美在线观看一二区| 日韩欧美卡一卡二| 国产精品久久久久久久久免费相片 | 欧美日韩大陆一区二区| 欧美v日韩v国产v| 中文字幕日本乱码精品影院| 亚洲bt欧美bt精品| 国产一区福利在线| 欧美影院一区二区| 久久久综合精品| 亚洲电影在线播放| 国产在线不卡一区| 91久久一区二区| 26uuu亚洲| 一区二区三区不卡视频在线观看| 久久超级碰视频| 色综合久久综合网| 久久午夜老司机| 亚洲国产精品自拍| 成人午夜视频福利| 日韩欧美精品在线| 亚洲欧美国产毛片在线| 精品中文字幕一区二区| 欧美亚洲日本国产| 国产精品美女一区二区在线观看| 婷婷六月综合亚洲| 99久久精品费精品国产一区二区| 日韩一区和二区| 夜夜爽夜夜爽精品视频| 国产精品一区二区在线看| 91精品国产丝袜白色高跟鞋| 最新国产成人在线观看| 国产毛片精品视频| 欧美浪妇xxxx高跟鞋交| 亚洲人成在线播放网站岛国| 国产一区999| 日韩亚洲欧美中文三级| 亚洲成人www| 日本道在线观看一区二区| 国产日产欧产精品推荐色| 美女视频一区在线观看| 欧美三区在线观看| 亚洲女爱视频在线| 成人app在线| 中文字幕av免费专区久久| 久久精品二区亚洲w码| 欧美丰满少妇xxxxx高潮对白| 亚洲美女淫视频| 不卡av在线免费观看| 亚洲国产精华液网站w| 国产一区二区三区免费播放| 日韩视频一区二区三区| 日本成人在线网站| 欧美精品一卡二卡| 午夜日韩在线观看| 欧美日韩国产一级片| 亚洲国产一区视频| 欧美制服丝袜第一页| 亚洲综合激情小说| 亚洲欧美一区二区在线观看| 国产精品一区二区三区乱码| 久久免费偷拍视频| 国产一区二区三区免费播放| 337p粉嫩大胆噜噜噜噜噜91av| 激情综合色丁香一区二区| 精品乱码亚洲一区二区不卡| 强制捆绑调教一区二区| 欧美一区二区三区小说| 麻豆91精品视频| 精品国产青草久久久久福利| 激情五月播播久久久精品| 国产三级精品三级在线专区| 高清久久久久久| 亚洲色图一区二区| 欧美日韩成人激情| 老司机精品视频导航| 久久精品人人做人人爽97| 成人免费三级在线| 一区二区三区成人| 91精品婷婷国产综合久久竹菊| 蜜臀精品久久久久久蜜臀| 欧美精品一区二区三区蜜桃视频| 国产精品一区二区在线观看网站| 国产精品天干天干在线综合| 色欧美乱欧美15图片| 午夜激情一区二区三区| 日韩女优电影在线观看| 久久se精品一区二区| 久久精品一二三| 色哟哟一区二区三区| 日韩vs国产vs欧美| 国产三级欧美三级日产三级99| 本田岬高潮一区二区三区| 亚洲一区二区av在线| 日韩午夜电影在线观看| 成人午夜视频网站| 亚洲成国产人片在线观看| 欧美成人福利视频| 99这里只有久久精品视频| 午夜一区二区三区视频| 久久精品亚洲国产奇米99| 91美女福利视频| 久久se精品一区二区| 亚洲精品成人少妇| 欧美不卡一区二区三区| 不卡的av在线| 美国av一区二区| 亚洲欧美日本韩国| wwwwww.欧美系列| 在线观看免费成人| 国产精品18久久久久久久久| 亚洲乱码国产乱码精品精98午夜| 欧美一级欧美三级在线观看| www.av亚洲| 久久99国产精品久久99果冻传媒| 亚洲视频一区二区免费在线观看| 欧美一级高清片| 91免费精品国自产拍在线不卡| 麻豆精品视频在线观看视频| 一区二区三区精密机械公司| 久久久精品免费免费| 欧美老肥妇做.爰bbww视频| 99久久婷婷国产综合精品电影| 日韩av在线播放中文字幕| 亚洲免费av在线| 国产精品国产成人国产三级| 欧美大片在线观看| 欧美日韩免费不卡视频一区二区三区| 国v精品久久久网|