目錄
6.3.4       ExampleTable_access.h" >6.3.4       ExampleTable_access.h
6.3.5       ExampleTable_checkfns.c" >6.3.5       ExampleTable_checkfns.c
6.3.6       ExampleTable_checkfns.h" >6.3.6       ExampleTable_checkfns.h
6.3.8       ExampleTable_checkfns_local.h" >6.3.8       ExampleTable_checkfns_local.h
6.3.9       ExampleTable_columns.h" >6.3.9       ExampleTable_columns.h
6.3.10   ExampleTable_enums.h" >6.3.10   ExampleTable_enums.h
首頁 資料庫 mysql教程 用NET-SNMP软件包开发简单客户端代理(6)

用NET-SNMP软件包开发简单客户端代理(6)

Jun 07, 2016 pm 03:30 PM
代理商 客戶端 開發 簡單 軟體套件

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

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆樹的耳語 - 如何解鎖抓鉤
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1665
14
CakePHP 教程
1424
52
Laravel 教程
1322
25
PHP教程
1270
29
C# 教程
1250
24
最簡單的硬碟序號查詢方式 最簡單的硬碟序號查詢方式 Feb 26, 2024 pm 02:24 PM

硬碟序號是硬碟的一個重要標識,通常用於唯一標識硬碟以及進行硬體識別。在某些情況下,我們可能需要查詢硬碟序號,例如在安裝作業系統、尋找正確裝置驅動程式或進行硬碟維修等情況下。本文將介紹一些簡單的方法,幫助大家查詢硬碟序號。方法一:使用Windows命令提示字元開啟命令提示字元。在Windows系統中,按下Win+R鍵,輸入"cmd"並按下回車鍵即可開啟命

VMware Horizo​​​​n客戶端在連線時凍結或停滯[修復] VMware Horizo​​​​n客戶端在連線時凍結或停滯[修復] Mar 03, 2024 am 09:37 AM

在使用VMWareHorizo​​n用戶端連線到VDI時,我們可能會遇到應用程式在驗證過程中凍結或連線阻塞的情況。本文將探討這個問題,並提供解決這種情況的方法。當VMWareHorizo​​n用戶端出現凍結或連線問題時,您可以採取一些措施來解決這個問題。修復VMWareHorizo​​n用戶端在連接時凍結或卡住如果VMWareHorizo​​n客戶端在Windows11/10上凍結或無法連接,請執行下面提到的解決方案:檢查網路連接重新啟動Horizo​​n用戶端檢查Horizo​​​​n伺服器狀態清除客戶端緩存修復Ho

四款值得推薦的AI輔助程式工具 四款值得推薦的AI輔助程式工具 Apr 22, 2024 pm 05:34 PM

這個AI輔助程式工具在這個AI快速發展的階段,挖掘出了一大批好用的AI輔助程式工具。 AI輔助程式設計工具能夠提升開發效率、提升程式碼品質、降低bug率,是現代軟體開發過程中的重要助手。今天大姚給大家分享4款AI輔助程式工具(而且都支援C#語言),希望對大家有幫助。 https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot是一款AI編碼助手,可幫助你更快、更省力地編寫程式碼,從而將更多精力集中在問題解決和協作上。 Git

PHP MQTT客戶端開髮指南 PHP MQTT客戶端開髮指南 Mar 27, 2024 am 09:21 AM

MQTT(MessageQueuingTelemetryTransport)是一種輕量級的訊息傳輸協議,通常用於物聯網設備之間的通訊。 PHP是一種常用的伺服器端程式語言,可以用來開發MQTT客戶端。本文將介紹如何使用PHP開發MQTT客戶端,並包含以下內容:MQTT協定的基本概念PHPMQTT客戶端程式庫的選取和使用實例:使用PHPMQTT客戶端發布和

AI程式設計師哪家強?探索Devin、通靈靈碼和SWE-agent的潛力 AI程式設計師哪家強?探索Devin、通靈靈碼和SWE-agent的潛力 Apr 07, 2024 am 09:10 AM

2022年3月3日,距離世界首個AI程式設計師Devin誕生不足一個月,普林斯頓大學的NLP團隊開發了一個開源AI程式設計師SWE-agent。它利用GPT-4模型在GitHub儲存庫中自動解決問題。 SWE-agent在SWE-bench測試集上的表現與Devin相似,平均耗時93秒,解決了12.29%的問題。 SWE-agent透過與專用終端交互,可以開啟、搜尋文件內容,使用自動語法檢查、編輯特定行,以及編寫和執行測試。 (註:以上內容為原始內容微調,但保留了原文中的關鍵訊息,未超過指定字數限制。)SWE-A

學習如何利用Go語言開發行動應用程式 學習如何利用Go語言開發行動應用程式 Mar 28, 2024 pm 10:00 PM

Go語言開發行動應用程式教學隨著行動應用程式市場的不斷蓬勃發展,越來越多的開發者開始探索如何利用Go語言開發行動應用程式。作為一種簡潔高效的程式語言,Go語言在行動應用開發中也展現了強大的潛力。本文將詳細介紹如何利用Go語言開發行動應用程序,並附上具體的程式碼範例,幫助讀者快速入門並開始開發自己的行動應用程式。一、準備工作在開始之前,我們需要準備好開發環境和工具。首

五大熱門Go語言庫總表:開發必備利器 五大熱門Go語言庫總表:開發必備利器 Feb 22, 2024 pm 02:33 PM

五大熱門Go語言庫總結:開發必備利器,需要具體程式碼範例Go語言自從誕生以來,受到了廣泛的關注和應用。作為一門新興的高效、簡潔的程式語言,Go的快速發展離不開豐富的開源程式庫的支援。本文將介紹五大熱門的Go語言庫,這些庫在Go開發中扮演了至關重要的角色,為開發者提供了強大的功能和便利的開發體驗。同時,為了更好地理解這些庫的用途和功能,我們會結合具體的程式碼範例進行講

百度網盤網頁無法啟動客戶端怎麼解決? 百度網盤網頁無法啟動客戶端怎麼解決? Mar 13, 2024 pm 05:00 PM

  許多朋友下載檔案會先在網頁上瀏覽,然後轉入客戶端下載。但有時使用者會遇到百度網盤網頁無法啟動客戶端的問題。針對這個問題,小編為大家準備了百度網盤網頁無法啟動客戶端的解決辦法,有需要的小夥伴可以參考一下哦。  解決方法  1、可能百度網盤不是最新版,手動打開百度網盤客戶端,點擊右上角的設定按鈕,再點擊版本升級。  如無更新,則會有以下提示,若有更新,請依照提示進行更新。  2、可能禁用了百度網盤的檢測服務程序  有可能使我們自己手動或使用安全軟體自動禁用了百度網盤的檢測服務程序。  請查看一下

See all articles