/*
 * White Rabbit SNMP
 * Copyright (C) 2010, CERN.
 *
 * Version:     wrsw_snmpd v1.0
 *
 * Authors:     Miguel Baizán (miguel.baizan@integrasys-sa.com)
 *
 * Description: Definition of the basic structures (indexes, rows,
 *              container) used to serve the SNMP requests. Init and clean up
 *              functions for the structures holding the container.
 *              Note: this file originally auto-generated by mib2c using
 *              mib2c.mfd.conf 17337
 *
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef IEEE8021BRIDGEBASETABLE_H
#define IEEE8021BRIDGEBASETABLE_H

#ifdef __cplusplus
extern "C" {
#endif


/** @addtogroup misc misc: Miscellaneous routines
 *
 * @{
 */
#include <net-snmp/library/asn1.h>

/* other required module components */
    /* *INDENT-OFF*  */
config_add_mib(IEEE8021-BRIDGE-MIB)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeBaseTable/ieee8021BridgeBaseTable_interface)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeBaseTable/ieee8021BridgeBaseTable_data_access)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeBaseTable/ieee8021BridgeBaseTable_data_get)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeBaseTable/ieee8021BridgeBaseTable_data_set)
    /* *INDENT-ON*  */

/* OID and column number definitions for ieee8021BridgeBaseTable */
#include "ieee8021BridgeBaseTable_oids.h"

/* enum definions */
#include "ieee8021BridgeBaseTable_enums.h"


#define DEFAULT_COMPONENTID 1
#define MAX_IFNAME_SIZE 16

/* *********************************************************************
 * function declarations
 */
void init_ieee8021BridgeBaseTable(void);
void shutdown_ieee8021BridgeBaseTable(void);

/* *********************************************************************
 * Table declarations
 */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ieee8021BridgeBaseTable
 ***
 **********************************************************************
 **********************************************************************/
/*
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeBaseTable is subid 1 of ieee8021BridgeBase.
 * Its status is Current.
 * OID: .1.3.111.2.802.1.1.2.1.1.1, length: 11
*/
/* *********************************************************************
 * When you register your mib, you get to provide a generic
 * pointer that will be passed back to you for most of the
 * functions calls.
 *
 * TODO:100:r: Review all context structures
 */
    /*
     * TODO:101:o: |-> Review ieee8021BridgeBaseTable registration context.
     */
typedef netsnmp_data_list ieee8021BridgeBaseTable_registration;

/**********************************************************************/
/*
 * TODO:110:r: |-> Review ieee8021BridgeBaseTable data context structure.
 * This structure is used to represent the data for ieee8021BridgeBaseTable.
 */
/*
 * This structure contains storage for all the columns defined in the
 * ieee8021BridgeBaseTable.
 */
typedef struct ieee8021BridgeBaseTable_data_s {

        /*
         * ieee8021BridgeBaseBridgeAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
         */
   char   ieee8021BridgeBaseBridgeAddress[6];
size_t      ieee8021BridgeBaseBridgeAddress_len; /* # of char elements, not bytes */

        /*
         * ieee8021BridgeBaseNumPorts(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
         */
   long   ieee8021BridgeBaseNumPorts;

        /*
         * ieee8021BridgeBaseComponentType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
         */
   u_long   ieee8021BridgeBaseComponentType;

        /*
         * ieee8021BridgeBaseDeviceCapabilities(5)/BITS/ASN_OCTET_STR/char(u_long)//L/A/W/E/r/d/h
         */
   u_long   ieee8021BridgeBaseDeviceCapabilities;

        /*
         * ieee8021BridgeBaseTrafficClassesEnabled(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
         */
   u_long   ieee8021BridgeBaseTrafficClassesEnabled;

        /*
         * ieee8021BridgeBaseMmrpEnabledStatus(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
         */
   u_long   ieee8021BridgeBaseMmrpEnabledStatus;

        /*
         * ieee8021BridgeBaseRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
         */
   u_long   ieee8021BridgeBaseRowStatus;

} ieee8021BridgeBaseTable_data;


/* *********************************************************************
 * TODO:115:o: |-> Review ieee8021BridgeBaseTable undo context.
 * We're just going to use the same data structure for our
 * undo_context. If you want to do something more efficent,
 * define your typedef here.
 */
typedef ieee8021BridgeBaseTable_data ieee8021BridgeBaseTable_undo_data;

/*
 * TODO:120:r: |-> Review ieee8021BridgeBaseTable mib index.
 * This structure is used to represent the index for ieee8021BridgeBaseTable.
 */
typedef struct ieee8021BridgeBaseTable_mib_index_s {

        /*
         * ieee8021BridgeBaseComponentId(1)/IEEE8021PbbComponentIdentifier/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
         */
   u_long   ieee8021BridgeBaseComponentId;


} ieee8021BridgeBaseTable_mib_index;

    /*
     * TODO:121:r: |   |-> Review ieee8021BridgeBaseTable max index length.
     * If you KNOW that your indexes will never exceed a certain
     * length, update this macro to that length.
*/
#define MAX_ieee8021BridgeBaseTable_IDX_LEN     1


/* *********************************************************************
 * TODO:130:o: |-> Review ieee8021BridgeBaseTable Row request (rowreq) context.
 * When your functions are called, you will be passed a
 * ieee8021BridgeBaseTable_rowreq_ctx pointer.
 */
typedef struct ieee8021BridgeBaseTable_rowreq_ctx_s {

    /** this must be first for container compare to work */
    netsnmp_index        oid_idx;
    oid                  oid_tmp[MAX_ieee8021BridgeBaseTable_IDX_LEN];

    ieee8021BridgeBaseTable_mib_index        tbl_idx;

    ieee8021BridgeBaseTable_data              data;
    unsigned int                column_exists_flags; /* flags for existence */
    ieee8021BridgeBaseTable_undo_data       * undo;
    unsigned int                column_set_flags; /* flags for set columns */


    /*
     * flags per row. Currently, the first (lower) 8 bits are reserved
     * for the user. See mfd.h for other flags.
     */
    u_int                       rowreq_flags;

    /*
     * TODO:131:o: |   |-> Add useful data to ieee8021BridgeBaseTable rowreq context.
     */

    /*
     * storage for future expansion
     */
    netsnmp_data_list             *ieee8021BridgeBaseTable_data_list;

} ieee8021BridgeBaseTable_rowreq_ctx;

typedef struct ieee8021BridgeBaseTable_ref_rowreq_ctx_s {
    ieee8021BridgeBaseTable_rowreq_ctx *rowreq_ctx;
} ieee8021BridgeBaseTable_ref_rowreq_ctx;

/* *********************************************************************
 * function prototypes
 */
    int ieee8021BridgeBaseTable_pre_request(ieee8021BridgeBaseTable_registration * user_context);
    int ieee8021BridgeBaseTable_post_request(ieee8021BridgeBaseTable_registration * user_context,
        int rc);

    int ieee8021BridgeBaseTable_rowreq_ctx_init(ieee8021BridgeBaseTable_rowreq_ctx *rowreq_ctx,
                                   void *user_init_ctx);
    void ieee8021BridgeBaseTable_rowreq_ctx_cleanup(ieee8021BridgeBaseTable_rowreq_ctx *rowreq_ctx);

    int ieee8021BridgeBaseTable_check_dependencies(ieee8021BridgeBaseTable_rowreq_ctx * rowreq_ctx);
    int ieee8021BridgeBaseTable_commit(ieee8021BridgeBaseTable_rowreq_ctx * rowreq_ctx);

    ieee8021BridgeBaseTable_rowreq_ctx *
                  ieee8021BridgeBaseTable_row_find_by_mib_index(ieee8021BridgeBaseTable_mib_index *mib_idx);

extern const oid ieee8021BridgeBaseTable_oid[];
extern const int ieee8021BridgeBaseTable_oid_size;


#include "ieee8021BridgeBaseTable_interface.h"
#include "ieee8021BridgeBaseTable_data_access.h"
#include "ieee8021BridgeBaseTable_data_get.h"
#include "ieee8021BridgeBaseTable_data_set.h"

/*
 * DUMMY markers, ignore
 *
 * TODO:099:x: *************************************************************
 * TODO:199:x: *************************************************************
 * TODO:299:x: *************************************************************
 * TODO:399:x: *************************************************************
 * TODO:499:x: *************************************************************
 */

#ifdef __cplusplus
}
#endif

#endif /* IEEE8021BRIDGEBASETABLE_H */
/** @} */
