⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 if_mib.cpp

📁 JdonFramework need above jdk 1.4.0This version has passed under Tomcat 4.x/5.x JBoss 3.x/JBoss 4.0.0
💻 CPP
📖 第 1 页 / 共 3 页
字号:
//--AgentGen BEGIN=ifTestId//--AgentGen END/** *  ifTestStatus * */ifTestStatus::ifTestStatus(const Oidx& id):   MibLeaf(id, READWRITE, new SnmpInt32()){	//--AgentGen BEGIN=ifTestStatus::ifTestStatus	//--AgentGen END}ifTestStatus::~ifTestStatus(){	//--AgentGen BEGIN=ifTestStatus::~ifTestStatus	//--AgentGen END}MibEntryPtr ifTestStatus::clone(){	MibEntryPtr other = new ifTestStatus(oid);	((ifTestStatus*)other)->replace_value(value->clone());	((ifTestStatus*)other)->set_reference_to_table(my_table);	//--AgentGen BEGIN=ifTestStatus::clone	//--AgentGen END	return other;}void ifTestStatus::get_request(Request* req, int ind){	//--AgentGen BEGIN=ifTestStatus::get_request	//--AgentGen END	MibLeaf::get_request(req, ind);}long ifTestStatus::get_state(){	return (long)*((SnmpInt32*)value);}void ifTestStatus::set_state(long l){	//--AgentGen BEGIN=ifTestStatus::set_state	//--AgentGen END	*((SnmpInt32*)value) = l;}int ifTestStatus::set(const Vbx& vb){	//--AgentGen BEGIN=ifTestStatus::set	//--AgentGen END	return MibLeaf::set(vb);}boolean ifTestStatus::value_ok(const Vbx& vb){	long v;	vb.get_value(v);	if ((v != 1)	     && (v != 2)) return FALSE;	//--AgentGen BEGIN=ifTestStatus::value_ok	//--AgentGen END	return TRUE;}int ifTestStatus::prepare_set_request(Request* req, int& ind){	int status;	if ((status = MibLeaf::prepare_set_request(req, ind)) !=	    SNMP_ERROR_SUCCESS) return status;	//--AgentGen BEGIN=ifTestStatus::prepare_set_request	//--AgentGen END	return SNMP_ERROR_SUCCESS;}//--AgentGen BEGIN=ifTestStatus//--AgentGen END/** *  ifTestType * */ifTestType::ifTestType(const Oidx& id):   MibLeaf(id, READWRITE, new Oid()){	//--AgentGen BEGIN=ifTestType::ifTestType	//--AgentGen END}ifTestType::~ifTestType(){	//--AgentGen BEGIN=ifTestType::~ifTestType	//--AgentGen END}MibEntryPtr ifTestType::clone(){	MibEntryPtr other = new ifTestType(oid);	((ifTestType*)other)->replace_value(value->clone());	((ifTestType*)other)->set_reference_to_table(my_table);	//--AgentGen BEGIN=ifTestType::clone	//--AgentGen END	return other;}void ifTestType::get_request(Request* req, int ind){	//--AgentGen BEGIN=ifTestType::get_request	//--AgentGen END	MibLeaf::get_request(req, ind);}int ifTestType::set(const Vbx& vb){	//--AgentGen BEGIN=ifTestType::set	//--AgentGen END	return MibLeaf::set(vb);}boolean ifTestType::value_ok(const Vbx& vb){	//--AgentGen BEGIN=ifTestType::value_ok	//--AgentGen END	return TRUE;}int ifTestType::prepare_set_request(Request* req, int& ind){	int status;	if ((status = MibLeaf::prepare_set_request(req, ind)) !=	    SNMP_ERROR_SUCCESS) return status;	//--AgentGen BEGIN=ifTestType::prepare_set_request	//--AgentGen END	return SNMP_ERROR_SUCCESS;}//--AgentGen BEGIN=ifTestType//--AgentGen END/** *  ifTestOwner * */ifTestOwner::ifTestOwner(const Oidx& id):   MibLeaf(id, READWRITE, new OctetStr()){	//--AgentGen BEGIN=ifTestOwner::ifTestOwner	//--AgentGen END}ifTestOwner::~ifTestOwner(){	//--AgentGen BEGIN=ifTestOwner::~ifTestOwner	//--AgentGen END}MibEntryPtr ifTestOwner::clone(){	MibEntryPtr other = new ifTestOwner(oid);	((ifTestOwner*)other)->replace_value(value->clone());	((ifTestOwner*)other)->set_reference_to_table(my_table);	//--AgentGen BEGIN=ifTestOwner::clone	//--AgentGen END	return other;}void ifTestOwner::get_request(Request* req, int ind){	//--AgentGen BEGIN=ifTestOwner::get_request	//--AgentGen END	MibLeaf::get_request(req, ind);}int ifTestOwner::set(const Vbx& vb){	//--AgentGen BEGIN=ifTestOwner::set	//--AgentGen END	return MibLeaf::set(vb);}boolean ifTestOwner::value_ok(const Vbx& vb){	//--AgentGen BEGIN=ifTestOwner::value_ok	//--AgentGen END	return TRUE;}int ifTestOwner::prepare_set_request(Request* req, int& ind){	int status;	if ((status = MibLeaf::prepare_set_request(req, ind)) !=	    SNMP_ERROR_SUCCESS) return status;	Vb vb(req->get_value(ind));	OctetStr v;	vb.get_value(v);	if (!(((v.len() >= 0) && (v.len() <= 255))))		 return SNMP_ERROR_WRONG_LENGTH;	//--AgentGen BEGIN=ifTestOwner::prepare_set_request	//--AgentGen END	return SNMP_ERROR_SUCCESS;}//--AgentGen BEGIN=ifTestOwner//--AgentGen END/** *  ifRcvAddressStatus * */ifRcvAddressStatus::ifRcvAddressStatus(const Oidx& id):   snmpRowStatus(id, READCREATE){	//--AgentGen BEGIN=ifRcvAddressStatus::ifRcvAddressStatus	//--AgentGen END}ifRcvAddressStatus::~ifRcvAddressStatus(){	//--AgentGen BEGIN=ifRcvAddressStatus::~ifRcvAddressStatus	//--AgentGen END}MibEntryPtr ifRcvAddressStatus::clone(){	MibEntryPtr other = new ifRcvAddressStatus(oid);	((ifRcvAddressStatus*)other)->replace_value(value->clone());	((ifRcvAddressStatus*)other)->set_reference_to_table(my_table);	//--AgentGen BEGIN=ifRcvAddressStatus::clone	//--AgentGen END	return other;}long ifRcvAddressStatus::get_state(){	return (long)*((SnmpInt32*)value);}void ifRcvAddressStatus::set_state(long l){	//--AgentGen BEGIN=ifRcvAddressStatus::set_state	//--AgentGen END	*((SnmpInt32*)value) = l;}int ifRcvAddressStatus::set(const Vbx& vb){	//--AgentGen BEGIN=ifRcvAddressStatus::set	//--AgentGen END	return snmpRowStatus::set(vb);}int ifRcvAddressStatus::prepare_set_request(Request* req, int& ind){	int status;	if ((status = snmpRowStatus::prepare_set_request(req, ind)) !=	    SNMP_ERROR_SUCCESS) return status;	//--AgentGen BEGIN=ifRcvAddressStatus::prepare_set_request	//--AgentGen END	return SNMP_ERROR_SUCCESS;}//--AgentGen BEGIN=ifRcvAddressStatus//--AgentGen END/** *  ifRcvAddressType * */ifRcvAddressType::ifRcvAddressType(const Oidx& id):   MibLeaf(id, READCREATE, new SnmpInt32(2), VMODE_DEFAULT){	//--AgentGen BEGIN=ifRcvAddressType::ifRcvAddressType	//--AgentGen END}ifRcvAddressType::~ifRcvAddressType(){	//--AgentGen BEGIN=ifRcvAddressType::~ifRcvAddressType	//--AgentGen END}MibEntryPtr ifRcvAddressType::clone(){	MibEntryPtr other = new ifRcvAddressType(oid);	((ifRcvAddressType*)other)->replace_value(value->clone());	((ifRcvAddressType*)other)->set_reference_to_table(my_table);	//--AgentGen BEGIN=ifRcvAddressType::clone	//--AgentGen END	return other;}void ifRcvAddressType::get_request(Request* req, int ind){	//--AgentGen BEGIN=ifRcvAddressType::get_request	//--AgentGen END	MibLeaf::get_request(req, ind);}long ifRcvAddressType::get_state(){	return (long)*((SnmpInt32*)value);}void ifRcvAddressType::set_state(long l){	//--AgentGen BEGIN=ifRcvAddressType::set_state	//--AgentGen END	*((SnmpInt32*)value) = l;}int ifRcvAddressType::set(const Vbx& vb){	//--AgentGen BEGIN=ifRcvAddressType::set	//--AgentGen END	return MibLeaf::set(vb);}boolean ifRcvAddressType::value_ok(const Vbx& vb){	long v;	vb.get_value(v);	if ((v != 1)	     && (v != 2) && (v != 3)	    ) return FALSE;	//--AgentGen BEGIN=ifRcvAddressType::value_ok	//--AgentGen END	return TRUE;}int ifRcvAddressType::prepare_set_request(Request* req, int& ind){	int status;	if ((status = MibLeaf::prepare_set_request(req, ind)) !=	    SNMP_ERROR_SUCCESS) return status;	//--AgentGen BEGIN=ifRcvAddressType::prepare_set_request	//--AgentGen END	return SNMP_ERROR_SUCCESS;}//--AgentGen BEGIN=ifRcvAddressType//--AgentGen END/** *  ifTableLastChange * */ifTableLastChange* ifTableLastChange::instance = 0;ifTableLastChange::ifTableLastChange():   MibLeaf(oidIfTableLastChange, READONLY, new TimeTicks()){	// This leaf object is a singleton. In order to access it use	// the static pointer ifTableLastChange::instance.	instance = this;	//--AgentGen BEGIN=ifTableLastChange::ifTableLastChange	//--AgentGen END}ifTableLastChange::~ifTableLastChange(){	//--AgentGen BEGIN=ifTableLastChange::~ifTableLastChange	//--AgentGen END}void ifTableLastChange::get_request(Request* req, int ind){	//--AgentGen BEGIN=ifTableLastChange::get_request	//--AgentGen END	MibLeaf::get_request(req, ind);}//--AgentGen BEGIN=ifTableLastChange//--AgentGen END/** *  ifStackLastChange * */ifStackLastChange* ifStackLastChange::instance = 0;ifStackLastChange::ifStackLastChange():   MibLeaf(oidIfStackLastChange, READONLY, new TimeTicks()){	// This leaf object is a singleton. In order to access it use	// the static pointer ifStackLastChange::instance.	instance = this;	//--AgentGen BEGIN=ifStackLastChange::ifStackLastChange	//--AgentGen END}ifStackLastChange::~ifStackLastChange(){	//--AgentGen BEGIN=ifStackLastChange::~ifStackLastChange	//--AgentGen END}void ifStackLastChange::get_request(Request* req, int ind){	//--AgentGen BEGIN=ifStackLastChange::get_request	//--AgentGen END	MibLeaf::get_request(req, ind);}//--AgentGen BEGIN=ifStackLastChange//--AgentGen END/** *  linkDown * */linkDown::linkDown(SubAgentXMib* mib){	my_mib = mib;	//--AgentGen BEGIN=linkDown::linkDown	backReference = mib;	//--AgentGen END}linkDown::~linkDown(){	//--AgentGen BEGIN=linkDown::~linkDown	//--AgentGen END}void linkDown::generate(Vbx* vbs, int sz, const OctetStr& context){	//--AgentGen BEGIN=linkDown::generate	//--AgentGen END	if (sz < 3) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkDown: too few var binds (given) (expected)");		LOG(sz);		LOG(3);		LOG_END;		return;	}	if (!(vbs[0].get_oid().in_subtree_of("1.3.6.1.2.1.2.2.1.1"))) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkDown: wrong var bind (no.) (given) (expected)");		LOG(1l);		LOG(vbs[0].get_printable_oid());		LOG("1.3.6.1.2.1.2.2.1.1");		LOG_END;		return;	}	if (!(vbs[1].get_oid().in_subtree_of("1.3.6.1.2.1.2.2.1.7"))) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkDown: wrong var bind (no.) (given) (expected)");		LOG(2l);		LOG(vbs[1].get_printable_oid());		LOG("1.3.6.1.2.1.2.2.1.7");		LOG_END;		return;	}	if (!(vbs[2].get_oid().in_subtree_of("1.3.6.1.2.1.2.2.1.8"))) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkDown: wrong var bind (no.) (given) (expected)");		LOG(3l);		LOG(vbs[2].get_printable_oid());		LOG("1.3.6.1.2.1.2.2.1.8");		LOG_END;		return;	}	my_mib->notify(context, oidLinkDown, vbs, sz);}//--AgentGen BEGIN=linkDown//--AgentGen END/** *  linkUp * */linkUp::linkUp(SubAgentXMib* mib){	my_mib = mib;	//--AgentGen BEGIN=linkUp::linkUp	backReference = mib;	//--AgentGen END}linkUp::~linkUp(){	//--AgentGen BEGIN=linkUp::~linkUp	//--AgentGen END}void linkUp::generate(Vbx* vbs, int sz, const OctetStr& context){	//--AgentGen BEGIN=linkUp::generate	//--AgentGen END	if (sz < 3) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkUp: too few var binds (given) (expected)");		LOG(sz);		LOG(3);		LOG_END;		return;	}	if (!(vbs[0].get_oid().in_subtree_of("1.3.6.1.2.1.2.2.1.1"))) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkUp: wrong var bind (no.) (given) (expected)");		LOG(1l);		LOG(vbs[0].get_printable_oid());		LOG("1.3.6.1.2.1.2.2.1.1");		LOG_END;		return;	}	if (!(vbs[1].get_oid().in_subtree_of("1.3.6.1.2.1.2.2.1.7"))) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkUp: wrong var bind (no.) (given) (expected)");		LOG(2l);		LOG(vbs[1].get_printable_oid());		LOG("1.3.6.1.2.1.2.2.1.7");		LOG_END;		return;	}	if (!(vbs[2].get_oid().in_subtree_of("1.3.6.1.2.1.2.2.1.8"))) {		LOG_BEGIN(ERROR_LOG | 1);		LOG("linkUp: wrong var bind (no.) (given) (expected)");		LOG(3l);		LOG(vbs[2].get_printable_oid());		LOG("1.3.6.1.2.1.2.2.1.8");		LOG_END;		return;	}	my_mib->notify(context, oidLinkUp, vbs, sz);}//--AgentGen BEGIN=linkUp//--AgentGen END/** *  ifEntry * */ifEntry* ifEntry::instance = 0;const index_info indIfEntry[1] = {	{ sNMP_SYNTAX_INT, FALSE, 1, 1 } };const Oidx indOidsIfEntry[1] = {	"1.3.6.1.2.1.2.2.1.1"};ifEntry::ifEntry(const OctetStr& context, SubAgentXMib* mib):   AgentXSharedTable(oidIfEntry, indIfEntry, 1, indOidsIfEntry, mib, context)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -