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 entLogicalTable 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 entLogicalTable as a table iterator\n"));
252N/A/** Initializes the entLogicalTable module */ 252N/A /* here we initialize all the tables we're planning on supporting */ 252N/A/** returns the first data point within the entLogicalTable 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 entLogicalTable_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 entLogicalTable 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 entLogicalTable 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 * Allocates a Logical entry. if logicidx >0 attempts to reuse an 252N/A /* End of Fix for 4893101 */ 252N/A /* End of Fix for 4927412 */ 252N/A /* Fix for 4927412: according to RFC 2737, entLogicalDescr has to be */ 252N/A /* unique - NULL should be rejected. */ 252N/A /* entLogicalTAddress should not accept NULL or "". */ 252N/A /* entLogicalTDomain should not accept NULL */ 252N/A /* entLogicalType will default to mib-2 for */ 252N/A /* NULL. For the rest, we will force NULL = "" */ 252N/A /* (zero-length string) */ 252N/A /* Fix for 4893101: We have to check for NULL so that it does not */ 252N/A /* crash. Also we need to have mib-2 as the default, */ 252N/A /* as outlined in the RFC */ 252N/A /* End of Fix for 4893101 */ 252N/A /* End of Fix for 4927412 */ 252N/A /* End of Fix for 4921309 */ 252N/A /* Fix for 4911817: Check for size and boundary limits */ 252N/A /* entLogicalDescr 0..255 */ 252N/A /* entLogicalCommunity 0..255 (deprecated) */ 252N/A /* entLogicalTAddress 1..255 */ 252N/A /* entLogicalContextEngineId 0..32 */ 252N/A /* entLogicalContextName 0..255 */ 252N/A /* End of Fix for 4911817 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* Fix for 4926767: We do not want NULL TDomain */ 252N/A /* End of Fix for 4926767 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* End of Fix for 4884526 */ 252N/A /* If index > 0, attempt to insert in appropriate place. */ 252N/A /* If the indexes don't match, we can use the specified index */ 252N/A /* Index > last value, make this the last entry */ 252N/A /* Index < zRunner, insert entry before it */ 252N/A /* Index fits before list head, insert entry */ 252N/A /* Index fits between two entries, insert entry */ 252N/A /* Re-initialize for code that follows */ 252N/A /* Either index was zero or specified index is already taken */ 252N/A /* End of Fix for 4921309 */ 252N/A /* End of Fix for 4888088 */ 252N/A return (-
2);
/* Entry is already stale */ 252N/A /* Fix for 4918876: We need to delete the related entries first */ 252N/A Delete all instances of this logical index in all other 252N/A tables to maintain table integrity. Should we roll-back if a 252N/A deletion fails, perhaps not 252N/A /* End of Fix for 4918876 */ 252N/A /* End of Fix for 4888088 */ 252N/A return (-
2);
/* Entry is already live */ 252N/A /* End of Fix for 4888088 */ 252N/A return NULL;
/* The stale entry exist, we can stop the search*/ 252N/A /* End of Fix for 4888088 */ 252N/A return NULL;
/* The live entry exist, we can stop the search*/ 252N/A /* End of Fix for 4888088 */ 252N/A /* Fix for 4918876: We need to delete the related entries */ 252N/A Delete all instances of this logical index in all other 252N/A tables to maintain table integrity. Should we roll-back if a 252N/A deletion fails, perhaps not 252N/A /* End of Fix for 4918876 */ 252N/A return (-
2);
/* The stale entry exist, we can stop the search*/