/*
 * 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 IEEE8021BRIDGETRAFFICCLASSTABLE_H
#define IEEE8021BRIDGETRAFFICCLASSTABLE_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/ieee8021BridgeTrafficClassTable/ieee8021BridgeTrafficClassTable_interface)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeTrafficClassTable/ieee8021BridgeTrafficClassTable_data_access)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeTrafficClassTable/ieee8021BridgeTrafficClassTable_data_get)
config_require(IEEE8021-BRIDGE-MIB/ieee8021BridgeTrafficClassTable/ieee8021BridgeTrafficClassTable_data_set)
    /* *INDENT-ON*  */

/* OID and column number definitions for ieee8021BridgeTrafficClassTable */
#include "ieee8021BridgeTrafficClassTable_oids.h"

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


#define DEFAULT_COMPONENTID 1

/* Custom IOCTLs */
#define PRIV_IOCGGETECR (SIOCDEVPRIVATE+5)
#define WRN_ECR_GET_PORTID 4

/* For custom ioctl operations on endpoint registers */
struct wrn_register_req {
    int         cmd;
    uint32_t    val;
};

/* *********************************************************************
 * function declarations
 */
void init_ieee8021BridgeTrafficClassTable(void);
void shutdown_ieee8021BridgeTrafficClassTable(void);

/* *********************************************************************
 * Table declarations
 */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ieee8021BridgeTrafficClassTable
 ***
 **********************************************************************
 **********************************************************************/
/*
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTrafficClassTable is subid 3 of ieee8021BridgePriority.
 * Its status is Current.
 * OID: .1.3.111.2.802.1.1.2.1.3.3, 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 ieee8021BridgeTrafficClassTable registration context.
     */
typedef netsnmp_data_list ieee8021BridgeTrafficClassTable_registration;

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

        /*
         * ieee8021BridgeTrafficClass(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
         */
   long   ieee8021BridgeTrafficClass;

} ieee8021BridgeTrafficClassTable_data;


/* *********************************************************************
 * TODO:115:o: |-> Review ieee8021BridgeTrafficClassTable 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 ieee8021BridgeTrafficClassTable_data ieee8021BridgeTrafficClassTable_undo_data;

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

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

        /*
         * ieee8021BridgeBasePort(2)/IEEE8021BridgePortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
         */
   u_long   ieee8021BridgeBasePort;

        /*
         * ieee8021BridgeTrafficClassPriority(1)/IEEE8021PriorityValue/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
         */
   u_long   ieee8021BridgeTrafficClassPriority;


} ieee8021BridgeTrafficClassTable_mib_index;

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


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

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

    ieee8021BridgeTrafficClassTable_mib_index        tbl_idx;

    ieee8021BridgeTrafficClassTable_data              data;
    unsigned int                column_exists_flags; /* flags for existence */
    ieee8021BridgeTrafficClassTable_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 ieee8021BridgeTrafficClassTable rowreq context.
     */

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

} ieee8021BridgeTrafficClassTable_rowreq_ctx;

typedef struct ieee8021BridgeTrafficClassTable_ref_rowreq_ctx_s {
    ieee8021BridgeTrafficClassTable_rowreq_ctx *rowreq_ctx;
} ieee8021BridgeTrafficClassTable_ref_rowreq_ctx;

/* *********************************************************************
 * function prototypes
 */
    int ieee8021BridgeTrafficClassTable_pre_request(ieee8021BridgeTrafficClassTable_registration * user_context);
    int ieee8021BridgeTrafficClassTable_post_request(ieee8021BridgeTrafficClassTable_registration * user_context,
        int rc);

    int ieee8021BridgeTrafficClassTable_rowreq_ctx_init(ieee8021BridgeTrafficClassTable_rowreq_ctx *rowreq_ctx,
                                   void *user_init_ctx);
    void ieee8021BridgeTrafficClassTable_rowreq_ctx_cleanup(ieee8021BridgeTrafficClassTable_rowreq_ctx *rowreq_ctx);

    int ieee8021BridgeTrafficClassTable_check_dependencies(ieee8021BridgeTrafficClassTable_rowreq_ctx * rowreq_ctx);
    int ieee8021BridgeTrafficClassTable_commit(ieee8021BridgeTrafficClassTable_rowreq_ctx * rowreq_ctx);

    ieee8021BridgeTrafficClassTable_rowreq_ctx *
                  ieee8021BridgeTrafficClassTable_row_find_by_mib_index(ieee8021BridgeTrafficClassTable_mib_index *mib_idx);

extern const oid ieee8021BridgeTrafficClassTable_oid[];
extern const int ieee8021BridgeTrafficClassTable_oid_size;


#include "ieee8021BridgeTrafficClassTable_interface.h"
#include "ieee8021BridgeTrafficClassTable_data_access.h"
#include "ieee8021BridgeTrafficClassTable_data_get.h"
#include "ieee8021BridgeTrafficClassTable_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 /* IEEE8021BRIDGETRAFFICCLASSTABLE_H */
/** @} */
