用NET-SNMP软件包开发简单客户端代理(6)
6.3.4 ExampleTable_access.h /*ExampleTable_access.h*/ /* * Note: this file originally auto-generated by mib2c using * :mib2c.access_functions.conf,v 1.9 2004/10/14 12:57:33 dts12 Exp $ */ #ifndef EXAMPLETABLE_ACCESS_H #define EXAMPLETABLE_
6.3.4 ExampleTable_access.h
/*ExampleTable_access.h*/
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.access_functions.conf,v 1.9 2004/10/14 12:57:33 dts12 Exp $
*/
#ifndef EXAMPLETABLE_ACCESS_H
#define EXAMPLETABLE_ACCESS_H
/** User-defined data access functions for data in table ExampleTable */
/** row level accessors */
Netsnmp_First_Data_Point ExampleTable_get_first_data_point;
Netsnmp_Next_Data_Point ExampleTable_get_next_data_point;
int ExampleTable_commit_row(void **my_data_context, int new_or_del);
void * ExampleTable_create_data_context(netsnmp_variable_list *index_data, int column);
/** column accessors */
long *get_MachineNumber(void *data_context, size_t *ret_len);
char *get_MachineStatus(void *data_context, size_t *ret_len);
u_long *get_CheckTime(void *data_context, size_t *ret_len);
long *get_MonSet(void *data_context, size_t *ret_len);
int set_MonSet(void *data_context, long *val, size_t val_len);
#endif /* EXAMPLETABLE_ACCESS_H */
6.3.5 ExampleTable_checkfns.c
/*ExampleTable_checkfns.c*/
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.check_values.conf,v 1.8 2004/01/12 00:43:45 rstory Exp $
*/
/********************************************************************
* NOTE NOTE NOTE
* This file is auto-generated and SHOULD NOT BE EDITED by hand.
* Modify the ExampleTable_checkfns_local.[ch] files insead so that you
* can regenerate this one as mib2c improvements are made.
********************************************************************/
/* standard headers */
#include
#include
#include "ExampleTable_checkfns.h"
#include "ExampleTable_checkfns_local.h"
#include "ExampleTable_enums.h"
/** Decides if an incoming value for the MonSet mib node is legal.
* @param type The incoming data type.
* @param val The value to be checked.
* @param val_len The length of data stored in val (in bytes).
* @return 0 if the incoming value is legal, an SNMP error code otherwise.
*/
int
check_MonSet(int type, long *val, size_t val_len,
long *old_val, size_t old_val_len) {
int ret;
/** Check to see that we were called legally */
if (!val)
return SNMP_ERR_GENERR;
/** Check the incoming type for correctness */
if (type != ASN_INTEGER)
return SNMP_ERR_WRONGTYPE;
ret = SNMP_ERR_NOERROR;
/** looks ok, call the local version of the same function. */
return check_MonSet_local(type, val, val_len, old_val, old_val_len);
}
6.3.6 ExampleTable_checkfns.h
/*ExampleTable_checkfns.h*/
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.iterate.conf,v 5.6 2003/02/20 00:52:07 hardaker Exp $
*/
/***********************************************************************
* This file is auto-generated and SHOULD NOT BE EDITED by hand.
* Modify the ExampleTable_checkfns_local.[ch] files insead.
* (so that you can regenerate this one as mib2c improvements are made)
***********************************************************************/
#ifndef EXAMPLETABLE_CHECKFNS_H
#define EXAMPLETABLE_CHECKFNS_H
/** make sure we load the functions that you can modify */
config_require(ExampleTable_checkfns_local)
/* these functions are designed to check incoming values for
columns in the ExampleTable table for legality with respect to
datatype and value.
*/
int check_MonSet(int type, long *val, size_t val_len, long *old_val, size_t old_val_len);
#endif /* EXAMPLETABLE_CHECKFNS_H */
6.3.7 ExampleTable_checkfns_local.c
/*ExampleTable_checkfns_local.c*/
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.check_values_local.conf,v 5.2 2004/05/04 23:34:56 hardaker Exp $
*/
/* standard headers */
#include
#include
#include "ExampleTable_checkfns.h"
#include "ExampleTable_enums.h"
/** Decides if an incoming value for the MonSet mib node is legal, from a local implementation specific viewpoint.
* @param type The incoming data type.
* @param val The value to be checked.
* @param val_len The length of data stored in val (in bytes).
* @return 0 if the incoming value is legal, an SNMP error code otherwise.
*/
int
check_MonSet_local(int type, long *val, size_t val_len, long *old_val, size_t old_val_len) {
/** XXX: you may want to check aspects of the new value that
were not covered by the automatic checks by the parent function. */
/** XXX: you make want to check that the requested change from
the old value to the new value is legal (ie, the transistion
from one value to another is legal */
/** if everything looks ok, return SNMP_ERR_NOERROR */
return SNMP_ERR_NOERROR;
}
6.3.8 ExampleTable_checkfns_local.h
/*ExampleTable_checkfns_local.h*/
/*
* Note: this file originally auto-generated by mib2c using
* : : mib2c.check_values_local.conf,v 5.2 2004/05/04 23:34:56 hardaker Exp $
*
*/
#ifndef EXAMPLETABLE_CHECKFNS_H
#define EXAMPLETABLE_CHECKFNS_H
/* these functions are designed to check incoming values for
columns in the ExampleTable table for legality with respect to
datatype and value according to local conventions. You should modify
them as appropriate. They will be called from parent check_value
functions that are auto-generated using mib2c and the parent functions
should NOT be modified.
*/
int check_MonSet_local(int type, long *val, size_t val_len, long *old_val, size_t old_val_len);
#endif /* EXAMPLETABLE_CHECKFNS_H */
6.3.9 ExampleTable_columns.h
/* ExampleTable_columns.h*/
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.column_defines.conf,v 5.1 2002/05/08 05:42:47 hardaker Exp $
*/
#ifndef EXAMPLETABLE_COLUMNS_H
#define EXAMPLETABLE_COLUMNS_H
/* column number definitions for table ExampleTable */
#define COLUMN_MACHINENUMBER 1
#define COLUMN_MACHINESTATUS 2
#define COLUMN_CHECKTIME 3
#define COLUMN_MONSET 4
#endif /* EXAMPLETABLE_COLUMNS_H */
6.3.10 ExampleTable_enums.h
/* ExampleTable_enums.h*/
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.column_enums.conf,v 5.2 2003/02/22 04:09:25 hardaker Exp $
*/
#ifndef EXAMPLETABLE_ENUMS_H
#define EXAMPLETABLE_ENUMS_H
#endif /* EXAMPLETABLE_ENUMS_H */
6.4 自定义mib文件MyMib.txt
MyMIB DEFINITIONS::=BEGIN
IMPORTS
enterprises,OBJECT-TYPE,Integer32,TimeTicks
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString FROM SNMPv2-TC;
foxmail OBJECT IDENTIFIER::={enterprises 310}
SecondCounter OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "This is a one minute counter from year 1970.1.1.0:0 to now"
::={foxmail 1}
WeekTime OBJECT-TYPE
SYNTAX TimeTicks
ACCESS read-only
STATUS mandatory
DESCRIPTION "Recording taday's time and the day sorts in the week"
::={foxmail 2}
ExampleTable OBJECT-TYPE
SYNTAX SEQUENCE OF ExampleEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A list of interface entries. The number of entries is
given by the value of ExampleNumber."
::= { foxmail 3 }
ExampleEntry OBJECT-TYPE
SYNTAX ExampleEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry containing management information applicable to a
particular interface."
INDEX { UserIndex }
::= { ExampleTable 1 }
ExampleEntry ::=
SEQUENCE {
UserIndex InterfaceIndex,
UserStatus DisplayString,
CheckTime TimeTicks,
MonSet Integer32
}
InterfaceIndex ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d"
STATUS current
DESCRIPTION
"A unique value, greater than zero, for each interface or
interface sub-layer in the managed system. It is
recommended that values are assigned contiguously starting
from 1. The value for each interface sub-layer must remain
constant at least from one re-initialization of the entity's
network management system to the next re-initialization."
SYNTAX Integer32 (1..2147483647)
UserIndex OBJECT-TYPE
SYNTAX InterfaceIndex
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A unique value, greater than zero, for each interface. It
is recommended that values are assigned contiguously
starting from 1. The value for each interface sub-layer
must remain constant at least from one re-initialization of
the entity's network management system to the next re-
initialization."
::= { ExampleEntry 1 }
UserStatus OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"machine status ."
::= { ExampleEntry 2 }
CheckTime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"machine status checking time."
::= { ExampleEntry 3 }
MonSet OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"An example to use set function."
::={ ExampleEntry 4}
END

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The hard disk serial number is an important identifier of the hard disk and is usually used to uniquely identify the hard disk and identify the hardware. In some cases, we may need to query the hard drive serial number, such as when installing an operating system, finding the correct device driver, or performing hard drive repairs. This article will introduce some simple methods to help you check the hard drive serial number. Method 1: Use Windows Command Prompt to open the command prompt. In Windows system, press Win+R keys, enter "cmd" and press Enter key to open the command
![VMware Horizon client freezes or stalls while connecting [Fix]](https://img.php.cn/upload/article/000/887/227/170942987315391.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
When connecting to a VDI using the VMWareHorizon client, we may encounter situations where the application freezes during authentication or the connection blocks. This article will explore this issue and provide ways to resolve this situation. When the VMWareHorizon client experiences freezing or connection issues, there are a few things you can do to resolve the issue. Fix VMWareHorizon client freezes or gets stuck while connecting If VMWareHorizon client freezes or fails to connect on Windows 11/10, do the below mentioned solutions: Check network connection Restart Horizon client Check Horizon server status Clear client cache Fix Ho

This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

MQTT (MessageQueuingTelemetryTransport) is a lightweight message transmission protocol commonly used for communication between IoT devices. PHP is a commonly used server-side programming language that can be used to develop MQTT clients. This article will introduce how to use PHP to develop an MQTT client and include the following content: Basic concepts of the MQTT protocol Selection and usage examples of the PHPMQTT client library: Using the PHPMQTT client to publish and

On March 3, 2022, less than a month after the birth of the world's first AI programmer Devin, the NLP team of Princeton University developed an open source AI programmer SWE-agent. It leverages the GPT-4 model to automatically resolve issues in GitHub repositories. SWE-agent's performance on the SWE-bench test set is similar to Devin, taking an average of 93 seconds and solving 12.29% of the problems. By interacting with a dedicated terminal, SWE-agent can open and search file contents, use automatic syntax checking, edit specific lines, and write and execute tests. (Note: The above content is a slight adjustment of the original content, but the key information in the original text is retained and does not exceed the specified word limit.) SWE-A

Summary of the five most popular Go language libraries: essential tools for development, requiring specific code examples. Since its birth, the Go language has received widespread attention and application. As an emerging efficient and concise programming language, Go's rapid development is inseparable from the support of rich open source libraries. This article will introduce the five most popular Go language libraries. These libraries play a vital role in Go development and provide developers with powerful functions and a convenient development experience. At the same time, in order to better understand the uses and functions of these libraries, we will explain them with specific code examples.

Go language development mobile application tutorial As the mobile application market continues to boom, more and more developers are beginning to explore how to use Go language to develop mobile applications. As a simple and efficient programming language, Go language has also shown strong potential in mobile application development. This article will introduce in detail how to use Go language to develop mobile applications, and attach specific code examples to help readers get started quickly and start developing their own mobile applications. 1. Preparation Before starting, we need to prepare the development environment and tools. head

When many friends download files, they will first browse on the web page and then transfer to the client to download. But sometimes users will encounter the problem that the Baidu Netdisk webpage cannot start the client. In response to this problem, the editor has prepared a solution for you to solve the problem that the Baidu Netdisk webpage cannot start the client. Friends in need can refer to it. Solution: 1. Maybe Baidu Netdisk is not the latest version. Manually open the Baidu Netdisk client, click the settings button in the upper right corner, and then click version upgrade. If there is no update, the following prompt will appear. If there is an update, please follow the prompts to update. 2. The detection service program of Baidu Cloud Disk may be disabled. It is possible that we manually or use security software to automatically disable the detection service program of Baidu Cloud Disk. Please check it out
