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

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

?? snmppasswd.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):
/*_############################################################################  _##   _##  snmpPasswd.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   _##    _##########################################################################*/char snmppasswd_cpp_version[]="@(#) SNMP++ $Id: snmpPasswd.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>#endif#ifdef _SNMPv3USM *usm;void KeyChange(Snmp* snmp, Pdu& myPdu, 	       const OctetStr& user, const OctetStr& newpass, 	       SnmpTarget& target, int type){  struct UsmKeyUpdate *uku = NULL;  int stat;  int status;  uku = usm->key_update_prepare(user, target, newpass,				myPdu, type, stat);  if (uku == NULL)    cout << "Key update preparation failed *************" << endl         << "with " << snmp->error_msg(stat) << endl <<endl;  if (( status = snmp->set( myPdu,target)) == SNMP_CLASS_SUCCESS) {    Vb vb3;    Oid oid3;    myPdu.get_vb( vb3,0);    vb3.get_oid(oid3);    Vb vb4;    Oid oid4;    myPdu.get_vb( vb4,1);    vb4.get_oid(oid4);    if (myPdu.get_type() == REPORT_MSG) {      cout << "Received a reportPDU! with Oid "            << oid3.get_printable() << endl           << snmp->error_msg(oid3) << endl;      usm->key_update_abort(uku);    }     else {      cout << flush << endl           << "Oid = " << vb3.get_printable_oid() << endl           << "Value = " << vb3.get_printable_value() << endl;      cout << flush << endl            << "Oid = " << vb4.get_printable_oid() << endl           << "Value = " << vb4.get_printable_value() << endl;      int resul = usm->key_update_commit(uku, USM_PasswordAllKeyUpdate);      cout << endl  << "result of local key update: "            << resul << endl;    }  }  else {    cout << "SNMP++ KeyChange Error, " << snmp->error_msg( status)	 << " (" << status <<")"<< endl;    usm->key_update_abort(uku);  }    cout << "******************************** END"        << endl << endl << flush;}int main(int argc, char **argv){   //---------[ check the arg count ]----------------------------------------   if ( argc < 4) {	  cout << "Usage:\n";	  cout << "snmpPasswd IpAddress | DNSName user newpassword [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 << "         -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";	  cout << "         -eEngineID, as hex\n";	  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;   }   OctetStr newUser, newPassword;   if (((strstr( argv[2],"-")==0) && (strstr( argv[3],"-")==0))) {	newUser = argv[2];	newPassword = argv[3];   }   else   {     cout << "wrong parameters..." << endl;     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   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;   OctetStr engineID;   v3MP *v3_MP;   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;     }     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;     }     if ( strstr( argv[x],"-e")!=0) {       ptr = argv[x]; ptr+=2;       engineID = OctetStr::from_hex_string(ptr);       continue;     }   }   //----------[ 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 ]--------------------------------------------   if (version == version3) {     OctetStr engineId = "snmpPasswd";     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 = 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);   }   //--------[ build up SNMP++ object needed ]-------------------------------   Pdu pdu;                               // construct a Pdu object   Vb vb;                                 // construct a Vb object   vb.set_oid(Oid("1.3.6.1.2.1.1.1.0"));  // 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   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 {     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   }   //-------[ issue the request, blocked mode ]-----------------------------   cout << "SNMP++ Get to " << argv[1] << " SNMPV"         << ((version==version3) ? (version) : (version+1))         << " Retries=" << retries        << " Timeout=" << timeout * 10 <<"ms";    if (version == version3)     cout << endl          << "securityName= " << securityName.get_printable()          << ", securityLevel= " << securityLevel          << ", securityModel= " << securityModel << endl          << "contextName= " << contextName.get_printable()          << ", contextEngineID= " << contextEngineID.get_printable()          << endl;   else     cout << " Community=" << community.get_printable() << endl << flush;   SnmpTarget *target;   if (version == version3)     target = &utarget;   else     target = &ctarget;   Pdu pduKeyChange;   if (version == version3) {     pduKeyChange.set_security_level( securityLevel);     pduKeyChange.set_context_name (contextName);     pduKeyChange.set_context_engine_id(contextEngineID);   }      snmp.get( pdu, *target);   KeyChange(&snmp, pduKeyChange, newUser, newPassword, *target, AUTHKEY);   Snmp::socket_cleanup();  // Shut down socket subsystem} #else#include <stdio.h>int main(){  printf("This example needs _SNMPv3 defined.\n");}#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产美女精品一区二区三区| 日韩成人精品在线| 欧美一区二区三级| 99久久99久久精品免费观看| 麻豆精品新av中文字幕| 国产麻豆日韩欧美久久| 一区二区三区免费| 久久伊99综合婷婷久久伊| 色视频一区二区| 国产成人av电影| 久久精品国内一区二区三区| 亚洲激情成人在线| 亚洲欧洲精品成人久久奇米网 | 欧美日韩国产精品自在自线| 国产另类ts人妖一区二区| 亚洲午夜久久久久| 亚洲人成在线观看一区二区| 国产婷婷色一区二区三区在线| 91麻豆精品国产91久久久| 日本久久一区二区| av在线不卡观看免费观看| 国产精品自在在线| 久久精品国产在热久久| 三级精品在线观看| 午夜亚洲国产au精品一区二区| 成人免费小视频| 国产精品久久久久一区二区三区 | 91麻豆精品国产91久久久久| 一本久道久久综合中文字幕| 99久久精品国产一区| 国产99久久久精品| 国产黄人亚洲片| 国产美女精品在线| 国产精品一二三区在线| 国产中文字幕精品| 国产一区二区三区四| 国产在线观看免费一区| 国产乱色国产精品免费视频| 久久99精品一区二区三区| 久久精品国产免费| 国产乱码精品一区二区三区五月婷| 热久久久久久久| 久久国内精品视频| 国模娜娜一区二区三区| 国产福利一区在线观看| 国产999精品久久| www.综合网.com| 色综合天天综合狠狠| 日本乱人伦一区| 欧美嫩在线观看| 日韩欧美一区在线观看| 精品久久久久久久人人人人传媒 | 日本一区二区三区四区| 国产精品视频你懂的| 亚洲欧洲性图库| 一区二区三国产精华液| 亚洲国产精品自拍| 欧美影院一区二区| 欧美性做爰猛烈叫床潮| 91精品国产色综合久久久蜜香臀| 日韩欧美成人激情| 欧美国产精品一区二区| 亚洲免费视频成人| 午夜欧美电影在线观看| 久久99精品国产麻豆婷婷| 国产大陆亚洲精品国产| 91丝袜高跟美女视频| 69p69国产精品| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美国产综合一区二区| 亚洲一区二区三区自拍| 琪琪久久久久日韩精品| 国产成人8x视频一区二区| 在线免费不卡视频| 日韩女优电影在线观看| 国产精品成人一区二区三区夜夜夜| 亚洲午夜免费电影| 激情文学综合插| 97久久精品人人做人人爽| 欧美丰满少妇xxxbbb| 久久众筹精品私拍模特| 亚洲精品国产一区二区精华液 | 成人教育av在线| 欧美系列在线观看| 国产亚洲福利社区一区| 亚洲自拍偷拍九九九| 国产精品一品二品| 欧美日产国产精品| 中文子幕无线码一区tr| 日韩国产欧美三级| 97国产一区二区| 日韩你懂的在线观看| 亚洲欧洲国产日韩| 精品系列免费在线观看| 在线看日韩精品电影| 久久久亚洲精华液精华液精华液| 亚洲主播在线播放| 国产69精品久久99不卡| 91精品国产欧美日韩| 亚洲三级理论片| 岛国精品一区二区| 欧美一区二区精品久久911| 亚洲免费资源在线播放| 国产一区二区三区香蕉 | 久久欧美中文字幕| 亚洲不卡一区二区三区| 99热精品国产| 欧美激情一区二区三区| 精品一区二区三区av| 欧美日韩一区二区不卡| 亚洲丝袜美腿综合| 丁香五精品蜜臀久久久久99网站| 欧美电影免费观看高清完整版在线 | 国产原创一区二区三区| 欧美日韩日日摸| 亚洲男人的天堂在线观看| 粉嫩绯色av一区二区在线观看 | 亚洲人成在线观看一区二区| 国产在线播放一区二区三区| 日韩一级黄色片| 天天综合色天天| 日本韩国一区二区| 亚洲色图视频免费播放| 成人免费观看av| 中文字幕乱码一区二区免费| 精品一区二区在线播放| 日韩欧美国产成人一区二区| 丝袜国产日韩另类美女| 欧美日韩国产综合视频在线观看 | 欧美三区在线视频| 一区二区激情视频| 日本福利一区二区| 亚洲欧美视频在线观看视频| av亚洲精华国产精华精华| 国产精品久久久久久久第一福利| 国产91精品露脸国语对白| 国产视频不卡一区| 成人精品一区二区三区四区| 欧美—级在线免费片| 不卡视频一二三四| 亚洲精品高清视频在线观看| 色一情一伦一子一伦一区| 亚洲综合小说图片| 欧美美女bb生活片| 蜜芽一区二区三区| 精品国产乱码久久久久久1区2区| 激情六月婷婷综合| 久久精品人人爽人人爽| 成人免费高清视频在线观看| 亚洲日本在线视频观看| 日本电影亚洲天堂一区| 亚洲第一搞黄网站| 日韩欧美一区二区在线视频| 国产在线精品一区二区夜色| 久久精品水蜜桃av综合天堂| 成人一区二区三区视频在线观看| 国产精品国产精品国产专区不蜜 | 日本高清不卡aⅴ免费网站| 亚洲一二三四久久| 欧美一区二区三区小说| 国产在线观看免费一区| 国产精品理论在线观看| 欧洲色大大久久| 欧美日本高清视频在线观看| 欧美a一区二区| 欧美激情在线看| 欧美午夜精品免费| 久久国产精品区| 亚洲欧美在线视频| 欧美精品久久一区二区三区| 韩国欧美一区二区| 亚洲裸体xxx| 日韩欧美一卡二卡| 91在线观看美女| 青青青伊人色综合久久| 国产精品天干天干在观线| 在线视频一区二区三| 激情国产一区二区| 亚洲欧美aⅴ...| 精品少妇一区二区三区| 91在线一区二区三区| 琪琪久久久久日韩精品| 亚洲视频一区二区免费在线观看| 91精品久久久久久久99蜜桃| 成人一区在线看| 日韩av在线播放中文字幕| 国产精品三级在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 日韩精品1区2区3区| 国产精品午夜久久| 日韩一级二级三级| 99re这里只有精品6| 国产一区二区剧情av在线| 亚洲国产日韩在线一区模特| 久久在线观看免费| 欧美日韩精品欧美日韩精品一综合| 国产成人自拍高清视频在线免费播放| 亚洲国产精品自拍| 亚洲视频小说图片| 久久精品无码一区二区三区|