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

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

?? snmpbulk.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
字號:
/*_############################################################################  _##   _##  snmpBulk.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   _##    _##########################################################################*//*  snmpBulk.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 snmpbulk_cpp_version[]="@(#) SNMP++ $Id: snmpBulk.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 WIN32#define strcasecmp stricmp#endif#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 << "snmpBulk IpAddress | DNSName [Oid [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";	  cout << "         -nN , non-repeaters default is N = 0\n";	  cout << "         -mN , max-repetitions default is  N = 1\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;   }   Pdu pdu;                              // construct a Pdu object   Vb vb;                                // construct a Vb object   if ( argc >= 3) {                  // if 3 args, then use the callers Oid	int i=2;	while ((strstr(argv[i],"-")==0) && (i<argc)) {		Oid oid(argv[i]);		if ( !oid.valid()) {            // check validity of user oid			cout << "Invalid Oid, " << argv[2] << "\n";			return -2;		}		vb.set_oid(oid);		pdu += vb;		i++;	}   }   else {     Oid oid("1.3.6.1.2.1.1.1");      // default is sysDescr     vb.set_oid(oid);     pdu += vb;                            // add the vb to the Pdu   }   //---------[ 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   int non_reps=0;                                 // non repeaters default is 0   int max_reps=1;                                 // maximum repetitions default is 1#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],"-n")!=0) {                 // parse for non repeaters       ptr = argv[x];ptr++;ptr++;       non_reps=atoi( ptr);       if (( non_reps < 0)||( non_reps>10)) non_reps=0;     }     if ( strstr( argv[x],"-m")!=0) {                 // parse for max repetitions        ptr = argv[x];ptr++;ptr++;       max_reps=atoi( ptr);       if ( max_reps < 0) max_reps=1;     }     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 = "snmpBulk";     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 ]-------------------------------   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++ GetBulk to " << argv[1] << " SNMPV" #ifdef _SNMPv3        << ((version==version3) ? (version) : (version+1))#else        << (version+1)#endif        << " Retries=" << retries	<< " Timeout=" << timeout * 10 << "ms"	<< " Non Reptrs=" << non_reps	<< " Max Reps=" << max_reps << endl;#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;   if (( status = snmp.get_bulk( pdu,*target,non_reps,max_reps))== SNMP_CLASS_SUCCESS) {     for ( int z=0;z<pdu.get_vb_count();z++) {       pdu.get_vb( vb,z);#ifdef _SNMPv3       if (pdu.get_type() == REPORT_MSG) {         Oid tmp;         vb.get_oid(tmp);         cout << "Received a reportPdu: "              << snmp.error_msg( tmp)               << endl              << vb.get_printable_oid() << " = "              << vb.get_printable_value() << endl;       }#endif       cout << "Oid = " << vb.get_printable_oid() << "\n";       if ( vb.get_syntax() != sNMP_SYNTAX_ENDOFMIBVIEW) {	 cout << "Value = " << vb.get_printable_value() << "\n\n";       }       else {	 cout << "End of MIB view.\n\n";       }     }   }   else     cout << "SNMP++ GetBulk Error, " << snmp.error_msg( status) << "\n";   Snmp::socket_cleanup();  // Shut down socket subsystem}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
a亚洲天堂av| 精品免费国产一区二区三区四区| 99国产欧美另类久久久精品| 色婷婷精品久久二区二区蜜臀av| 色欧美片视频在线观看| 欧美日韩精品是欧美日韩精品| 日韩三级.com| 亚洲国产精品国自产拍av| 亚洲麻豆国产自偷在线| 日韩国产在线一| 粉嫩高潮美女一区二区三区 | 欧美亚洲禁片免费| 日韩欧美高清在线| 亚洲欧美日本在线| 奇米影视一区二区三区小说| 不卡的av中国片| 日韩一级大片在线观看| 国产精品久久久久久久久久久免费看 | 亚洲乱码国产乱码精品精可以看| 日本不卡一区二区三区| 99久久国产综合精品色伊| 91精品国产综合久久福利| 日韩毛片精品高清免费| 国产精一品亚洲二区在线视频| 欧美在线一二三| 日韩一区二区三区三四区视频在线观看 | 国产91精品一区二区麻豆网站| 欧美亚洲国产一区在线观看网站 | 99久久国产综合精品色伊| 日韩欧美国产三级电影视频| 亚洲一级片在线观看| 国产精一品亚洲二区在线视频| 91麻豆国产精品久久| 日韩午夜激情视频| 天天色天天操综合| 在线精品视频免费观看| 国产精品久久夜| 麻豆视频一区二区| 91精品国产色综合久久不卡电影| 一区二区三区影院| 国产在线视频不卡二| 欧美蜜桃一区二区三区| 亚洲高清久久久| 欧亚一区二区三区| 一区二区三区电影在线播| 91亚洲国产成人精品一区二区三| 91精品在线麻豆| 亚洲在线成人精品| av一本久道久久综合久久鬼色| 久久久久久久电影| 蜜桃一区二区三区在线| 欧美一区二区性放荡片| 日韩国产一区二| 3d动漫精品啪啪一区二区竹菊| 午夜电影网一区| 8x福利精品第一导航| 麻豆精品蜜桃视频网站| 日韩欧美国产成人一区二区| 亚洲超碰精品一区二区| 51久久夜色精品国产麻豆| 一区二区三区在线看| aaa亚洲精品一二三区| 亚洲欧美日韩电影| 色综合中文字幕国产 | 欧美xxxxx牲另类人与| 亚洲黄色小说网站| 99精品视频一区| 亚洲丝袜另类动漫二区| 不卡视频一二三| 亚洲视频图片小说| 91久久香蕉国产日韩欧美9色| 一区二区三区加勒比av| 欧美三级在线看| 国产在线国偷精品产拍免费yy| 国产精品视频yy9299一区| 91久久精品网| 久久福利视频一区二区| 国产精品你懂的在线欣赏| 久久久综合视频| jlzzjlzz亚洲日本少妇| 亚洲高清久久久| 久久久久一区二区三区四区| 97成人超碰视| 免费成人在线观看| 中文字幕一区二| 欧美精选午夜久久久乱码6080| 激情深爱一区二区| 亚洲免费观看高清完整版在线| 欧美丰满嫩嫩电影| 成人av资源网站| 日韩在线一二三区| 国产日韩一级二级三级| 欧美日韩综合色| 国产高清亚洲一区| 亚洲高清久久久| 国产精品美女久久久久av爽李琼| 欧美中文字幕一区二区三区亚洲| 麻豆精品在线视频| 亚洲在线观看免费视频| 国产欧美一区二区精品仙草咪| 欧美探花视频资源| 国产91综合网| 美女一区二区视频| 亚洲第一二三四区| 中文字幕中文在线不卡住| 欧美一级一级性生活免费录像| 99久久久久久| 美女精品一区二区| 亚洲一区二区四区蜜桃| 欧美精品一区二区久久久| 91丨porny丨最新| 国产一区二区三区国产| 免费成人美女在线观看.| 亚洲图片有声小说| 国产精品黄色在线观看| 国产性色一区二区| 久久亚洲捆绑美女| 精品美女被调教视频大全网站| 欧美日韩你懂得| 欧美私人免费视频| 色综合天天综合在线视频| 成人免费视频app| 91久久国产最好的精华液| 91蜜桃免费观看视频| 国产成人精品一区二区三区四区| 美女在线观看视频一区二区| 中文字幕一区二区三区av| 久久久综合视频| 久久久蜜桃精品| 精品久久一区二区三区| 久久综合九色综合欧美就去吻 | ...av二区三区久久精品| 久久久精品人体av艺术| 久久精品水蜜桃av综合天堂| 91麻豆精品国产无毒不卡在线观看| 欧美日韩你懂的| 8x8x8国产精品| 精品国产乱码久久久久久夜甘婷婷 | 日韩亚洲欧美在线观看| 日韩一区二区视频| 亚洲精品一区二区三区影院| 久久亚洲一区二区三区四区| 精品国产百合女同互慰| 精品福利在线导航| 国产午夜一区二区三区| 国产精品久久久久久久久晋中 | 欧美在线视频全部完| 色婷婷久久久久swag精品| 色欧美乱欧美15图片| 在线观看91视频| 日韩午夜在线观看| 久久精品一区八戒影视| 国产精品女上位| 亚洲综合久久久久| 另类小说欧美激情| 国产白丝网站精品污在线入口| 不卡av在线免费观看| 91小视频在线观看| 91精品国产综合久久蜜臀| 五月天亚洲精品| 亚洲va天堂va国产va久| 一二三区精品福利视频| 亚洲国产欧美在线人成| 狠狠色综合色综合网络| 国产精品一区二区x88av| 99久久婷婷国产综合精品| 91.麻豆视频| 国产精品美女一区二区三区| 亚洲成a人v欧美综合天堂下载 | 一区二区三区四区亚洲| 午夜视频久久久久久| 美国一区二区三区在线播放| 国产.欧美.日韩| 欧美精品高清视频| 欧美激情一区在线观看| 国产精品成人一区二区三区夜夜夜 | 日韩三级伦理片妻子的秘密按摩| 国产女主播一区| 无吗不卡中文字幕| 成人av在线电影| 欧美哺乳videos| 亚洲国产综合人成综合网站| 激情丁香综合五月| 欧美日韩的一区二区| 日本一区二区电影| 日韩电影在线免费观看| 91丨porny丨最新| 久久亚洲二区三区| 亚洲成人激情自拍| 色综合咪咪久久| 国产午夜精品美女毛片视频| 亚洲高清免费视频| 91网站黄www| 国产日韩精品一区二区三区在线| 午夜欧美电影在线观看| 色综合天天综合网国产成人综合天| 欧美成人精精品一区二区频| 亚洲综合在线五月| 99久久婷婷国产综合精品电影| 久久久蜜桃精品|