/*
 * Note: this file originally auto-generated by mib2c using
 *       version $ of $ 
 *
 * $Id:$
 */
/** \page MFD helper for dot1qPortVlanTable
 *
 * \section intro Introduction
 * Introductory text.
 *
 */
/* standard Net-SNMP includes */
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-features.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>

/* include our parent header */
#include "dot1qPortVlanTable.h"

#include <net-snmp/agent/mib_modules.h>

#include "dot1qPortVlanTable_interface.h"

const oid dot1qPortVlanTable_oid[] = { DOT1QPORTVLANTABLE_OID };
const int dot1qPortVlanTable_oid_size = OID_LENGTH(dot1qPortVlanTable_oid);

    dot1qPortVlanTable_registration  dot1qPortVlanTable_user_context;

void initialize_table_dot1qPortVlanTable(void);
void shutdown_table_dot1qPortVlanTable(void);


/**
 * Initializes the dot1qPortVlanTable module
 */
void
init_dot1qPortVlanTable(void)
{
    DEBUGMSGTL(("verbose:dot1qPortVlanTable:init_dot1qPortVlanTable","called\n"));

    /*
     * TODO:300:o: Perform dot1qPortVlanTable one-time module initialization.
     */
     
    /*
     * here we initialize all the tables we're planning on supporting
     */
    if (should_init("dot1qPortVlanTable"))
        initialize_table_dot1qPortVlanTable();

} /* init_dot1qPortVlanTable */

/**
 * Shut-down the dot1qPortVlanTable module (agent is exiting)
 */
void
shutdown_dot1qPortVlanTable(void)
{
    if (should_init("dot1qPortVlanTable"))
        shutdown_table_dot1qPortVlanTable();

}

/**
 * Initialize the table dot1qPortVlanTable 
 *    (Define its contents and how it's structured)
 */
void
initialize_table_dot1qPortVlanTable(void)
{
    dot1qPortVlanTable_registration * user_context;
    u_long flags;

    DEBUGMSGTL(("verbose:dot1qPortVlanTable:initialize_table_dot1qPortVlanTable","called\n"));

    /*
     * TODO:301:o: Perform dot1qPortVlanTable one-time table initialization.
     */

    /*
     * TODO:302:o: |->Initialize dot1qPortVlanTable user context
     * if you'd like to pass in a pointer to some data for this
     * table, allocate or set it up here.
     */
    /*
     * a netsnmp_data_list is a simple way to store void pointers. A simple
     * string token is used to add, find or remove pointers.
     */
    user_context = netsnmp_create_data_list("dot1qPortVlanTable", NULL, NULL);
    
    /*
     * No support for any flags yet, but in the future you would
     * set any flags here.
     */
    flags = 0;
    
    /*
     * call interface initialization code
     */
    _dot1qPortVlanTable_initialize_interface(user_context, flags);
} /* initialize_table_dot1qPortVlanTable */

/**
 * Shutdown the table dot1qPortVlanTable 
 */
void
shutdown_table_dot1qPortVlanTable(void)
{
    /*
     * call interface shutdown code
     */
    _dot1qPortVlanTable_shutdown_interface(&dot1qPortVlanTable_user_context);
}

/**
 * extra context initialization (eg default values)
 *
 * @param rowreq_ctx    : row request context
 * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
 *
 * @retval MFD_SUCCESS  : no errors
 * @retval MFD_ERROR    : error (context allocate will fail)
 */
int
dot1qPortVlanTable_rowreq_ctx_init(dot1qPortVlanTable_rowreq_ctx *rowreq_ctx,
                           void *user_init_ctx)
{
    DEBUGMSGTL(("verbose:dot1qPortVlanTable:dot1qPortVlanTable_rowreq_ctx_init","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
    /*
     * TODO:210:o: |-> Perform extra dot1qPortVlanTable rowreq initialization. (eg DEFVALS)
     */
    rowreq_ctx->data.dot1qPvid = 1;
    
    rowreq_ctx->data.dot1qPortAcceptableFrameTypes = DOT1QPORTACCEPTABLEFRAMETYPES_ADMITALL;
    
    rowreq_ctx->data.dot1qPortIngressFiltering = TRUTHVALUE_FALSE;
    
    rowreq_ctx->data.dot1qPortGvrpStatus = ENABLEDSTATUS_ENABLED;
    
    rowreq_ctx->data.dot1qPortRestrictedVlanRegistration = TRUTHVALUE_FALSE;
    

    return MFD_SUCCESS;
} /* dot1qPortVlanTable_rowreq_ctx_init */

/**
 * extra context cleanup
 *
 */
void dot1qPortVlanTable_rowreq_ctx_cleanup(dot1qPortVlanTable_rowreq_ctx *rowreq_ctx)
{
    DEBUGMSGTL(("verbose:dot1qPortVlanTable:dot1qPortVlanTable_rowreq_ctx_cleanup","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);
    
    /*
     * TODO:211:o: |-> Perform extra dot1qPortVlanTable rowreq cleanup.
     */
} /* dot1qPortVlanTable_rowreq_ctx_cleanup */

/**
 * pre-request callback
 *
 *
 * @retval MFD_SUCCESS              : success.
 * @retval MFD_ERROR                : other error
 */
int
dot1qPortVlanTable_pre_request(dot1qPortVlanTable_registration * user_context)
{
    DEBUGMSGTL(("verbose:dot1qPortVlanTable:dot1qPortVlanTable_pre_request","called\n"));

    /*
     * TODO:510:o: Perform dot1qPortVlanTable pre-request actions.
     */

    return MFD_SUCCESS;
} /* dot1qPortVlanTable_pre_request */

/**
 * post-request callback
 *
 * Note:
 *   New rows have been inserted into the container, and
 *   deleted rows have been removed from the container and
 *   released.
 *
 * @param user_context
 * @param rc : MFD_SUCCESS if all requests succeeded
 *
 * @retval MFD_SUCCESS : success.
 * @retval MFD_ERROR   : other error (ignored)
 */
int
dot1qPortVlanTable_post_request(dot1qPortVlanTable_registration * user_context, int rc)
{
    DEBUGMSGTL(("verbose:dot1qPortVlanTable:dot1qPortVlanTable_post_request","called\n"));

    /*
     * TODO:511:o: Perform dot1qPortVlanTable post-request actions.
     */

    return MFD_SUCCESS;
} /* dot1qPortVlanTable_post_request */


/** @{ */
