252N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 252N/A * U.S. Government Rights - Commercial software. Government users are subject 252N/A * to the Sun Microsystems, Inc. standard license agreement and applicable 252N/A * provisions of the FAR and its supplements. 252N/A * This distribution may include materials developed by third parties. Sun, 252N/A * Sun Microsystems, the Sun logo and Solaris are trademarks or registered 252N/A * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 252N/A * Note: this file originally auto-generated by mib2c using 252N/A/** Initialize the entAliasMappingTable table by defining its contents and how it's structured */ 252N/A /* create the table structure itself */ 252N/A /* if your table is read only, it's easiest to change the 252N/A HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY */ 252N/A /* Fix for 4910624 - changing HANDLER_CAN_RWRITE to HANDLER_CAN_RONLY */ 252N/A /* End of Fix for 4910624 */ 252N/A return;
/* mallocs failed */ 252N/A /*************************************************** 252N/A * Setting up the table's definition 252N/A /* iterator access routines */ 252N/A /*************************************************** 252N/A * registering the table with the master agent 252N/A "Registering table entAliasMappingTable as a table iterator\n"));
252N/A/** Initializes the entAliasMappingTable module */ 252N/A /* here we initialize all the tables we're planning on supporting */ 252N/A/** returns the first data point within the entAliasMappingTable table data. 252N/A Set the my_loop_context variable to the first data point structure 252N/A of your choice (from which you can find the next one). This could 252N/A be anything from the first node in a linked list, to an integer 252N/A pointer containing the beginning of an array variable. 252N/A Set the my_data_context variable to something to be returned to 252N/A you later that will provide you with the data to return in a given 252N/A row. This could be the same pointer as what my_loop_context is 252N/A set to, or something different. 252N/A The put_index_data variable contains a list of snmp variable 252N/A bindings, one for each index in your table. Set the values of 252N/A each appropriately according to the data matching the first row 252N/A and return the put_index_data variable at the end of the function. 252N/A/** functionally the same as entAliasMappingTable_get_first_data_point, but 252N/A my_loop_context has already been set to a previous value and should 252N/A be updated to the next in the list. For example, if it was a 252N/A linked list, you might want to cast it and the return 252N/A my_loop_context->next. The my_data_context pointer should be set 252N/A to something you need later and the indexes in put_index_data 252N/A/** handles requests for the entAliasMappingTable table, if anything else needs to be done */ 252N/A /* perform anything here that you need to do before each 252N/A request is processed. */ 252N/A /* the following extracts the my_data_context pointer set in 252N/A the loop functions above. You can then use the results to 252N/A help return data for the columns of the entAliasMappingTable table in question */ 252N/A /* XXX: no row existed, if you support creation and this is a 252N/A set, start dealing with it here, else continue */ 252N/A /* extracts the information about the table from the request */ 252N/A /* table_info->colnum contains the column number requested */ 252N/A /* table_info->indexes contains a linked list of snmp variable 252N/A bindings for the indexes of the table. Values in the list 252N/A have been set corresponding to the indexes of the 252N/A /* the table_iterator helper should change all GETNEXTs 252N/A into GETs for you automatically, so you don't have to 252N/A worry about the GETNEXT case. Only GETs and SETs need 252N/A to be dealt with here */ 252N/A /* We shouldn't get here */ 252N/A/* Add an entry into the Alias Mapping Table 252N/A 1 for entry already exist 252N/A /* Fix for 4927412: Rejects NULL xAliasMapId */ 252N/A /* End of Fix for 4927412 */ 252N/A /* Fix for 4888088: logical index cannot be smaller than zero, */ 252N/A /* and physical index cannot be smaller than */ 252N/A /* or equal to zero. -2 for stale entries */ 252N/A /* End of Fix for 4888088 */ 252N/A }
else {
/* Add phy index to last entry in the array */ 252N/A/* Returns 0 for successful deletion 252N/A /* Fix for 4888088: logical index cannot be smaller than zero, */ 252N/A /* and physical index cannot be smaller than */ 252N/A /* or equal to zero. -2 for stale entries */ 252N/A /* End of Fix for 4888088 */ 252N/A return (-
1);
/* Entry not found */ 252N/A /* Fix for 4906853: we only need to free it (and count) if */ 252N/A /* entAliasMapId != NULL. A better fix is to use a link list */ 252N/A /* instead of an array for this structure */ 252N/A /* End of Fix for 4906853 */ 252N/A/* Deletes all the entries in the table with primary index as 252N/A Return number of entries deleted on success, 252N/A -2 for a existing stale entry 252N/A /* Fix for 4888088: We do not need the check for 4883511 anymore, */ 252N/A /* because entAliasLogicalIndexorZero will never be set */ 252N/A /* to negative values. Instead we will check if the */ 252N/A /* entries are stale (except when xentLogicalIndex = 0) */ 252N/A /* End of Fix for 4888088 */ 252N/A/* Deletes all entries of the table for a given logical index. 252N/A Returns the number if entries deleted 252N/A -1 if the entry is not found 252N/A -2 if the logical index is stale 252N/A The memory allocated is freed when the primary index, physical index 252N/A /* Fix for 4888088: Here we are not allowing logical index = 0. We are */ 252N/A /* forcing the user to use deleteAliasMappingTableEntry */ 252N/A /* End of Fix for 4888088 */ 252N/A /* End of Fix for 4888088 */