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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i5h-3LL

HOME


5h-3LL 1.0
DIR: /usr/share/snmp/mib2c-data
/usr/share/snmp/mib2c-data/
Upload File:
Current File : /usr/share/snmp/mib2c-data/mfd-interface.m2c
#############################################################  -*- c -*-
## generic include for XXX. Do not use directly.
##
## $Id$
########################################################################
@if $m2c_mark_boundary == 1@
/** START code generated by $RCSfile$ $Revision$ */
@end@
########################################################################
##
########################################################################
@eval $m2c_processing_type = 'h'@
@open ${name}_interface.h@
@eval $hack = "Id"@
/*
 * Note: this file originally auto-generated by mib2c using
 *       version $Revision$ of $RCSfile$
 *
 * $$hack:$
 */
/** @ingroup interface: Routines to interface to Net-SNMP
 *
 * \warning This code should not be modified, called directly,
 *          or used to interpret functionality. It is subject to
 *          change at any time.
 * 
 * @{
 */
@include m2c-internal-warning.m2i@
##
@eval $m2c_save = "$name"@
@eval $name = "${name}_INTERFACE"@
@include generic-header-top.m2i@
@eval $name = "$m2c_save"@

#include "${name}.h"


/* ********************************************************************
 * Table declarations
 */
@foreach $table table@
@    include m2c_setup_table.m2i@

/* PUBLIC interface initialization routine */
void _${context}_initialize_interface(${context}_registration * user_ctx,
                                    u_long flags);
void _${context}_shutdown_interface(${context}_registration * user_ctx);

${context}_registration *
${context}_registration_get( void );

${context}_registration *
${context}_registration_set( ${context}_registration * newreg );

netsnmp_container *${context}_container_get( void );
int ${context}_container_size( void );

@   if $m2c_table_settable@
u_int ${context}_dirty_get( void );
void ${context}_dirty_set( u_int status );

@   end@
@   if $m2c_data_allocate == 1@
@      eval $m2c_tmp = "${context}_data *"@
@      if $m2c_data_init == 1@
@         eval $m2c_tmp = "$m2c_tmp, void *"@
@      @end@
@   elsif $m2c_data_init == 1@
@      eval $m2c_tmp = "void *"@
@   else@
@      eval $m2c_tmp = "void"@
@   end@
    ${context}_rowreq_ctx * ${context}_allocate_rowreq_ctx($m2c_tmp);
void ${context}_release_rowreq_ctx(${context}_rowreq_ctx *rowreq_ctx);

int ${context}_index_to_oid(netsnmp_index *oid_idx,
                            ${context}_mib_index *mib_idx);
int ${context}_index_from_oid(netsnmp_index *oid_idx,
                              ${context}_mib_index *mib_idx);

@   if $m2c_table_persistent == 1@
@      include mfd-persistence.m2i@

@   end@
/*
 * access to certain internals. use with caution!
 */
void ${context}_valid_columns_set(netsnmp_column_info *vc);

@end@ # for each
@eval $m2c_save = "$name"@
@eval $name = "${name}_INTERFACE"@
@include generic-header-bottom.m2i@
/** @} */
@eval $name = "$m2c_save"@
########################################################################
########################################################################
########################################################################
########################################################################
########################################################################
########################################################################
########################################################################
##
@open ${name}_interface.c@
/*
 * Note: this file originally auto-generated by mib2c using
 *       version $Revision$ of $RCSfile$ 
 *
 * $$hack:$
 */
@include m2c-internal-warning.m2i@

@include generic-source-includes.m2i@

#include <net-snmp/agent/table_container.h>
#include <net-snmp/library/container.h>

#include "${name}_interface.h"

netsnmp_feature_require(baby_steps)
netsnmp_feature_require(row_merge)
netsnmp_feature_require(check_all_requests_error)

#include <ctype.h>

@eval $m2c_processing_type = 'i'@
@foreach $table table@
@   include m2c_setup_table.m2i@
@   include details-table.m2i@
########################################################################
typedef struct ${context}_interface_ctx_s {

   netsnmp_container              *container;
@   if $m2c_data_cache == 1@
   netsnmp_cache                  *cache;
@   end@

   ${context}_registration *      user_ctx;
   
   netsnmp_table_registration_info  tbl_info;

   netsnmp_baby_steps_access_methods access_multiplexer;

@  if $m2c_table_settable@
    u_int                             table_dirty;

@  end@
} ${context}_interface_ctx;

static ${context}_interface_ctx ${context}_if_ctx;

static void _${context}_container_init(
    ${context}_interface_ctx *if_ctx);
static void _${context}_container_shutdown(
    ${context}_interface_ctx *if_ctx);


netsnmp_container *
${context}_container_get( void )
{
    return ${context}_if_ctx.container;
}

${context}_registration *
${context}_registration_get( void )
{
    return ${context}_if_ctx.user_ctx;
}

${context}_registration *
${context}_registration_set( ${context}_registration * newreg )
{
    ${context}_registration * old = ${context}_if_ctx.user_ctx;
    ${context}_if_ctx.user_ctx = newreg;
    return old;
}

int
${context}_container_size( void )
{
    return CONTAINER_SIZE(${context}_if_ctx.container);
}

@  if $m2c_table_settable@
u_int
${context}_dirty_get( void )
{
    return ${context}_if_ctx.table_dirty;
}

void
${context}_dirty_set( u_int status )
{
    DEBUGMSGTL(("${context}:${context}_dirty_set",
                "called. was %d, now %d\n",
                ${context}_if_ctx.table_dirty, status));
    ${context}_if_ctx.table_dirty = status;
}

@end@
/*
 * mfd multiplexer modes
 */
static Netsnmp_Node_Handler _mfd_${context}_pre_request;
static Netsnmp_Node_Handler _mfd_${context}_post_request;
static Netsnmp_Node_Handler _mfd_${context}_object_lookup;
static Netsnmp_Node_Handler _mfd_${context}_get_values;
@   if $m2c_table_settable@
static Netsnmp_Node_Handler _mfd_${context}_check_objects;
static Netsnmp_Node_Handler _mfd_${context}_undo_setup;
static Netsnmp_Node_Handler _mfd_${context}_set_values;
static Netsnmp_Node_Handler _mfd_${context}_undo_cleanup;
static Netsnmp_Node_Handler _mfd_${context}_undo_values;
static Netsnmp_Node_Handler _mfd_${context}_commit;
static Netsnmp_Node_Handler _mfd_${context}_undo_commit;
static Netsnmp_Node_Handler _mfd_${context}_irreversible_commit;
@      if $m2c_table_dependencies == 1@
static Netsnmp_Node_Handler _mfd_${context}_check_dependencies;
@      end@

@   end@ # writable
@   if ("$m2c_data_context" eq "generated") && (($m2c_undo_embed == 0) || ($m2c_data_allocate == 1))@
${context}_data *${context}_allocate_data(void);

@   end@
/**
 * @internal
 * Initialize the table $context 
 *    (Define its contents and how it's structured)
 */
void
_${context}_initialize_interface(${context}_registration * reg_ptr,  u_long flags)
{
    netsnmp_baby_steps_access_methods *access_multiplexer =
        &${context}_if_ctx.access_multiplexer;
    netsnmp_table_registration_info *tbl_info = &${context}_if_ctx.tbl_info;
    netsnmp_handler_registration *reginfo;
    netsnmp_mib_handler *handler;
    int    mfd_modes = 0;

    DEBUGMSGTL(("internal:${context}:_${context}_initialize_interface","called\n"));


    /*************************************************
     *
     * save interface context for ${context}
     */
    /*
     * Setting up the table's definition
     */
    netsnmp_table_helper_add_indexes(tbl_info,
    @foreach $tabledx index@
                                  $tabledx.type, /** index: $tabledx */
    @end@
                             0);

    /*  Define the minimum and maximum accessible columns.  This
        optimizes retrieval. */
    tbl_info->min_column = $context.uc_MIN_COL;
    tbl_info->max_column = $context.uc_MAX_COL;

    /*
     * save users context
     */
    ${context}_if_ctx.user_ctx = reg_ptr;

    /*
     * call data access initialization code
     */
    ${context}_init_data(reg_ptr);

    /*
     * set up the container
     */
    _${context}_container_init(&${context}_if_ctx);
    if (NULL == ${context}_if_ctx.container) {
        snmp_log(LOG_ERR,"could not initialize container for ${context}\n");
        return;
    }
    
    /*
     * access_multiplexer: REQUIRED wrapper for get request handling
     */
    access_multiplexer->object_lookup = _mfd_${context}_object_lookup;
    access_multiplexer->get_values = _mfd_${context}_get_values;

    /*
     * no wrappers yet
     */
    access_multiplexer->pre_request = _mfd_${context}_pre_request;
    access_multiplexer->post_request = _mfd_${context}_post_request;

#ifndef NETSNMP_DISABLE_SET_SUPPORT
##
@   if $m2c_table_settable@

    /*
     * REQUIRED wrappers for set request handling
     */
    access_multiplexer->object_syntax_checks = _mfd_${context}_check_objects;
    access_multiplexer->undo_setup = _mfd_${context}_undo_setup;
    access_multiplexer->undo_cleanup = _mfd_${context}_undo_cleanup;
    access_multiplexer->set_values = _mfd_${context}_set_values;
    access_multiplexer->undo_sets = _mfd_${context}_undo_values;

    /*
     * no wrappers yet
     */
    access_multiplexer->commit = _mfd_${context}_commit;
    access_multiplexer->undo_commit = _mfd_${context}_undo_commit;
    access_multiplexer->irreversible_commit = _mfd_${context}_irreversible_commit;
##
@      if $m2c_table_dependencies == 1@
    
    /*
     * REQUIRED for tables with dependencies
     */
    access_multiplexer->consistency_checks = _mfd_${context}_check_dependencies;
@      end@
@   end@ # writable
#endif

    /*************************************************
     *
     * Create a registration, save our reg data, register table.
     */
    DEBUGMSGTL(("$name:init_$context",
                "Registering $context as a mibs-for-dummies table.\n"));		 
    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
    reginfo = netsnmp_handler_registration_create("${context}", handler,
                                                  ${context}_oid,
                                                  ${context}_oid_size,
                                                  HANDLER_CAN_BABY_STEP |
#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
                                                  HANDLER_CAN_RONLY
#else
@if $m2c_table_settable == 1@
                                                  HANDLER_CAN_RWRITE
@else@
                                                  HANDLER_CAN_RONLY
@end@
#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
                                                  );
    if(NULL == reginfo) {
        snmp_log(LOG_ERR,"error registering table ${context}\n");
        return;
    }
    reginfo->my_reg_void = &${context}_if_ctx;

    /*************************************************
     *
     * set up baby steps handler, create it and inject it
     */
    if( access_multiplexer->object_lookup )
        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
    if( access_multiplexer->pre_request )
        mfd_modes |= BABY_STEP_PRE_REQUEST;
    if( access_multiplexer->post_request )
        mfd_modes |= BABY_STEP_POST_REQUEST;
    
#if !(defined(NETSNMP_NO_WRITE_SUPPORT) || defined(NETSNMP_DISABLE_SET_SUPPORT))
    if( access_multiplexer->set_values )
        mfd_modes |= BABY_STEP_SET_VALUES;
    if( access_multiplexer->irreversible_commit )
        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
    if( access_multiplexer->object_syntax_checks )
        mfd_modes |= BABY_STEP_CHECK_OBJECT;

    if( access_multiplexer->undo_setup )
        mfd_modes |= BABY_STEP_UNDO_SETUP;
    if( access_multiplexer->undo_cleanup )
        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
    if( access_multiplexer->undo_sets )
        mfd_modes |= BABY_STEP_UNDO_SETS;
    
    if( access_multiplexer->row_creation )
        mfd_modes |= BABY_STEP_ROW_CREATE;
    if( access_multiplexer->consistency_checks )
        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
    if( access_multiplexer->commit )
        mfd_modes |= BABY_STEP_COMMIT;
    if( access_multiplexer->undo_commit )
        mfd_modes |= BABY_STEP_UNDO_COMMIT;
#endif /* NETSNMP_NO_WRITE_SUPPORT || NETSNMP_DISABLE_SET_SUPPORT */
    
    handler = netsnmp_baby_steps_handler_get(mfd_modes);
    netsnmp_inject_handler(reginfo, handler);

    /*************************************************
     *
     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
     */
    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
    netsnmp_inject_handler(reginfo, handler);

    /*************************************************
     *
     * inject container_table helper
     */
    handler =
        netsnmp_container_table_handler_get(tbl_info,
                                            ${context}_if_ctx.container,
                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
    netsnmp_inject_handler( reginfo, handler );

@   if $m2c_data_cache == 1@
    /*************************************************
     *
     * inject cache helper
     */
    if(NULL != ${context}_if_ctx.cache) {
        handler = netsnmp_cache_handler_get(${context}_if_ctx.cache);
        netsnmp_inject_handler( reginfo, handler );
    }

@   end@
    /*
     * register table
     */
    netsnmp_register_table(reginfo, tbl_info);

@if $m2c_table_persistent == 1@
    /*
     * register config/persistence callbacks
     */
    ${context}_container_init_persistence(${context}_if_ctx.container);
    
@end@
} /* _${context}_initialize_interface */

/**
 * @internal
 * Shutdown the table $context
 */
void
_${context}_shutdown_interface(${context}_registration * reg_ptr)
{
    /*
     * shutdown the container
     */
    _${context}_container_shutdown(&${context}_if_ctx);
}

void
${context}_valid_columns_set(netsnmp_column_info *vc)
{
    ${context}_if_ctx.tbl_info.valid_columns = vc;
} /* ${context}_valid_columns_set */

@include generic-table-indexes-to-oid.m2i@
@include generic-table-indexes-from-oid.m2i@

########################################################################
##
@    if (($m2c_data_allocate == 1) || ($m2c_undo_embed == 0)) && ("$m2c_data_context" eq "generated")@
@        eval $m2c_gda_todo_suppress = 1@ # no todo comments
@        include generic-data-allocate.m2i@ # resets suppress
@    end@
########################################################################
/* *********************************************************************
 * @internal
 * allocate resources for a ${context}_rowreq_ctx
 */
${context}_rowreq_ctx *
@if $m2c_data_allocate == 1@
@   eval $m2c_tmp = "${context}_data *data"@
@   if $m2c_data_init == 1@
@     eval $m2c_tmp = "$m2c_tmp, void *user_init_ctx"@
@   end@
@elsif $m2c_data_init == 1@
@   eval $m2c_tmp = "void *user_init_ctx"@
@else@
@   eval $m2c_tmp = "void"@
@end@
${context}_allocate_rowreq_ctx($m2c_tmp)
{
    ${context}_rowreq_ctx *rowreq_ctx =
                  SNMP_MALLOC_TYPEDEF(${context}_rowreq_ctx);

    DEBUGMSGTL(("internal:${context}:${context}_allocate_rowreq_ctx","called\n"));

    if(NULL == rowreq_ctx) {
        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
                 "${context}_rowreq_ctx.\n");
        return NULL;
    }
@if $m2c_data_allocate == 1@
    else {
        if(NULL != data) {
            /*
             * track if we got data from user
             */
            rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
            rowreq_ctx->data = data;
        }
        else if (NULL == (rowreq_ctx->data = ${context}_allocate_data())) {
            SNMP_FREE(rowreq_ctx);
            return NULL;
        }
    }

    /*
     * undo context will be allocated when needed (in *_undo_setup)
     */
@end@

    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;

    rowreq_ctx->${context}_data_list = NULL;

@if $m2c_data_init == 1@
    /*
     * if we allocated data, call init routine
     */
    if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
        if(SNMPERR_SUCCESS !=
            ${context}_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
           ${context}_release_rowreq_ctx(rowreq_ctx);
           rowreq_ctx = NULL;
        }
    }
@end@

    return rowreq_ctx;
} /* ${context}_allocate_rowreq_ctx */

/*
 * @internal
 * release resources for a ${context}_rowreq_ctx
 */
void
${context}_release_rowreq_ctx(${context}_rowreq_ctx *rowreq_ctx)
{
    DEBUGMSGTL(("internal:${context}:${context}_release_rowreq_ctx","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
@if $m2c_data_init == 1@
    ${context}_rowreq_ctx_cleanup(rowreq_ctx);
@end@

@if $m2c_data_allocate == 1@
    /*
     * for non-transient data, don't free data we got from the user
     */
    if ((rowreq_ctx->data) &&
        !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
        ${context}_release_data(rowreq_ctx->data);
 
@end@ 
@if $m2c_undo_embed == 0@
    if(rowreq_ctx->undo)
        ${context}_release_data(rowreq_ctx->undo);
 
@end@ 
    /*
     * free index oid pointer
     */
    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
        free(rowreq_ctx->oid_idx.oids);

    SNMP_FREE(rowreq_ctx);
} /* ${context}_release_rowreq_ctx */

########################################################################
##
/**
 * @internal
 * wrapper
 */
static int
_mfd_${context}_pre_request(netsnmp_mib_handler *handler,
                            netsnmp_handler_registration *reginfo,
                            netsnmp_agent_request_info *agtreq_info,
                            netsnmp_request_info *requests)
{
    int rc;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_pre_request",
                "called\n"));
    
    if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
        DEBUGMSGTL(("internal:${context}",
                    "skipping additional pre_request\n"));
        return SNMP_ERR_NOERROR;
    }
        
    rc = ${context}_pre_request(${context}_if_ctx.user_ctx);
    if (MFD_SUCCESS != rc) {
        /*
         * nothing we can do about it but log it
         */
        DEBUGMSGTL(("${context}","error %d from "
                    "${context}_pre_request\n", rc));
        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
    }
    
    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_pre_request */

/**
 * @internal
 * wrapper
 */
static int
_mfd_${context}_post_request(netsnmp_mib_handler *handler,
                             netsnmp_handler_registration *reginfo,
                             netsnmp_agent_request_info *agtreq_info,
                             netsnmp_request_info *requests)
{
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    int rc, packet_rc;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_post_request",
                "called\n"));

    /*
     * release row context, if deleted
     */
    if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
        ${context}_release_rowreq_ctx(rowreq_ctx);

    /*
     * wait for last call before calling user
     */
    if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
        DEBUGMSGTL(("internal:${context}",
                    "waiting for last post_request\n"));
        return SNMP_ERR_NOERROR;
    }
    
    packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
@  if $m2c_table_settable@
    if ((MFD_SUCCESS != packet_rc) && ${context}_dirty_get()) {
        /*
         * we shouldn't get here. the undo steps should also clear
         * the dirty flags.
         */
        snmp_log(LOG_WARNING, "${context} dirty flag set in post_request "
                 "but status != SUCCESS.\n");
    }

@   end@
    rc = ${context}_post_request(${context}_if_ctx.user_ctx,packet_rc);
    if (MFD_SUCCESS != rc) {
        /*
         * nothing we can do about it but log it
         */
        DEBUGMSGTL(("${context}","error %d from "
                    "${context}_post_request\n", rc));
    }
    
    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_post_request */

########################################################################
##
@if ($m2c_table_row_creation == 1) || ($m2c_table_persistent == 1)@
NETSNMP_STATIC_INLINE int
_${context}_check_indexes(${context}_rowreq_ctx * rowreq_ctx)
{
    int                          rc = SNMPERR_SUCCESS;

    DEBUGMSGTL(("internal:${context}:_${context}_check_indexes","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

##
@if $m2c_table_external_indexes != 0@
    /*
     * check that the corresponding EXTERNAL row exists
     */
@   foreach $node externalindex@
@      include m2c_setup_node.m2i@

    /* (INDEX) $m2c_node_summary */
    rc = ${context}_${node}_check_index( rowreq_ctx );
    if(MFD_SUCCESS != rc)
        return SNMP_ERR_NOCREATION;
@   end@ # for each nonindex

@end@ # external index
@   foreach $node internalindex@
@      include m2c_setup_node.m2i@

    /* (INDEX) $m2c_node_summary */
@   eval $m2c_nv_val = "rowreq_ctx->tbl_idx.$node"@
@   eval $m2c_nv_len = "rowreq_ctx->tbl_idx.${node}_len"@
@   eval $m2c_nv_str = "rowreq_ctx->tbl_idx.$node"@
@   include node-validate.m2i@
       if (MFD_SUCCESS != rc)
          return rc;
        rc = ${node}_check_index( rowreq_ctx );
       if(MFD_SUCCESS != rc)
           return SNMP_ERR_NOCREATION;
@   end@ # for each internalindex

    /*
     * if individual parts look ok, check them as a whole
     */
    return ${context}_validate_index( ${context}_if_ctx.user_ctx, rowreq_ctx );
} /* _${context}_check_indexes */
##----------------------------------------------------------------------
/**
 * @internal
 * wrapper
 */
static ${table}_rowreq_ctx *
_mfd_${context}_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
{
    ${context}_rowreq_ctx * rowreq_ctx;
    ${context}_mib_index mib_idx;
    int rc;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_rowreq_from_index",
                "called\n"));

    if (NULL == rc_ptr)
        rc_ptr = &rc;
    *rc_ptr = MFD_SUCCESS;

    memset(&mib_idx, 0x0, sizeof(mib_idx));
    
    /*
     * try to parse oid
     */
    *rc_ptr = ${context}_index_from_oid(oid_idx, &mib_idx);
    if(MFD_SUCCESS != *rc_ptr) {
        DEBUGMSGT(("$context", "error parsing index\n"));
        return NULL;
    }

    /*
     * allocate new context
     */
@   eval $m2c_tmp = ""@
@   if ($m2c_data_allocate == 1) || ($m2c_data_init == 1)@
@      eval $m2c_tmp = "NULL"@
@      if ($m2c_data_allocate == 1) && ($m2c_data_init == 1)@
@         eval $m2c_tmp = "$m2c_tmp, NULL"@
@      @end@
@   end@
    rowreq_ctx = ${context}_allocate_rowreq_ctx($m2c_tmp);
    if (NULL == rowreq_ctx) {
        *rc_ptr = MFD_ERROR;
        return NULL; /* msg already logged */
    }
    
    memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));

    /*
     * check indexes
     */
    *rc_ptr = _${context}_check_indexes(rowreq_ctx);
    if(MFD_SUCCESS != *rc_ptr) {
        netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
                       (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
        ${context}_release_rowreq_ctx(rowreq_ctx);
        return NULL;
    }

    /*
     * copy indexes
     */
    rowreq_ctx->oid_idx.len = oid_idx->len;
    memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));

    return rowreq_ctx;
} /* _mfd_${context}_rowreq_from_index */


@end@ # row creation
/**
 * @internal
 * wrapper
 */
static int
_mfd_${context}_object_lookup(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    int                    rc = SNMP_ERR_NOERROR;
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    
    DEBUGMSGTL(("internal:${context}:_mfd_${context}_object_lookup","called\n"));

    /*
     * get our context from mfd
     * ${context}_interface_ctx *if_ctx =
     *             (${context}_interface_ctx *)reginfo->my_reg_void;
     */

    if(NULL == rowreq_ctx) {
@   if $m2c_table_row_creation == 0@
        rc = SNMP_ERR_NOCREATION;
@   else@
        netsnmp_table_request_info *tblreq_info;
        netsnmp_index oid_idx;

        tblreq_info = netsnmp_extract_table_info(requests);
        if(NULL == tblreq_info) {
            snmp_log(LOG_ERR, "request had no table info\n");
            return MFD_ERROR;
        }

        /*
         * try create rowreq
         */
        oid_idx.oids = tblreq_info->index_oid;
        oid_idx.len = tblreq_info->index_oid_len;

        rowreq_ctx = _mfd_${context}_rowreq_from_index(&oid_idx, &rc);
        if(MFD_SUCCESS == rc) {
            netsnmp_assert(NULL != rowreq_ctx);
            rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
            /*
             * add rowreq_ctx to request data lists
             */
            netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
        }
@   end@ // row creation
    }

    if (MFD_SUCCESS != rc)
        netsnmp_request_set_error_all(requests, rc);
    else
        ${context}_row_prep(rowreq_ctx);

    return SNMP_VALIDATE_ERR(rc);
} /* _mfd_${context}_object_lookup */

########################################################################
##
/***********************************************************************
 *
 * GET processing
 *
 ***********************************************************************/
/*
 * @internal
 * Retrieve the value for a particular column
 */
NETSNMP_STATIC_INLINE int
_${context}_get_column( ${context}_rowreq_ctx *rowreq_ctx,
                       netsnmp_variable_list *var, int column )
{
    int rc = SNMPERR_SUCCESS;
    
    DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_column",
                "called for %d\n", column));


    netsnmp_assert(NULL != rowreq_ctx);

    switch(column) {
@   foreach $node internalindex@
@      include m2c_setup_node.m2i@
@      if $node.accessible == 1@

    /* (INDEX) $m2c_node_summary */
    case COLUMN_$node.uc:
    var->type = $node.type;
@         if $m2c_node_needlength == 1@
    /*
     * NOTE: val_len is in bytes, ${node}_len might not be (e.g. oids)
     */
        if (var->val_len < (rowreq_ctx->tbl_idx.${node}_len *
                            sizeof(rowreq_ctx->tbl_idx.${node}[0]))) {
           var->val.string = malloc(rowreq_ctx->tbl_idx.${node}_len *
                                    sizeof(rowreq_ctx->tbl_idx.${node}[0]));
        }
        var->val_len = rowreq_ctx->tbl_idx.${node}_len * sizeof(rowreq_ctx->tbl_idx.${node}[0]);
        memcpy( var->val.string, rowreq_ctx->tbl_idx.$node, var->val_len );
@         else@
        var->val_len = sizeof($m2c_decl);
        (*var->val.integer) = rowreq_ctx->tbl_idx.$node;
@         end@
        break;
@      end@ ## accessible
@   end@ ## index
@   foreach $node nonindex@
@      include m2c_setup_node.m2i@
@      if $node.accessible == 1@

    /* $m2c_node_summary */
    case COLUMN_$node.uc:
@   if $m2c_table_sparse == 1@
        if (! (COLUMN_$node.uc_FLAG & rowreq_ctx->column_exists_flags)) {
            DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_column",
                        "column %d ($node) doesn't exist\n", column));
            return MFD_SKIP;
        }

@   end@
##         use sizeof except for BITS
@         if $m2c_node_needlength == 0@
@            if "$node.perltype" eq "BITS"@
    {
        $m2c_decl mask = 0xff << ((sizeof($m2c_decl) - 1) * 8);
        int       idx = 0;
@            else@
    var->val_len = sizeof($m2c_decl);
@            end@
@         end@
    var->type = $node.type;
rc = ${node}_get(rowreq_ctx, $m2c_node_var_ref );
@         if ($m2c_node_needlength == 0) && ("$node.perltype" eq "BITS")@
        /*
         * check for length of bits string
         */
        var->val_len = 0;
        while( 0 != mask ) {
            ++idx;
            if ( *(($m2c_decl *) var->val.string) & mask )
                var->val_len = idx;
            mask = mask >> 8;
        }
    }
@         end@
        break;
 @      end@ # accessible
@   end@ # for each column

     default:
        if ($context.uc_MIN_COL <= column && column <= $context.uc_MAX_COL) {
            DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_column",
                "assume column %d is reserved\n", column));
            rc = MFD_SKIP;
        } else {
            snmp_log(LOG_ERR,
                "unknown column %d in _${context}_get_column\n", column);
        }
        break;
    }

    return rc;
} /* _${context}_get_column */

########################################################################
##
int
_mfd_${context}_get_values(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    netsnmp_table_request_info * tri;
    u_char                     * old_string;
    void                      (*dataFreeHook)(void *);
    int                        rc;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_get_values","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
@if $m2c_table_sparse == 1@
    DEBUGMSGTL(("9:${context}:_mfd_${context}_get_values",
                "exists %p\n", (void*)rowreq_ctx->column_exists_flags));

@end@
    for(;requests; requests = requests->next) {
        /*
         * save old pointer, so we can free it if replaced
         */
        old_string = requests->requestvb->val.string;
        dataFreeHook = requests->requestvb->dataFreeHook;
        if(NULL == requests->requestvb->val.string) {
            requests->requestvb->val.string = requests->requestvb->buf;
            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
        }
        else if(requests->requestvb->buf == requests->requestvb->val.string) {
            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
        }

        /*
         * get column data
         */
        tri = netsnmp_extract_table_info(requests);
        if(NULL == tri)
            continue;
        
        rc = _${context}_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
        if(rc) {
            if(MFD_SKIP == rc) {
                requests->requestvb->type = SNMP_NOSUCHINSTANCE;
                rc = SNMP_ERR_NOERROR;
            }
        }
        else if (NULL == requests->requestvb->val.string) {
            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
            rc = SNMP_ERR_GENERR;
        }
        if(rc)
            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));

        /*
         * if the buffer wasn't used previously for the old data (i.e. it
         * was allcoated memory)  and the get routine replaced the pointer,
         * we need to free the previous pointer.
         */
        if(old_string && (old_string != requests->requestvb->buf) &&
           (requests->requestvb->val.string != old_string)) {
            if(dataFreeHook)
                (*dataFreeHook)(old_string);
            else
                free(old_string);
        }
    } /* for results */

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_get_values */

########################################################################
##
/***********************************************************************
 *
 * SET processing
 *
 ***********************************************************************/

@if $m2c_table_settable == 0@
/*
 * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
 */
@else@
/*----------------------------------------------------------------------
 *
 * SET: Syntax checks
 *
 *---------------------------------------------------------------------*/
/*
 * @internal
 * Check the syntax for a particular column
 */
NETSNMP_STATIC_INLINE int
_${context}_check_column( ${context}_rowreq_ctx *rowreq_ctx,
                         netsnmp_variable_list *var, int column )
{
    int rc = SNMPERR_SUCCESS;
    
    DEBUGMSGTL(("internal:${context}:_${context}_check_column",
                "called for %d\n", column));

    netsnmp_assert(NULL != rowreq_ctx);

    switch(column) {
@   eval $m2c_nvv_item = "${m2c_context_item}tbl_idx."@
@   foreach $node internalindex@
@      include m2c_setup_node.m2i@
    /* (INDEX) $m2c_node_summary */
    case COLUMN_$node.uc:
        rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
        break;
@   end@ ## index
@   eval $m2c_nvv_item = "$m2c_data_item"@
@   foreach $node nonindex@
@      include m2c_setup_node.m2i@
@      if $node.settable == 0@

    /* $m2c_node_summary */
    case COLUMN_$node.uc:
        rc = SNMP_ERR_NOTWRITABLE;
        break;
@          next@
@      end@

    /* $m2c_node_summary */
    case COLUMN_$node.uc:
@      include node-varbind-validate.m2i@
    if(SNMPERR_SUCCESS != rc) {
        DEBUGMSGTL(("${context}:_${context}_check_column:$node",
                    "varbind validation failed (eg bad type or size)\n"));
    }
    else {
        rc = ${node}_check_value( rowreq_ctx, $m2c_node_var_val );
        if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
           (MFD_NOT_VALID_NOW != rc)) {
            snmp_log(LOG_ERR, "bad rc %d from ${node}_check_value\n", rc);
            rc = SNMP_ERR_GENERR;
        }
    }
        break;
@   end@ # for each nonindex

        default: /** We shouldn't get here */
            rc = SNMP_ERR_GENERR;
            snmp_log(LOG_ERR, "unknown column %d in _${context}_check_column\n", column);
    }

    return rc;
} /* _${context}_check_column */

##----------------------------------------------------------------------
int
_mfd_${context}_check_objects(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    netsnmp_table_request_info * tri;
    int                          rc;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_check_objects","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
    for(;requests; requests = requests->next) {

        /*
         * get column number from table request info, and check that column
         */
        tri = netsnmp_extract_table_info(requests);
        if(NULL == tri)
            continue;

        rc = _${context}_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
        if(rc) {
            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
            break;
        }

    } /* for results */

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_check_objects */


@      if $m2c_table_dependencies == 1@
/*----------------------------------------------------------------------
 *
 * SET: check dependencies
 *
 *---------------------------------------------------------------------*/
/*
 * @internal
 * Check dependencies wrapper
 */
static int
_mfd_${context}_check_dependencies(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    int                    rc;
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    DEBUGMSGTL(("internal:${context}:_mfd_${context}_check_dependencies","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

    rc = ${context}_check_dependencies(rowreq_ctx);
    if(rc){
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_check_dependencies\n", rc));
        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
    }

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_check_dependencies */

@end@ // dependencies
/*----------------------------------------------------------------------
 *
 * SET: Undo setup
 *
 *---------------------------------------------------------------------*/
/*
 * @internal
 * Set the value for a particular column
 */
NETSNMP_STATIC_INLINE int
_${context}_undo_setup_column( ${context}_rowreq_ctx *rowreq_ctx, int column )
{
    int rc = SNMPERR_SUCCESS;
    
    DEBUGMSGTL(("internal:${context}:_${context}_undo_setup_column",
                "called for %d\n", column));

    netsnmp_assert(NULL != rowreq_ctx);

    switch(column) {
@   foreach $node nonindex@
@      include m2c_setup_node.m2i@
@      if $node.settable == 1@

    /* $m2c_node_summary */
    case COLUMN_$node.uc:
        rowreq_ctx->column_set_flags |= COLUMN_$node.uc_FLAG;
        rc = ${node}_undo_setup(rowreq_ctx );
        break;
 @      end@ # settable
@   end@ # for each column

     default:
         snmp_log(LOG_ERR,"unknown column %d in _${context}_undo_setup_column\n", column);
         break;
    }

    return rc;
} /* _${context}_undo_setup_column */


##----------------------------------------------------------------------
/**
 * @internal
 * undo setup
 */
int
_mfd_${context}_undo_setup(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    int                    rc;
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_setup","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

@if $m2c_undo_embed == 0@
    /*
     * allocate undo context
     */
    rowreq_ctx->undo = ${context}_allocate_data();
    if(NULL == rowreq_ctx->undo) {
        /** msg already logged */
        netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
        return SNMP_ERR_NOERROR;
    }

@end@
    /*
     * row undo setup
     */
    rowreq_ctx->column_set_flags = 0;
    rc = ${context}_undo_setup(rowreq_ctx);
    if (MFD_SUCCESS != rc)  {
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_undo_setup\n", rc));
        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
    }
    else {
        /*
         * column undo setup
         */
        netsnmp_table_request_info * tri;
        for(;requests; requests = requests->next) {
            /*
             * set column data
             */
            tri = netsnmp_extract_table_info(requests);
            if(NULL == tri)
                continue;
            
            rc = _${context}_undo_setup_column(rowreq_ctx, tri->colnum);
            if(MFD_SUCCESS != rc)  {
                DEBUGMSGTL(("${context}:mfd","error %d from "
                            "${context}_undo_setup_column\n", rc));
                netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
            }
        } /* for results */
    }
    
    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_undo_setup */

/**
 * @internal
 * undo setup
 */
int
_mfd_${context}_undo_cleanup(netsnmp_mib_handler *handler,
                             netsnmp_handler_registration *reginfo,
                             netsnmp_agent_request_info *agtreq_info,
                             netsnmp_request_info *requests)
{
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    int rc;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_cleanup","called\n"));

    /*
     * failed row create in early stages has no rowreq_ctx
     */
    if (NULL == rowreq_ctx)
        return MFD_SUCCESS;

    /*
     * call user cleanup
     */
    rc = ${context}_undo_cleanup(rowreq_ctx);
    if (MFD_SUCCESS != rc) {
        /*
         * nothing we can do about it but log it
         */
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_undo_cleanup\n", rc));
    }

@if $m2c_undo_embed == 0@
    /*
     * release undo context, if needed
     */
    if(rowreq_ctx->undo) {
         ${context}_release_data(rowreq_ctx->undo);
         rowreq_ctx->undo = NULL;
    }

@end@

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_undo_cleanup */

/*----------------------------------------------------------------------
 *
 * SET: Set values
 *
 *---------------------------------------------------------------------*/
/*
 * @internal
 * Set the value for a particular column
 */
NETSNMP_STATIC_INLINE int
_${context}_set_column( ${context}_rowreq_ctx *rowreq_ctx,
                       netsnmp_variable_list *var, int column )
{
    int rc = SNMPERR_SUCCESS;
    
    DEBUGMSGTL(("internal:${context}:_${context}_set_column",
                "called for %d\n", column));

    netsnmp_assert(NULL != rowreq_ctx);

    switch(column) {
@   foreach $node nonindex@
@      include m2c_setup_node.m2i@
@      if $node.settable == 1@

    /* $m2c_node_summary */
    case COLUMN_$node.uc:
        rowreq_ctx->column_set_flags |= COLUMN_$node.uc_FLAG;
        rc = ${node}_set(rowreq_ctx, $m2c_node_var_val );
        break;
 @      end@ # settable
@   end@ # for each column

     default:
         snmp_log(LOG_ERR,"unknown column %d in _${context}_set_column\n", column);
         rc = SNMP_ERR_GENERR;
         break;
    }
    
    return rc;
} /* _${context}_set_column */

########################################################################
##
int
_mfd_${context}_set_values(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    netsnmp_table_request_info * tri;
    int                          rc = SNMP_ERR_NOERROR;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_set_values","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
    rowreq_ctx->column_set_flags = 0;
    for(;requests; requests = requests->next) {
        /*
         * set column data
         */
        tri = netsnmp_extract_table_info(requests);
        if(NULL == tri)
            continue;
        
        rc = _${context}_set_column(rowreq_ctx,
                                    requests->requestvb, tri->colnum);
        if(MFD_SUCCESS != rc)  {
            DEBUGMSGTL(("${context}:mfd","error %d from "
                        "${context}_set_column\n", rc));
            netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
        }
    } /* for results */

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_set_values */

/*----------------------------------------------------------------------
 *
 * SET: commit
 *
 *---------------------------------------------------------------------*/
/**
 * @internal
 * commit the values
 */
int
_mfd_${context}_commit(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    int                    rc;
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_commit","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
    rc = ${context}_commit(rowreq_ctx);
    if (MFD_SUCCESS != rc) {
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_commit\n", rc));
        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
    }

    if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
        /*
         * if we successfully commited this row, set the dirty flag. Use the
         * current value + 1 (i.e. dirty = # rows changed).
         * this is checked in post_request...
         */
        ${context}_dirty_set( ${context}_dirty_get() + 1 ); /* set table dirty flag */
    }

    return SNMP_ERR_NOERROR;
}

int
_mfd_${context}_undo_commit(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    int                    rc;
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_commit","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

    if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
        u_int  d = ${context}_dirty_get();

        netsnmp_assert(d != 0);
        if(d)
            ${context}_dirty_set( d - 1 );
    }

    rc = ${context}_undo_commit(rowreq_ctx);
    if (MFD_SUCCESS != rc) {
        /*
         * nothing we can do about it but log it
         */
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_undo_commit\n", rc));
    }

    if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
        snmp_log(LOG_WARNING, "${context} row dirty flag still set after undo_commit\n");
        rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
    }

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_commit */

/*----------------------------------------------------------------------
 *
 * SET: Undo
 *
 *---------------------------------------------------------------------*/
/**
 * @internal
 * undo the value for a particular column
 */
NETSNMP_STATIC_INLINE int
_${context}_undo_column( ${context}_rowreq_ctx *rowreq_ctx,
                       netsnmp_variable_list *var, int column )
{
    int rc = SNMPERR_SUCCESS;
    
    DEBUGMSGTL(("internal:${context}:_${context}_undo_column",
                "called for %d\n", column));

    netsnmp_assert(NULL != rowreq_ctx);

    switch(column) {
@   foreach $node nonindex@
@      include m2c_setup_node.m2i@
@      if $node.settable == 1@

    /* $m2c_node_summary */
    case COLUMN_$node.uc:
        rc = ${node}_undo(rowreq_ctx);
        break;
 @      end@ # settable
@   end@ # for each column

     default:
         snmp_log(LOG_ERR,"unknown column %d in _${context}_undo_column\n", column);
         break;
    }

    return rc;
} /* _${context}_undo_column */

########################################################################
##
int
_mfd_${context}_undo_values(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
    int                    rc;
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    netsnmp_table_request_info * tri;

    DEBUGMSGTL(("internal:${context}:_mfd_${context}_undo_values","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
    rc = ${context}_undo(rowreq_ctx);
    if (MFD_SUCCESS != rc) {
        /*
         * nothing we can do about it but log it
         */
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_undo\n", rc));
    }
    
    for(;requests; requests = requests->next) {
        /*
         * set column data
         */
        tri = netsnmp_extract_table_info(requests);
        if(NULL == tri)
            continue;
        
        rc = _${context}_undo_column(rowreq_ctx, requests->requestvb,
                                     tri->colnum);
        if (MFD_SUCCESS != rc) {
            /*
             * nothing we can do about it but log it
             */
            DEBUGMSGTL(("${context}:mfd","error %d from "
                        "${context}_undo_column\n", rc));
        }
    } /* for results */

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_undo_values */

/*----------------------------------------------------------------------
 *
 * SET: irreversible commit
 *
 *---------------------------------------------------------------------*/
/**
 * @internal
 * commit irreversible actions
 */
int
_mfd_${context}_irreversible_commit(netsnmp_mib_handler *handler,
                         netsnmp_handler_registration *reginfo,
                         netsnmp_agent_request_info *agtreq_info,
                         netsnmp_request_info *requests)
{
@   if $m2c_irreversible_commit == 1@
    int                    rc;
@   end@
    ${context}_rowreq_ctx *rowreq_ctx = (${context}_rowreq_ctx*)
                  netsnmp_container_table_row_extract(requests);
    
    DEBUGMSGTL(("internal:${context}:_mfd_${context}_irreversible:commit","called\n"));
   
    netsnmp_assert(NULL != rowreq_ctx);
    
@   if $m2c_irreversible_commit == 1@
    rc = ${context}_irreversible_commit(rowreq_ctx);
    if (MFD_SUCCESS != rc) {
        netsnmp_request_set_error_all(requests, SNMP_ERR_COMMITFAILED);
        DEBUGMSGTL(("${context}:mfd","error %d from "
                    "${context}_irreversible_commit\n", rc));
    }

@   end@
    /*
     * check for and handle row creation/deletion
     * and update column exist flags...
     */
    if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
        if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
            CONTAINER_REMOVE(${context}_if_ctx.container, rowreq_ctx);
    }
    else {
        if (rowreq_ctx->column_set_flags) {
@if $m2c_table_sparse == 1@
           DEBUGMSGTL(("internal:${context}:_mfd_irreversible_commit",
                       "updating exists (%p) w/set (%p) = %p\n",
                       rowreq_ctx->column_exists_flags,
                       rowreq_ctx->column_set_flags,
                       (rowreq_ctx->column_exists_flags |
                        rowreq_ctx->column_set_flags)));
           rowreq_ctx->column_exists_flags |=
           rowreq_ctx->column_set_flags;
@end@ # sparse
           rowreq_ctx->column_set_flags = 0;
        }
@if ($m2c_table_row_creation == 1)@
        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
            CONTAINER_INSERT(${context}_if_ctx.container, rowreq_ctx);
        }
@end@ # creation
    }

    return SNMP_ERR_NOERROR;
} /* _mfd_${context}_irreversible_commit */

@end@ # settable
/***********************************************************************
 *
 * DATA ACCESS
 *
 ***********************************************************************/
@    include mfd-access-${m2c_table_access}-defines.m2i@
@    if $m2c_table_persistent == 1@
@       include mfd-persistence.m2i@
@    end@

${context}_rowreq_ctx *
${context}_row_find_by_mib_index(${context}_mib_index *mib_idx)
{
    ${context}_rowreq_ctx   *rowreq_ctx;
    oid                      oid_tmp[MAX_OID_LEN];
    netsnmp_index            oid_idx;
    int                      rc;

    /*
     * set up storage for OID
     */
    oid_idx.oids = oid_tmp;
    oid_idx.len = sizeof(oid_tmp)/sizeof(oid);

    /*
     * convert
     */
    rc = ${context}_index_to_oid(&oid_idx, mib_idx);
    if (MFD_SUCCESS != rc)
        return NULL;

    rowreq_ctx = (${context}_rowreq_ctx*)CONTAINER_FIND(${context}_if_ctx.container, &oid_idx);

    return rowreq_ctx;
}

@   if $m2c_table_refcounts == 1@
int
${context}_row_ref_increment(${context}_rowreq_ctx *rowreq_ctx)
{
    if (NULL == rowreq_ctx)
        return -1;
    
    ++rowreq_ctx->ref_count;
    DEBUGMSGTL(("${context}:${context}_row_ref_increment",
                "row %p ref count is %d\n",rowreq_ctx,
                rowreq_ctx->ref_count));

    return MFD_SUCCESS;
}

int
${context}_row_ref_decrement(${context}_rowreq_ctx *rowreq_ctx)
{
    if (NULL == rowreq_ctx)
        return -1;
    
    if (0 == rowreq_ctx->ref_count) {
        snmp_log(LOG_WARNING,"attempt to decrement ref_count below 0\n");
        return -2;
    }
    --rowreq_ctx->ref_count;
    DEBUGMSGTL(("${context}:${context}_row_ref_decrement",
                "row %p ref count is %d\n",rowreq_ctx,
                rowreq_ctx->ref_count));

    return MFD_SUCCESS;
}
    
@   end@ // refcounts
@end@ # foreach table
##
########################################################################
@if $m2c_mark_boundary == 1@
/** END code generated by $RCSfile$ $Revision$ */
@end@