libdessert0.87-0.87.2/0000755000175000017500000000000011331020526012372 5ustar dvddvdlibdessert0.87-0.87.2/dessert_agentx.c0000644000175000017500000003714511331020526015567 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by David Gutzmann at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" /* global data storage // P U B L I C */ /* global data storage // P R I V A T E */ pthread_rwlock_t _dessert_appstats_cblist_lock = PTHREAD_RWLOCK_INITIALIZER; dessert_agentx_appstats_cb_entry_t *_dessert_appstats_cblist = NULL; pthread_rwlock_t _dessert_appparams_cblist_lock = PTHREAD_RWLOCK_INITIALIZER; dessert_agentx_appparams_cb_entry_t *_dessert_appparams_cblist = NULL; /* local data storage*/ int keep_snmp_running = 1; pthread_mutex_t _dessert_agentx_appparams_nextindex_mutex = PTHREAD_MUTEX_INITIALIZER; uint8_t _dessert_agentx_appparams_nextindex = 0; /* internal functions forward declarations*/ static void *_dessert_agentx_worker(void *arg); static dessert_agentx_appstats_cb_entry_t *_dessert_agentx_appstats_add( dessert_agentx_appstatscb_get_t *c, uint8_t bulknobulk_flag); static uint8_t _dessert_agentx_appparams_new_index(void); /****************************************************************************** * * EXTERNAL / PUBLIC * * NET - S N M P // A G E N T _ X * ******************************************************************************/ /****************************************************************************** * appStats ******************************************************************************/ /** Creates and initializes a new dessert_agentx_appstats_t. * * @return the new dessert_agentx_appstats_t * * @warning A dessert_agentx_appstats_t allocated with this function must be * freed with dessert_agentx_appstats_destroy(). * * @see dessert_agentx_appstats_destroy() * * @par Description:\n * */ dessert_agentx_appstats_t *dessert_agentx_appstats_new() { dessert_agentx_appstats_t *appstat; appstat = malloc(sizeof(dessert_agentx_appstats_t)); appstat->prev = appstat; appstat->next = NULL; memset(appstat->name,0, sizeof(appstat->name)); memset(appstat->desc,0, sizeof(appstat->desc)); appstat->value_type = DESSERT_APPSTATS_VALUETYPE_BOOL; appstat->node_or_link = DESSERT_APPSTATS_NODEORLINK_NONE; memset(appstat->macaddress1, 0, ETHER_ADDR_LEN); memset(appstat->macaddress2, 0, ETHER_ADDR_LEN); appstat->bool = DESSERT_APPSTATS_BOOL_FALSE; return appstat; } /** Frees a dessert_agentx_appstats_t. * * @param appstat the dessert_agentx_appstats_t to be freed * * @warning Only use this method to free a dessert_agentx_appstats_t which was allocated with dessert_agentx_appstats_new(). * * @see dessert_agentx_appstats_new() * * @par Description:\n */ void dessert_agentx_appstats_destroy(dessert_agentx_appstats_t *appstat) { free(appstat); } /** Adds an application statistics callback. * * @param[in] *c the callback to add * * @retval pointer to the corresponding callback entry on success * @retval NULL otherwise * * @par Description:\n * */ dessert_agentx_appstats_cb_entry_t *dessert_agentx_appstats_add( dessert_agentx_appstatscb_get_t *c) { return (_dessert_agentx_appstats_add(c, DESSERT_APPSTATS_CB_NOBULK)); } /** Adds an application statistics bulk callback. * * @param[in] *c the callback to add * * @retval pointer to the corresponding callback entry on success * @retval NULL otherwise * * @par Description:\n * */ dessert_agentx_appstats_cb_entry_t *dessert_agentx_appstats_add_bulk( dessert_agentx_appstatscb_get_t *c) { return (_dessert_agentx_appstats_add(c, DESSERT_APPSTATS_CB_BULK)); } /** Deletes an application statistics callback. * * @param *e pointer to a callback entry * * @retval DESSERT_OK on success * @retval DESSERT_ERR otherwise * * @see dessert_agentx_appstats_add() * @see dessert_agentx_appstats_add_bulk() * * @par Description:\n */ int dessert_agentx_appstats_del(dessert_agentx_appstats_cb_entry_t *e) { if (e == NULL) { return DESSERT_ERR; } pthread_rwlock_wrlock(&_dessert_appstats_cblist_lock); DL_DELETE(_dessert_appstats_cblist, e); pthread_rwlock_unlock(&_dessert_appstats_cblist_lock); free(e); return DESSERT_OK; } /****************************************************************************** * appParams ******************************************************************************/ /** Creates and initializes a new dessert_agentx_appparams_t. * * @return the new dessert_agentx_appparams_t * * @warning A dessert_agentx_appparams_t allocated with this function must be * freed with dessert_agentx_appparams_destroy(). * * @see dessert_agentx_appparams_destroy() * * @par Description:\n * */ dessert_agentx_appparams_t *dessert_agentx_appparam_new() { dessert_agentx_appparams_t *appparam; appparam = malloc(sizeof(dessert_agentx_appparams_t)); memset(appparam->name,0, sizeof(appparam->name)); memset(appparam->desc,0, sizeof(appparam->desc)); appparam->value_type = DESSERT_APPPARAMS_VALUETYPE_BOOL; appparam->bool = DESSERT_APPSTATS_BOOL_FALSE; return appparam; } /** Frees a dessert_agentx_appparams_t. * * @param appparam the dessert_agentx_appparams_t to be freed * * @warning Only use this method to free a dessert_agentx_appparams_t which was * allocated with dessert_agentx_appparams_new(). * * @see dessert_agentx_appparams_new() * * @par Description:\n */ void dessert_agentx_appparam_destroy(dessert_agentx_appparams_t *appparam) { free(appparam); } /** Adds an application parameter callback. * * @param[in] *c the callback to add * * @retval pointer to the corresponding callback entry on success * @retval NULL otherwise * * @par Description:\n * */ dessert_agentx_appparams_cb_entry_t *dessert_agentx_appparams_add( dessert_agentx_appparamscb_get_t *get, dessert_agentx_appparamscb_set_t *set) { dessert_agentx_appparams_cb_entry_t *e; e = malloc(sizeof(dessert_agentx_appparams_cb_entry_t)); if (e == NULL) { dessert_err("failed to allocate buffer for new dessert_agentx_appparams_entry_t"); return (NULL); } e->index = _dessert_agentx_appparams_new_index(); e->get = get; e->set = set; pthread_rwlock_wrlock(&_dessert_appparams_cblist_lock); DL_APPEND(_dessert_appparams_cblist, e); pthread_rwlock_unlock(&_dessert_appparams_cblist_lock); return (e); } /** Deletes an application parameter callback. * * @param *e pointer to a callback entry * * @retval DESSERT_OK on success * @retval DESSERT_ERR otherwise * * @see dessert_agentx_appparams_add() * * @par Description:\n */ int dessert_agentx_appparams_del(dessert_agentx_appparams_cb_entry_t *e) { if (e == NULL) { return DESSERT_ERR; } pthread_rwlock_wrlock(&_dessert_appparams_cblist_lock); DL_DELETE(_dessert_appparams_cblist, e); pthread_rwlock_unlock(&_dessert_appparams_cblist_lock); /* TODO: invalidate row*/ return DESSERT_OK; } /****************************************************************************** * * INTERNAL / PRIVATE * * NET - S N M P // A G E N T _ X * ******************************************************************************/ /****************************************************************************** * appStats ******************************************************************************/ void _dessert_agentx_appstats_free(dessert_agentx_appstats_t *appstat){ if (appstat->value_type == DESSERT_APPSTATS_VALUETYPE_OCTETSTRING && appstat->octetstring != NULL) { free(appstat->octetstring); } dessert_agentx_appstats_destroy(appstat); } void _dessert_agentx_appstats_free_list( dessert_agentx_appstats_t **appstats_list) { dessert_agentx_appstats_t *appstat; dessert_agentx_appstats_t *tbf; for (appstat = (*appstats_list); appstat;) { tbf = appstat; appstat = appstat->next; _dessert_agentx_appstats_free(tbf); } } int _dessert_agentx_appstats_harvest_callbacks( dessert_agentx_appstats_t **appstats_list) { dessert_agentx_appstats_cb_entry_t *cbe; dessert_agentx_appstats_t *new_appstat; dessert_agentx_appstats_t *appstat; int res = 0; pthread_rwlock_rdlock(&_dessert_appstats_cblist_lock); DL_FOREACH(_dessert_appstats_cblist, cbe) { new_appstat = dessert_agentx_appstats_new(); if (new_appstat == NULL) { dessert_err("failed to allocate buffer for new dessert_agentx_appstats_entry_t"); dessert_err("freeing appstats harvested so far..."); _dessert_agentx_appstats_free_list(appstats_list); return DESSERT_ERR; } res = cbe->c(new_appstat); if (res == DESSERT_OK) { if (cbe->isbulk_flag & DESSERT_APPSTATS_CB_NOBULK) { DL_APPEND(*appstats_list, new_appstat); } else { // DESSERT_APPSTATS_BULK dessert_agentx_appstats_t temp; DL_FOREACH(new_appstat, appstat ) { temp.next = appstat->next; temp.prev = appstat->prev; DL_APPEND(*appstats_list, appstat); appstat = &temp; } } } else { dessert_err("freeing list of appstats received from callback..."); _dessert_agentx_appstats_free_list(&new_appstat); pthread_rwlock_unlock(&_dessert_appstats_cblist_lock); dessert_agentx_appstats_del(cbe); pthread_rwlock_rdlock(&_dessert_appstats_cblist_lock); } } pthread_rwlock_unlock(&_dessert_appstats_cblist_lock); return DESSERT_OK; } /****************************************************************************** * appParams ******************************************************************************/ void _dessert_agentx_appparams_free(dessert_agentx_appparams_t *appparam) { if (appparam->value_type == DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING && appparam->octetstring != NULL) { free(appparam->octetstring); } dessert_agentx_appparam_destroy(appparam); } void _dessert_agentx_appparams_free_list( dessert_agentx_appparams_t **appparams_list) { dessert_agentx_appparams_t *appparam; dessert_agentx_appparams_t *tbf; for (appparam = (*appparams_list); appparam;) { tbf = appparam; appparam = appparam->next; _dessert_agentx_appparams_free(tbf); } } int _dessert_agentx_appparams_harvest_callbacks( dessert_agentx_appparams_t **appparams_list) { dessert_agentx_appparams_cb_entry_t *cbe; dessert_agentx_appparams_t *new_appparam; int res = 0; pthread_rwlock_rdlock(&_dessert_appparams_cblist_lock); DL_FOREACH(_dessert_appparams_cblist, cbe) { new_appparam = dessert_agentx_appparam_new(); if (new_appparam == NULL) { dessert_err("failed to allocate buffer for new dessert_agentx_appparams_entry_t"); dessert_err("freeing appstats harvested so far..."); _dessert_agentx_appparams_free_list(appparams_list); return DESSERT_ERR; } res = cbe->get(new_appparam); new_appparam->index = cbe->index; if (res == DESSERT_OK) { DL_APPEND(*appparams_list, new_appparam); } else { _dessert_agentx_appparams_free(new_appparam); pthread_rwlock_unlock(&_dessert_appparams_cblist_lock); dessert_agentx_appparams_del(cbe); pthread_rwlock_rdlock(&_dessert_appparams_cblist_lock); } } // DL_FOREACH pthread_rwlock_unlock(&_dessert_appparams_cblist_lock); return DESSERT_OK; } dessert_agentx_appparamscb_set_t *_dessert_agentx_appparams_getsettercbforindex( int index) { dessert_agentx_appparams_cb_entry_t *cbe; pthread_rwlock_rdlock(&_dessert_appparams_cblist_lock); DL_FOREACH(_dessert_appparams_cblist, cbe) if (cbe->index == index) break; pthread_rwlock_unlock(&_dessert_appparams_cblist_lock); if (cbe->index == index) return cbe->set; else { return NULL; } } /****************************************************************************** * other ******************************************************************************/ /** setup and initialize net-snmp subagent (via agent x)*/ void _dessert_agentx_init_subagent() { /************************************************************************** * setup snmp handling.... *************************************************************************/ pthread_t snmp_worker; snmp_enable_calllog(); //debug_register_tokens("trace"); //debug_register_tokens("tdomain"); debug_register_tokens(AGENT); //debug_register_tokens("snmp_agent"); //debug_register_tokens("helper:table:req"); debug_register_tokens("dessertAppParamsTable"); debug_register_tokens("verbose:dessertAppParamsTable"); debug_register_tokens("internal:dessertAppParamsTable"); debug_register_tokens("dessertAppParamsTable"); debug_register_tokens("verbose:dessertAppStatsTable"); debug_register_tokens("internal:dessertAppStatsTable"); snmp_set_do_debugging(1); netsnmp_log_handler *logh; logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_FILE, LOG_DEBUG); if (logh) { logh->pri_max = LOG_EMERG; logh->token = strdup("/tmp/dessertAGENTX.log"); } netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1); //SOCK_STARTUP; init_agent(AGENT); /* * initialize the scalars */ init_dessertObjects(); /* * init dessert{Mesh, Sys}ifTable mib code */ init_dessertMeshifTable(); init_dessertSysifTable(); /* * init dessertApp{Stats, Param}Table mib code */ init_dessertAppParamsTable(); init_dessertAppStatsTable(); init_snmp(AGENT); DEBUGMSGTL((AGENT, "Initialized agent and snmp.\n")); pthread_create(&snmp_worker, NULL, _dessert_agentx_worker, NULL); } void dessert_agentx_stop_subagent() { keep_snmp_running = 0; } /****************************************************************************** * * LOCAL * * NET - S N M P // A G E N T _ X * ******************************************************************************/ static dessert_agentx_appstats_cb_entry_t *_dessert_agentx_appstats_add( dessert_agentx_appstatscb_get_t *c, uint8_t bulknobulk_flag) { dessert_agentx_appstats_cb_entry_t *e; e = malloc(sizeof(dessert_agentx_appstats_cb_entry_t)); if (e == NULL) { dessert_err("failed to allocate buffer for new dessert_agentx_appstats_entry_t"); return (NULL); } e->isbulk_flag |= bulknobulk_flag; e->c = c; pthread_rwlock_wrlock(&_dessert_appstats_cblist_lock); DL_APPEND(_dessert_appstats_cblist, e); pthread_rwlock_unlock(&_dessert_appstats_cblist_lock); return (e); } static uint8_t _dessert_agentx_appparams_new_index(void) { uint8_t index; pthread_mutex_lock(&_dessert_agentx_appparams_nextindex_mutex); index = _dessert_agentx_appparams_nextindex++; pthread_mutex_unlock(&_dessert_agentx_appparams_nextindex_mutex); return index; } static void *_dessert_agentx_worker(void *arg) { DEBUGMSGTL((AGENT, "snmp_worker running...\n")); dessert_info("snmp_worker running..."); while (keep_snmp_running) { /* * if you use select(), see snmp_select_info() in snmp_api(3) */ /* * --- OR --- */ agent_check_and_process(1); /* 0 == don't block */ } dessert_info("snmp_worker exiting..."); return (NULL); } libdessert0.87-0.87.2/DES-SERT.doxyfile0000644000175000017500000017107011331020526015333 0ustar dvddvd# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "DES-SERT - A Simple and Extensible Routing Framework for Testbeds" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = to be set # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST = YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = . # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = dessert_internal.h utlist.h # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = YES # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) # there is already a search function so this one should typically # be disabled. SEARCHENGINE = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = YES # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = __attribute__(x)= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = NO # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES libdessert0.87-0.87.2/Intro.txt0000644000175000017500000002630011331020526014227 0ustar dvddvd DES-SERT - an Extensible Routing-Framework for Testbeds Copyright Copyright Philipp Schmidt , Computer Systems and Telematics / Distributed, Embedded Systems (DES) group, Freie Universitaet Berlin This document has been published under GNU Free Documentation License. All rights reserved. 1. Introduction DES-SERT, the DES Simple and Extensible Routing-Framework for Testbeds, is a framework designed to assist researchers implementing routing protocols for testbeds. DES-SERT enables the implementation of routing protocols on top of Ethernet via an underlay (Layer 2.5) in user space. It introduces an abstraction from OS specific issues and provides functionality and data structures to implement proactive, reactive, and hybrid routing protocols. While generally usable in many application scenarios, it is primarily used in DES-Mesh (http://www.des-testbed.net/), the multi-transceiver wireless mesh network testbed part of the DES-Testbed. 2. DES-SERT Architecture DES-SERT introduces some concepts to implement routing protocols. When implementing a routing protocol with DES-SERT, you should be familiar with these concepts to structure and tailor your implementation. 2.1. messages Every packet you send or receive on the mesh is represented as a DES-SERT message. From a programmers point of view, a DES-SERT message is just a C-structure: typedef struct dessert_msg { /** the layer2 header on the wire */ struct ether_header l2h; /** short name of the protocol as passed to dessert_init() */ char proto[DESSERT_PROTO_STRLEN]; /** version of the app as passed to dessert_init() */ uint8_t ver; /** flags - bits 1-4 reserved for dessert, bits 5-8 for app usage */ uint8_t flags; /** ttl or hopcount field for app usage - 0xff if not used*/ uint8_t ttl; /** reserved for app usage - 0x00 if not used */ uint8_t u8; /** reserved for app usage - 0xbeef if not used */ uint16_t u16; /** header length incl. extensions */ uint16_t hlen; /** payload length */ uint16_t plen; } dessert_msg_t; Every message sent via the underlay carries this structure as a packet header. All data in a "dessert_msg" is stored in network byte order. DES-SERT tries to care as automatically as possible of this structure. Nevertheless you will have to care at least about: "l2h.ether_dhost" and "ttl". If you need to send some data along with every packet, e.g. some kind of metric or cost your routing protocol uses, you should try to fit this data into the "u8", "u16" and the upper 4 bits of the "flags" field. These fields will never be touched by DES-SERT except on initialization via "dessert_msg_new". Because just a C-structure is not really usable as a packet, there are some utility functions around - please have a look around in "dessert.h" and the doxygen doku. The most important ones are: "dessert_msg_new" and "dessert_msg_destroy", which do not simply allocate memory for a DES-SERT message, but for a whole packet of maximum size and initialize the structures for further packet construction/processing. int dessert_msg_new(dessert_msg_t **msgout); void dessert_msg_destroy(dessert_msg_t* msg); 2.1.2 DES-SERT extensions A DES-SERT extension is some structure used to piggyback data on a DES-SERT message. It consists of a 8-bit user supplied type field (with some reserved values), an 8-bit length field and user supplied data of arbitrary length of 253 bytes at most. It can be added to a message via "dessert_msg_addext", retrieved via "dessert_msg_getext" and removed via "dessert_msg_delext". int dessert_msg_addext(dessert_msg_t* msg, dessert_ext_t** ext, uint8_t type, size_t len); int dessert_msg_getext(const dessert_msg_t* msg, dessert_ext_t** ext, uint8_t type, int index); int dessert_msg_delext(dessert_msg_t *msg, dessert_ext_t *ext); It is recommended not to put single data fields in extensions, but combine semantically related data in a struct and attach this struct as an extension because every extension carried introduces an 16-bit overhead to the packet. 2.2. Processing pipelines Routing algorithms are often split up in several parts like packet validation, loop-detection or routing table lookup. To implement these as independent and clear as possible, DES-SERT enables you to split up your packet processing in as many parts as you like. There are two separate processing pipelines - one for packets received from the kernel via a TUN or TAP interface and one for packets received via an interface used on the mesh network. You can register callbacks to be added to one of these pipelines with "dessert_sysrxcb_add" or "dessert_meshrxcb_add". Both take an additional integer argument ("priority") specifying the order the callbacks should be called. Higher "priority" value results in being called later within the pipeline. int dessert_sysrxcb_add(dessert_sysrxcb_t* c, int prio); int dessert_meshrxcb_add(dessert_meshrxcb_t* c, int prio); If a callback returns "DESSERT_MSG_KEEP" the packed will be processed by further callbacks, if it returns "DESSERT_MSG_DROP" the message will be dropped and no further callbacks will be called. You do not need to care about the management of the buffers for incoming messages - DES-SERT does this for you. Nevertheless if you need to add extensions or enlarge the payload of a message, you need to tell DES-SERT to enlarge the buffer for you if the flag "DESSERT_FLAG_SPARSE" is set on the message. You can do this by returning "DESSERT_MSG_NEEDNOSPARSE" from within a callback. The callback will be called again with a larger buffer and no "DESSERT_FLAG_SPARSE" flag being set. 2.2.1. Processing buffer If you need to pass information along several callbacks, you can do this in the processing buffer passed to the the callbacks. This buffer contains some local processing flags ("lflags") set by the builtin callback "dessert_msg_ifaceflags_cb" (e.g. telling you about packet origin or if the packet is multicast) and 1KB of space for your callbacks to pass along arbitrary data. This buffer might only be allocated after you explicitly request it - in this case the proc argument is NULL and you can return the value "DESSERT_MSG_NEEDMSGPROC" from within your callback. The callback will be called again with a valid processing buffer. 2.3. Using interfaces 2.3.1. Using a TUN/TAP interface First you have to choose whether to use a TUN or TAP interface. TUN interfaces are used to exchange IPv4 / IPv6 datagrams with the kernel network stack. TAP interfaces are used to exchange Ethernet frames with the kernel network stack. If you want to route Ethernet frames, you should choose a TAP interface. If you intend to implement a custom layer 2 to layer 3 mapping, you should use a TUN interface. Currently, you can only initialize and use a single sys (TUN/TAP) interface. This is done by "dessert_sysif_init". You must then set up the interface config in the kernel yourself e.g. by calling "ifconfig". int dessert_sysif_init(char* name, uint8_t flags); In either case, frames you receive from a TUN/TAP interface will be passed along the callbacks added by "dessert_sysrxcb_add" to the processing pipeline. Each of them will be called with a pointer to an Ethernet frame. In case of a TUN interface, "ether_shost" and "ether_dhost" are set to "00:00:00:00:00:00", and ether_type reflects whether the packet received is IPv4 oder IPv6. Packets are sent to the kernel network stack with "dessert_syssend". In case of a TUN Interface "ether_shost" and "ether_dhost" will be ignored. int dessert_syssend(const struct ether_header *eth, size_t len); 2.3.2. Using a mesh interface Mesh interfaces are used similar to the TUN/TAP interface with two major differences: You can have multiple mesh interfaces and they send and receive DES-SERT messages instead of Ethernet frames. You add an mesh interface using "dessert_meshif_add" and can send to it by calling "dessert_meshsend". If the interface parameter is NULL, the packet will be transmitted over every interface (good for flooding). int dessert_meshif_add(const char* dev, uint8_t flags); int dessert_meshsend(const dessert_msg_t* msg, const dessert_meshif_t *iface); 2.4. Logging You can write log messages easily with a bunch of macros provided by DES-SERT ("dessert_debug", "dessert_info" ,"dessert_notice", "dessert_warn", "dessert_warning", "dessert_err", "dessert_crit", "dessert_alert" and "dessert_emerg"). Each of them can be used like "printf" and logs to Syslog, STDERR, file or a ringbuffer depending on your configuration. DES-SERT also ships with a custom "assert" macro which acts like the original macro from the standard C library and uses the logging mechanism described above. 2.5. Periodics Periodics help you to perform maintenance or delayed tasks. A task consists of a callback, which will be called at the time you requested, and a void pointer the callback is passed. You can add these tasks by calling "dessert_periodic_add" or "dessert_periodic_add_delayed". 2.6. CLI DES-SERT supports simple configuration and debugging of your routing protocol implementation by providing a Cisco like command line interface (cli) and a config file parser based upon it. This cli is realized through libcli (http://code.google.com/p/libcli/). DES-SERT does some of the initialization of libcli. Therefore, it provides the main cli anchor "dessert_cli" and some anchors to add commands below "dessert_cli_.*". Because DES-SERT only loosely wraps libcli, you should make yourself familiar with libcli itself. This may be improved in further DES-SERT releases. You can evaluate a config file by calling "cli_file" and start a thread enabling a telnet-interface for DES-SERT by calling "dessert_cli_run". 2.7. Putting all together Now you have learned about the most important aspects of DES-SERT. To write your own routing protocol implementation, you need to know how to put all this together. You should start with a main() program parsing the command line options and then calling "dessert_init()". This is needed to set up DES-SERT correctly. Afterwards you can register callbacks, read the config file and do what you like. If everything is set up, you call "dessert_run()" and let the event based framework do its job. If you would like to see a complete protocol implementation sample, have a look at the "gossiping" directory. 3. Contact & Feedback We love feedback - if you have patches, comments or questions, please contact us! Recent contact information is available on http://www.des-testbed.net/des-sert/ libdessert0.87-0.87.2/dessert_log.c0000644000175000017500000003007011331020526015050 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" #include /* data storage */ FILE *dessert_logfd = NULL; char dessert_logprefix[12]; #define _DESSERT_LOGFLAG_SYSLOG 0x1 #define _DESSERT_LOGFLAG_LOGFILE 0x2 #define _DESSERT_LOGFLAG_STDERR 0x4 #define _DESSERT_LOGFLAG_RBUF 0x8 int _dessert_logflags = _DESSERT_LOGFLAG_STDERR; int _dessert_loglevel = LOG_DEBUG; /* the logging ringbuffer */ char *_dessert_logrbuf = NULL; /* pointer to begin */ int _dessert_logrbuf_len = 0; /* length in lines (DESSERT_LOGLINE_MAX*_dessert_logrbuf_len*sizeof(char) would be in bytes) */ int _dessert_logrbuf_cur = 0; /* current position */ int _dessert_logrbuf_used = 0; /* used slots */ pthread_rwlock_t _dessert_logrbuf_len_lock = PTHREAD_RWLOCK_INITIALIZER; /* for resizing */ pthread_mutex_t _dessert_logrbuf_mutex = PTHREAD_MUTEX_INITIALIZER; /* for moving _dessert_logrbuf_cur */ /* internal functions forward declarations TODO: cleanup */ /****************************************************************************** * * EXTERNAL / PUBLIC * * L O G F A C I L I T Y * ******************************************************************************/ /** Configure dessert logging framework and sets up logging. * * @arg opts OR'd flags - @see DESSERT_LOG_* * * %DESCRIPTION: * **/ int dessert_logcfg(uint16_t opts) { snprintf(dessert_logprefix, 12, "dessert/%s", dessert_proto); pthread_rwlock_wrlock(&dessert_cfglock); /* configure logging */ if ((opts & DESSERT_LOG_SYSLOG) && !(opts & DESSERT_LOG_NOSYSLOG)) { if (!(_dessert_logflags & _DESSERT_LOGFLAG_SYSLOG)) { /* initialize syslog channel */ openlog(dessert_logprefix, LOG_PID, LOG_DAEMON); } _dessert_logflags |= _DESSERT_LOGFLAG_SYSLOG; } else if (!(opts & DESSERT_LOG_SYSLOG) && (opts & DESSERT_LOG_NOSYSLOG)) { if (_dessert_logflags & _DESSERT_LOGFLAG_SYSLOG) { /* close syslog channel */ closelog(); } _dessert_logflags &= ~_DESSERT_LOGFLAG_SYSLOG; } if ((opts & DESSERT_LOG_STDERR) && !(opts & DESSERT_LOG_NOSTDERR) && !(_dessert_status & _DESSERT_STATUS_DAEMON)) { _dessert_logflags |= _DESSERT_LOGFLAG_STDERR; } else if ((!(opts & DESSERT_LOG_STDERR) && (opts & DESSERT_LOG_NOSTDERR)) || (_dessert_status & _DESSERT_STATUS_DAEMON)) { _dessert_logflags &= ~_DESSERT_LOGFLAG_STDERR; } if ((opts & DESSERT_LOG_FILE) && !(opts & DESSERT_LOG_NOFILE) && dessert_logfd != NULL) { _dessert_logflags |= _DESSERT_LOGFLAG_LOGFILE; } else if ((!(opts & DESSERT_LOG_FILE) && (opts & DESSERT_LOG_NOFILE)) || dessert_logfd == NULL) { _dessert_logflags &= ~_DESSERT_LOGFLAG_LOGFILE; } if ((opts & DESSERT_LOG_DEBUG) && !(opts & DESSERT_LOG_NODEBUG)) { _dessert_loglevel = LOG_DEBUG; } else if (!(opts & DESSERT_LOG_DEBUG) && (opts & DESSERT_LOG_NODEBUG)) { _dessert_loglevel = LOG_INFO; } if ((opts & DESSERT_LOG_RBUF) && !(opts & DESSERT_LOG_NORBUF)) { _dessert_logflags |= _DESSERT_LOGFLAG_RBUF; } else if (!(opts & DESSERT_LOG_RBUF) && (opts & DESSERT_LOG_NORBUF)) { _dessert_logflags &= ~_DESSERT_LOGFLAG_RBUF; } pthread_rwlock_unlock(&dessert_cfglock); return 0; } /****************************************************************************** * * INTERNAL / PRIVATE * * L O G F A C I L I T Y * ******************************************************************************/ char* _dessert_log_rbuf_nextline(void) { char* r = NULL; pthread_mutex_lock(&_dessert_logrbuf_mutex); if (_dessert_logrbuf_len > 0) { if (_dessert_logrbuf_cur >= _dessert_logrbuf_len) { _dessert_logrbuf_cur = 0; } r = _dessert_logrbuf + (DESSERT_LOGLINE_MAX * _dessert_logrbuf_cur); _dessert_logrbuf_cur++; if (_dessert_logrbuf_used < _dessert_logrbuf_len - 1) { _dessert_logrbuf_used++; } } pthread_mutex_unlock(&_dessert_logrbuf_mutex); return (r); } /** internal log function * * @internal * * @param[in] level loglevel from * @param[in] *func function name called from * @param[in] *file file name called from * @param[in] *line line called from * @param[in] *fmt printf format string * @param[in] ... (var-arg) printf like variables **/ void _dessert_log(int level, const char* func, const char* file, int line, const char *fmt, ...) { va_list args; char *rbuf_line = NULL; char buf[DESSERT_LOGLINE_MAX]; char lf[80]; char *lt; char lds[27]; struct tm ldd; time_t ldi; int lf_slen, buf_slen; if (_dessert_loglevel < level) return; snprintf(lf, 80, " (%s@%s:%d)", func, file, line); lf_slen = strlen(lf); va_start(args, fmt); vsnprintf(buf, DESSERT_LOGLINE_MAX, fmt, args); va_end(args); buf_slen = strlen(buf); if (_dessert_logflags & _DESSERT_LOGFLAG_SYSLOG) { syslog(level, "%s%s", buf, lf); } if (_dessert_logflags & _DESSERT_LOGFLAG_RBUF) { pthread_rwlock_rdlock(&_dessert_logrbuf_len_lock); rbuf_line = _dessert_log_rbuf_nextline(); } if (_dessert_logflags & (_DESSERT_LOGFLAG_LOGFILE | _DESSERT_LOGFLAG_STDERR | _DESSERT_LOGFLAG_RBUF)) { time(&ldi); localtime_r(&ldi, &ldd); snprintf(lds, 26, "%04d-%02d-%02d %02d:%02d:%02d%+05.1f ", ldd.tm_year + 1900, ldd.tm_mon + 1, ldd.tm_mday, ldd.tm_hour, ldd.tm_min, ldd.tm_sec, (double) ldd.tm_gmtoff / 3600); switch (level) { case LOG_EMERG: lt = "EMERG: "; break; case LOG_ALERT: lt = "ALERT: "; break; case LOG_CRIT: lt = "CRIT: "; break; case LOG_ERR: lt = "ERR: "; break; case LOG_WARNING: lt = "WARN: "; break; case LOG_NOTICE: lt = "NOTICE:"; break; case LOG_INFO: lt = "INFO: "; break; default: lt = "DEBUG: "; break; } if (32 + buf_slen + lf_slen > 80) { if (_dessert_logflags & _DESSERT_LOGFLAG_LOGFILE && dessert_logfd != NULL) fprintf(dessert_logfd, "%s%s%s\n%80s\n", lds, lt, buf, lf); if (_dessert_logflags & _DESSERT_LOGFLAG_STDERR) fprintf(stderr, "%s%s%s\n%80s\n", lds, lt, buf, lf); if (_dessert_logflags & _DESSERT_LOGFLAG_RBUF && rbuf_line != NULL) snprintf(rbuf_line, DESSERT_LOGLINE_MAX, "%s%s%s\n%80s", lds, lt, buf, lf); } else { while (32 + buf_slen + lf_slen < 80) { buf[buf_slen++] = ' '; } buf[buf_slen] = '\0'; if (_dessert_logflags & _DESSERT_LOGFLAG_LOGFILE && dessert_logfd != NULL) fprintf(dessert_logfd, "%s%s%s%s\n", lds, lt, buf, lf); if (_dessert_logflags & _DESSERT_LOGFLAG_STDERR) fprintf(stderr, "%s%s%s%s\n", lds, lt, buf, lf); if (_dessert_logflags & _DESSERT_LOGFLAG_RBUF && rbuf_line != NULL) snprintf(rbuf_line, DESSERT_LOGLINE_MAX, "%s%s%s%s", lds, lt, buf, lf); } if (_dessert_logflags & _DESSERT_LOGFLAG_LOGFILE && dessert_logfd != NULL) { fflush(dessert_logfd); } if (_dessert_logflags & _DESSERT_LOGFLAG_RBUF) { pthread_rwlock_unlock(&_dessert_logrbuf_len_lock); } } } /** command "logging file" */ int _dessert_cli_logging_file(struct cli_def *cli, char *command, char *argv[], int argc) { FILE *newlogdf; if (argc != 1) { cli_print(cli, "usage %s filename\n", command); return CLI_ERROR; } newlogdf = fopen(argv[0], "a"); if (newlogdf == NULL) { dessert_err("failed o open %s as logfile\n", argv[0]); cli_print(cli, "failed o open %s as logfile\n", argv[0]); return CLI_ERROR; } /* clean up old logfile first */ if (dessert_logfd != NULL) { dessert_logcfg(DESSERT_LOG_NOFILE); fclose(dessert_logfd); } dessert_logfd = newlogdf; dessert_logcfg(DESSERT_LOG_FILE); return CLI_OK; } /** command "logging file" */ int _dessert_cli_no_logging_file(struct cli_def *cli, char *command, char *argv[], int argc) { dessert_logcfg(DESSERT_LOG_NOFILE); if (dessert_logfd != NULL) { fclose(dessert_logfd); } dessert_logfd = NULL; return CLI_OK; } /** command "logging ringbuffer" */ int _dessert_cli_logging_ringbuffer(struct cli_def *cli, char *command, char *argv[], int argc) { int newlen = -1; if (argc != 1 || (newlen = (int) strtol(argv[0], NULL, 10)) < 0) { cli_print(cli, "usage %s [buffer length]\n", command); return CLI_ERROR; } if (newlen == _dessert_logrbuf_len) return CLI_OK; if (newlen == 0) { cli_print(cli, "will not set buffer length to 0 - use no logging ringbuffer instead\n"); return CLI_ERROR; } pthread_rwlock_wrlock(&_dessert_logrbuf_len_lock); /* make logging buffer larger - easy if not ENOMEM*/ if (newlen > _dessert_logrbuf_len) { _dessert_logrbuf = realloc(_dessert_logrbuf, newlen * DESSERT_LOGLINE_MAX * sizeof(char)); if (_dessert_logrbuf == NULL) { _dessert_logrbuf_len = 0; _dessert_logrbuf_cur = 0; } else { _dessert_logrbuf_len = newlen; } dessert_logcfg(DESSERT_LOG_RBUF); /* make logging buffer smaller - pain in the ass */ } else if (newlen < _dessert_logrbuf_len) { /* move current log buffer if needed */ if (_dessert_logrbuf_cur > newlen) { memmove(_dessert_logrbuf, _dessert_logrbuf + (DESSERT_LOGLINE_MAX * (_dessert_logrbuf_cur - newlen)), newlen * DESSERT_LOGLINE_MAX * sizeof(char)); _dessert_logrbuf_cur -= newlen; } _dessert_logrbuf = realloc(_dessert_logrbuf, newlen * DESSERT_LOGLINE_MAX * sizeof(char)); if (_dessert_logrbuf == NULL) { _dessert_logrbuf_len = 0; _dessert_logrbuf_cur = 0; } else { _dessert_logrbuf_len = newlen; } } else { dessert_err("this never happens"); } if (_dessert_logrbuf_used > _dessert_logrbuf_len - 1) _dessert_logrbuf_used = _dessert_logrbuf_len - 1; pthread_rwlock_unlock(&_dessert_logrbuf_len_lock); return CLI_OK; } /** command "no logging ringbuffer" */ int _dessert_cli_no_logging_ringbuffer(struct cli_def *cli, char *command, char *argv[], int argc) { if (_dessert_logrbuf == NULL) { return CLI_OK; } else { pthread_rwlock_wrlock(&_dessert_logrbuf_len_lock); dessert_logcfg(DESSERT_LOG_NORBUF); free(_dessert_logrbuf); _dessert_logrbuf = NULL; _dessert_logrbuf_len = 0; _dessert_logrbuf_cur = 0; pthread_rwlock_unlock(&_dessert_logrbuf_len_lock); return CLI_OK; } } /** command "show logging" */ int _dessert_cli_cmd_logging(struct cli_def *cli, char *command, char *argv[], int argc) { pthread_rwlock_rdlock(&_dessert_logrbuf_len_lock); int i = 0; int max = _dessert_logrbuf_len - 1; char* line; if (_dessert_logrbuf_len < 1) { cli_print( cli, "logging to ringbuffer is disables - use \"logging ringbuffer [int]\" in config-mode first"); pthread_rwlock_unlock(&_dessert_logrbuf_len_lock); return CLI_ERROR; } if (argc == 1) { int max2 = (int) strtol(argv[0], NULL, 10); if (max2 > 0) { max = max2; } } /* where to start and print? */ if (max > _dessert_logrbuf_used) { max = _dessert_logrbuf_used; } i = _dessert_logrbuf_cur - max - 1; if (i < 0) { i += _dessert_logrbuf_len; } while (max > 0) { i++; max--; if (i == _dessert_logrbuf_len) { i = 0; } line = _dessert_logrbuf + (DESSERT_LOGLINE_MAX * i); cli_print(cli, "%s", line); } pthread_rwlock_unlock(&_dessert_logrbuf_len_lock); return CLI_OK; } libdessert0.87-0.87.2/dessert_cli.c0000644000175000017500000003650211331020526015044 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 32 #endif /* global data storage // P U B L I C */ struct cli_def *dessert_cli; struct cli_command *dessert_cli_show; struct cli_command *dessert_cli_cfg_iface; struct cli_command *dessert_cli_cfg_no; struct cli_command *dessert_cli_cfg_no_iface; struct cli_command *dessert_cli_cfg_logging; struct cli_command *dessert_cli_cfg_no_logging; /* global data storage // P R I V A T E */ /* nothing here - yet */ /* local data storage*/ int _dessert_cli_sock; struct sockaddr_in6 _dessert_cli_addr; char _dessert_cli_hostname[HOST_NAME_MAX + DESSERT_PROTO_STRLEN + 1]; pthread_t _dessert_cli_worker; int _dessert_cli_running = 0; uint16_t _cli_port = 4519; // should be default port number /* internal functions forward declarations*/ static void *_dessert_cli_accept_thread(void* arg); static int _dessert_cli_cmd_showmeshifs(struct cli_def *cli, char *command, char *argv[], int argc); static int _dessert_cli_cmd_showsysif(struct cli_def *cli, char *command, char *argv[], int argc); static int _dessert_cli_cmd_dessertinfo(struct cli_def *cli, char *command, char *argv[], int argc); static int _dessert_cli_cmd_setport(struct cli_def *cli, char *command, char *argv[], int argc); static void _dessert_cli_cmd_showmeshifs_print_helper(struct cli_def *cli, dessert_meshif_t *meshif); /****************************************************************************** * * EXTERNAL / PUBLIC * * C L I - C O M M A N D L I N E I N T E R F A C E * ******************************************************************************/ /** CLI command - config mode - interface sys $iface, $ipv4-addr, $netmask */ int dessert_cli_cmd_addsysif(struct cli_def *cli, char *command, char *argv[], int argc) { char buf[255]; int i; if (argc != 3) { cli_print(cli, "usage %s [sys-interface] [ip-address] [netmask]\n", command); return CLI_ERROR; } dessert_info("initializing sys interface"); dessert_sysif_init(argv[0], DESSERT_TAP | DESSERT_MAKE_DEFSRC); sprintf(buf, "ifconfig %s %s netmask %s mtu 1300 up", argv[0], argv[1], argv[2]); i = system(buf); dessert_info("running ifconfig on sys interface returned %i", i); return (i == 0 ? CLI_OK : CLI_ERROR); } /** CLI command - config mode - interface mesh $iface */ int dessert_cli_cmd_addmeshif(struct cli_def *cli, char *command, char *argv[], int argc) { char buf[255]; int i; if (argc != 1) { cli_print(cli, "usage %s [mesh-interface]\n", command); return CLI_ERROR; } dessert_info("initializing mesh interface %s", argv[0]); dessert_meshif_add(argv[0], DESSERT_IF_PROMISC); sprintf(buf, "ifconfig %s up", argv[0]); i = system(buf); dessert_info("running ifconfig on mesh interface %s returned %i",argv[0], i); return (i == 0 ? CLI_OK : CLI_ERROR); } /** * */ FILE* dessert_cli_get_cfg(int argc, char** argv) { FILE* cfg; const char* path_head = "/etc/"; const char* path_tail = ".conf"; char* str = alloca(strlen(argv[0])+1); strcpy(str, argv[0]); char* ptr = strtok(str, "/"); char* daemon = ptr; while (ptr != NULL) { daemon = ptr; ptr = strtok(NULL, "/"); } if (argc != 2) { char * path = alloca(strlen(path_head)+1 +strlen(path_tail)+1 +strlen(daemon)+1); strcat(path, path_head); strcat(path, daemon); strcat(path, path_tail); cfg = fopen(path, "r"); if (cfg == NULL) { dessert_err("specify configuration file\nusage: \"%s configfile\"\nusage: \"%s\" if /etc/%s.conf is present", daemon, daemon, daemon); exit(1); } } else { cfg = fopen(argv[1], "r"); if (cfg == NULL) { dessert_err("failed to open configfile %s", argv[1]); exit(2); } else { dessert_info("using file %s as configuration file", argv[1]); } } return cfg; } int dessert_set_cli_port(uint16_t port) { if (_dessert_cli_running == 1) { dessert_err("CLI is already running!"); return DESSERT_ERR; } if (port >= 1024 && port <= 49151) _cli_port = port; else { port = 0; dessert_err("Port number has to be in [1024, 49151]"); } dessert_info("CLI on port %d", _cli_port); return (port == 0 ? DESSERT_ERR : DESSERT_OK); } /** Start up the command line interface. * * @param[in] port port to listen on * * @retval DESSERT_OK on success * @retval -errno otherwise * * %DESCRIPTION: * */ int dessert_cli_run() { _dessert_cli_running = 1; int on = 1; /* listen for connections */ _dessert_cli_sock = socket(AF_INET6, SOCK_STREAM, 0); setsockopt(_dessert_cli_sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); memset(&_dessert_cli_addr, 0, sizeof(_dessert_cli_addr)); _dessert_cli_addr.sin6_family = AF_INET6; _dessert_cli_addr.sin6_addr = in6addr_any; _dessert_cli_addr.sin6_port = htons(_cli_port); if (bind(_dessert_cli_sock, (struct sockaddr *) &_dessert_cli_addr, sizeof(_dessert_cli_addr))) { dessert_err("cli socket bind to port %d failed - %s", _cli_port, strerror(errno)); return -errno; } listen(_dessert_cli_sock, 8); dessert_debug("starting worker thread for cli"); pthread_create(&_dessert_cli_worker, NULL, _dessert_cli_accept_thread, &_dessert_cli_sock); return DESSERT_OK; } /****************************************************************************** * * INTERNAL / PRIVATE * * C L I - C O M M A N D L I N E I N T E R F A C E * ******************************************************************************/ /** internal function to initialize libcli */ int _dessert_cli_init() { dessert_cli = cli_init(); /* set host name */ memset(_dessert_cli_hostname, 0x0, HOST_NAME_MAX + DESSERT_PROTO_STRLEN + 1); gethostname(_dessert_cli_hostname, HOST_NAME_MAX); strncpy(_dessert_cli_hostname + strlen(_dessert_cli_hostname), ":", 1); strncpy(_dessert_cli_hostname + strlen(_dessert_cli_hostname), dessert_proto, DESSERT_PROTO_STRLEN); cli_set_hostname(dessert_cli, _dessert_cli_hostname); /* initialize show commands */ dessert_cli_show = cli_register_command(dessert_cli, NULL, "show", NULL, PRIVILEGE_UNPRIVILEGED, MODE_EXEC, "display information"); cli_register_command(dessert_cli, dessert_cli_show, "dessert-info", _dessert_cli_cmd_dessertinfo, PRIVILEGE_UNPRIVILEGED, MODE_EXEC, "Display information about this program."); cli_register_command(dessert_cli, dessert_cli_show, "logging", _dessert_cli_cmd_logging, PRIVILEGE_UNPRIVILEGED, MODE_EXEC, "show logging ringbuffer"); cli_register_command(dessert_cli, dessert_cli_show, "meshifs", _dessert_cli_cmd_showmeshifs, PRIVILEGE_UNPRIVILEGED, MODE_EXEC, "Print list of registered interfaces used by the daemon."); cli_register_command(dessert_cli, dessert_cli_show, "sysif", _dessert_cli_cmd_showsysif, PRIVILEGE_UNPRIVILEGED, MODE_EXEC, "Print the name of the TUN/TAP interface used as system interface."); /* initialize config mode commands */ dessert_cli_cfg_iface = cli_register_command(dessert_cli, NULL, "interface", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "create or configure interfaces"); dessert_cli_cfg_no = cli_register_command(dessert_cli, NULL, "no", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "negate command"); dessert_cli_cfg_no_iface = cli_register_command(dessert_cli, dessert_cli_cfg_no, "interface", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "remove interface or negate interface config"); dessert_cli_cfg_logging = cli_register_command(dessert_cli, NULL, "logging", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "change logging config"); dessert_cli_cfg_no_logging = cli_register_command(dessert_cli, dessert_cli_cfg_no, "logging", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "disable logging for..."); cli_register_command(dessert_cli, dessert_cli_cfg_logging, "ringbuffer", _dessert_cli_logging_ringbuffer, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "set logging ringbuffer size (in lines)"); cli_register_command(dessert_cli, dessert_cli_cfg_no_logging, "ringbuffer", _dessert_cli_logging_ringbuffer, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "disable logging to ringbuffer"); cli_register_command(dessert_cli, dessert_cli_cfg_logging, "file", _dessert_cli_logging_file, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "set logfile and enable file logging"); cli_register_command(dessert_cli, dessert_cli_cfg_no_logging, "file", _dessert_cli_logging_file, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "set logfile disable file logging"); cli_register_command(dessert_cli, NULL, "port", _dessert_cli_cmd_setport, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "configure TCP port the daemon is listening on"); /* initialize other commands */ cli_register_command(dessert_cli, NULL, "shutdown", _dessert_cli_cmd_shutdown, PRIVILEGE_PRIVILEGED, MODE_EXEC, "shut daemon down"); return DESSERT_OK; } /****************************************************************************** * * LOCAL * * C L I - C O M M A N D L I N E I N T E R F A C E * ******************************************************************************/ static int _dessert_cli_cmd_setport(struct cli_def *cli, char *command, char *argv[], int argc) { if (_dessert_cli_running == 1) { cli_print(dessert_cli,"CLI is already running!"); return CLI_ERROR; } return (dessert_set_cli_port((uint16_t) atoi(argv[0]))==DESSERT_ERR?CLI_ERROR:CLI_OK); } /** command "show meshifs" */ static int _dessert_cli_cmd_showmeshifs(struct cli_def *cli, char *command, char *argv[], int argc) { dessert_meshif_t *meshif = dessert_meshiflist_get(); if (meshif == NULL) { cli_print(dessert_cli, "No mesh interfaces registered!"); return CLI_ERROR; } else { MESHIFLIST_ITERATOR_START(meshif) { _dessert_cli_cmd_showmeshifs_print_helper(cli, meshif); }MESHIFLIST_ITERATOR_STOP; return CLI_OK; } } /** command "show sysif" */ static int _dessert_cli_cmd_showsysif(struct cli_def *cli, char *command, char *argv[], int argc) { dessert_sysif_t *sysif = _dessert_sysif; if (sysif == NULL) { cli_print(cli, "\nNo system interface registered!"); return CLI_ERROR; } else { cli_print(cli, "\nStatistics for system interface [%s]", sysif->if_name); cli_print(cli, " MAC address : [%02x:%02x:%02x:%02x:%02x:%02x]", sysif->hwaddr[0], sysif->hwaddr[1], sysif->hwaddr[2], sysif->hwaddr[3], sysif->hwaddr[4], sysif->hwaddr[5]); cli_print(cli, " Packets received : [%"PRIi64"]", sysif->ipkts); cli_print(cli, " Packets send : [%"PRIi64"]", sysif->opkts); cli_print(cli, " Bytes received : [%"PRIi64"]", sysif->ibytes); cli_print(cli, " Bytes send : [%"PRIi64"]", sysif->obytes); return CLI_OK; } } /** command "show dessert-info" */ static int _dessert_cli_cmd_dessertinfo(struct cli_def *cli, char *command, char *argv[], int argc) { cli_print(cli, "\nprotocol running: %s v %d", dessert_proto, dessert_ver); cli_print(cli, "libdessert version: %s", SHLIB_VERSION); cli_print( cli, " ------------------------------------------------------------------------------ "); cli_print( cli, " Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). "); cli_print( cli, " All rights reserved. "); cli_print( cli, " "); cli_print( cli, " These sources were originally developed by Philipp Schmidt "); cli_print( cli, " at Freie Universitaet Berlin (http://www.fu-berlin.de/), "); cli_print( cli, " Computer Systems and Telematics / Distributed, Embedded Systems (DES) group "); cli_print( cli, " (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) "); cli_print( cli, " ------------------------------------------------------------------------------ "); cli_print( cli, " This program is free software: you can redistribute it and/or modify it under "); cli_print( cli, " the terms of the GNU General Public License as published by the Free Software "); cli_print( cli, " Foundation, either version 3 of the License, or (at your option) any later "); cli_print( cli, " version. "); cli_print( cli, " "); cli_print( cli, " This program is distributed in the hope that it will be useful, but WITHOUT "); cli_print( cli, " ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS "); cli_print( cli, " FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. "); cli_print( cli, " "); cli_print( cli, " You should have received a copy of the GNU General Public License along with "); cli_print( cli, " this program. If not, see http://www.gnu.org/licenses/ . "); cli_print( cli, " ------------------------------------------------------------------------------ "); return CLI_OK; } /** internal thread function running the cli */ static void *_dessert_cli_accept_thread(void* arg) { int *s = (int *) arg; int c; while ((c = accept(*s, NULL, 0))) { cli_loop(dessert_cli, c); /* pass the connection off to libcli */ close(c); } cli_done(dessert_cli); /* free data structures */ return (NULL); } /** internal helper function to _dessert_cli_cmd_showmeshifs */ static void _dessert_cli_cmd_showmeshifs_print_helper(struct cli_def *cli, dessert_meshif_t *meshif) { cli_print(cli, "\nStatistics for mesh interface [%s]", meshif->if_name); cli_print(cli, " MAC address : [%02x:%02x:%02x:%02x:%02x:%02x]", meshif->hwaddr[0], meshif->hwaddr[1], meshif->hwaddr[2], meshif->hwaddr[3], meshif->hwaddr[4], meshif->hwaddr[5]); cli_print(cli, " Packets received : [%"PRIi64"]", meshif->ipkts); cli_print(cli, " Packets send : [%"PRIi64"]", meshif->opkts); cli_print(cli, " Bytes received : [%"PRIi64"]", meshif->ibytes); cli_print(cli, " Bytes send : [%"PRIi64"]", meshif->obytes); return CLI_OK; } libdessert0.87-0.87.2/dessert_periodic.c0000644000175000017500000002272211331020526016072 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" /* global data storage // P U B L I C */ /* global data storage // P R I V A T E */ dessert_periodic_t *_tasklist = NULL; pthread_mutex_t _dessert_periodic_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t _dessert_periodic_changed = PTHREAD_COND_INITIALIZER; pthread_t _dessert_periodic_worker; int _dessert_periodic_worker_running = 0; /* local data storage*/ /* local functions forward declarations*/ static int _dessert_periodic_add_periodic_t(dessert_periodic_t *task); static void *_dessert_periodic_thread(void* arg); /****************************************************************************** * * EXTERNAL / PUBLIC * * P E R I O D I C T A S K S * ******************************************************************************/ /** Adds a delayed/periodic task to the task list * * @param[in] c callback to call when task is scheduled * @param[in] data data to give to the callback * @param[in] scheduled when should the callback be called the first time * @param[in] interval how often should it be called (set to NULL if only once) * * @retval pointer if the callback was added successfully * @retval NULL otherwise * * @note The GNU C Library Documentation * states about the @c tv_usec member of the @c struct @c timeval: This is the * rest of the elapsed time (a fraction of a second), represented as the number * of microseconds. It is always less than one @a million. So, to make sure * this invariant is always met, consider using the provided TIMEVAL_ADD() macro. * * @par Description: * * @par Examples: * @li Register a callback function to be executed every 1.5 seconds - and * delay the first call to it for another 1.5 seconds: * @code * struct timeval interval; * interval.tv_sec = 1; * interval.tv_usec = 500000; * * struct timeval schedule; * gettimeofday(&schedule, NULL); * TIMEVAL_ADD(&schedule, 1, 500000); * * dessert_periodic_add(callback, NULL, &schedule, &interval); * @endcode * * */ dessert_periodic_t *dessert_periodic_add(dessert_periodiccallback_t* c, void *data, const struct timeval *scheduled, const struct timeval *interval) { struct timeval now; dessert_periodic_t *task; if (scheduled == NULL) { gettimeofday(&now, NULL); scheduled = &now; } assert(scheduled != NULL); /* sanity checks */ if (c == NULL) { return (NULL); } /* get task memory */ task = malloc(sizeof(dessert_periodic_t)); if (task == NULL) { return NULL; } /* copy data */ task->c = c; task->data = data; memcpy(&(task->scheduled), scheduled, sizeof(struct timeval)); if (interval == NULL) { task->interval.tv_sec = 0; task->interval.tv_usec = 0; } else { memcpy(&(task->interval), interval, sizeof(struct timeval)); } task->next = NULL; pthread_mutex_lock(&_dessert_periodic_mutex); _dessert_periodic_add_periodic_t(task); pthread_mutex_unlock(&_dessert_periodic_mutex); return (task); } /** Adds a delayed task to the task list * * This is an easier version of dessert_periodic_add() taking a single delay as parameter. * * @param[in] c callback to call when task is scheduled * @param[in] data data to give to the callback * @param[in] delay the delay in seconds * * %DESCRIPTION: \n */ dessert_periodic_t *dessert_periodic_add_delayed(dessert_periodiccallback_t* c, void *data, int delay) { struct timeval at; gettimeofday(&at, NULL); at.tv_sec += delay; return (dessert_periodic_add(c, data, &at, NULL)); } /** Removes a delayed/periodic task from the task list. * * @param[in] p pointer to task description * * @return -1 on failure, 0 if the task was removed * * %DESCRIPTION: \n */ int dessert_periodic_del(dessert_periodic_t *p) { dessert_periodic_t *i; int x = -1; assert(p != NULL); pthread_mutex_lock(&_dessert_periodic_mutex); if (p == _tasklist) { _tasklist = _tasklist->next; x++; } i = _tasklist; while (i != NULL) { if (i->next == p) { i->next = p->next; x++; } i = i->next; } pthread_mutex_unlock(&_dessert_periodic_mutex); assert(x < 2); free(p); return (x); } /****************************************************************************** * * INTERNAL / PRIVATE * * P E R I O D I C T A S K S * ******************************************************************************/ /** internal function to start periodic worker */ void _dessert_periodic_init() { if (_dessert_periodic_worker_running == 0) { _dessert_periodic_worker_running = 1; pthread_create(&_dessert_periodic_worker, NULL, _dessert_periodic_thread, NULL); } } /****************************************************************************** * * LOCAL / PRIVATE * * P E R I O D I C T A S K S * ******************************************************************************/ /* internal task list modifier - only call while holding _dessert_periodic_mutex */ static int _dessert_periodic_add_periodic_t(dessert_periodic_t *task) { dessert_periodic_t *i; /* first task? */ if (_tasklist == task) { dessert_err("infinite loop in periodic tasklist requested - aborting!"); return (-1); } else if (_tasklist == NULL) { _tasklist = task; pthread_cond_broadcast(&_dessert_periodic_changed); } /* is next task.... */ else if (task->scheduled.tv_sec < _tasklist->scheduled.tv_sec || (task->scheduled.tv_sec == _tasklist->scheduled.tv_sec && task->scheduled.tv_usec < _tasklist->scheduled.tv_usec)) { task->next = _tasklist; _tasklist = task; pthread_cond_broadcast(&_dessert_periodic_changed); } /* search right place */ else { i = _tasklist; while (i->next != NULL && (i->next->scheduled.tv_sec < task->scheduled.tv_sec || (i->next->scheduled.tv_sec == task->scheduled.tv_sec && i->next->scheduled.tv_usec <= task->scheduled.tv_usec))) { i = i->next; if (i->next == task) { dessert_err("infinite loop in periodic tasklist requested - aborting!"); return (-1); } } /* last or right place */ task->next = i->next; i->next = task; /* no need to tell periodic thread to check again - next task has not changed */ } return (0); } /* internal worker for the task list */ static void *_dessert_periodic_thread(void* arg) { dessert_periodic_t *next_task; dessert_periodic_t task; struct timeval now; struct timespec ts; pthread_mutex_lock(&_dessert_periodic_mutex); while (1) { gettimeofday(&now, NULL); if (_tasklist == NULL) { if (pthread_cond_wait(&_dessert_periodic_changed, &_dessert_periodic_mutex) == EINVAL) { dessert_err("sleeping failed in periodic scheduler - scheduler died"); break; } continue; } else if (now.tv_sec < _tasklist->scheduled.tv_sec || (now.tv_sec == _tasklist->scheduled.tv_sec && now.tv_usec < _tasklist->scheduled.tv_usec)) { ts.tv_sec = _tasklist->scheduled.tv_sec; ts.tv_nsec = _tasklist->scheduled.tv_usec * 1000; if (pthread_cond_timedwait(&_dessert_periodic_changed, &_dessert_periodic_mutex, &ts) == EINVAL) { dessert_err("sleeping failed in periodic scheduler - scheduler died"); break; } continue; } /* run next task */ next_task = _tasklist; _tasklist = next_task->next; /* safe task to local variable */ memcpy(&task, next_task, sizeof(dessert_periodic_t)); /* periodic task - re-add */ if (next_task->interval.tv_sec != 0 || next_task->interval.tv_usec != 0) { next_task->scheduled.tv_sec += next_task->interval.tv_sec; next_task->scheduled.tv_usec += next_task->interval.tv_usec; if (next_task->scheduled.tv_usec >= 1000000) { next_task->scheduled.tv_sec += 1; next_task->scheduled.tv_usec -= 1000000; } _dessert_periodic_add_periodic_t(next_task); } /* otherwise free memory */ else { free(next_task); } /* run the callback */ pthread_mutex_unlock(&_dessert_periodic_mutex); /* call the callback - remove it from list if exits with nonzero code */ if (task.c(task.data, &(task.scheduled), &(task.interval))) { dessert_periodic_del(next_task); } pthread_mutex_lock(&_dessert_periodic_mutex); } pthread_mutex_unlock(&_dessert_periodic_mutex); _dessert_periodic_worker_running = 0; return (NULL); } libdessert0.87-0.87.2/dessert.h0000644000175000017500000014265211331020526014226 0ustar dvddvd/***************************************************************************//** @file @page license License @brief Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). \n All rights reserved. \n These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group \n (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) \n -----------------------------------------------------------------------------\n 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 3 of the License, or (at your option) any later version. \n \n 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.\n \n You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ . \n -----------------------------------------------------------------------------\n For further information and questions please use the web site \n http://www.des-testbed.net/ *******************************************************************************/ /***************************************************************************//** * * @mainpage DES-SERT * * * @section intro_sec Introduction * * DES-SERT, the DES Simple and Extensible Routing-Framework for Testbeds, * is a framework designed to assist researchers implementing routing * protocols for testbeds. * * DES-SERT enables the implementation of routing protocols on top of * Ethernet via an underlay (Layer 2.5) in user space. * It introduces an abstraction from OS specific issues and provides * functionality and data structures to implement proactive, reactive, * and hybrid routing protocols. * While generally usable in many application scenarios, it is primarily * used in DES-Mesh (http://www.des-testbed.net/), the multi-transceiver * wireless mesh network testbed part of the DES-Testbed at Freie * Universitaet Berlin, Germany. * * @section arch_sec DES-SERT Architecture * * DES-SERT introduces some concepts to implement routing protocols. * When implementing a routing protocol with DES-SERT, you should be * familiar with these concepts to structure and tailor your implementation. * * * @subsection messages_subsec DES-SERT Messages * * Every packet you send or receive on the mesh is represented as a * DES-SERT message. From a programmers point of view, a DES-SERT message * is just a C-structure: * * @code * typedef struct __attribute__ ((__packed__)) dessert_msg { * struct ether_header l2h; * char proto[DESSERT_PROTO_STRLEN]; * uint8_t ver; * uint8_t flags; * union { * uint32_t u32; * struct __attribute__ ((__packed__)) { * uint8_t ttl; * uint8_t u8; * uint16_t u16; * }; * }; * uint16_t hlen; * uint16_t plen; * } dessert_msg_t; * @endcode * * Every message sent via the underlay carries this structure as a packet * header. All data in a "dessert_msg" is stored in network byte order. * DES-SERT tries to care as automatically as possible of this structure. * Nevertheless you will have to care at least about: "l2h.ether_dhost" and * "ttl". * * If you need to send some data along with every packet, e.g. some kind of * metric or cost your routing protocol uses, you should try to fit this * data into the "u8", "u16" and the upper 4 bits of the "flags" field. * These fields will never be touched by DES-SERT except on initialization * via "dessert_msg_new". * * Because just a C-structure is not really usable as a packet, there are some * utility functions around - please have a look around in "dessert.h" and the * doxygen documentation. The most important ones are: "dessert_msg_new" and * "dessert_msg_destroy", which do not simply allocate memory for a DES-SERT * message, but for a whole packet of maximum size and initialize the * structures for further packet construction/processing. * * @code * int dessert_msg_new(dessert_msg_t **msgout); * * void dessert_msg_destroy(dessert_msg_t* msg); * @endcode * * * @subsection extensions_subsec DES-SERT Extensions * * A DES-SERT extension is some structure used to piggyback data on a * DES-SERT message. It consists of a 8-bit user supplied type field (with * some reserved values), an 8-bit length field and user supplied data of * arbitrary length of 253 bytes at most. * * It can be added to a message via dessert_msg_addext(), retrieved via * dessert_msg_getext() and removed via dessert_msg_delext(). * * @code * int dessert_msg_addext(dessert_msg_t* msg, dessert_ext_t** ext, * uint8_t type, size_t len); * * int dessert_msg_delext(dessert_msg_t *msg, dessert_ext_t *ext); * * int dessert_msg_getext(const dessert_msg_t* msg, dessert_ext_t** ext, * uint8_t type, int index); * * @endcode * * It is recommended not to put single data fields in extensions, but * combine semantically related data in a struct and attach this struct * as an extension because every extension carried introduces an 16-bit * overhead to the packet. * * * @subsection pipelines_subsec Processing Pipelines * * Routing algorithms are often split up in several parts like packet * validation, loop-detection or routing table lookup. * To implement these as independent and clear as possible, DES-SERT enables * you to split up your packet processing in as many parts as you like. * * There are two separate processing pipelines - one for packets received * from the kernel via a TUN or TAP interface and one for packets received * via an interface used on the mesh network. * * You can register callbacks to be added to one of these pipelines with * "dessert_sysrxcb_add" or "dessert_meshrxcb_add". Both take an additional * integer argument ("priority") specifying the order the callbacks should * be called. Higher "priority" value results in being called later * within the pipeline. * * @code * int dessert_sysrxcb_add(dessert_sysrxcb_t* c, int prio); * * int dessert_meshrxcb_add(dessert_meshrxcb_t* c, int prio); * @endcode * * If a callback returns "DESSERT_MSG_KEEP" the packed will be processed by * further callbacks, if it returns "DESSERT_MSG_DROP" the message will be * dropped and no further callbacks will be called. * * You do not need to care about the management of the buffers for incoming * messages - DES-SERT does this for you. Nevertheless if you need to add * extensions or enlarge the payload of a message, you need to tell DES-SERT * to enlarge the buffer for you if the flag "DESSERT_FLAG_SPARSE" is set on * the message. You can do this by returning "DESSERT_MSG_NEEDNOSPARSE" from * within a callback. The callback will be called again with a larger buffer * and no "DESSERT_FLAG_SPARSE" flag being set. * * * @subsection buffer_subsec Processing Buffer * * If you need to pass information along several callbacks, you can do this * in the processing buffer passed to the the callbacks. This buffer contains * some local processing flags ("lflags") set by the builtin callback * "dessert_msg_ifaceflags_cb" (e.g. telling you about packet origin or if * the packet is multicast) and 1KB of space for your callbacks to pass * along arbitrary data. * * This buffer might only be allocated after you explicitly request it - in * this case the proc argument is NULL and you can return the value * "DESSERT_MSG_NEEDMSGPROC" from within your callback. The callback will * be called again with a valid processing buffer. * * * @section interfaces_sec Using Interfaces * * * @subsection sysif_subsec Using a TUN/TAP interface * * First you have to choose whether to use a TUN or TAP interface. TUN * interfaces are used to exchange IPv4 / IPv6 datagrams with the kernel * network stack. TAP interfaces are used to exchange Ethernet frames * with the kernel network stack. If you want to route Ethernet frames, * you should choose a TAP interface. If you intend to implement * a custom layer 2 to layer 3 mapping, you should use a TUN interface. * Currently, you can only initialize and use a single sys (TUN/TAP) interface. * This is done by "dessert_sysif_init". You must then set up the interface * config in the kernel yourself e.g. by calling "ifconfig". * * @code * * int dessert_sysif_init(char* name, uint8_t flags); * * @endcode * * In either case, frames you receive from a TUN/TAP interface will be * passed along the callbacks added by "dessert_sysrxcb_add" to the * processing pipeline. Each of them will be called with a pointer to an * Ethernet frame. In case of a TUN interface, "ether_shost" and "ether_dhost" * are set to "00:00:00:00:00:00", and ether_type reflects whether the packet * received is IPv4 oder IPv6. * * Packets are sent to the kernel network stack with "dessert_syssend". * In case of a TUN Interface "ether_shost" and "ether_dhost" will be * ignored. * * @code * int dessert_syssend_msg(dessert_msg_t *msg); * * int dessert_syssend(const struct ether_header *eth, size_t len); * @endcode * * * @subsection meshif_subsec Using a Mesh Interface * * Mesh interfaces are used similar to the TUN/TAP interface with two major * differences: You can have multiple mesh interfaces and they send and * receive DES-SERT messages instead of Ethernet frames. * * You add an mesh interface using "dessert_meshif_add" and can send to it * by calling "dessert_meshsend". If the interface parameter is NULL, the * packet will be transmitted over every interface (good for flooding). * * @code * int dessert_meshif_add(const char* dev, uint8_t flags); * * * int dessert_meshsend(const dessert_msg_t* msgin, * const dessert_meshif_t *iface); * * int dessert_meshsend_hwaddr(const dessert_msg_t* msgin, * const uint8_t hwaddr[ETHER_ADDR_LEN]); * * int dessert_meshsend_allbutone(const dessert_msg_t* msgin, * const dessert_meshif_t *iface); * * int dessert_meshsend_fast(dessert_msg_t* msg, * const dessert_meshif_t *iface); * * int dessert_meshsend_fast_hwaddr(dessert_msg_t* msg, * const uint8_t hwaddr[ETHER_ADDR_LEN]); * * int dessert_meshsend_fast_allbutone(dessert_msg_t* msg, * const dessert_meshif_t *iface); * * int dessert_meshsend_raw(dessert_msg_t* msg, * const dessert_meshif_t *iface); * @endcode * * @section logging_sec Logging * * You can write log messages easily with a bunch of macros provided * by DES-SERT ("dessert_debug", "dessert_info" ,"dessert_notice", * "dessert_warn", "dessert_warning", "dessert_err", "dessert_crit", * "dessert_alert" and "dessert_emerg"). Each of them can be used like * "printf" and logs to Syslog, STDERR, file or a ringbuffer depending * on your configuration. * * DES-SERT also ships with a custom "assert" macro which acts like * the original macro from the standard C library and uses the logging * mechanism described above. * * * @section periodics_sec Periodics * * Periodics help you to perform maintenance or delayed tasks. A task * consists of a callback, which will be called at the time you requested, * and a void pointer the callback is passed. You can add these tasks by * calling "dessert_periodic_add" or "dessert_periodic_add_delayed". * * * @section cli_sec CLI - Command Line Interface * * DES-SERT supports simple configuration and debugging of your routing * protocol implementation by providing a Cisco like command line interface * (cli) and a config file parser based upon it. * This cli is realized through libcli (http://code.google.com/p/libcli/). * * DES-SERT does some of the initialization of libcli. Therefore, it provides * the main cli anchor "dessert_cli" and some anchors to add commands below * "dessert_cli_.*". Because DES-SERT only loosely wraps libcli, you should * make yourself familiar with libcli itself. This may be improved in further * DES-SERT releases. * * You can evaluate a config file by calling "cli_file" and start a thread * enabling a telnet-interface for DES-SERT by calling "dessert_cli_run". * * * @section all_sec Putting it all together * * Now you have learned about the most important aspects of DES-SERT. * To write your own routing protocol implementation, you need to know * how to put all this together. * * You should start with a main() program parsing the command line options * and then calling "dessert_init()". This is needed to set up DES-SERT * correctly. Afterwards you can register callbacks, read the config file * and do what you like. If everything is set up, you call "dessert_run()" * and let the event based framework do its job. * * If you would like to see a complete protocol implementation sample, * have a look at the "gossiping" directory. * * * @section feedback_sec Contact & Feedback * * We love feedback - if you have patches, comments or questions, * please contact us! Recent contact information is available on * http://www.des-testbed.net/des-sert/ * ******************************************************************************/ #ifndef DESSERT_H #define DESSERT_H #ifdef TARGET_DARWIN #include #define TUN_BSD #endif #ifdef TARGET_LINUX #define TUN_LINUX #endif #include #include #include #include #include #include #include /***************************************************************************//** * * @defgroup global G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** ethernet protocol used on layer 2 */ #define DESSERT_ETHPROTO 0x8042 /** maximum frame size to assemble as dessert_msg */ #define DESSERT_MAXFRAMELEN ETHER_MAX_LEN /** maximum size of the data part in dessert_ext */ #define DESSERT_MAXEXTDATALEN 253 /** length of protocol string used in dessert_msg */ #define DESSERT_PROTO_STRLEN 4 /** size of local message processing buffer */ #define DESSERT_LBUF_LEN 1024 /** return code for many dessert_* functions */ #define DESSERT_OK 0 /** return code for many dessert_* functions */ #define DESSERT_ERR 1 /****************************************************************************** * typedefs ******************************************************************************/ /** runtime-unique frame id */ typedef uint64_t dessert_frameid_t; /** A basic message send on des-sert layer2.5. */ typedef struct __attribute__ ((__packed__)) dessert_msg { /** the layer2 header on the wire */ struct ether_header l2h; /** short name of the protocol as passed to dessert_init() */ char proto[DESSERT_PROTO_STRLEN]; /** version of the app as passed to dessert_init() */ uint8_t ver; /** flags - bits 1-4 reserved for dessert, bits 5-8 for app usage */ uint8_t flags; union { /** reserved for app usage */ uint32_t u32; struct __attribute__ ((__packed__)) { /** ttl or hopcount field for app usage - 0xff if not used*/ uint8_t ttl; /** reserved for app usage - 0x00 if not used */ uint8_t u8; /** reserved for app usage - 0xbeef if not used */ uint16_t u16; }; }; /** header length incl. extensions - in network byte order */ uint16_t hlen; /** payload length - in network byte order */ uint16_t plen; } dessert_msg_t; /** local processing struct for dessert_msg_t */ typedef struct dessert_msg_proc { /** 16 bits for local processing flags */ uint16_t lflags; /** 16 bits reserved */ uint16_t lreserved; /** DESSERT_LBUF_LEN bytes buffer */ char lbuf[DESSERT_LBUF_LEN]; } dessert_msg_proc_t; /** a extension record to add to a dessert_msg */ typedef struct __attribute__ ((__packed__)) dessert_ext { /** type of the extension * user supplied types must be >= DESSERT_EXT_USER */ uint8_t type; /** length of the extension in bytes * including the 2 bytes of the extension * header itself*/ uint8_t len; /** pointer to the data - real length is len-2 bytes */ uint8_t data[DESSERT_MAXEXTDATALEN]; } dessert_ext_t; /** an interface used for dessert_msg frames */ typedef struct dessert_meshif { /** pointer to next interface */ struct dessert_meshif *next; /** pointer to next interface */ struct dessert_meshif *prev; /** name of interface */ char if_name[IFNAMSIZ]; /** system ifindex */ unsigned int if_index; /** hardware address of interface */ uint8_t hwaddr[ETHER_ADDR_LEN]; /* uthash key*/ /** counter mutex */ pthread_mutex_t cnt_mutex; /** packet counter in */ uint64_t ipkts; /** packet counter out */ uint64_t opkts; /** packet counter in */ uint64_t ibytes; /** packet counter out */ uint64_t obytes; /** libpcap descriptor for the interface */ pcap_t *pcap; /** libpcap error message buffer */ char pcap_err[PCAP_ERRBUF_SIZE]; /** pthread running the request loop */ pthread_t worker; } dessert_meshif_t; /** A tun/tap interface used to inject packets to dessert implemented daemons. * * \note Please make sure first fields are equal to dessert_meshif to re-use * _dessert_meshif_gethwaddr(). * */ typedef struct dessert_sysif { /** pointer to next interface */ struct dessert_sysif *next; /** name of interface */ char if_name[IFNAMSIZ]; /** system ifindex */ unsigned int if_index; /** hardware address of the interface */ uint8_t hwaddr[ETHER_ADDR_LEN]; /** counter mutex */ pthread_mutex_t cnt_mutex; /** packet counter in */ uint64_t ipkts; /** packet counter out */ uint64_t opkts; /** packet counter in */ uint64_t ibytes; /** packet counter out */ uint64_t obytes; /** file descriptor to read/write from/to */ int fd; /** if it is a tun or tap interface */ uint8_t flags; /** pthread running the request loop */ pthread_t worker; } dessert_sysif_t; /** Callback type to call if a packed is received via a dessert mesh interface. * * @param *msg dessert_msg_t frame received * @param len length of the buffer pointed to from dessert_msg_t * @param *proc local processing buffer passed along the callback pipeline - may be NULL * @param *iface interface received packet on - may be NULL * @param id unique internal frame id of the packet * * @retval DESSERT_MSG_KEEP to continue processing the packet * @retval DESSERT_MSG_DROP to drop it * @retval DESSERT_MSG_NEEDMSGPROC to get a processing buffer * @retval DESSERT_MSG_NEEDNOSPARSE to get a full packet buffer (e.g. needed to add extensions) * * \warning The callbacks are invoked with no locks hold by the thread, * \warning YOU MUST make sure the thread holds no locks after the callback exits. * \warning YOU MUST also make sure not to do anything blocking in a callback! * * If the callback exits with DESSERT_MSG_NEEDMSGPROC or DESSERT_MSG_NEEDNOSPARSE * and the respective buffer is NULL or sparse, the callback is called again after * providing the requested resource. * */ typedef int dessert_meshrxcb_t(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id); /** Callback type to call if a packed should be injected into dessert via a tun/tap interface. * * @param *msg dessert msg received - original ethernet frame is encapsulated within * @param len length of ethernet frame received * @param *proc local processing buffer passed along the callback pipeline - may be NULL * @param *sysif interface received packet on * @param id unique internal frame id of the packet * * @retval DESSERT_MSG_KEEP to continue processing the packet * @retval DESSERT_MSG_DROP to drop it * * \warning The callbacks are invoked with no locks hold by the thread, * \warning YOU MUST make sure the thread holds no locks after the callback exits. * \warning YOU MUST also make sure not to do anything blocking in a callback! * */ typedef int dessert_sysrxcb_t(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id); /** callbacks type to call in a periodic task * * The callbacks are invoked with no locks hold by the thread, * YOU MUST make sure the thread holds no locks after the callback exits. * YOU MUST also make sure not to do anything blocking in a callback! * * @arg *data void pointer to pass to the callback * @arg scheduled when this call was scheduled * @arg interval how often this call should be scheduled * ®return should be 0, otherwise the callback is unregistered */ typedef int dessert_periodiccallback_t(void *data, struct timeval *scheduled, struct timeval *interval); /** definition of a periodic tasklist entry */ typedef struct dessert_periodic { /** callback to call */ dessert_periodiccallback_t *c; /** when to call next */ struct timeval scheduled; /** call every */ struct timeval interval; /** data pointer to pass to callback */ void *data; /** internal pointer for task list */ struct dessert_periodic *next; } dessert_periodic_t; /***************************************************************************//** * @} * * @defgroup core C O R E * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** type for local unique packet identification */ #define DESSERT_FRAMEID_MAX ((uint64_t)-1) /** flag for dessert_init - daemonize when calling * disables logging to STDERR */ #define DESSERT_OPT_DAEMONIZE 0x0100 /** flag for dessert_init - do not daemonize when calling */ #define DESSERT_OPT_NODAEMONIZE 0x0200 /** flag for dessert_init - create and write pid file */ #define DESSERT_OPT_PID 0x0400 /** flag for dessert_init - do not create and write pid file */ #define DESSERT_OPT_NOPID 0x0800 /****************************************************************************** * globals ******************************************************************************/ /** protocol string used in dessert_msg frames */ extern char dessert_proto[DESSERT_PROTO_STRLEN+1]; /** version int used in dessert_msg frames */ extern u_int8_t dessert_ver; /** default src address used for local generated dessert_msg frames */ extern u_int8_t dessert_l25_defsrc[ETHER_ADDR_LEN]; /** constant holding ethernet broadcast address after dessert_init */ extern u_char ether_broadcast[ETHER_ADDR_LEN]; /** constant holding ethernet null address after dessert_init */ extern u_char ether_null[ETHER_ADDR_LEN]; /** the config funnel */ extern pthread_rwlock_t dessert_cfglock; /****************************************************************************** * functions ******************************************************************************/ int dessert_init(const char* proto, int version, uint16_t opts, char* pidfile); int dessert_run(void); void dessert_exit(void); /***************************************************************************//** * @} * * @defgroup cli C L I - C O M M A N D _ L I N E _ I N T E R F A C E * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * globals ******************************************************************************/ extern struct cli_def *dessert_cli; extern struct cli_command *dessert_cli_show; extern struct cli_command *dessert_cli_cfg_iface; extern struct cli_command *dessert_cli_cfg_no; extern struct cli_command *dessert_cli_cfg_no_iface; extern struct cli_command *dessert_cli_cfg_set; extern struct cli_command *dessert_cli_cfg_logging; extern struct cli_command *dessert_cli_cfg_no_logging; /****************************************************************************** * functions ******************************************************************************/ int dessert_cli_run(void); FILE* dessert_cli_get_cfg(int argc, char** argv); int dessert_set_cli_port(uint16_t port); int dessert_cli_cmd_addsysif(struct cli_def *cli, char *command, char *argv[], int argc); int dessert_cli_cmd_addmeshif(struct cli_def *cli, char *command, char *argv[], int argc); /***************************************************************************//** * @} * * @defgroup log L O G _ F A C I L I T Y * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** flag for dessert_logcfg - enable syslog logging */ #define DESSERT_LOG_SYSLOG 0x0001 /** flag for dessert_logcfg - disable syslog logging */ #define DESSERT_LOG_NOSYSLOG 0x0002 /** flag for dessert_logcfg - enable logfile logging * @warning before using this you MUST use fopen(dessert_logfd, ...) to open the logfile */ #define DESSERT_LOG_FILE 0x0004 /** flag for dessert_logcfg - disable logfile logging */ #define DESSERT_LOG_NOFILE 0x0008 /** flag for dessert_logcfg - enable logging to stderr */ #define DESSERT_LOG_STDERR 0x0010 /** flag for dessert_logcfg - disable logging to stderr */ #define DESSERT_LOG_NOSTDERR 0x0020 /** flag for dessert_logcfg - enable logging to ringbuffer */ #define DESSERT_LOG_RBUF 0x0040 /** flag for dessert_logcfg - disable logging to ringbuffer */ #define DESSERT_LOG_NORBUF 0x0080 /** flag for dessert_logcfg - enable debug loglevel */ #define DESSERT_LOG_DEBUG 0x0100 /** flag for dessert_logcfg - disable debug loglevel */ #define DESSERT_LOG_NODEBUG 0x0200 /****************************************************************************** * functions ******************************************************************************/ int dessert_logcfg(uint16_t opts); void _dessert_log(int level, const char* func, const char* file, int line, const char *fmt, ...); /** log at DEBUG level */ #define dessert_debug(...) _dessert_log(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at INFO level */ #define dessert_info(...) _dessert_log(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at NOTICE level */ #define dessert_notice(...) _dessert_log(LOG_NOTICE, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at WARNING level */ #define dessert_warn(...) _dessert_log(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at WARNING level */ #define dessert_warning(...) _dessert_log(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at ERR level */ #define dessert_err(...) _dessert_log(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at CRIT level */ #define dessert_crit(...) _dessert_log(LOG_CRIT, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at ALERT level */ #define dessert_alert(...) _dessert_log(LOG_ALERT, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /** log at EMERG level */ #define dessert_emerg(...) _dessert_log(LOG_EMERG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) /***************************************************************************//** * @} * * @defgroup mesh M E S H - I N T E R F A C E S * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** return code for dessert_meshrxcb_t - forces to copy the message and call again*/ #define DESSERT_MSG_NEEDNOSPARSE 1 /** return code for dessert_meshrxcb_t - forces to generate processing info and call again*/ #define DESSERT_MSG_NEEDMSGPROC 2 /** return code for dessert_meshrxcb_t and dessert_sysrxcb_t */ #define DESSERT_MSG_KEEP 0 /** return code for dessert_meshrxcb_t and dessert_sysrxcb_t */ #define DESSERT_MSG_DROP -1 /** flag for dessert_meshif_add - set interface in promiscuous-mode (default) */ #define DESSERT_IF_PROMISC 0x0 /** flag for dessert_meshif_add - do not set interface in promiscuous-mode */ #define DESSERT_IF_NOPROMISC 0x1 /** flag for dessert_meshif_add - filter out non-des-sert frames in libpcap (default) */ #define DESSERT_IF_FILTER 0x0 /** flag for dessert_meshif_add - do not filter out non-des-sert frames in libpcap */ #define DESSERT_IF_NOFILTER 0x2 /****************************************************************************** * functions ******************************************************************************/ /* sending messages */ int dessert_meshsend(const dessert_msg_t* msgin, const dessert_meshif_t *iface); int dessert_meshsend_allbutone(const dessert_msg_t* msgin, const dessert_meshif_t *iface); int dessert_meshsend_hwaddr(const dessert_msg_t* msgin, const uint8_t hwaddr[ETHER_ADDR_LEN]); int dessert_meshsend_randomized(const dessert_msg_t* msgin); int dessert_meshsend_fast(dessert_msg_t* msg, const dessert_meshif_t *iface); int dessert_meshsend_fast_allbutone(dessert_msg_t* msg, const dessert_meshif_t *iface); int dessert_meshsend_fast_hwaddr(dessert_msg_t* msg, const uint8_t hwaddr[ETHER_ADDR_LEN]); int dessert_meshsend_fast_randomized(dessert_msg_t* msgin); int dessert_meshsend_raw(dessert_msg_t* msg, const dessert_meshif_t *iface); /* meshrx-callback handling */ int dessert_meshrxcb_add(dessert_meshrxcb_t* c, int prio); int dessert_meshrxcb_del(dessert_meshrxcb_t* c); /* mesh interface handling */ int dessert_meshif_add(const char* dev, uint8_t flags); int dessert_meshif_del(const char* dev); dessert_meshif_t * dessert_meshif_get_name(const char* dev); dessert_meshif_t * dessert_meshif_get_hwaddr(const uint8_t hwaddr[ETHER_ADDR_LEN]); dessert_meshif_t * dessert_meshiflist_get(void); /*\}*/ /***************************************************************************//** * @} * * @defgroup sys S Y S - I N T E R F A C E S * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** flag for dessert_sysif_init - open tun (ip/ipv6) device */ #define DESSERT_TUN 0x00 /** flag for dessert_sysif_init - open tap (ethernet) device */ #define DESSERT_TAP 0x01 /** flag for dessert_sysif_init - set dessert_l25_defsrc to mac of tap device */ #define DESSERT_MAKE_DEFSRC 0x02 /** flag for dessert_sysif_init - get mac for tap failed - try mac in src of first packet */ #define _DESSERT_TAP_NOMAC 0x80 /****************************************************************************** * functions ******************************************************************************/ int dessert_sysif_init(char* name, uint8_t flags); int dessert_sysrxcb_add(dessert_sysrxcb_t* c, int prio); int dessert_sysrxcb_del(dessert_sysrxcb_t* c); int dessert_syssend_msg(dessert_msg_t *msg); int dessert_syssend(const struct ether_header *eth, size_t len); /***************************************************************************//** * @} * * @defgroup msg M E S S A G E _ H A N D L I N G * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** flag for dessert_msg.flags - message len is hlen+plen * if not set buffer len is assumed as DESSERT_MAXFRAMELEN + DESSERT_MSGPROCLEN */ #define DESSERT_FLAG_SPARSE 0x1 /* *********************** */ /** flag for dessert_msg_proc.lflags - l25 src is one of our interfaces */ #define DESSERT_LFLAG_SRC_SELF 0x0002 /** flag for dessert_msg_proc.lflags - l25 dst is multicast address*/ #define DESSERT_LFLAG_DST_MULTICAST 0x0004 /** flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces */ #define DESSERT_LFLAG_DST_SELF 0x0008 /** flag for dessert_msg_proc.lflags - l25 dst is broadcast */ #define DESSERT_LFLAG_DST_BROADCAST 0x0010 /** flag for dessert_msg_proc.lflags - l2 src is one of our interfaces */ #define DESSERT_LFLAG_PREVHOP_SELF 0x0020 /** flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces */ #define DESSERT_LFLAG_NEXTHOP_SELF 0x0040 /** flag for dessert_msg_proc.lflags - l2 dst is broadcast */ #define DESSERT_LFLAG_NEXTHOP_BROADCAST 0x0080 /** flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces, * but we received the message not via the indented interface, e.g. we * overheard it */ #define DESSERT_LFLAG_DST_SELF_OVERHEARD 0x0100 /** flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces, * but we received the message not via the indented interface, e.g. we * overheard it */ #define DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD 0x0200 /* *********************** */ /** length of dessert_ext header */ #define DESSERT_EXTLEN (sizeof(struct dessert_ext) - DESSERT_MAXEXTDATALEN) /** dessert_ext type wildcard - any extension */ #define DESSERT_EXT_ANY 0x00 /** dessert_ext type for ethernet header */ #define DESSERT_EXT_ETH 0x01 /** dessert_ext type for packet tracing */ #define DESSERT_EXT_TRACE 0x02 /** first dessert_ext type for usage by the user */ #define DESSERT_EXT_USER 0x40 /* *********************** */ /** packet tracing flag - only record hosts */ #define DESSERT_MSG_TRACE_HOST (ETHER_ADDR_LEN) /** packet tracing flag - record interfaces */ #define DESSERT_MSG_TRACE_IFACE (3*ETHER_ADDR_LEN) /* *********************** */ /** Returns the length of a given extension. */ #define dessert_ext_getdatalen(ext) (ext->len - DESSERT_EXTLEN) /****************************************************************************** * functions ******************************************************************************/ int dessert_msg_new(dessert_msg_t **msgout); int dessert_msg_clone(dessert_msg_t **msgnew, const dessert_msg_t *msgold, uint8_t sparse); int dessert_msg_check(const dessert_msg_t* msg, size_t len); void dessert_msg_dump(const dessert_msg_t* msg, size_t len, char *buf, size_t blen); void dessert_msg_destroy(dessert_msg_t* msg); int dessert_msg_ethencap(const struct ether_header* eth, size_t eth_len, dessert_msg_t **msgout); int dessert_msg_ethdecap(const dessert_msg_t* msg, struct ether_header** ethout); struct ether_header* dessert_msg_getl25ether (const dessert_msg_t* msg); int dessert_msg_proc_clone(dessert_msg_proc_t **procnew, const dessert_msg_proc_t *procold); void dessert_msg_proc_dump(const dessert_msg_t* msg, size_t len, const dessert_msg_proc_t *proc, char *buf, size_t blen); void dessert_msg_proc_destroy(dessert_msg_proc_t* proc); int dessert_msg_addpayload(dessert_msg_t* msg, void** payload, int len); int dessert_msg_getpayload(dessert_msg_t *msg, void **payload); int dessert_msg_addext(dessert_msg_t* msg, dessert_ext_t** ext, uint8_t type, size_t len); int dessert_msg_delext(dessert_msg_t *msg, dessert_ext_t *ext); int dessert_msg_resizeext(dessert_msg_t *msg, dessert_ext_t *ext, size_t new_len); int dessert_msg_getext(const dessert_msg_t* msg, dessert_ext_t** ext, uint8_t type, int index); int dessert_msg_get_ext_count(const dessert_msg_t* msg, uint8_t type); int dessert_msg_trace_initiate(dessert_msg_t* msg, int mode); int dessert_msg_trace_dump(const dessert_msg_t* msg, char* buf, int blen); int dessert_msg_dump_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id); int dessert_msg_check_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id); int dessert_msg_trace_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id); int dessert_msg_ifaceflags_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *riface, dessert_frameid_t id); /***************************************************************************//** * @} * * @defgroup periodic P E R I O D I C _ T A S K S * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ dessert_periodic_t *dessert_periodic_add(dessert_periodiccallback_t* c, void *data, const struct timeval *scheduled, const struct timeval *interval); dessert_periodic_t *dessert_periodic_add_delayed(dessert_periodiccallback_t* c, void *data, int delay); int dessert_periodic_del(dessert_periodic_t *p); /***************************************************************************//** * @} * * @defgroup agentx NET - S N M P // A G E N T _ X * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ /** Flag indicating the dessert_agentx_appstats_t is of type bool. */ #define DESSERT_APPSTATS_VALUETYPE_BOOL 0 /** Flag indicating the dessert_agentx_appstats_t is of type int32. */ #define DESSERT_APPSTATS_VALUETYPE_INT32 1 /** Flag indicating the dessert_agentx_appstats_t is of type uint32. */ #define DESSERT_APPSTATS_VALUETYPE_UINT32 2 /** Flag indicating the dessert_agentx_appstats_t is of type counter64. */ #define DESSERT_APPSTATS_VALUETYPE_COUNTER64 3 /** Flag indicating the dessert_agentx_appstats_t is of type octetstring. */ #define DESSERT_APPSTATS_VALUETYPE_OCTETSTRING 4 /* *********************** */ /** Flag indicating the dessert_agentx_appstats_t does not contain information regarding a node or a link. */ #define DESSERT_APPSTATS_NODEORLINK_NONE 0 /** Flag indicating the dessert_agentx_appstats_t contains information regarding a node. */ #define DESSERT_APPSTATS_NODEORLINK_NODE 1 /** Flag indicating the dessert_agentx_appstats_t contains information regarding a link. */ #define DESSERT_APPSTATS_NODEORLINK_LINK 2 /* *********************** */ /** What is considered to be TRUE in a dessert_agentx_appstats_t. */ #define DESSERT_APPSTATS_BOOL_TRUE 1 /** What is considered to be FALSE in a dessert_agentx_appstats_t. */ #define DESSERT_APPSTATS_BOOL_FALSE 0 /* *********************** */ /** Flag indicating the dessert_agentx_appparams_t is of type bool. */ #define DESSERT_APPPARAMS_VALUETYPE_BOOL 0 /** Flag indicating the dessert_agentx_appparams_t is of type int32. */ #define DESSERT_APPPARAMS_VALUETYPE_INT32 1 /** Flag indicating the dessert_agentx_appparams_t is of type uint32. */ #define DESSERT_APPPARAMS_VALUETYPE_UINT32 2 /** Flag indicating the dessert_agentx_appparams_t is of type octetstring. */ #define DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING 3 /* *********************** */ /** What is considered to be TRUE in a dessert_agentx_appparams_t. */ #define DESSERT_APPPARAMS_BOOL_TRUE 1 /** What is considered to be FALSE in a dessert_agentx_appparams_t. */ #define DESSERT_APPPARAMS_BOOL_FALSE 0 /* *********************** */ /** Flag indicating if a appstats callback entry is of type bulk. */ #define DESSERT_APPSTATS_CB_BULK 1 /** Flag indicating if a appstats callback entry is of type nobulk. */ #define DESSERT_APPSTATS_CB_NOBULK 2 /****************************************************************************** * typedefs ******************************************************************************/ /** An abstract data type representing some statistical datum.*/ typedef struct dessert_agentx_appstats { /** A prev pointer. @internal */ struct dessert_agentx_appstats *prev; /** A next pointer. @internal */ struct dessert_agentx_appstats *next; /** The name of the datum. */ char name[256]; /** A description of the datum*/ char desc[256]; /** The type of the datum. * * @see For valid values please refer to: \n DESSERT_APPSTATS_VALUETYPE_BOOL * @see DESSERT_APPSTATS_VALUETYPE_INT32 * @see DESSERT_APPSTATS_VALUETYPE_UINT32 * @see DESSERT_APPSTATS_VALUETYPE_COUNTER64 * @see DESSERT_APPSTATS_VALUETYPE_OCTETSTRING */ int value_type; /** Indicates if this datum contains information about a node or a link * * @see For valid values please refer to: \n DESSERT_APPSTATS_NODEORLINK_NONE * @see DESSERT_APPSTATS_NODEORLINK_NODE * @see DESSERT_APPSTATS_NODEORLINK_LINK */ int node_or_link; /** Field representing a mac address if this datum contains information about a node or a link. */ uint8_t macaddress1 [ETHER_ADDR_LEN]; /** Field representing a mac address if this datum contains information about a link. */ uint8_t macaddress2 [ETHER_ADDR_LEN]; union { /** A boolean. * * @see For valid values please refer to: \n DESSERT_APPSTATS_BOOL_TRUE * @see DESSERT_APPSTATS_BOOL_FALSE */ uint8_t bool; /** A 32bit signed integer. */ int32_t int32; /** A 32bit unsigned integer. */ uint32_t uint32; /** A 64bit unsigned integer with counter semantics */ uint64_t counter64; struct { /** The length of the octetstring field. */ uint8_t octetstring_len; /** Character pointer to some raw bytes. */ char *octetstring; }; }; } dessert_agentx_appstats_t; /** An abstract data type representing some parameter.*/ typedef struct dessert_agentx_appparams { /** Internal. @internal */ struct dessert_agentx_appparams *prev; /** Internal. @internal */ struct dessert_agentx_appparams *next; /** Internal. @internal Internal. */ uint8_t index; /** The name of the datum. */ char name[256]; /** A description of the datum*/ char desc[256]; /** The type of the parameter. * * @see For valid values please refer to: \n DESSERT_APPPARAMS_VALUETYPE_BOOL * @see DESSERT_APPPARAMS_VALUETYPE_INT32 * @see DESSERT_APPPARAMS_VALUETYPE_UINT32 * @see DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING */ int value_type; union { /** A boolean. * * @see For valid values please refer to: \n DESSERT_APPPARAMS_BOOL_TRUE * @see DESSERT_APPPARAMS_BOOL_FALSE */ uint8_t bool; /** A 32bit signed integer. */ int32_t int32; /** A 32bit unsigned integer. */ uint32_t uint32; struct { /** The length of the octetstring field. */ uint16_t octetstring_len; /** Character pointer to some raw bytes. */ char *octetstring; }; }; } dessert_agentx_appparams_t; /** Callback type to call if the AppstatsTable is asked for by some snmp client. * * @param *appstats dessert_agentx_appstats_t the statistical datum to be filled out * * * @retval DESSERT_OK on success * @retval DESSERT_ERR to remove the corresponding callback entry * */ typedef int dessert_agentx_appstatscb_get_t(struct dessert_agentx_appstats *appstats); /** Callback type to call if the AppparamsTable is asked for by some snmp client. * * @param *appstats dessert_agentx_appparams_t the parameter to be filled out * * * @retval DESSERT_OK on success * @retval DESSERT_ERR to remove the corresponding callback entry * */ typedef int dessert_agentx_appparamscb_get_t(struct dessert_agentx_appparams *appparams); /** Callback type to call if the specific row represented by this callback is * going to be set by some snmp client. * * @param *appstats dessert_agentx_appparams_t the new value * * * @retval DESSERT_OK on success * @retval DESSERT_ERR otherwise * */ typedef int dessert_agentx_appparamscb_set_t(struct dessert_agentx_appparams *appparams); /** A callback entry representing a statistical datum. */ typedef struct dessert_agentx_appstats_cb_entry { /** Interal. @internal */ struct dessert_agentx_appstats_cb_entry *prev; /** Interal. @internal */ struct dessert_agentx_appstats_cb_entry *next; /** Flag indicating whether this entry represents a bulk entry.*/ uint8_t isbulk_flag; /** The getter callback. */ dessert_agentx_appstatscb_get_t *c; } dessert_agentx_appstats_cb_entry_t; /** A callback entry representing a parameter. */ typedef struct dessert_agentx_appparams_cb_entry { /** Internal. @internal */ struct dessert_agentx_appparams_cb_entry *prev; /** Internal. @internal*/ struct dessert_agentx_appparams_cb_entry *next; /** Internal. @internal */ uint8_t index; /** The getter callback. */ dessert_agentx_appparamscb_get_t *get; /** The setter callback. */ dessert_agentx_appparamscb_set_t *set; } dessert_agentx_appparams_cb_entry_t; /****************************************************************************** * globals ******************************************************************************/ /****************************************************************************** * functions ******************************************************************************/ dessert_agentx_appstats_t *dessert_agentx_appstats_new(void); void dessert_agentx_appstats_destroy(dessert_agentx_appstats_t *appstat); dessert_agentx_appstats_cb_entry_t *dessert_agentx_appstats_add(dessert_agentx_appstatscb_get_t *c); dessert_agentx_appstats_cb_entry_t *dessert_agentx_appstats_add_bulk(dessert_agentx_appstatscb_get_t *c); int dessert_agentx_appstats_del(dessert_agentx_appstats_cb_entry_t *e); dessert_agentx_appparams_t *dessert_agentx_appparam_new(void); void dessert_agentx_appparam_destroy(dessert_agentx_appparams_t *appparam); dessert_agentx_appparams_cb_entry_t *dessert_agentx_appparams_add(dessert_agentx_appparamscb_get_t *get, dessert_agentx_appparamscb_set_t *set); int dessert_agentx_appparams_del(dessert_agentx_appparams_cb_entry_t *e); /**************************************************************************//** * @} * * @defgroup macros U S E F U L L _ MA C R O S * * @brief EXTERNAL / PUBLIC * * @{ ******************************************************************************/ /** A convenience macro to safely iterate the list of mesh interfaces. * * @param __interface pointer to a temporal dessert_meshif_t * * @warning You must pair it with an ending MESHIFLIST_ITERATOR_STOP() macro! * Please find an usage example in the Examples paragraph below. * * @par Examples: * * @li The do_something() function will be called for every mesh interface in the list. * @code * dessert_meshif_t *iface; * * MESHIFLIST_ITERATOR_START(iface) * do_something(iface); // do something to every iface * MESHIFLIST_ITERATOR_STOP; * @endcode */ #define MESHIFLIST_ITERATOR_START(__interface) \ pthread_rwlock_rdlock(&dessert_cfglock); \ DL_FOREACH(dessert_meshiflist_get(), __interface) { /** A convenience macro to safely iterate the list of mesh interfaces. * * @see MESHIFLIST_ITERATOR_START() */ #define MESHIFLIST_ITERATOR_STOP } pthread_rwlock_unlock(&dessert_cfglock) /** A convenience macro to safely add @a __sec seconds and @a __usec microseconds * to the @c struct @c timeval @a __tv in an invariant respecting manner. * * @param __tv the @c struct @c timeval to add to * @param __sec the number of seconds to add up to @a __tv->tv_sec * @param __usec the number of microseconds to add up to @a __tv.->tv_usec * * %DESCRIPTION: \n * The GNU C Library Documentation * states about the @c tv_usec member of the @c struct @c timeval: This is the * rest of the elapsed time (a fraction of a second), represented as the number * of microseconds. It is always less than one @a million. * */ #define TIMEVAL_ADD(__tv, __sec, __usec) \ do { \ (__tv)->tv_sec += __sec; \ (__tv)->tv_usec += __usec; \ if((__tv)->tv_usec >= 1000000) { \ ++(__tv)->tv_sec; \ (__tv)->tv_usec -= 1000000; \ } \ } while(0) #define likely(x) (__builtin_expect((x),1)) #define unlikely(x) (__builtin_expect((x),0)) #define __dessert_assert(func, file, line, e) \ ((void)_dessert_log(LOG_EMERG, func, file, line, "assertion `%s' failed!\n", e), abort) #ifdef NDEBUG #define assert(e) ((void)0) #else #define assert(e) \ (__builtin_expect(!(e), 0) ? __dessert_assert(__FUNCTION__, __FILE__, __LINE__, #e) : (void)0) #endif /** @} */ /****************************************************************************** * * ! ! ! ! O L D ! ! ! T O D O ! ! ! ! * ******************************************************************************/ /** the config-flag variable */ //extern uint16_t dessert_cfgflags; // TODO not used! to be removed??!? /** size of a dessert_msg buffer */ //#define dessert_msg_buflen(x) ((x->flags&DESSERT_FLAG_SPARSE)?(x->hlen+x->plen):(DESSERT_MAXFRAMELEN+DESSERT_MSGPROCLEN)) //#define dessert_frameid_overflow(x, y) ((x>y)&&((x-y)>(DESSERT_FRAMEID_MAX/2))) #endif /* DESSERT_H*/ libdessert0.87-0.87.2/changelog.gz0000644000175000017500000000121411331020526014661 0ustar dvddvdϞCKchangelogT]o@|)0|ͪݨRD+E"--vȯ8Q 73;{;d9?U'&'+bX<4\0ua~> wNd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_agentx_appparams_cb_entry Struct Reference

dessert_agentx_appparams_cb_entry Struct Reference
[NET - S N M P // A G E N T _ X]

A callback entry representing a parameter. More...

#include <dessert.h>

Collaboration diagram for dessert_agentx_appparams_cb_entry:

Data Fields

struct
dessert_agentx_appparams_cb_entry
prev
 Internal.
struct
dessert_agentx_appparams_cb_entry
next
 Internal.
uint8_t index
 Internal.
dessert_agentx_appparamscb_get_tget
 The getter callback.
dessert_agentx_appparamscb_set_tset
 The setter callback.

Detailed Description

A callback entry representing a parameter.


Field Documentation


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats__cb__entry__coll__graph.map0000644000175000017500000000003511331020526031064 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__mesh_gad7ff09f7d63c4ff2d9669f88fbe12f12_icgraph.map0000644000175000017500000000035211331020526026665 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__msg_ga9a58534c56c6d5bba349178b00f5df2c_icgraph.md50000644000175000017500000000004011331020526026225 0ustar dvddvd94269675543c731e343c5e35344de9c3libdessert0.87-0.87.2/doxygen/html/structdessert__meshif.html0000644000175000017500000002172411331020526022317 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_meshif Struct Reference

dessert_meshif Struct Reference
[G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S]

an interface used for dessert_msg frames More...

#include <dessert.h>

Collaboration diagram for dessert_meshif:

Data Fields

struct dessert_meshifnext
 pointer to next interface
struct dessert_meshifprev
 pointer to next interface
char if_name [IFNAMSIZ]
 name of interface
unsigned int if_index
 system ifindex
uint8_t hwaddr [ETHER_ADDR_LEN]
 hardware address of interface
pthread_mutex_t cnt_mutex
 counter mutex
uint64_t ipkts
 packet counter in
uint64_t opkts
 packet counter out
uint64_t ibytes
 packet counter in
uint64_t obytes
 packet counter out
pcap_t * pcap
 libpcap descriptor for the interface
char pcap_err [PCAP_ERRBUF_SIZE]
 libpcap error message buffer
pthread_t worker
 pthread running the request loop

Detailed Description

an interface used for dessert_msg frames


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appparams__coll__graph.map0000644000175000017500000000003511331020526027026 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/structdessert__meshif__coll__graph.map0000644000175000017500000000003511331020526024610 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/graph_legend.dot0000644000175000017500000000423611331020526020147 0ustar dvddvddigraph G { edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"]; node [fontname="FreeSans",fontsize="10",shape=record]; Node9 [shape="box",label="Inherited",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",fillcolor="grey75",style="filled" fontcolor="black"]; Node10 -> Node9 [dir=back,color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"]; Node10 [shape="box",label="PublicBase",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classPublicBase.html"]; Node11 -> Node10 [dir=back,color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"]; Node11 [shape="box",label="Truncated",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="red",URL="$classTruncated.html"]; Node13 -> Node9 [dir=back,color="darkgreen",fontsize="10",style="solid",fontname="FreeSans"]; Node13 [shape="box",label="ProtectedBase",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classProtectedBase.html"]; Node14 -> Node9 [dir=back,color="firebrick4",fontsize="10",style="solid",fontname="FreeSans"]; Node14 [shape="box",label="PrivateBase",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classPrivateBase.html"]; Node15 -> Node9 [dir=back,color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"]; Node15 [shape="box",label="Undocumented",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="grey75"]; Node16 -> Node9 [dir=back,color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"]; Node16 [shape="box",label="Templ< int >",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classTempl.html"]; Node17 -> Node16 [dir=back,color="orange",fontsize="10",style="dashed",label="< int >",fontname="FreeSans"]; Node17 [shape="box",label="Templ< T >",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classTempl.html"]; Node18 -> Node9 [dir=back,color="darkorchid3",fontsize="10",style="dashed",label="m_usedClass",fontname="FreeSans"]; Node18 [shape="box",label="Used",fontsize="10",height=0.2,width=0.4,fontname="FreeSans",color="black",URL="$classUsed.html"]; } libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appparams.html0000644000175000017500000003141611331020526024534 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_agentx_appparams Struct Reference

dessert_agentx_appparams Struct Reference
[NET - S N M P // A G E N T _ X]

An abstract data type representing some parameter. More...

#include <dessert.h>

Collaboration diagram for dessert_agentx_appparams:

Data Fields

struct dessert_agentx_appparamsprev
 Internal.
struct dessert_agentx_appparamsnext
 Internal.
uint8_t index
 Internal.
char name [256]
 The name of the datum.
char desc [256]
 A description of the datum.
int value_type
 The type of the parameter.
union {
   uint8_t   bool
 A boolean.
   int32_t   int32
 A 32bit signed integer.
   uint32_t   uint32
 A 32bit unsigned integer.
   struct {
      uint16_t   octetstring_len
 The length of the octetstring field.
      char *   octetstring
 Character pointer to some raw bytes.
   } 
}; 

Detailed Description

An abstract data type representing some parameter.


Field Documentation

A boolean.

See also:
For valid values please refer to:
DESSERT_APPPARAMS_BOOL_TRUE
DESSERT_APPPARAMS_BOOL_FALSE

A 32bit signed integer.

The name of the datum.

Character pointer to some raw bytes.

The length of the octetstring field.

A 32bit unsigned integer.


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__mesh_ga16f52ad209a9d5885c61f320da3e8118_icgraph.md50000644000175000017500000000004011331020526026227 0ustar dvddvd07a3ee6f843426e0e1dd9a325ae2c12alibdessert0.87-0.87.2/doxygen/html/group__mesh_ga374acb57d6cebc12fdacf68a66c4303f_icgraph.md50000644000175000017500000000004011331020526026663 0ustar dvddvd8c25d3fb3e2be6acbc50b127cdbdf72blibdessert0.87-0.87.2/doxygen/html/ftv2mnode.png0000644000175000017500000000030211331020526017420 0ustar dvddvdPNG  IHDRL1$PLTEStRNS@ftEXtSoftwaregif2png 2.4.2^G*IDATxc`.BtRTn bLJJ"05y'IENDB`libdessert0.87-0.87.2/doxygen/html/ftv2lastnode.png0000644000175000017500000000035111331020526020133 0ustar dvddvdPNG  IHDRL10PLTEӠtRNS@ftEXtSoftwaregif2png 2.4.2^G&tEXtCommentUlead GIF SmartSaver Ver 2.0io?IDATxc`0O 3$3=IENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats__cb__entry__coll__graph.png0000644000175000017500000001041111331020526031072 0ustar dvddvdPNG  IHDR0bKGDIDATxyT 8*~A3$)P\2;EG 5ʟ/+-zNn)%-XlYJ "?maB>s>9}e @H8 pAh3"fD͈#B G6hAnn.ǏBhpRSS}+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3gO?IIIG_i#?Xt0}4~~~XYYʮ]8pAAAbccy穮&447n*p០ƭuZaaa===ٻw/`MFZZAAA$$$C@@O=SLÃAh0`vsTPyy9/GGGj_) {/۶m#>>sOX[[L6  |6EA+E]Ʈ]puueŊ̟?ߤEcAzhuu5aaaDDDÊ+L~H8 }h`` իt899pB^xݻwgΜ9dff_\Jyyy_)jH~~>'Oۻ;A;;;֭g &A0Q:t({/h GT pAh3"fD͈#B G6# m'FlF~IENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_gacef13fdc8b42b9c90087fd15ea68dc75_icgraph.map0000644000175000017500000000030411331020526026550 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__msg_ga36014dbdcc5597ada3d4b23e104f4bb0_icgraph.png0000644000175000017500000011037411331020526026444 0ustar dvddvdPNG  IHDR5 bKGD IDATxyXSWoHNHЀ+ (qߘթѩEVFE+m*FT ;Br~X3ris9{sc B!6JOB!BHcPQC!BiӨ!B!i]@H{ tyɸk׮͈ŃtiǺv 777]AKG7 x!duz ўΣ}}[TnNǩSMkME{yriMQQC%** źKcwb{A7!FE !:ݻ'OsOOO5k@"#GDFFVmu1coX, rrrh;v!H JU|1b c]y0ݺu Rz>}ǀpuu@T۷pB,Z":uŽ;4檭Gwylǫn®]|q2hS97l؀ r4h%'!!! ̙Rq}ץ5|BZ Fi4,$$De7f``9*++Ypp0YYYJlL.3g0H.]Ģ KLLd%%%lĉwe161ә2e aL*sαj<[v-ST/`ؖ-[Jb۶mcKNNf㬲mڴ|wqϕWaaa<o*ٳgz3333***؆ XnݘJb%%%3\~WrrrXdd$lŬ]x'Oj0VXXξ>M,a;/eRV9}5gdd$sttT/g1oooGVVWSRRX,f?3ϡ'}B545|{k=‚YXX0`@-^EDD03<2gט Tڲ8y<)cݿ P(cݼyuQc|6l`SNURT*ո3׳y<5''G o' &f[laL.7nәKLLdL$*uիgOc7جY{YK3TO欪bbݾ}1Ƙ;_Cx>|mL&qo.zBtO⇆yeffٹs}!!!ݻ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uVÉث~fϞd⭷O>y[[[INNv6=='O*Jشif)S?b\ǎcܹL8 lsM>#f33gΐI~~>.]bٲep/_NFF{qF),,f3}4FN>Lnn.X7Ԉ_8pիWzj㏉nmk|@`` )))dffRRRpL`82Ou\zo^xB@@!!!rMmۆ` 55 &e#wA^yV\IPP۷oюnd")),e˖ƤIOٸq#W^ $$/ċ/HVV9_)hoo9sM5440sL秸>VXڵkILLdƌlڴK.x,T'@@@>nmwD~w{'88ؙ4;|sϝul6&OS|95"^Z~=G0DDDƭ^z{۷oYblݺ?-ZĎ;hnn'Nφ ذan<չxby233&<ӧOol:dXbϞ=c455͇~d222}:uyyy<$$$yf8w ,w)"PTT=tuulv)kooٳL:eȵkרe``겠S:M]]qqqzݟ$&&CQQш;qq555$bxhsN!((8566BLL ӦMs)'x *.wϛ/Iî 山X{n[R򨬬}OϘ;7M?h$,,mN^jn'**rL&_l6uқٿM<=oYDDDDD5%5"""""2)qMIkJjDDDDDd\SR#"""""㚒tܓ: ynݺWR#""""dpp_}ÐGahhhhԈȸFDDDDD5%5"""""2MΌu""""""w:( IENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_gab9a2f77494c8ca73de1194574492c317_icgraph.png0000644000175000017500000003473211331020526026140 0ustar dvddvdPNG  IHDRbKGD IDATx{\T?\`( rs@" WJj>:OS^z<2}Sy7pB wll,|}}aoo @כ.cbcc[sΑL&={Puu5JR(i&t@tq:pyxxPvv6iZ>}:-YHLNJE4sLJIIbR(DP$iժUd0?&vZ2 n:3PjТErrrёnZ&kkkc$c 5˗/9s4O111GAAAMʖ.]J˖-{]x>$ʈ˄TT enDDERꈈٳn2h xXgQQ,,,JشFgI |3E:B :ɶ!C򐙙 cYuu5M'x \.Gdd$VX\.X&T'bxxx{{{ 7dJǍmH$_X =u MWs u2NNNh4M0~x5O@DذaJKKT*O`P@9v y67Ghl"N u2ላZ?GDDD 99۷ocȑᅬ'B*"88GQQ ^mfcSO=oC #@ cǎѣDGG[l3g`^x2Su *>9Mln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;R8::(|7{Ƹ]L˜pAVΟ?o/""ܾ}#GD||<}L8R?>@Lbn<6 Mk`Ȑ!?~<$ N8VkuBġC a2|Ϟ=hu|ӱd-T۪Z;b0h޼y$iĉEQQQ6l  'OOO5kzRTENe""2SuJ$&Rhh(9sFegg79n* 0a?//YYYgN% ܢ H$@Xbnj5-G@@@;Fd9mga1XYYťL wc] Nj0:ga13 'cfc,@cc1pa1fN 1ׁn=jXWǷ2aJ~~>N:e0tƌ//&803 ρ03 'cfc,DRyIENDB`libdessert0.87-0.87.2/doxygen/html/group__mesh_ga8eeaddc9c5386a2eb116e602beb41936_icgraph.map0000644000175000017500000000036311331020526026626 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/globals.html0000644000175000017500000005544111331020526017335 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- _ -

- d -

- e -

- m -

- t -


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/dessert_8h__incl.png0000644000175000017500000003600611331020526020742 0ustar dvddvdPNG  IHDRxuݖbKGD IDATxwXTg/A+R`WĨ1Fh3&olݘk6ĂآX!(]Ql4ia(\W+Ι=gT I$AAAA%AbD'BŒ%KTF# 0 儇:nYFa1x  jF$x  jF$x  jF$x  jF$x  jF$x  jF$x h\0UYYɶmT jL$x 'NpeU_~ɭ[>>]N>͡CXn[4y2kjjtQQQ|]|MF`2+Wm66nHdd$.\AŋL8/rU@DFFc^uc̙4y2["**Aƈ}yW'`ȑWI X$IB`,YAaa!;OVV7^$7cM"ҰȨ5?Κ5kqA&ZA,--=ֿ:::MԱ|)&Mjy     E+q5BCom BD'BťәWclv_U'O^#&&^B7p ֬^=k⎱d( 4I$x t:cYZ;/.NEwc&&^,^ָq(ZZbx t"L҉ϤلNhb|od(FaggFMz jյe)P^ee @rmbbRJ<ggk\]Gb G,Bg ͪ٫:N\\:g^ALpvE$tfk;[A#I$&$**4> w/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Rd{_~a۶m̟?CCw#LLL022ޱB%ˮ3뇟K߾=s5V/Mݛ&x>>>DFF*V.//gĉ믏uK.EKKׯ3zh"66f?OOO2e ܼyN>;wr-.^HDDDcP׺ח[n*g[rރ;v @>@}Ϟ=þ}>ƒQٓAm?GE9KStV]*55j}NNN`ccØ1cx0` gϞ%11EM۷OYwY֜۞^@#Fǫ/f̘_~I޽;w.IIIL6 ___>#,--y7,Է>{9>#sѣbΜ95zҵ\0oCRR"7n !!!C?~<9993FqL&QXXXCN8Խh;iKϝ;Es=(++,,,ϧ;w₽=۶mSe|זKG\j$66&Lַ׬t}Xk륱{sSuF?OU+-C t4Mĉ;QfS2)꨻ܟrss_U244; Ν;'J͛7oV>|xtLJo͢팍e BS233Yv#3a;ٴi~)wښC5< T".._ 4eʔ)>}Z1o޼K>E+  t<            FKHH8z$UpO^^Ҷ~/''L*]\~{a|$x"233C___ ]FFFJ+ȨG\Y=#Ozioi!IxAA%cAAԌHAAԌHAAps\IENDB`libdessert0.87-0.87.2/doxygen/html/tab_l.gif0000644000175000017500000000130211331020526016557 0ustar dvddvdGIF89a ,薴ŝɯͻ, ,@P`H$!%CqVe2XJ(Ġ+3 2$ kv-u*"}|}|~q(" $f 'l(&&$r & !){rƲεҽͼиP?Bm A%V܈!k/Đ;^$Ɩ#Mf)f͇(WLK҄ I)L:eD Cx*4 Uh %A^NKbeXkx!2t !5t]$%X.i[]YfEkg`:zҞ;}jaaM׸c瞽vۺ8ȋ'?9積G_>yu_ߞ]zw߭Ǿm浏G~თ/>٫|W}v;libdessert0.87-0.87.2/doxygen/html/structdessert__sysif__coll__graph.md50000644000175000017500000000004011331020526024376 0ustar dvddvd2a897cf50148a0da3cd3f858fc61058blibdessert0.87-0.87.2/doxygen/html/group__mesh_gad7ff09f7d63c4ff2d9669f88fbe12f12_icgraph.png0000644000175000017500000001007311331020526026675 0ustar dvddvdPNG  IHDR(iE*(bKGDIDATx{Peﲻ`uP%򬬡AA02&@A A4@A(( %E  t3f0t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ٳbJ٤|v}7څ;vLqVyɓoСC̞=\NAAC aru., … DEE"M&=ᄹsٳgqqqO>̛7 2h N>'N͛J?˫I>dƍ<:ݳ[AJѣ;v,SSS9 wwwnŋQ(~!aaaMTу͛7sN ӧ>>>h4&YCCCƍGff&#Ff{1}Y ğFBV*W\({|]55u;fG믿fȐ! >|`^1cqssϏg3dffjWGGG FUUÆ FRy5Σwޭz<<<>|0ׯ̌GyիWT*Q(󱵵%$$ 6pI?ߊ'61x`LLLtl%%%t]g" ٳ'}i|F=n:\v 7nmm%>>Gyd1-9WJ`H[]]78 0 HLL$..wygŮ'--X֬YCaaٶw^VXҥKIOOmL6K1z=o6hǾH. "b'3 5tcrMe9TGJ67PW%Áޞd"22;;; ;;g}<СC^QIHHJKK%뛔.\G}Djj*999Q^^7شi111osNjjj8}4ǎ?';;ZMff&M*d2222عs'lܸyIC*/999h44_oo/믿΂ &tU t#1g>K88J.^ dݺurAx J%š$mR1'T׮]'66v~wYvDoERX}bPZZJmm-sDQ$997߲cǎ =^ԝo(99___\Bpp0]ijjGeɒ%t:rrrXv-Zsꫯg6Z̛qrrb׮]_??? RXhgΜ`ZlqB^Mk9O0I1Ř3g>aaaRWWGDD |gtwwB`˖-⋜:u JŌ3HKKc׮]f=?"))i\I z+NGcc##Dmm-}}}jdy3z3w\O.9rfdd+2&?QA2h o&NN6 7-3홻…B\|<<zq+4nj {ݮY|2VCՐ'c5dX Y|2VCհow[ķhѢednl,C,c=dX Y|2Vye?IENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__periodic__coll__graph.png0000644000175000017500000000546011331020526025151 0ustar dvddvdPNG  IHDR('bKGD IDATx{PWp E@TjA˺hТ;ZFuTh4Sc3k[lŵgJG:UZeԠ ՊEVED $H" PAE0{{y{#yh4>.:"Wj+`H>$?? bx,YdCsonn.˖-X"}#m'''?xJdeem۶ ԼV ^E"WFe \;Y7СM`DuYǝsK: ZȋI>47R]Cy>C]@X"FstC5Kٳxxx׮y$&&}cڸPyF˝>_Omy#V#6"Z YV˶bxy{)m/sNQGWx9Rui6~nW Zׯ?z?mCv[Qq6QJ,lDUC]րO±cǎjخ&&&H>Nbvk׮eܹX۞={X`lذJe͔OF{lj'xWx7h4|Caa!III|̟?E1 ؼysGK.KDD+WٳO[]]]' rV^Myye Zm{#Lւ̽Ǒee(${uЬ]ɵsqrrB.@QQaaa888HJJ iii,\]jj*˗/h4MMM ( JW^>#!!tlڴp233ywرc%%%?Gk.ҐJ߿͜O@QQ|رWWW6nȸqCӑX,O>a߾}wkL/// 6,Y~8n͛7MwPT$&&j*2225k[l=qKIϜm#qGA,:8?˽ur*mB̙3R\\LZZt:"##yj|7[;wW_}wW_Q]]ywD$''Irr2,<ɓ'5k3g`=z<̂ 4iQQQ:u` R?fL\t)zH$Ӵ'..D„ Xp!Ǐ1Je\ ,,Prrrhll4!883f MMM[H]ۈr?ʝ{Q,vBep;<›ZYР6 ޶^}vvv5'j`ذa$$$0gr9L>{K/u:4X, [[5wīV9rdg#F@TRYYi׬ eڴi\x a8;; mbmnw>|x'5RϏzɼ=R׷gDk֣=i.NsAU;%lDl FlSYa˸^]H J} F$jSQQAYYYy6662o<-+Wdݜ8qGJ [B[*2qD^G$a4'>>_Çe[6s>ZmGzB FѱcJGv ;;;yk;Bɓqrr5މG{WMyZ-wi" MfΜɱc:566v䫪پ}{:RzUN}\N@@oF&Kll,QYYɄ 3gjtbccqss5ki$]qww'))uhv.޽Cq-|}}Yhvvv.]ի ʕ+̞=Sb4Ma&M/\.ߟ2֬Yk^NF4zj4PSc|FlѣGuVBCC2e eeeL>hvICC6l@,oA~~>!CvZvD]=%%e˖u2kרcرH_)j***T JKKijj" 777l|vEo1f d]^^{e׮]\|;;;ƌө$dLH}}=...ϔJ%UUU :S |TUUT*y2dy<薜P h3 { margin-top: 0; } .directory p { margin: 0px; white-space: nowrap; } .directory div { display: none; margin: 0px; } .directory img { vertical-align: -30%; } /* these are for tree view when not used as main index */ .directory-alt { font-size: 100%; font-weight: bold; } .directory-alt h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } .directory-alt > h3 { margin-top: 0; } .directory-alt p { margin: 0px; white-space: nowrap; } .directory-alt div { display: none; margin: 0px; } .directory-alt img { vertical-align: -30%; } /* @end */ address { font-style: normal; color: #333; } table.doxtable { border-collapse:collapse; } table.doxtable td, table.doxtable th { border: 1px solid #153788; padding: 3px 7px 2px; } table.doxtable th { background-color: #254798; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; text-align:left; } libdessert0.87-0.87.2/doxygen/html/group__mesh_ga58e1c127ee23b780717c468f4643677e_icgraph.md50000644000175000017500000000004011331020526026113 0ustar dvddvde0ae5545771f5c0b2e2cb28018f56de0libdessert0.87-0.87.2/doxygen/html/structdessert__sysif__coll__graph.map0000644000175000017500000000003511331020526024472 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__mesh_ga374acb57d6cebc12fdacf68a66c4303f_icgraph.map0000644000175000017500000000032711331020526026763 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/structdessert__msg__proc.html0000644000175000017500000000716411331020526023016 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_msg_proc Struct Reference

dessert_msg_proc Struct Reference
[G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S]

local processing struct for dessert_msg_t More...

#include <dessert.h>

Data Fields

uint16_t lflags
 16 bits for local processing flags
uint16_t lreserved
 16 bits reserved
char lbuf [DESSERT_LBUF_LEN]
 DESSERT_LBUF_LEN bytes buffer.

Detailed Description

local processing struct for dessert_msg_t


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__sys.html0000644000175000017500000003335311331020526020101 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: S Y S - I N T E R F A C E S

S Y S - I N T E R F A C E S

EXTERNAL / PUBLIC. More...

Defines

#define DESSERT_TUN   0x00
 flag for dessert_sysif_init - open tun (ip/ipv6) device
#define DESSERT_TAP   0x01
 flag for dessert_sysif_init - open tap (ethernet) device
#define DESSERT_MAKE_DEFSRC   0x02
 flag for dessert_sysif_init - set dessert_l25_defsrc to mac of tap device
#define _DESSERT_TAP_NOMAC   0x80
 flag for dessert_sysif_init - get mac for tap failed - try mac in src of first packet

Functions

int dessert_sysif_init (char *name, uint8_t flags)
 Initializes the tun/tap Interface dev for des-sert.
int dessert_sysrxcb_add (dessert_sysrxcb_t *c, int prio)
 adds a callback function to call if a packet should be injected into dessert via a tun/tap interface
int dessert_sysrxcb_del (dessert_sysrxcb_t *c)
 removes all occurrences of the callback function from the list of callbacks.
int dessert_syssend_msg (dessert_msg_t *msg)
 sends a packet via tun/tap interface to the kernel
int dessert_syssend (const struct ether_header *eth, size_t len)
 sends a packet via tun/tap interface to the kernel

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

int dessert_sysif_init ( char *  device,
uint8_t  flags 
)

Initializes the tun/tap Interface dev for des-sert.

Here is the caller graph for this function:

int dessert_sysrxcb_add ( dessert_sysrxcb_t c,
int  prio 
)

adds a callback function to call if a packet should be injected into dessert via a tun/tap interface

  • *c callback function
  • prio priority of the function - lower first!
    Returns:
    DESSERT_OK on success
    -errno on error

Here is the caller graph for this function:

int dessert_sysrxcb_del ( dessert_sysrxcb_t c  ) 

removes all occurrences of the callback function from the list of callbacks.

  • c callback function
    Returns:
    DESSERT_OK on success, DESSERT_ERR on error
int dessert_syssend ( const struct ether_header *  eth,
size_t  len 
)

sends a packet via tun/tap interface to the kernel

  • *eth message to send
  • len length of message to send
    Returns:
    DESSERT_OK on success
    -EIO if message failed to be sent

Here is the caller graph for this function:

int dessert_syssend_msg ( dessert_msg_t msg  ) 

sends a packet via tun/tap interface to the kernel

  • *msg message to send
    Returns:
    DESSERT_OK on success
    -EIO if message failed to be sent

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_ga8863aa26b4d7a7ea1fc3e93ce29d97ab_icgraph.png0000644000175000017500000002340111331020526026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OOyK5558pjqsskVVW+**"55`\\\KWTTDqq1uuuJ%$$bƱINӜغu+:߿N:S:usݦ򬮮f߾}899Ԣot !&cp;=xjÆ DEEd<]x3Ҕt]y-h1&Bې ݺu3[t%ލ2d9m6ڥ}-__kشBqǻt[M^B!ht !BIB!ځ$]B!@.!Bv IB!D;K!QB&[CyrIB. h73f`,; !B%B$B!ht !BBgMhIENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_ga173dd4e9ef2d63e5ef2413468415b518_icgraph.png0000644000175000017500000004112211331020526026200 0ustar dvddvdPNG  IHDRen bKGD IDATxy\SW?OH &*"ԺcuԺ2EjwiZv:贝ںPego_; SXeZQkM+.(Nؑ%f z{sNyrc B!Dt!BB!dPB!dh;BE> KKKmAG x<O!ҧBCC0yL!ZBbiA_2B!dB!dB!dB!dB!dB!d'PLL RRRvR=.**Ž;pڵ~kcÎ;Ʒ~0!'RDD`voQ=^b\.رZ|GVoeff믿vPRFyLqqqvYYY֭[X~=ƏomD%e<aee!C`…jIPFF|||{{{ʶl333B̜9*N\ٳgȑ#prr\.G@@d2g*++={@* {333H$w+XV¦MpI0|U+V;z(  Hptt\]]qFG\qk\pATbڵD077ۻU'!1BȀBCC+WP(d0,$$3D g"]x1TʲX]][`{7c΂6dh"ʘD"agϞe---())a:::l֭LT/`;v`JڵiΝ;А?~555>|wqˆcY[[8P(X]] ,**) /0&YAA322bQQQm۶3)JαFAA 1Wƅ Wbccc6l` L&1cccz~&t2B'b7ofsNNN,$$3WWWkײ׳h&JٵkcVuu5cqqYPP"UKOO؏3}61XZZ1bm/^WT2Dң1lmmYbb"c1B._*{@eee?͟?_Uv8Ǫs25.\LLLԒꠠ h">@I!}nHN WTTGGGyyȳ sżypx{{C,AAAŜe\uRi3tP7 oj)>{{{ն<666B!._>6lJ%<Ԟ.}UXE{5.\U=8q"9$=ZSF gbb\\EE@$aڴiSꫯݻQYY( ,Y8˸ԓ*++ն~-[۸t TԨm?VX5.\\.ǰa4K[2"<<%%%W???d2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>b`ddk?חsW !E y"<<%%%W???d2ܼy777DEEaΝ1c<<%Փ5eJ-[b6c fii̙BBBc޽D",,,ҥKY[[+((`ɉ2cccvA,T'WŅT~377g? DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Alphabetical List
Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/tab_b.gif0000644000175000017500000000004311331020526016546 0ustar dvddvdGIF89a,D;libdessert0.87-0.87.2/doxygen/html/group__msg_gafebf49518288be044d479fe7e3ab2799_icgraph.md50000644000175000017500000000004011331020526026260 0ustar dvddvd5d2b25150f38f349a1c2175302dffe99libdessert0.87-0.87.2/doxygen/html/group__msg_ga60e3f08eba0d38f2764e75f5d4cda5da_icgraph.png0000644000175000017500000001672211331020526026560 0ustar dvddvdPNG  IHDR]bKGDIDATxyTW?w6@ QA\(TGm[E{:Gx9c֩Vm;ֶC%گ؂lu?Ql"&;$Cj۹s'h4?d޽{Fagr`|Ғ={{ _ݏNgv…~ŭP(P(d[ne,55Y[[ow_C o[z6???X``Nٖ-[֭[ӧ ~:c^WWce\u2\[&XvvvTVV21X^^ 1իWv͖/_W0Tj0p׸ H$][ώ;Xdd1 #1m4mSN=tq-xxxho dz>+V $$A]]pq |>...F ! {[/ǃr@ 011)2FڢZg[MM @"`ܹ(..ֹ}G`PTHLLD[[y,} \YYYARߓp477y:J%X#JkO?Ñ\@KK p)۷χP(ٳvZTTTgWCP|OR͛W?D"444@=F^VV3gp2@d|W:u*f̘" eҤIxwYf֭[ Add$***ӧW\Aؼy3} H{gsaڴiGss3u]ۏ=̙@CR!44Ԩݱc988=*++K~~~~7XʰpBxtuuťO׏BO⓱cPPP((\4!1!CSWyyUϯBAAZZ:vvhDPZz2~Q cZ{{2 RUCvܹBI wP\BIIUS >r#BBvmrGL[[ G|B %2&56.㏓QWiO='PUը pwÌnr\RSS G,ى'?TtvեхZ;wT:!&Nww;vڛ.*JJJC8ptCVȑ3|:;:]hjjcmЎw["%mF}܄ pw-i>z[C!}O`%8t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z-0p2P Fy=sBpo2ƴ'}j \\l8!d C&Bxϰj|}AZqAX?G7 ^ :]]u]۟F|8z4jDžMEUU/{^#77;L ??W 2Yߦ~TK.ETTԐo+W|v g~}BF_NNعs1bbѣ? ᡿ؾ[SkJS?OCyylbxy9&9A.wWM,LVz_ͻv81Db-[= 8t{TV64D agtNNprFxo36#? ((BAA5Fii-j |&N77;L8A6x?9!/ j zW"QuttHj*QRBI ^qdb"- B*XC*Lf SS;FC@dH{wdX$Kҥ[ض-ff&Fgb">>WvS5{(-EII-jqN PQQ.vvpqe2P(1m|\6n(>d2[d~l55MGee=PQQԦA@''36{{K[w\ŋD"a/_fϟg...,??566ŋ 60gW̌-[*&JYrr2lGee%lΝLѰ?`{e߿r2KKKvY{=&_|at?2;;;م B`Bmݺ577Tfmm;JKK;ukiiawfL0Bx<۶mknnf)))ښ%&&ry?}7J $7x^Zgc ,00Pl˖-l֭Ņ]~1}bc12:KKKV^^-d,;;`;*++c,// Bcի`|wf˗/֫hT*5Pk I$ޮgǎ,223o`{eLP0[[[cl2:FC@p6mζS(..ƭ[᡽%$$>,VX#&&uuqq |>...F¢{JX PP|}y<<== *no?388M4͛79;;~z@ *̞=D7n܀L&nooGVVGG>q Rl̚5 J%jjjىZ`ʔ)8v O֎GRR~m!##5kVqmL2'N)kkkCzz:د(2 tЕxr????qpB|W:u*N< %%E;3ғч& *H{{{=W<|سgjkk!q9H$^ۇo>2 '2r{U@2NQ q!S!d@!%B(B8E?#dYO08F a1!q$""nnn/ !d!d@!%B?w qRIENDB`libdessert0.87-0.87.2/doxygen/html/modules.html0000644000175000017500000000406711331020526017360 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Module Index
Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/graph_legend.png0000644000175000017500000005364711331020526020157 0ustar dvddvdPNG  IHDRK!bKGD IDATxy\YȦ,n  V~R4SRo]Ss)+ dsAATTdQ 9 ~zř;w33ߙ1c1  c1kZ8d1c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V@P'|A(TI.]~0KrR;bδ06;BBgML̔)U~L QQmGb}*ܺpK%%(ͯ]g3|lnO`%m$S177 __7reBB>ĤϿ?r5ξ8G/:{P)x"04cc#uѱB}W:|섅)Sp!S)6A4C!BL!BS0RSS9s#~hU^^η~u>̹stB<) B ϏM65yJbccvZ_Tk䚄iHBѵkWnǏSYYNJHBPVVFhh(IIIL>BATTo!cccyWQ(^Xx1̚5dT*˖-#!!'r)/_ʕ+QT\´i $<<\B$` !cPdddplBLL ɓh4Ν;ٴi>}j#66Kٳg#33Czj:uĩS }ҿKTTocРA=zT?.!sNB<&Zܹs155[nspҽ{wѣtЁ)S`ff /B -- ~m o'022 SSӇѣܜW^y!D#+Ocǎ62mԍ1܍7(((`ڴiaĈ5ajW^O !IBfdii'k֬iXMM FFFRv{/--7 OA !D32d p…l­[@w !>L!hF̟?Eѯ_? pwwLJ~}K,O>\̝;WWW]Ɛ!CZB2!ϰ3fPXXHxx^/..}ɻZ- mrrr۷/֏\'//ܰ|"##ҥN& !B`ooC122j :בBC!` !B)B!tJB!) B!B$` !B)B!tJB!) B!B$` !BI>BFrr2.`M>]%!2\\8v.à9::2|p}!xHB!:%` !B)B!tJB!ЩM31IIENDB`libdessert0.87-0.87.2/doxygen/html/doxygen.png0000644000175000017500000000240111331020526017173 0ustar dvddvdPNG  IHDRd-ok>gAMAOX2tEXtSoftwareAdobe ImageReadyqe<]PLTEǾ"&ﶻޠ{ԍ눙נED9hg]_X<@:#mhU1tRNSvIDATxbC: d#h` @X",***LK.], X@t b @BD6%""  % B:Hf@ RPy"K`\PbC(!II!h(!Cąl!0[X\J\$TM(>a$S @ Ш@R.$LJBRAG1 (FPhhT%!`&q%u P    CT$B|Wl!B`R$( @A%%@,(%$RPmB U`1IYB  99\1 yCCCf"[N'=TGȒl8^K5<SRɤ%@@  b1qAXH&BR y nP4A j>  t!+(.WQA2MU܂ `1%`19F< 3cZ`e!\ D+. 83!lYYA -6EJV @XXX 4 @86`RdB4I " "@xrʌHA`f ȰC"XV0C b@2H ȓ p)!( 04)(%R $Tʀbb,s@7 Ѱ?f֗\PIx!I"Ȉ3 QYt^^gv- }>WJOAV`$&#88\FF SFJ$ƀƊ 4 - Hf ?5 k1d, ."FˀI"4Hgx|fm)))9. aMD& X@t b @%DK.], X@t b @d`ɽSOIENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_ga8863aa26b4d7a7ea1fc3e93ce29d97ab_icgraph.md50000644000175000017500000000004011331020526026453 0ustar dvddvd74bb3f3c9f2a68a17b103d1a216366b8libdessert0.87-0.87.2/doxygen/html/group__msg_gafebf49518288be044d479fe7e3ab2799_icgraph.map0000644000175000017500000000030511331020526026354 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__mesh_ga8eeaddc9c5386a2eb116e602beb41936_icgraph.md50000644000175000017500000000004011331020526026526 0ustar dvddvd056238cab767499ae84e13b8205f5730libdessert0.87-0.87.2/doxygen/html/group__msg_gaf7c69abdbce2f190e18104eddf245c62_icgraph.map0000644000175000017500000000173711331020526026545 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__periodic_ga37438b35b803d62fd1792f269cfd9126_icgraph.png0000644000175000017500000001050511331020526027136 0ustar dvddvdPNG  IHDR(Q`bKGDIDATxyTT703( ᾆ 1KES3 Qh9/9b& %n!*2[st Y~f;̽w A ‹IAAQ@AY7ܽ{7D_ɓ  4*sZی_D߽{7ӧO׎ / ## 4*vbڴiZ۞RԩSu!sI6lx.u7T  ( , " "  ( ,uR@Ν;ǵk"tWXX޽{e=jjC.5/\7t7Dnn.~V[mb%frӐiӦǮI9}4W\5yf222-_QQܪyM ֬׳QQI\^g9mn0{ln߾]oٱcV[mb%frӐf͚Ǯ)**|m۶~hݿ>,];7ܼz)EEE_ov}:F[봘ԚIVBV:*||.R\\7{ҵkW6mʄ ^. 6mb:tGGGx!˗/ݝÇիWpGe۶mDDD`ffƏ? &$Ξ=K`` hт$QTTġC066[(gVHLL* +L4I1PXXȬY(**"44?Z-[.CHHH污XZ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ǎѹsg 5jzt|-xɞn~N[/y7-{D...h_EQQ/^4y0afrƍDzeːeR11 7%(**_~,Y7nX5͛7ƛ h 7w^R+ɉ~˗/ӭ[7Ɣ*:/L8={̹s|vꭴ_cǎK\\K.ۛ|~&L@DD-… ߟ!C|rj58q`bbb5U&iٯ5ƍǴijxyy͌3JPOj~\r$++p.SL4׳sN~sڊUrc}ll,\zЫW/fϞܹsCO3fؿ?gF.s%^{5"##Mٜ;֭_7z4kNMLƳ>ӧި3W=Y:{qp':: t8x,*U.EY hzd0`j"""x'Yr% :/2|pMիWٴixyyqiç^z%eb6żyXng^Q(3h rssYv-...wZB*^',!5\ѣG舃>>>(JMƔjO@Mtt4=cƌ17W雿MT`g/WTTTп#G20ZW… k^#U&9N˗yꩧpuu6׬Y;Ez=UUUtU,NᤦP(*v}ΠRWqpd /Нr㗆K ~:wuqq1ϟgϞF555pm EeR1+--̙3 :www_),,jդl3YO>((Aqq988ai{knBIIIiׄ,Jnnn7n؊ h`QQQ6Ak`rss;FAxP,`CDRA!") AlHʂ 6D$eA[7C PlbkɦP(MJn,$$h˲h4 AX޽ 1g2) O) AlHʂ 6ɚUIENDB`libdessert0.87-0.87.2/doxygen/html/group__sys_ga47fac5a4a5b28a150ddf774f92814188_icgraph.md50000644000175000017500000000004011331020526026200 0ustar dvddvd4af41af4093a66d8521eb5db616a5473libdessert0.87-0.87.2/doxygen/html/dessert_8h_source.html0000644000175000017500000032057311331020526021343 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert.h Source File
Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/graph_legend.html0000644000175000017500000001111211331020526020314 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented,
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};

This will result in the following graph:

graph_legend.png

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.

The arrows have the following meaning:

  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/ftv2plastnode.png0000644000175000017500000000024511331020526020315 0ustar dvddvdPNG  IHDRy PLTE<^,tRNS@ftEXtSoftwaregif2png 2.4.2^G(IDATxc` 0ach(`2 BY 1,nuIENDB`libdessert0.87-0.87.2/doxygen/html/globals_func.html0000644000175000017500000002357411331020526020352 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields
 

- _ -

- d -


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_gaf7c69abdbce2f190e18104eddf245c62_icgraph.png0000644000175000017500000004426411331020526026556 0ustar dvddvdPNG  IHDRybKGD IDATxy\T( (PK*( 䂹ZeefjK/353- @i TeQL\Ua``br93}=3{ϝ{1B!bU΀BHGńBHQ1!jB Ozz:N(ٳgBTLQ".]N(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qs&DQː!!<199 ߏ&PmS |?I-x\__{{3>>www!h^<6Z1055~tvvk.//7XLtb||m뱺}JJJ0;;^h4 8;;6|>`}}{{{E¼ C+f\\F#ڐn}׊y||Eo4h DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Page Index

Related Pages

Here is a list of all related documentation pages:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appparams__coll__graph.png0000644000175000017500000000756611331020526027055 0ustar dvddvdPNG  IHDR0bKGD+IDATx{Tջ?3p(( K+L׊N@"'0 VVZ&KR+P$SC-/e r?'5g|~ؗwV",-@ AG$@I,tqD ]AG$@Q'O|ZNeix%gJLL|?<?رcLA# S 99###n݊JbpNʔ)Sxwʢٳgs)˒%K cxyyoPQQA@@}{bl1':2kr9޽KrAjkk`޽ 72g>>????BCCW^!;;c)II=pwwvSS^ϵ#.N=ˠ)q$pk%++_~SSS|||d8::R__7&&Prssݻ7/B3{rrrvJ?~->#<<-1ڞI\I/RZ 7+iAhh[>1Fjo޽ݻwc>s_ʧ-=+hO/8h46j6Jb5WK(dtHO|Q(--LJիWYv-/^gϞDDD0f6oLjj*j.\A25 ˗/gر[{{{4 qqq{xxxHǑ#Gزe X[[o@VV6lݻ`ee'Ç׫8^~elݻwyY`˖-kt?~L.\le5srr8vrtLLL"KdF2r2ϒ7w657I|cHCg~bԨQ9_4޽;*K?~CPWWJ?Mkkkڤ yѣG *JquuBAee%ǎcذaM<3yd뉈@P3XXX<> 22lZ4< `bb¬YP(j8tcǎmKo}(,,,6lXXXHڤʄ}ATr(((G+tQH7f͚vիW`̙3mp055}NTbddX=Ibb= [GLOBa*H6hڝݺu{eee@^RV^ jDFFɥKؽ{n%e*S'N`šVL8Qw+** {Z#GЧO n3xF̬6CC-E=tJ38ܞ5\9twU61{yyqQJJJEƍ@S5kرcdd;Ǐ=Iprr\Nnn.UUU'N@ˍ7tþУjYr%!!!,^d].왙@־fxRCGcdAߺ>mj =??3 0[n#3f 22wwwQՌ=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R_Tq-PLTEtRNS@ftEXtSoftwaregif2png 2.4.2^GvIDATxc````c``d'0bq$8`q'30012 pT2Si`q'ʀ\\RKRSiȔRRi 6तhQkqMaNU`'E$pgc 0o#UGIENDB`libdessert0.87-0.87.2/doxygen/html/group__sys_ga4a69d48f1f2f8e1425d1ec8b3be3226c_icgraph.md50000644000175000017500000000004011331020526026334 0ustar dvddvd6d0019f2b20d1f42e4371c0c86e29df2libdessert0.87-0.87.2/doxygen/html/group__msg_ga9a58534c56c6d5bba349178b00f5df2c_icgraph.map0000644000175000017500000000030411331020526026320 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/dessert_8h.html0000644000175000017500000032325611331020526017764 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert.h File Reference

dessert.h File Reference

#include <net/if.h>
#include <net/ethernet.h>
#include <pcap.h>
#include <stdint.h>
#include <syslog.h>
#include <stdlib.h>
#include <libcli.h>
Include dependency graph for dessert.h:

Go to the source code of this file.

Data Structures

struct  dessert_msg
 A basic message send on des-sert layer2.5. More...
struct  dessert_msg_proc
 local processing struct for dessert_msg_t More...
struct  dessert_ext
 a extension record to add to a dessert_msg More...
struct  dessert_meshif
 an interface used for dessert_msg frames More...
struct  dessert_sysif
 A tun/tap interface used to inject packets to dessert implemented daemons. More...
struct  dessert_periodic
 definition of a periodic tasklist entry More...
struct  dessert_agentx_appstats
 An abstract data type representing some statistical datum. More...
struct  dessert_agentx_appparams
 An abstract data type representing some parameter. More...
struct  dessert_agentx_appstats_cb_entry
 A callback entry representing a statistical datum. More...
struct  dessert_agentx_appparams_cb_entry
 A callback entry representing a parameter. More...

Defines

#define DESSERT_ETHPROTO   0x8042
 ethernet protocol used on layer 2
#define DESSERT_MAXFRAMELEN   ETHER_MAX_LEN
 maximum frame size to assemble as dessert_msg
#define DESSERT_MAXEXTDATALEN   253
 maximum size of the data part in dessert_ext
#define DESSERT_PROTO_STRLEN   4
 length of protocol string used in dessert_msg
#define DESSERT_LBUF_LEN   1024
 size of local message processing buffer
#define DESSERT_OK   0
 return code for many dessert_* functions
#define DESSERT_ERR   1
 return code for many dessert_* functions
#define DESSERT_FRAMEID_MAX   ((uint64_t)-1)
 type for local unique packet identification
#define DESSERT_OPT_DAEMONIZE   0x0100
 flag for dessert_init - daemonize when calling disables logging to STDERR
#define DESSERT_OPT_NODAEMONIZE   0x0200
 flag for dessert_init - do not daemonize when calling
#define DESSERT_OPT_PID   0x0400
 flag for dessert_init - create and write pid file
#define DESSERT_OPT_NOPID   0x0800
 flag for dessert_init - do not create and write pid file
#define DESSERT_LOG_SYSLOG   0x0001
 flag for dessert_logcfg - enable syslog logging
#define DESSERT_LOG_NOSYSLOG   0x0002
 flag for dessert_logcfg - disable syslog logging
#define DESSERT_LOG_FILE   0x0004
 flag for dessert_logcfg - enable logfile logging
#define DESSERT_LOG_NOFILE   0x0008
 flag for dessert_logcfg - disable logfile logging
#define DESSERT_LOG_STDERR   0x0010
 flag for dessert_logcfg - enable logging to stderr
#define DESSERT_LOG_NOSTDERR   0x0020
 flag for dessert_logcfg - disable logging to stderr
#define DESSERT_LOG_RBUF   0x0040
 flag for dessert_logcfg - enable logging to ringbuffer
#define DESSERT_LOG_NORBUF   0x0080
 flag for dessert_logcfg - disable logging to ringbuffer
#define DESSERT_LOG_DEBUG   0x0100
 flag for dessert_logcfg - enable debug loglevel
#define DESSERT_LOG_NODEBUG   0x0200
 flag for dessert_logcfg - disable debug loglevel
#define dessert_debug(...)   _dessert_log(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at DEBUG level
#define dessert_info(...)   _dessert_log(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at INFO level
#define dessert_notice(...)   _dessert_log(LOG_NOTICE, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at NOTICE level
#define dessert_warn(...)   _dessert_log(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at WARNING level
#define dessert_warning(...)   _dessert_log(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at WARNING level
#define dessert_err(...)   _dessert_log(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at ERR level
#define dessert_crit(...)   _dessert_log(LOG_CRIT, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at CRIT level
#define dessert_alert(...)   _dessert_log(LOG_ALERT, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at ALERT level
#define dessert_emerg(...)   _dessert_log(LOG_EMERG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at EMERG level
#define DESSERT_MSG_NEEDNOSPARSE   1
 return code for dessert_meshrxcb_t - forces to copy the message and call again
#define DESSERT_MSG_NEEDMSGPROC   2
 return code for dessert_meshrxcb_t - forces to generate processing info and call again
#define DESSERT_MSG_KEEP   0
 return code for dessert_meshrxcb_t and dessert_sysrxcb_t
#define DESSERT_MSG_DROP   -1
 return code for dessert_meshrxcb_t and dessert_sysrxcb_t
#define DESSERT_IF_PROMISC   0x0
 flag for dessert_meshif_add - set interface in promiscuous-mode (default)
#define DESSERT_IF_NOPROMISC   0x1
 flag for dessert_meshif_add - do not set interface in promiscuous-mode
#define DESSERT_IF_FILTER   0x0
 flag for dessert_meshif_add - filter out non-des-sert frames in libpcap (default)
#define DESSERT_IF_NOFILTER   0x2
 flag for dessert_meshif_add - do not filter out non-des-sert frames in libpcap
#define DESSERT_TUN   0x00
 flag for dessert_sysif_init - open tun (ip/ipv6) device
#define DESSERT_TAP   0x01
 flag for dessert_sysif_init - open tap (ethernet) device
#define DESSERT_MAKE_DEFSRC   0x02
 flag for dessert_sysif_init - set dessert_l25_defsrc to mac of tap device
#define _DESSERT_TAP_NOMAC   0x80
 flag for dessert_sysif_init - get mac for tap failed - try mac in src of first packet
#define DESSERT_FLAG_SPARSE   0x1
 flag for dessert_msg.flags - message len is hlen+plen if not set buffer len is assumed as DESSERT_MAXFRAMELEN + DESSERT_MSGPROCLEN
#define DESSERT_LFLAG_SRC_SELF   0x0002
 flag for dessert_msg_proc.lflags - l25 src is one of our interfaces
#define DESSERT_LFLAG_DST_MULTICAST   0x0004
 flag for dessert_msg_proc.lflags - l25 dst is multicast address
#define DESSERT_LFLAG_DST_SELF   0x0008
 flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces
#define DESSERT_LFLAG_DST_BROADCAST   0x0010
 flag for dessert_msg_proc.lflags - l25 dst is broadcast
#define DESSERT_LFLAG_PREVHOP_SELF   0x0020
 flag for dessert_msg_proc.lflags - l2 src is one of our interfaces
#define DESSERT_LFLAG_NEXTHOP_SELF   0x0040
 flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces
#define DESSERT_LFLAG_NEXTHOP_BROADCAST   0x0080
 flag for dessert_msg_proc.lflags - l2 dst is broadcast
#define DESSERT_LFLAG_DST_SELF_OVERHEARD   0x0100
 flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces, but we received the message not via the indented interface, e.g.
#define DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD   0x0200
 flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces, but we received the message not via the indented interface, e.g.
#define DESSERT_EXTLEN   (sizeof(struct dessert_ext) - DESSERT_MAXEXTDATALEN)
 length of dessert_ext header
#define DESSERT_EXT_ANY   0x00
 dessert_ext type wildcard - any extension
#define DESSERT_EXT_ETH   0x01
 dessert_ext type for ethernet header
#define DESSERT_EXT_TRACE   0x02
 dessert_ext type for packet tracing
#define DESSERT_EXT_USER   0x40
 first dessert_ext type for usage by the user
#define DESSERT_MSG_TRACE_HOST   (ETHER_ADDR_LEN)
 packet tracing flag - only record hosts
#define DESSERT_MSG_TRACE_IFACE   (3*ETHER_ADDR_LEN)
 packet tracing flag - record interfaces
#define dessert_ext_getdatalen(ext)   (ext->len - DESSERT_EXTLEN)
 Returns the length of a given extension.
#define DESSERT_APPSTATS_VALUETYPE_BOOL   0
 Flag indicating the dessert_agentx_appstats_t is of type bool.
#define DESSERT_APPSTATS_VALUETYPE_INT32   1
 Flag indicating the dessert_agentx_appstats_t is of type int32.
#define DESSERT_APPSTATS_VALUETYPE_UINT32   2
 Flag indicating the dessert_agentx_appstats_t is of type uint32.
#define DESSERT_APPSTATS_VALUETYPE_COUNTER64   3
 Flag indicating the dessert_agentx_appstats_t is of type counter64.
#define DESSERT_APPSTATS_VALUETYPE_OCTETSTRING   4
 Flag indicating the dessert_agentx_appstats_t is of type octetstring.
#define DESSERT_APPSTATS_NODEORLINK_NONE   0
 Flag indicating the dessert_agentx_appstats_t does not contain information regarding a node or a link.
#define DESSERT_APPSTATS_NODEORLINK_NODE   1
 Flag indicating the dessert_agentx_appstats_t contains information regarding a node.
#define DESSERT_APPSTATS_NODEORLINK_LINK   2
 Flag indicating the dessert_agentx_appstats_t contains information regarding a link.
#define DESSERT_APPSTATS_BOOL_TRUE   1
 What is considered to be TRUE in a dessert_agentx_appstats_t.
#define DESSERT_APPSTATS_BOOL_FALSE   0
 What is considered to be FALSE in a dessert_agentx_appstats_t.
#define DESSERT_APPPARAMS_VALUETYPE_BOOL   0
 Flag indicating the dessert_agentx_appparams_t is of type bool.
#define DESSERT_APPPARAMS_VALUETYPE_INT32   1
 Flag indicating the dessert_agentx_appparams_t is of type int32.
#define DESSERT_APPPARAMS_VALUETYPE_UINT32   2
 Flag indicating the dessert_agentx_appparams_t is of type uint32.
#define DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING   3
 Flag indicating the dessert_agentx_appparams_t is of type octetstring.
#define DESSERT_APPPARAMS_BOOL_TRUE   1
 What is considered to be TRUE in a dessert_agentx_appparams_t.
#define DESSERT_APPPARAMS_BOOL_FALSE   0
 What is considered to be FALSE in a dessert_agentx_appparams_t.
#define DESSERT_APPSTATS_CB_BULK   1
 Flag indicating if a appstats callback entry is of type bulk.
#define DESSERT_APPSTATS_CB_NOBULK   2
 Flag indicating if a appstats callback entry is of type nobulk.
#define MESHIFLIST_ITERATOR_START(__interface)
 A convenience macro to safely iterate the list of mesh interfaces.
#define MESHIFLIST_ITERATOR_STOP   } pthread_rwlock_unlock(&dessert_cfglock)
 A convenience macro to safely iterate the list of mesh interfaces.
#define TIMEVAL_ADD(__tv, __sec, __usec)
 A convenience macro to safely add __sec seconds and __usec microseconds to the struct timeval __tv in an invariant respecting manner.
#define likely(x)   (__builtin_expect((x),1))
#define unlikely(x)   (__builtin_expect((x),0))
#define __dessert_assert(func, file, line, e)   ((void)_dessert_log(LOG_EMERG, func, file, line, "assertion `%s' failed!\n", e), abort)
#define assert(e)   (__builtin_expect(!(e), 0) ? __dessert_assert(__FUNCTION__, __FILE__, __LINE__, #e) : (void)0)

Typedefs

typedef uint64_t dessert_frameid_t
 runtime-unique frame id
typedef struct dessert_msg dessert_msg_t
 A basic message send on des-sert layer2.5.
typedef struct dessert_msg_proc dessert_msg_proc_t
 local processing struct for dessert_msg_t
typedef struct dessert_ext dessert_ext_t
 a extension record to add to a dessert_msg
typedef struct dessert_meshif dessert_meshif_t
 an interface used for dessert_msg frames
typedef struct dessert_sysif dessert_sysif_t
 A tun/tap interface used to inject packets to dessert implemented daemons.
typedef int dessert_meshrxcb_t (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 Callback type to call if a packed is received via a dessert mesh interface.
typedef int dessert_sysrxcb_t (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id)
 Callback type to call if a packed should be injected into dessert via a tun/tap interface.
typedef int dessert_periodiccallback_t (void *data, struct timeval *scheduled, struct timeval *interval)
 callbacks type to call in a periodic task
typedef struct dessert_periodic dessert_periodic_t
 definition of a periodic tasklist entry
typedef struct
dessert_agentx_appstats 
dessert_agentx_appstats_t
 An abstract data type representing some statistical datum.
typedef struct
dessert_agentx_appparams 
dessert_agentx_appparams_t
 An abstract data type representing some parameter.
typedef int dessert_agentx_appstatscb_get_t (struct dessert_agentx_appstats *appstats)
 Callback type to call if the AppstatsTable is asked for by some snmp client.
typedef int dessert_agentx_appparamscb_get_t (struct dessert_agentx_appparams *appparams)
 Callback type to call if the AppparamsTable is asked for by some snmp client.
typedef int dessert_agentx_appparamscb_set_t (struct dessert_agentx_appparams *appparams)
 Callback type to call if the specific row represented by this callback is going to be set by some snmp client.
typedef struct
dessert_agentx_appstats_cb_entry 
dessert_agentx_appstats_cb_entry_t
 A callback entry representing a statistical datum.
typedef struct
dessert_agentx_appparams_cb_entry 
dessert_agentx_appparams_cb_entry_t
 A callback entry representing a parameter.

Functions

int dessert_init (const char *proto, int version, uint16_t opts, char *pidfile)
 Initializes dessert framework and sets up logging.
int dessert_run (void)
 main loop - wait until dessert_exit() is called or killed
void dessert_exit (void)
 Causes dessert_run() to break out of the main loop.
int dessert_cli_run (void)
 Start up the command line interface.
FILE * dessert_cli_get_cfg (int argc, char **argv)
int dessert_set_cli_port (uint16_t port)
int dessert_cli_cmd_addsysif (struct cli_def *cli, char *command, char *argv[], int argc)
 CLI command - config mode - interface sys $iface, $ipv4-addr, $netmask.
int dessert_cli_cmd_addmeshif (struct cli_def *cli, char *command, char *argv[], int argc)
 CLI command - config mode - interface mesh $iface.
int dessert_logcfg (uint16_t opts)
 Configure dessert logging framework and sets up logging.
void _dessert_log (int level, const char *func, const char *file, int line, const char *fmt,...)
 internal log function
int dessert_meshsend (const dessert_msg_t *msgin, const dessert_meshif_t *iface)
 Sends a dessert message via the specified interface or all interfaces.
int dessert_meshsend_allbutone (const dessert_msg_t *msgin, const dessert_meshif_t *iface)
 Sends a dessert message via all interfaces, except via the specified interface.
int dessert_meshsend_hwaddr (const dessert_msg_t *msgin, const uint8_t hwaddr[ETHER_ADDR_LEN])
 Sends a dessert message via the interface which is identified by the given hardware address.
int dessert_meshsend_randomized (const dessert_msg_t *msgin)
 Sends a dessert message via all interfaces in a randomized fashion.
int dessert_meshsend_fast (dessert_msg_t *msg, const dessert_meshif_t *iface)
 Sends a dessert message fast via the specified interface or all interfaces.
int dessert_meshsend_fast_allbutone (dessert_msg_t *msg, const dessert_meshif_t *iface)
 Sends a dessert message fast via all interfaces, except the specified interface.
int dessert_meshsend_fast_hwaddr (dessert_msg_t *msg, const uint8_t hwaddr[ETHER_ADDR_LEN])
 Sends a dessert message fast via the interface specified by the given hardware address.
int dessert_meshsend_fast_randomized (dessert_msg_t *msgin)
 Sends a dessert message fast via all interfaces in a randomized fashion.
int dessert_meshsend_raw (dessert_msg_t *msg, const dessert_meshif_t *iface)
 Sends a dessert message msg via the specified interface iface or all interfaces.
int dessert_meshrxcb_add (dessert_meshrxcb_t *c, int prio)
 Adds a callback function to the meshrx pipeline.
int dessert_meshrxcb_del (dessert_meshrxcb_t *c)
 Removes all occurrences of the given callback function c from the meshrx pipeline.
int dessert_meshif_add (const char *dev, uint8_t flags)
 Initializes given mesh interface, starts up the packet processor thread.
int dessert_meshif_del (const char *dev)
 Removes the corresponding dessert_meshif struct from _dessert_meshiflist and does some cleanup.
dessert_meshif_tdessert_meshif_get_name (const char *dev)
 Looks for mesh interface with name dev in the list of mesh interfaces and returns a pointer to it.
dessert_meshif_tdessert_meshif_get_hwaddr (const uint8_t hwaddr[ETHER_ADDR_LEN])
 Looks for mesh interface with hardware address hwaddr in the list of mesh interfaces and returns a pointer to it.
dessert_meshif_tdessert_meshiflist_get (void)
 Returns the head of the list of mesh interfaces (_desert_meshiflist).
int dessert_sysif_init (char *name, uint8_t flags)
 Initializes the tun/tap Interface dev for des-sert.
int dessert_sysrxcb_add (dessert_sysrxcb_t *c, int prio)
 adds a callback function to call if a packet should be injected into dessert via a tun/tap interface
int dessert_sysrxcb_del (dessert_sysrxcb_t *c)
 removes all occurrences of the callback function from the list of callbacks.
int dessert_syssend_msg (dessert_msg_t *msg)
 sends a packet via tun/tap interface to the kernel
int dessert_syssend (const struct ether_header *eth, size_t len)
 sends a packet via tun/tap interface to the kernel
int dessert_msg_new (dessert_msg_t **msgout)
 creates a new dessert_msg_t and initializes it.
int dessert_msg_clone (dessert_msg_t **msgnew, const dessert_msg_t *msgold, uint8_t sparse)
 generates a copy of a dessert_msg
int dessert_msg_check (const dessert_msg_t *msg, size_t len)
 checks whether a dessert_msg is consistent
void dessert_msg_dump (const dessert_msg_t *msg, size_t len, char *buf, size_t blen)
 dump a dessert_msg_t to a string
void dessert_msg_destroy (dessert_msg_t *msg)
 free a dessert_msg
int dessert_msg_ethencap (const struct ether_header *eth, size_t eth_len, dessert_msg_t **msgout)
 creates a new dessert_msg from an ethernet frame.
int dessert_msg_ethdecap (const dessert_msg_t *msg, struct ether_header **ethout)
 extracts an ethernet frame from a dessert_msg
struct ether_header * dessert_msg_getl25ether (const dessert_msg_t *msg)
 get the ether_header sent as DESSERT_EXT_ETH in a dessert_msg
int dessert_msg_proc_clone (dessert_msg_proc_t **procnew, const dessert_msg_proc_t *procold)
 generates a copy of a dessert_msg_proc
void dessert_msg_proc_dump (const dessert_msg_t *msg, size_t len, const dessert_msg_proc_t *proc, char *buf, size_t blen)
 dump a dessert_msg_t to a string
void dessert_msg_proc_destroy (dessert_msg_proc_t *proc)
 free a dessert_prc_msg
int dessert_msg_addpayload (dessert_msg_t *msg, void **payload, int len)
 add or replace payload to a dessert_msg
int dessert_msg_getpayload (dessert_msg_t *msg, void **payload)
 Retrieves a pointer to the payload of a dessert message msg.
int dessert_msg_addext (dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, size_t len)
 add an extension record to a dessert_msg
int dessert_msg_delext (dessert_msg_t *msg, dessert_ext_t *ext)
 remove an extension record from a dessert_msg
int dessert_msg_resizeext (dessert_msg_t *msg, dessert_ext_t *ext, size_t new_len)
 Resizes a given extension record ext within in a dessert message msg to the new length new_len.
int dessert_msg_getext (const dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, int index)
 get an specific or all extensions
int dessert_msg_get_ext_count (const dessert_msg_t *msg, uint8_t type)
 get an specific or all extensions
int dessert_msg_trace_initiate (dessert_msg_t *msg, int mode)
 add initial trace header to dessert message
int dessert_msg_trace_dump (const dessert_msg_t *msg, char *buf, int blen)
 dump packet trace to string
int dessert_msg_dump_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 dump a dessert_msg_t to debug log
int dessert_msg_check_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 callback that checks whether a dessert_msg is consistent
int dessert_msg_trace_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 check if the message carries a trace extension and add the current trace info if iface is NULL, the packet is ignored
int dessert_msg_ifaceflags_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *riface, dessert_frameid_t id)
 callback to set the local processing flags in dessert_msg_proc_t on an arriving dessert_msg_t
dessert_periodic_tdessert_periodic_add (dessert_periodiccallback_t *c, void *data, const struct timeval *scheduled, const struct timeval *interval)
 Adds a delayed/periodic task to the task list.
dessert_periodic_tdessert_periodic_add_delayed (dessert_periodiccallback_t *c, void *data, int delay)
 Adds a delayed task to the task list.
int dessert_periodic_del (dessert_periodic_t *p)
 Removes a delayed/periodic task from the task list.
dessert_agentx_appstats_tdessert_agentx_appstats_new (void)
 Creates and initializes a new dessert_agentx_appstats_t.
void dessert_agentx_appstats_destroy (dessert_agentx_appstats_t *appstat)
 Frees a dessert_agentx_appstats_t.
dessert_agentx_appstats_cb_entry_tdessert_agentx_appstats_add (dessert_agentx_appstatscb_get_t *c)
 Adds an application statistics callback.
dessert_agentx_appstats_cb_entry_tdessert_agentx_appstats_add_bulk (dessert_agentx_appstatscb_get_t *c)
 Adds an application statistics bulk callback.
int dessert_agentx_appstats_del (dessert_agentx_appstats_cb_entry_t *e)
 Deletes an application statistics callback.
dessert_agentx_appparams_tdessert_agentx_appparam_new (void)
 Creates and initializes a new dessert_agentx_appparams_t.
void dessert_agentx_appparam_destroy (dessert_agentx_appparams_t *appparam)
 Frees a dessert_agentx_appparams_t.
dessert_agentx_appparams_cb_entry_tdessert_agentx_appparams_add (dessert_agentx_appparamscb_get_t *get, dessert_agentx_appparamscb_set_t *set)
 Adds an application parameter callback.
int dessert_agentx_appparams_del (dessert_agentx_appparams_cb_entry_t *e)
 Deletes an application parameter callback.

Variables

char dessert_proto [DESSERT_PROTO_STRLEN+1]
 protocol string used in dessert_msg frames
u_int8_t dessert_ver
 version int used in dessert_msg frames
u_int8_t dessert_l25_defsrc [ETHER_ADDR_LEN]
 default src address used for local generated dessert_msg frames
u_char ether_broadcast [ETHER_ADDR_LEN]
 constant holding ethernet broadcast address after dessert_init
u_char ether_null [ETHER_ADDR_LEN]
 constant holding ethernet null address after dessert_init
pthread_rwlock_t dessert_cfglock
 the config funnel
struct cli_def * dessert_cli
struct cli_command * dessert_cli_show
struct cli_command * dessert_cli_cfg_iface
struct cli_command * dessert_cli_cfg_no
struct cli_command * dessert_cli_cfg_no_iface
struct cli_command * dessert_cli_cfg_set
struct cli_command * dessert_cli_cfg_logging
struct cli_command * dessert_cli_cfg_no_logging

Detailed Description


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_ga07a7fbeec245d9f997021e7c7aabffe5_icgraph.md50000644000175000017500000000004011331020526026537 0ustar dvddvd57f07dbcd683b9ec205037471433cc66libdessert0.87-0.87.2/doxygen/html/group__mesh_ga58e1c127ee23b780717c468f4643677e_icgraph.map0000644000175000017500000000031511331020526026210 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__global.html0000644000175000017500000005267411331020526020532 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S

G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S

EXTERNAL / PUBLIC. More...

Data Structures

struct  dessert_msg
 A basic message send on des-sert layer2.5. More...
struct  dessert_msg_proc
 local processing struct for dessert_msg_t More...
struct  dessert_ext
 a extension record to add to a dessert_msg More...
struct  dessert_meshif
 an interface used for dessert_msg frames More...
struct  dessert_sysif
 A tun/tap interface used to inject packets to dessert implemented daemons. More...
struct  dessert_periodic
 definition of a periodic tasklist entry More...

Defines

#define DESSERT_ETHPROTO   0x8042
 ethernet protocol used on layer 2
#define DESSERT_MAXFRAMELEN   ETHER_MAX_LEN
 maximum frame size to assemble as dessert_msg
#define DESSERT_MAXEXTDATALEN   253
 maximum size of the data part in dessert_ext
#define DESSERT_PROTO_STRLEN   4
 length of protocol string used in dessert_msg
#define DESSERT_LBUF_LEN   1024
 size of local message processing buffer
#define DESSERT_OK   0
 return code for many dessert_* functions
#define DESSERT_ERR   1
 return code for many dessert_* functions

Typedefs

typedef uint64_t dessert_frameid_t
 runtime-unique frame id
typedef struct dessert_msg dessert_msg_t
 A basic message send on des-sert layer2.5.
typedef struct dessert_msg_proc dessert_msg_proc_t
 local processing struct for dessert_msg_t
typedef struct dessert_ext dessert_ext_t
 a extension record to add to a dessert_msg
typedef struct dessert_meshif dessert_meshif_t
 an interface used for dessert_msg frames
typedef struct dessert_sysif dessert_sysif_t
 A tun/tap interface used to inject packets to dessert implemented daemons.
typedef int dessert_meshrxcb_t (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 Callback type to call if a packed is received via a dessert mesh interface.
typedef int dessert_sysrxcb_t (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id)
 Callback type to call if a packed should be injected into dessert via a tun/tap interface.
typedef int dessert_periodiccallback_t (void *data, struct timeval *scheduled, struct timeval *interval)
 callbacks type to call in a periodic task
typedef struct dessert_periodic dessert_periodic_t
 definition of a periodic tasklist entry

Detailed Description

EXTERNAL / PUBLIC.


Typedef Documentation

typedef int dessert_meshrxcb_t(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)

Callback type to call if a packed is received via a dessert mesh interface.

Parameters:
*msg dessert_msg_t frame received
len length of the buffer pointed to from dessert_msg_t
*proc local processing buffer passed along the callback pipeline - may be NULL
*iface interface received packet on - may be NULL
id unique internal frame id of the packet
Return values:
DESSERT_MSG_KEEP to continue processing the packet
DESSERT_MSG_DROP to drop it
DESSERT_MSG_NEEDMSGPROC to get a processing buffer
DESSERT_MSG_NEEDNOSPARSE to get a full packet buffer (e.g. needed to add extensions)
Warning:
The callbacks are invoked with no locks hold by the thread,
YOU MUST make sure the thread holds no locks after the callback exits.
YOU MUST also make sure not to do anything blocking in a callback!

If the callback exits with DESSERT_MSG_NEEDMSGPROC or DESSERT_MSG_NEEDNOSPARSE and the respective buffer is NULL or sparse, the callback is called again after providing the requested resource.

typedef struct dessert_msg dessert_msg_t

A basic message send on des-sert layer2.5.

typedef int dessert_periodiccallback_t(void *data, struct timeval *scheduled, struct timeval *interval)

callbacks type to call in a periodic task

The callbacks are invoked with no locks hold by the thread, YOU MUST make sure the thread holds no locks after the callback exits. YOU MUST also make sure not to do anything blocking in a callback!

  • *data void pointer to pass to the callback
  • scheduled when this call was scheduled
  • interval how often this call should be scheduled ®return should be 0, otherwise the callback is unregistered

A tun/tap interface used to inject packets to dessert implemented daemons.

Note:
Please make sure first fields are equal to dessert_meshif to re-use _dessert_meshif_gethwaddr().
typedef int dessert_sysrxcb_t(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id)

Callback type to call if a packed should be injected into dessert via a tun/tap interface.

Parameters:
*msg dessert msg received - original ethernet frame is encapsulated within
len length of ethernet frame received
*proc local processing buffer passed along the callback pipeline - may be NULL
*sysif interface received packet on
id unique internal frame id of the packet
Return values:
DESSERT_MSG_KEEP to continue processing the packet
DESSERT_MSG_DROP to drop it
Warning:
The callbacks are invoked with no locks hold by the thread,
YOU MUST make sure the thread holds no locks after the callback exits.
YOU MUST also make sure not to do anything blocking in a callback!

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats__coll__graph.md50000644000175000017500000000004011331020526026605 0ustar dvddvd00be43c9330b179fccc21d6cba4ebdbblibdessert0.87-0.87.2/doxygen/html/group__msg_gac1fa7dd6d73701eea3a1b9a734b69093_icgraph.map0000644000175000017500000000106211331020526026373 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__log.html0000644000175000017500000003371011331020526020041 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: L O G _ F A C I L I T Y

L O G _ F A C I L I T Y

EXTERNAL / PUBLIC. More...

Defines

#define DESSERT_LOG_SYSLOG   0x0001
 flag for dessert_logcfg - enable syslog logging
#define DESSERT_LOG_NOSYSLOG   0x0002
 flag for dessert_logcfg - disable syslog logging
#define DESSERT_LOG_FILE   0x0004
 flag for dessert_logcfg - enable logfile logging
#define DESSERT_LOG_NOFILE   0x0008
 flag for dessert_logcfg - disable logfile logging
#define DESSERT_LOG_STDERR   0x0010
 flag for dessert_logcfg - enable logging to stderr
#define DESSERT_LOG_NOSTDERR   0x0020
 flag for dessert_logcfg - disable logging to stderr
#define DESSERT_LOG_RBUF   0x0040
 flag for dessert_logcfg - enable logging to ringbuffer
#define DESSERT_LOG_NORBUF   0x0080
 flag for dessert_logcfg - disable logging to ringbuffer
#define DESSERT_LOG_DEBUG   0x0100
 flag for dessert_logcfg - enable debug loglevel
#define DESSERT_LOG_NODEBUG   0x0200
 flag for dessert_logcfg - disable debug loglevel
#define dessert_debug(...)   _dessert_log(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at DEBUG level
#define dessert_info(...)   _dessert_log(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at INFO level
#define dessert_notice(...)   _dessert_log(LOG_NOTICE, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at NOTICE level
#define dessert_warn(...)   _dessert_log(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at WARNING level
#define dessert_warning(...)   _dessert_log(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at WARNING level
#define dessert_err(...)   _dessert_log(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at ERR level
#define dessert_crit(...)   _dessert_log(LOG_CRIT, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at CRIT level
#define dessert_alert(...)   _dessert_log(LOG_ALERT, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at ALERT level
#define dessert_emerg(...)   _dessert_log(LOG_EMERG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 log at EMERG level

Functions

int dessert_logcfg (uint16_t opts)
 Configure dessert logging framework and sets up logging.
void _dessert_log (int level, const char *func, const char *file, int line, const char *fmt,...)
 internal log function

Detailed Description

EXTERNAL / PUBLIC.


Define Documentation

#define DESSERT_LOG_FILE   0x0004

flag for dessert_logcfg - enable logfile logging

Warning:
before using this you MUST use fopen(dessert_logfd, ...) to open the logfile

Function Documentation

int dessert_logcfg ( uint16_t  opts  ) 

Configure dessert logging framework and sets up logging.

  • opts OR'd flags -
    See also:
    DESSERT_LOG_*
    DESCRIPTION:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/main.html0000644000175000017500000005052711331020526016636 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: DES-SERT

DES-SERT

0.87.1

Introduction

DES-SERT, the DES Simple and Extensible Routing-Framework for Testbeds, is a framework designed to assist researchers implementing routing protocols for testbeds.

DES-SERT enables the implementation of routing protocols on top of Ethernet via an underlay (Layer 2.5) in user space. It introduces an abstraction from OS specific issues and provides functionality and data structures to implement proactive, reactive, and hybrid routing protocols.

While generally usable in many application scenarios, it is primarily used in DES-Mesh (http://www.des-testbed.net/), the multi-transceiver wireless mesh network testbed part of the DES-Testbed at Freie Universitaet Berlin, Germany.

DES-SERT Architecture

DES-SERT introduces some concepts to implement routing protocols. When implementing a routing protocol with DES-SERT, you should be familiar with these concepts to structure and tailor your implementation.

DES-SERT Messages

Every packet you send or receive on the mesh is represented as a DES-SERT message. From a programmers point of view, a DES-SERT message is just a C-structure:

 typedef struct __attribute__ ((__packed__)) dessert_msg {
    struct     ether_header l2h;
    char       proto[DESSERT_PROTO_STRLEN];
    uint8_t    ver;
    uint8_t    flags;
    union {
            uint32_t u32;
            struct __attribute__ ((__packed__)) {
                uint8_t    ttl;
                uint8_t    u8;
                uint16_t   u16;
            };
    };
    uint16_t   hlen;
    uint16_t   plen;
 } dessert_msg_t;

Every message sent via the underlay carries this structure as a packet header. All data in a "dessert_msg" is stored in network byte order. DES-SERT tries to care as automatically as possible of this structure. Nevertheless you will have to care at least about: "l2h.ether_dhost" and "ttl".

If you need to send some data along with every packet, e.g. some kind of metric or cost your routing protocol uses, you should try to fit this data into the "u8", "u16" and the upper 4 bits of the "flags" field. These fields will never be touched by DES-SERT except on initialization via "dessert_msg_new".

Because just a C-structure is not really usable as a packet, there are some utility functions around - please have a look around in "dessert.h" and the doxygen documentation. The most important ones are: "dessert_msg_new" and "dessert_msg_destroy", which do not simply allocate memory for a DES-SERT message, but for a whole packet of maximum size and initialize the structures for further packet construction/processing.

DES-SERT Extensions

A DES-SERT extension is some structure used to piggyback data on a DES-SERT message. It consists of a 8-bit user supplied type field (with some reserved values), an 8-bit length field and user supplied data of arbitrary length of 253 bytes at most.

It can be added to a message via dessert_msg_addext(), retrieved via dessert_msg_getext() and removed via dessert_msg_delext().

    int dessert_msg_addext(dessert_msg_t* msg, dessert_ext_t** ext,
                        uint8_t type, size_t len);

    int dessert_msg_delext(dessert_msg_t *msg, dessert_ext_t *ext);

    int dessert_msg_getext(const dessert_msg_t* msg, dessert_ext_t** ext,
                        uint8_t type, int index);

It is recommended not to put single data fields in extensions, but combine semantically related data in a struct and attach this struct as an extension because every extension carried introduces an 16-bit overhead to the packet.

Processing Pipelines

Routing algorithms are often split up in several parts like packet validation, loop-detection or routing table lookup. To implement these as independent and clear as possible, DES-SERT enables you to split up your packet processing in as many parts as you like.

There are two separate processing pipelines - one for packets received from the kernel via a TUN or TAP interface and one for packets received via an interface used on the mesh network.

You can register callbacks to be added to one of these pipelines with "dessert_sysrxcb_add" or "dessert_meshrxcb_add". Both take an additional integer argument ("priority") specifying the order the callbacks should be called. Higher "priority" value results in being called later within the pipeline.

If a callback returns "DESSERT_MSG_KEEP" the packed will be processed by further callbacks, if it returns "DESSERT_MSG_DROP" the message will be dropped and no further callbacks will be called.

You do not need to care about the management of the buffers for incoming messages - DES-SERT does this for you. Nevertheless if you need to add extensions or enlarge the payload of a message, you need to tell DES-SERT to enlarge the buffer for you if the flag "DESSERT_FLAG_SPARSE" is set on the message. You can do this by returning "DESSERT_MSG_NEEDNOSPARSE" from within a callback. The callback will be called again with a larger buffer and no "DESSERT_FLAG_SPARSE" flag being set.

Processing Buffer

If you need to pass information along several callbacks, you can do this in the processing buffer passed to the the callbacks. This buffer contains some local processing flags ("lflags") set by the builtin callback "dessert_msg_ifaceflags_cb" (e.g. telling you about packet origin or if the packet is multicast) and 1KB of space for your callbacks to pass along arbitrary data.

This buffer might only be allocated after you explicitly request it - in this case the proc argument is NULL and you can return the value "DESSERT_MSG_NEEDMSGPROC" from within your callback. The callback will be called again with a valid processing buffer.

Using Interfaces

Using a TUN/TAP interface

First you have to choose whether to use a TUN or TAP interface. TUN interfaces are used to exchange IPv4 / IPv6 datagrams with the kernel network stack. TAP interfaces are used to exchange Ethernet frames with the kernel network stack. If you want to route Ethernet frames, you should choose a TAP interface. If you intend to implement a custom layer 2 to layer 3 mapping, you should use a TUN interface.

Currently, you can only initialize and use a single sys (TUN/TAP) interface. This is done by "dessert_sysif_init". You must then set up the interface config in the kernel yourself e.g. by calling "ifconfig".

    int dessert_sysif_init(char* name, uint8_t flags);

In either case, frames you receive from a TUN/TAP interface will be passed along the callbacks added by "dessert_sysrxcb_add" to the processing pipeline. Each of them will be called with a pointer to an Ethernet frame. In case of a TUN interface, "ether_shost" and "ether_dhost" are set to "00:00:00:00:00:00", and ether_type reflects whether the packet received is IPv4 oder IPv6.

Packets are sent to the kernel network stack with "dessert_syssend". In case of a TUN Interface "ether_shost" and "ether_dhost" will be ignored.

    int dessert_syssend_msg(dessert_msg_t *msg);

    int dessert_syssend(const struct ether_header *eth, size_t len);

Using a Mesh Interface

Mesh interfaces are used similar to the TUN/TAP interface with two major differences: You can have multiple mesh interfaces and they send and receive DES-SERT messages instead of Ethernet frames.

You add an mesh interface using "dessert_meshif_add" and can send to it by calling "dessert_meshsend". If the interface parameter is NULL, the packet will be transmitted over every interface (good for flooding).

    int dessert_meshif_add(const char* dev, uint8_t flags);


    int dessert_meshsend(const dessert_msg_t* msgin,
                    const dessert_meshif_t *iface);

    int dessert_meshsend_hwaddr(const dessert_msg_t* msgin,
                    const uint8_t hwaddr[ETHER_ADDR_LEN]);

    int dessert_meshsend_allbutone(const dessert_msg_t* msgin,
                    const dessert_meshif_t *iface);

    int dessert_meshsend_fast(dessert_msg_t* msg,
                    const dessert_meshif_t *iface);

    int dessert_meshsend_fast_hwaddr(dessert_msg_t* msg,
                    const uint8_t hwaddr[ETHER_ADDR_LEN]);

    int dessert_meshsend_fast_allbutone(dessert_msg_t* msg,
                    const dessert_meshif_t *iface);

    int dessert_meshsend_raw(dessert_msg_t* msg,
                    const dessert_meshif_t *iface);

Logging

You can write log messages easily with a bunch of macros provided by DES-SERT ("dessert_debug", "dessert_info" ,"dessert_notice", "dessert_warn", "dessert_warning", "dessert_err", "dessert_crit", "dessert_alert" and "dessert_emerg"). Each of them can be used like "printf" and logs to Syslog, STDERR, file or a ringbuffer depending on your configuration.

DES-SERT also ships with a custom "assert" macro which acts like the original macro from the standard C library and uses the logging mechanism described above.

Periodics

Periodics help you to perform maintenance or delayed tasks. A task consists of a callback, which will be called at the time you requested, and a void pointer the callback is passed. You can add these tasks by calling "dessert_periodic_add" or "dessert_periodic_add_delayed".

CLI - Command Line Interface

DES-SERT supports simple configuration and debugging of your routing protocol implementation by providing a Cisco like command line interface (cli) and a config file parser based upon it. This cli is realized through libcli (http://code.google.com/p/libcli/).

DES-SERT does some of the initialization of libcli. Therefore, it provides the main cli anchor "dessert_cli" and some anchors to add commands below "dessert_cli_.*". Because DES-SERT only loosely wraps libcli, you should make yourself familiar with libcli itself. This may be improved in further DES-SERT releases.

You can evaluate a config file by calling "cli_file" and start a thread enabling a telnet-interface for DES-SERT by calling "dessert_cli_run".

Putting it all together

Now you have learned about the most important aspects of DES-SERT. To write your own routing protocol implementation, you need to know how to put all this together.

You should start with a main() program parsing the command line options and then calling "dessert_init()". This is needed to set up DES-SERT correctly. Afterwards you can register callbacks, read the config file and do what you like. If everything is set up, you call "dessert_run()" and let the event based framework do its job.

If you would like to see a complete protocol implementation sample, have a look at the "gossiping" directory.

Contact & Feedback

We love feedback - if you have patches, comments or questions, please contact us! Recent contact information is available on http://www.des-testbed.net/des-sert/


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appparams__cb__entry__coll__graph.png0000644000175000017500000001070611331020526031226 0ustar dvddvdPNG  IHDR)0M7ebKGD{IDATx{TTه8⠈@(\E1$1$ш&)hDhkU%M1 HQPŏ[mVzBN6"8|LE3\FaY?yyyGf2LAE@ AF)@УAJ hD=AF)@УQ>xǏw@E;vlw˰)\f͚ZAe-æ<Z8z!ʕ+RSSQ(|hZ/^LBBׯ__d֬Y9qnnn2|Fk73OSr9ݻw{q믿8;;Ill,555|'3b6ol_d1@RhZV^V%44 uVnݺƍ 8;;Fa„ őFtt4)))`Ν+ %څ'j|g6rApΝ;Ow-sX>zԩSׯd'%p *ɘw퓋(]וw^n޼ɦMx(]DD999={zٳgQQQ>} 6XI 4޹GIN TϼZLLY>Yl}/^LJE='((1cp9BBB@ӟ&Md5_<] 6"LR)LU\2xۄ\|wH~~>_c̘1d2\]]illl6!!qqqa쩩ýlΜ9ck?ڵk-Mz;%%%۷[I-7.ájoLΡV '?Iypqqa򣞓_J]]]whM`{u}7\Sԭ<}.}\ܞ 6 5ZL+]v{{{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.ZBPp%vAqq1NNN+6+Q_9vC tZn(^\\o^A^vFsZ[[O?Mpp0Ge񸸸0}tV^dL*'=~k\v+ V\ ٮ*++2p|3^_)vvv9s7x+WгgOz}999u[666mn5z*{{{H"0 ,\ reoܚI嬨/f:ɓ'IJJbڵ :nݺ HTLh+jc'''&NÇZ9@BBgϞ?$44gJƤrj4uGG{7Xu^WJZZWf?cSitMĈ$$$T*իEEE3n8FB2|ΝKII 999lݺAd|={LƤru8ft\/// F*fs 3tiS> DD|ߪ6mgժUxzz?@pp0,_/2x`jjj5jɓ'  22HMŤr6lYb鄇V ''9sw>ru bl+ )KZ'L'7oƍ9G}h.\ȠAPT :Sh8x Ѹp%^~eLZٔ+[lW^i-,WG0avbɒ%( >cLԺbv!==:662,}Yk ?EEE0`֭[رc=z4?pnܸ;ÃӧO] /)/^̖-[$rʔ)(J|}}>|8yyyl޼[=/Rn߾mvm֭[ǤIEPCLL iii&sZz,]{k>99VJQQeee <{{F1Fõkpsskx"wܡbR9*//ʕ+<8::jL-d\ prrju555\xWWW|||PՔ0|p@zmb-nt?|23/Xsƿ[=! .pMYb ӧObVKnn.uuu >bR9*--ܹs=WWqe^yzYK%5TVV~~~1iҤsZrXvcnOw-}4w+2?nwuddWydg_:w+))i{#M 6xA`|ewVNo'!qvv6oBuZ99u'<<*H$=?3 *ʬ}2fkaT*/ <Ğ B" B" B$^[kIENDB`libdessert0.87-0.87.2/doxygen/html/license.html0000644000175000017500000000530211331020526017323 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: License

License

Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB).


All rights reserved.

These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group
(http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/)
-----------------------------------------------------------------------------
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 3 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/ .
-----------------------------------------------------------------------------
For further information and questions please use the web site
http://www.des-testbed.net/


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__mesh.html0000644000175000017500000013554511331020526020225 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: M E S H - I N T E R F A C E S

M E S H - I N T E R F A C E S

EXTERNAL / PUBLIC. More...

Defines

#define DESSERT_MSG_NEEDNOSPARSE   1
 return code for dessert_meshrxcb_t - forces to copy the message and call again
#define DESSERT_MSG_NEEDMSGPROC   2
 return code for dessert_meshrxcb_t - forces to generate processing info and call again
#define DESSERT_MSG_KEEP   0
 return code for dessert_meshrxcb_t and dessert_sysrxcb_t
#define DESSERT_MSG_DROP   -1
 return code for dessert_meshrxcb_t and dessert_sysrxcb_t
#define DESSERT_IF_PROMISC   0x0
 flag for dessert_meshif_add - set interface in promiscuous-mode (default)
#define DESSERT_IF_NOPROMISC   0x1
 flag for dessert_meshif_add - do not set interface in promiscuous-mode
#define DESSERT_IF_FILTER   0x0
 flag for dessert_meshif_add - filter out non-des-sert frames in libpcap (default)
#define DESSERT_IF_NOFILTER   0x2
 flag for dessert_meshif_add - do not filter out non-des-sert frames in libpcap

Functions

int dessert_meshsend (const dessert_msg_t *msgin, const dessert_meshif_t *iface)
 Sends a dessert message via the specified interface or all interfaces.
int dessert_meshsend_allbutone (const dessert_msg_t *msgin, const dessert_meshif_t *iface)
 Sends a dessert message via all interfaces, except via the specified interface.
int dessert_meshsend_hwaddr (const dessert_msg_t *msgin, const uint8_t hwaddr[ETHER_ADDR_LEN])
 Sends a dessert message via the interface which is identified by the given hardware address.
int dessert_meshsend_randomized (const dessert_msg_t *msgin)
 Sends a dessert message via all interfaces in a randomized fashion.
int dessert_meshsend_fast (dessert_msg_t *msg, const dessert_meshif_t *iface)
 Sends a dessert message fast via the specified interface or all interfaces.
int dessert_meshsend_fast_allbutone (dessert_msg_t *msg, const dessert_meshif_t *iface)
 Sends a dessert message fast via all interfaces, except the specified interface.
int dessert_meshsend_fast_hwaddr (dessert_msg_t *msg, const uint8_t hwaddr[ETHER_ADDR_LEN])
 Sends a dessert message fast via the interface specified by the given hardware address.
int dessert_meshsend_fast_randomized (dessert_msg_t *msgin)
 Sends a dessert message fast via all interfaces in a randomized fashion.
int dessert_meshsend_raw (dessert_msg_t *msg, const dessert_meshif_t *iface)
 Sends a dessert message msg via the specified interface iface or all interfaces.
int dessert_meshrxcb_add (dessert_meshrxcb_t *c, int prio)
 Adds a callback function to the meshrx pipeline.
int dessert_meshrxcb_del (dessert_meshrxcb_t *c)
 Removes all occurrences of the given callback function c from the meshrx pipeline.
int dessert_meshif_add (const char *dev, uint8_t flags)
 Initializes given mesh interface, starts up the packet processor thread.
int dessert_meshif_del (const char *dev)
 Removes the corresponding dessert_meshif struct from _dessert_meshiflist and does some cleanup.
dessert_meshif_tdessert_meshif_get_name (const char *dev)
 Looks for mesh interface with name dev in the list of mesh interfaces and returns a pointer to it.
dessert_meshif_tdessert_meshif_get_hwaddr (const uint8_t hwaddr[ETHER_ADDR_LEN])
 Looks for mesh interface with hardware address hwaddr in the list of mesh interfaces and returns a pointer to it.
dessert_meshif_tdessert_meshiflist_get (void)
 Returns the head of the list of mesh interfaces (_desert_meshiflist).

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

int dessert_meshif_add ( const char *  dev,
uint8_t  flags 
)

Initializes given mesh interface, starts up the packet processor thread.

Parameters:
[in] *dev interface name
[in] flags 
Todo:
Document the flags parameter.
Return values:
DESSERT_OK on success
DESSERT_ERR on error

DESCRIPTION:

Here is the caller graph for this function:

int dessert_meshif_del ( const char *  dev  ) 

Removes the corresponding dessert_meshif struct from _dessert_meshiflist and does some cleanup.

Parameters:
[in] dev interface name to remove from list
Return values:
DESSERT_OK on success
-errno on error

DESCRIPTION:

dessert_meshif_t* dessert_meshif_get_hwaddr ( const uint8_t  hwaddr[ETHER_ADDR_LEN]  ) 

Looks for mesh interface with hardware address hwaddr in the list of mesh interfaces and returns a pointer to it.

Parameters:
[in] *hwaddr interface hardware address
Return values:
pointer if the interface is found
NULL otherwise

DESCRIPTION:

dessert_meshif_t* dessert_meshif_get_name ( const char *  dev  ) 

Looks for mesh interface with name dev in the list of mesh interfaces and returns a pointer to it.

Parameters:
[in] *dev interface name
Return values:
pointer if the interface is found
NULL otherwise

DESCRIPTION:

dessert_meshif_t* dessert_meshiflist_get ( void   ) 

Returns the head of the list of mesh interfaces (_desert_meshiflist).

Return values:
pointer if list is not empty
NULL otherwise

DESCRIPTION:

Here is the caller graph for this function:

int dessert_meshrxcb_add ( dessert_meshrxcb_t c,
int  prio 
)

Adds a callback function to the meshrx pipeline.

The callback going to get called if a packet is received via a dessert interface.

Parameters:
[in] c callback function
[in] prio priority of the function - lower first!
Return values:
DESSERT_OK on success
-errno on error

DESCRIPTION:

int dessert_meshrxcb_del ( dessert_meshrxcb_t c  ) 

Removes all occurrences of the given callback function c from the meshrx pipeline.

Parameters:
[in] c callback function pointer
Return values:
DESSERT_OK on success
DESSERT_ERR otherwise

DESCRIPTION:

int dessert_meshsend ( const dessert_msg_t msgin,
const dessert_meshif_t iface 
)

Sends a dessert message via the specified interface or all interfaces.

The original message buffer will not be altered, and the ethernet src address will be set correctly

Parameters:
[in] *msgin message to send
[in] *iface interface to send from - use NULL for all interfaces
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

int dessert_meshsend_allbutone ( const dessert_msg_t msgin,
const dessert_meshif_t iface 
)

Sends a dessert message via all interfaces, except via the specified interface.

The original message buffer will not be altered, and the ethernet src address will be set correctly.

Parameters:
[in] *msgin message to send
[in] *iface interface NOT to send from - use NULL for all interfaces
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

int dessert_meshsend_fast ( dessert_msg_t msg,
const dessert_meshif_t iface 
)

Sends a dessert message fast via the specified interface or all interfaces.

This method is faster than dessert_meshsend(), but does not check the message and may alter the message buffer.

Parameters:
[in] *msg message to send
[in] *iface interface to send from
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

Here is the caller graph for this function:

int dessert_meshsend_fast_allbutone ( dessert_msg_t msg,
const dessert_meshif_t iface 
)

Sends a dessert message fast via all interfaces, except the specified interface.

This method is faster than dessert_meshsend_allbutone(), but does not check the message and may alter the message buffer.

Parameters:
[in] *msg message to send
[in] *iface interface to NOT send from - use NULL for all interfaces
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

Here is the caller graph for this function:

int dessert_meshsend_fast_hwaddr ( dessert_msg_t msg,
const uint8_t  hwaddr[ETHER_ADDR_LEN] 
)

Sends a dessert message fast via the interface specified by the given hardware address.

This method is faster than dessert_meshsend_hwaddr(), but does not check the message and may alter the message buffer.

Parameters:
[in] *msg message to send
[in] *hwaddr hardware address of the interface to send from
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

Here is the caller graph for this function:

int dessert_meshsend_fast_randomized ( dessert_msg_t msgin  ) 

Sends a dessert message fast via all interfaces in a randomized fashion.

This method is faster than dessert_meshsend_randomized(), but does not check the message and may alter the message buffer.

Parameters:
[in] *msgin message to send
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

Here is the caller graph for this function:

int dessert_meshsend_hwaddr ( const dessert_msg_t msgin,
const uint8_t  hwaddr[ETHER_ADDR_LEN] 
)

Sends a dessert message via the interface which is identified by the given hardware address.

The original message buffer will not be altered, and the ethernet src address will be set correctly.

Parameters:
[in] *msgin message to send
[in] *hwaddr hardware address of the interface to send from
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

int dessert_meshsend_randomized ( const dessert_msg_t msgin  ) 

Sends a dessert message via all interfaces in a randomized fashion.

The original message buffer will not be altered, and the ethernet src address will be set correctly.

Parameters:
[in] *msgin message to send
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:

int dessert_meshsend_raw ( dessert_msg_t msg,
const dessert_meshif_t iface 
)

Sends a dessert message msg via the specified interface iface or all interfaces.

This method is faster than dessert_meshsend(), but does not check the message and may alter the message buffer. In contrast to dessert_meshsend_fast() it does not write the ether_shost address.

Parameters:
[in] *msg message to send
[in] *iface interface to send from
Return values:
DESSERT_OK on success
EINVAL if message is broken
EIO if message was not sent successfully

DESCRIPTION:


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__periodic.html0000644000175000017500000002604311331020526021057 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: P E R I O D I C _ T A S K S

P E R I O D I C _ T A S K S

EXTERNAL / PUBLIC. More...

Functions

dessert_periodic_tdessert_periodic_add (dessert_periodiccallback_t *c, void *data, const struct timeval *scheduled, const struct timeval *interval)
 Adds a delayed/periodic task to the task list.
dessert_periodic_tdessert_periodic_add_delayed (dessert_periodiccallback_t *c, void *data, int delay)
 Adds a delayed task to the task list.
int dessert_periodic_del (dessert_periodic_t *p)
 Removes a delayed/periodic task from the task list.

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

dessert_periodic_t* dessert_periodic_add ( dessert_periodiccallback_t c,
void *  data,
const struct timeval *  scheduled,
const struct timeval *  interval 
)

Adds a delayed/periodic task to the task list.

Parameters:
[in] c callback to call when task is scheduled
[in] data data to give to the callback
[in] scheduled when should the callback be called the first time
[in] interval how often should it be called (set to NULL if only once)
Return values:
pointer if the callback was added successfully
NULL otherwise
Note:
The GNU C Library Documentation states about the tv_usec member of the struct timeval: This is the rest of the elapsed time (a fraction of a second), represented as the number of microseconds. It is always less than one million. So, to make sure this invariant is always met, consider using the provided TIMEVAL_ADD() macro.
Description:
Examples:
  • Register a callback function to be executed every 1.5 seconds - and delay the first call to it for another 1.5 seconds:
      struct timeval interval;
      interval.tv_sec = 1;
      interval.tv_usec = 500000;
    
      struct timeval schedule;
      gettimeofday(&schedule, NULL);
      TIMEVAL_ADD(&schedule, 1, 500000);
    
      dessert_periodic_add(callback, NULL, &schedule, &interval);
    

Here is the caller graph for this function:

dessert_periodic_t* dessert_periodic_add_delayed ( dessert_periodiccallback_t c,
void *  data,
int  delay 
)

Adds a delayed task to the task list.

This is an easier version of dessert_periodic_add() taking a single delay as parameter.

Parameters:
[in] c callback to call when task is scheduled
[in] data data to give to the callback
[in] delay the delay in seconds

DESCRIPTION:

int dessert_periodic_del ( dessert_periodic_t p  ) 

Removes a delayed/periodic task from the task list.

Parameters:
[in] p pointer to task description
Returns:
-1 on failure, 0 if the task was removed

DESCRIPTION:


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_ga60e3f08eba0d38f2764e75f5d4cda5da_icgraph.md50000644000175000017500000000004011331020526026443 0ustar dvddvd779c06f051706882ee3678f981b85e75libdessert0.87-0.87.2/doxygen/html/structdessert__meshif__coll__graph.md50000644000175000017500000000004011331020526024514 0ustar dvddvd5636742a01cd76739f00fb728f586a79libdessert0.87-0.87.2/doxygen/html/dessert_8h__incl.md50000644000175000017500000000004011331020526020630 0ustar dvddvdea03050783a53ad2603a584b85560ba5libdessert0.87-0.87.2/doxygen/html/group__cli.html0000644000175000017500000001717611331020526020037 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: C L I - C O M M A N D _ L I N E _ I N T E R F A C E

C L I - C O M M A N D _ L I N E _ I N T E R F A C E

EXTERNAL / PUBLIC. More...

Functions

int dessert_cli_run (void)
 Start up the command line interface.
FILE * dessert_cli_get_cfg (int argc, char **argv)
int dessert_set_cli_port (uint16_t port)
int dessert_cli_cmd_addsysif (struct cli_def *cli, char *command, char *argv[], int argc)
 CLI command - config mode - interface sys $iface, $ipv4-addr, $netmask.
int dessert_cli_cmd_addmeshif (struct cli_def *cli, char *command, char *argv[], int argc)
 CLI command - config mode - interface mesh $iface.

Variables

struct cli_def * dessert_cli
struct cli_command * dessert_cli_show
struct cli_command * dessert_cli_cfg_iface
struct cli_command * dessert_cli_cfg_no
struct cli_command * dessert_cli_cfg_no_iface
struct cli_command * dessert_cli_cfg_set
struct cli_command * dessert_cli_cfg_logging
struct cli_command * dessert_cli_cfg_no_logging

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

int dessert_cli_run ( void   ) 

Start up the command line interface.

Parameters:
[in] port port to listen on
Return values:
DESSERT_OK on success
-errno otherwise

DESCRIPTION:


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_gacef13fdc8b42b9c90087fd15ea68dc75_icgraph.md50000644000175000017500000000004011331020526026455 0ustar dvddvd07c9cd352bd3a74960386137e8e98f90libdessert0.87-0.87.2/doxygen/html/files.html0000644000175000017500000000316411331020526017007 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: File Index

File List

Here is a list of all documented files with brief descriptions:
dessert.h [code]

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__periodic.html0000644000175000017500000001201211331020526022630 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_periodic Struct Reference

dessert_periodic Struct Reference
[G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S]

definition of a periodic tasklist entry More...

#include <dessert.h>

Collaboration diagram for dessert_periodic:

Data Fields

dessert_periodiccallback_tc
 callback to call
struct timeval scheduled
 when to call next
struct timeval interval
 call every
void * data
 data pointer to pass to callback
struct dessert_periodicnext
 internal pointer for task list

Detailed Description

definition of a periodic tasklist entry


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/globals_vars.html0000644000175000017500000000467711331020526020375 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields
 

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__sys_ga47fac5a4a5b28a150ddf774f92814188_icgraph.map0000644000175000017500000000034611331020526026301 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/annotated.html0000644000175000017500000000705211331020526017662 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Structures

Data Structures

Here are the data structures with brief descriptions:
dessert_agentx_appparamsAn abstract data type representing some parameter
dessert_agentx_appparams_cb_entryA callback entry representing a parameter
dessert_agentx_appstatsAn abstract data type representing some statistical datum
dessert_agentx_appstats_cb_entryA callback entry representing a statistical datum
dessert_extExtension record to add to a dessert_msg
dessert_meshifInterface used for dessert_msg frames
dessert_msgA basic message send on des-sert layer2.5
dessert_msg_procLocal processing struct for dessert_msg_t
dessert_periodicDefinition of a periodic tasklist entry
dessert_sysifA tun/tap interface used to inject packets to dessert implemented daemons

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/ftv2vertline.png0000644000175000017500000000034511331020526020155 0ustar dvddvdPNG  IHDRL10PLTEӠtRNS@ftEXtSoftwaregif2png 2.4.2^G&tEXtCommentUlead GIF SmartSaver Ver 2.0io?IDATxc`0O[!<:IENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats__cb__entry__coll__graph.md50000644000175000017500000000004011331020526030770 0ustar dvddvd47a65105ab156ba02592844d12fedae4libdessert0.87-0.87.2/doxygen/html/functions.html0000644000175000017500000003243011331020526017713 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

- b -

- c -

- d -

- f -

- g -

- h -

- i -

- l -

- m -

- n -

- o -

- p -

- s -

- t -

- u -

- v -

- w -


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__mesh_gaa93f48da25750346bc75ed224874b389_icgraph.map0000644000175000017500000000034311331020526026264 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__msg_ga07a7fbeec245d9f997021e7c7aabffe5_icgraph.png0000644000175000017500000003456711331020526026663 0ustar dvddvdPNG  IHDR>LbKGD IDATx{\e?30( (xBEöR45,Zm|k-I40vT#*!r4b gfzy{q.9܏c1(2t1ƺ>.61 c1:Xeggu0A+.6u"O `:y^\l:Ç ӿN>fcL0;.61 c1bcL0;.6=EpaÇQZZj0X;bXgggt 3fh~5Dddm͚5T*E`` rss[\J&Mݻ!RsԩS9!88[l=lmmsNZ 刊js^_ Xx1jusn;""...077ǢEP__un$buW\!TJ* 'N$i֭R(>>,--̙3tat*++iӦҥKۄɡnݺ̙3))) H.Sbb"P(H$ڵkIVg}FhƍViӦM5 %KPuu5edd%$$:gBA&&&>333I&ё#GF_vSDk$.o6͛76www (5jT˗ӊ+(66DZ\\LD$&gNN&LD".\|l곽6/!Yhn*ލX5}t߿nnn1b233 0`6looo3ܹs;v`ᰳŋ^xf۴0;;;驓[7ʈXgx'g{5 Mp 88849P]]dT*xxxήEmB}>޽{HII1c`mm|Z5y Uh\bX'҉>\ZLP >>vwwwxxxcDG'}Ȼcell f1/\lceccɓ': g|6c1bcL0;.61 c1bcL0;ΆNĤ7RgCyy c0 p-?ZdR "$88:DhuP7o*x 7 "`̘~  7Fd3^O#>g$&"'>z@``d2^'uJ'cUě8zg=z gFHP "pɘ7Qmm=Νo+aii8qήdL cP 11G騬Ɛ!rL4 n=$ um͆1Wҥ,7ܿq#ݺo &NOޙO`L*px*'OBI8;`!  ooH#=0DWsp?ʕl""0pпdbXK5^XpjM(e8?RCXGņ1! $$VVBtt2vNBzz_XXqayӈ ###̚Jچ {u/{cѢ5ݻ:<ƺ .6/E$DEGy S …>q5thuE{z׫p|s'NBVx̛K0g\lXWXXsس' yy%3 21.6JN7ߜ?^  -ko|̆u)8p"v>79 b0556tx=5ܺuvQWƌ kc\lXgV[[]ܹ b1 /@l4cϞ${ŕxaW1~ŗuD\lXVN]رacc aqe1FcZqq%I"`B_LccAc?>"## c>w)%%|s?TP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GTK.wAFFz 4999-?LV#rJxzzb̘1|2̙ɓ'ݻO#ر%%%0afL&CnndX3o7Ov KK&myyyqFrr2T*<<<`ggע6>v=`̘1~iM^BtÄ榥ʐ ;;; >999D@@@?++ iiipvv~NKjgϞ-zvo·f9-6B@|||hLj B Fc)cll f[rh?\l{`ɆCh?|6c1bcL0;.61 c1bcL0;Ά1Mbk^f?نN'44M6c1lcczņ1ƘΘIENDB`libdessert0.87-0.87.2/doxygen/html/group__core.html0000644000175000017500000002704011331020526020207 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: C O R E

C O R E

EXTERNAL / PUBLIC. More...

Defines

#define DESSERT_FRAMEID_MAX   ((uint64_t)-1)
 type for local unique packet identification
#define DESSERT_OPT_DAEMONIZE   0x0100
 flag for dessert_init - daemonize when calling disables logging to STDERR
#define DESSERT_OPT_NODAEMONIZE   0x0200
 flag for dessert_init - do not daemonize when calling
#define DESSERT_OPT_PID   0x0400
 flag for dessert_init - create and write pid file
#define DESSERT_OPT_NOPID   0x0800
 flag for dessert_init - do not create and write pid file

Functions

int dessert_init (const char *proto, int version, uint16_t opts, char *pidfile)
 Initializes dessert framework and sets up logging.
int dessert_run (void)
 main loop - wait until dessert_exit() is called or killed
void dessert_exit (void)
 Causes dessert_run() to break out of the main loop.

Variables

char dessert_proto [DESSERT_PROTO_STRLEN+1]
 protocol string used in dessert_msg frames
u_int8_t dessert_ver
 version int used in dessert_msg frames
u_int8_t dessert_l25_defsrc [ETHER_ADDR_LEN]
 default src address used for local generated dessert_msg frames
u_char ether_broadcast [ETHER_ADDR_LEN]
 constant holding ethernet broadcast address after dessert_init
u_char ether_null [ETHER_ADDR_LEN]
 constant holding ethernet null address after dessert_init
pthread_rwlock_t dessert_cfglock
 the config funnel

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

int dessert_init ( const char *  proto,
int  version,
uint16_t  opts,
char *  pidfile 
)

Initializes dessert framework and sets up logging.

  • *proto 4 char string for protocol name
  • version version number of protocol
  • opts
    See also:
    DESSERT_OPT_*
    Returns:
    DESSERT_OK on success, DESSERT_ERR otherwise
int dessert_run ( void   ) 

main loop - wait until dessert_exit() is called or killed

Returns:
arg to dessert_exit

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appparams__coll__graph.md50000644000175000017500000000004011331020526026732 0ustar dvddvd58702814b29b1e36f6d2a7fd8097cef3libdessert0.87-0.87.2/doxygen/html/ftv2blank.png0000644000175000017500000000025611331020526017415 0ustar dvddvdPNG  IHDRGtRNStEXtSoftwaregif2png 2.4.2^G%tEXtCommentUlead GIF SmartSaver Ver 2.0!^SIDATxc80Bx<2r|IENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats__coll__graph.map0000644000175000017500000000003511331020526026701 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__msg_ga07a7fbeec245d9f997021e7c7aabffe5_icgraph.map0000644000175000017500000000145611331020526026643 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/tabs.css0000644000175000017500000000346411331020526016465 0ustar dvddvd/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ DIV.tabs { float : left; width : 100%; background : url("tab_b.gif") repeat-x bottom; margin-bottom : 4px; } DIV.tabs UL { margin : 0px; padding-left : 10px; list-style : none; } DIV.tabs LI, DIV.tabs FORM { display : inline; margin : 0px; padding : 0px; } DIV.tabs FORM { float : right; } DIV.tabs A { float : left; background : url("tab_r.gif") no-repeat right top; border-bottom : 1px solid #84B0C7; font-size : 80%; font-weight : bold; text-decoration : none; } DIV.tabs A:hover { background-position: 100% -150px; } DIV.tabs A:link, DIV.tabs A:visited, DIV.tabs A:active, DIV.tabs A:hover { color: #1A419D; } DIV.tabs SPAN { float : left; display : block; background : url("tab_l.gif") no-repeat left top; padding : 5px 9px; white-space : nowrap; } DIV.tabs #MSearchBox { float : right; display : inline; font-size : 1em; } DIV.tabs TD { font-size : 80%; font-weight : bold; text-decoration : none; } /* Commented Backslash Hack hides rule from IE5-Mac \*/ DIV.tabs SPAN {float : none;} /* End IE5-Mac hack */ DIV.tabs A:hover SPAN { background-position: 0% -150px; } DIV.tabs LI.current A { background-position: 100% -150px; border-width : 0px; } DIV.tabs LI.current SPAN { background-position: 0% -150px; padding-bottom : 6px; } DIV.navpath { background : none; border : none; border-bottom : 1px solid #84B0C7; text-align : center; margin : 2px; padding : 2px; } libdessert0.87-0.87.2/doxygen/html/group__msg_ga9a58534c56c6d5bba349178b00f5df2c_icgraph.png0000644000175000017500000000766411331020526026347 0ustar dvddvdPNG  IHDRX(95bKGDiIDATx{P/0H Wqp]F RBKTl@Z 1^"TB @ dA.?*,gg9A܌ tv /*Q`AtDXAWאБqϙiӦuvm"цΫrLݗ\2CO>:Z||<*]DFFӠKjj*6l0œ& 肺؃AQ`AtDXAVAGDAQ`AtDgܹs\vMW N%%%a裏:; Y=u/_UO%&&U_㗸|Ci7 dddtv̟?7ntvmxUUU^#ҽAVV՝ !g1M~_ (^-OCC9sWreHKKɓ'qF SLaԩ477SUUEpp0| IQ=r8x0ףs۷ɓ'3yd{=رcXYYh"ƌCPP 5 :LMMٷo E6>¨?O>tsss 4CÑdOXXvllϸq8q"+Wd֭ǖkOcÆ bkk BpYf k8;;P(8x FR~FVX>555666(TА#F޽{0aƼK_>kkk޽۷9sOOOfѢE0tPfϞdT𨠶gѵkWe?)o+|L&JeL),,$77>޽KNNZ[YYǯ6`eӓᣫjW)_}㗴SusEEE899rsM]2kjj0a퍹9cǎ%""sss6>QAm)ϖ{7122R.,⳷W>V&accq\My8=?3|ׯ_gϞxTp  ڥr=?28;;i&e[]]2fBBB !??D>Cv)&էBKiv@[@rݝjkkׯ8qj[#v=zD>\#Gʶ%66l>3LBvvdTr毺LMM)++Sy|H4PU~Cg0mØ1cDbbb?رcYF7OK|k- }}}w﮶Ȩ]0`SUUE߾}ٴiFFF2~GoDGO%-*^h[m{g5dLyy9vvv$''cll!w4333tj+h y"`痺 BgVAGDAQ`AtDXAVAGDA ^/`#=_r\XZ:v 6bVAGDAQ`At֩GmnHIENDB`libdessert0.87-0.87.2/doxygen/html/group__sys_ga4a69d48f1f2f8e1425d1ec8b3be3226c_icgraph.map0000644000175000017500000000030511331020526026430 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/index.html0000644000175000017500000000111111331020526017002 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds <body> <a href="main.html">Frames are disabled. Click here to go to the main page.</a> </body> libdessert0.87-0.87.2/doxygen/html/ftv2link.png0000644000175000017500000000054611331020526017265 0ustar dvddvdPNG  IHDR_Tq-0PLTE~tRNS@ftEXtSoftwaregif2png 2.4.2^G&tEXtCommentUlead GIF SmartSaver Ver 2.0 JIDATx} 0Eo3c~SW~nZ:d5d/y!Pf}Qp@ϭtb a;j;hQ$Kh^~m((8LF-Y8\+qygyTi/q+xIENDB`libdessert0.87-0.87.2/doxygen/html/group__sys_ga3e9b0a0ce49597c62e519f1721225803_icgraph.map0000644000175000017500000000062311331020526026052 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/structdessert__periodic__coll__graph.md50000644000175000017500000000004011331020526025037 0ustar dvddvd953efa95b05e07f348cd81b2aa2fed06libdessert0.87-0.87.2/doxygen/html/tab_r.gif0000644000175000017500000000503111331020526016570 0ustar dvddvdGIF89a,薴ŝɯͻ,,@pH,Ȥrl:ШtJZجv h d@L"F:򑐌$9 (8&Nz (GFB^!˨)WVl)1 w̥.wY0Ib|Hpf:e pJ}Ȧ6nz 80%"8v~ @JЂMBІ:D'ZPKF ּ&16юz HGJRb L5Җ0LgJӚ#(e>Ӟ@ PJԢHMRԦ:PTJժ&5;%Uծz` XJVCjYֶp\Uxͫ^׾i)$Mb:v, ಘͬf7z hGKҚMjWֺ*$SPͭnwm +Mr:E?9Zͮv9" xKbLz^A|ͯ0/LN(; n0'LaJ0{/{ؘG|(SCr. v1wc6@LdHNd/PLeOXp|+s2L_153M5t3_:wsgʹπp?/FFЎt!-JҖ1NӞuA-Pԝ>53UWծ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˨ҥKzyM%((RԩS裏P*19^sj=!-3gСCS^^/lt)uu|J ggg{5]RL> wttYﶮ(3f iiiz_+WX{֯_FO>I RkL2'OCHH4:Δ:z׻'''BBBꫯd455ݻwu H*&5'v|Z`Μ9:tf͚k:檣7WvttI/er7n+++u?Lk׮^9-]|8+fȑDDD6U*&5)ZWRqe3GRm6mُxz> Bamt|LL;waѯ =hje K/Xii)N ,,|***}6|w$&&2yd ,Z{JŤ4ԚSNm۶h"YQ~cygdd~ZXXŋ{$O&wFGGImm- >bcc9r$ռ HVV111(J~w~m""" ƌٝ3[nw{yޝԚ `7nqCPj{b0gbcC dd#=,55X?6[vz{{Gee%aaa>ܝ544PPP ())<Ss{u{arOt44P( <``߿~({z^{  zlb0.upUHNN~$%V_O;{矣R$;;[V4Y<^9r$;v[[>NBdddr>ΨoR_OEEE>ܗ A Y  Y  Y  ?g9eʔ H_\Azf'Q"ORpA>=KADAA4KA 7%oIENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_ga36014dbdcc5597ada3d4b23e104f4bb0_icgraph.map0000644000175000017500000000353611331020526026436 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__mesh_ga374acb57d6cebc12fdacf68a66c4303f_icgraph.png0000644000175000017500000001074311331020526026775 0ustar dvddvdPNG  IHDR(bKGDIDATx{Pe *P@j$ciB0%o A4f',4y&Pڼ2jX HO ">r ]׮{u~o AA,N@Aӈ\A,XAY}\s"СCQrss)--5w`q|&@lblQQQmwae,qCwkdee$`ҥdQQQ$%%; AL4m➹  X8   X8   X8 '(..][: 99>Duoulڴ3w-[f]_R|O'={?E[b/_6wֲqFƠom-[ٳg2ia;XSSΝ;;?(ٰa=~JII~9~:|Yc0wm:z*6laitTe}8=z~0wzc<Ə_',ZjJvaN2w<33'… [}x0k,^z%x 222m6l ,, ΝKyy^mYYY 孷ޢ8 %sFP„  #==5k49/;wIHH47&gMܻw&** u֦=\z?\=L41c0~Vۋ;..No[Ϸ;)9=zX]v駟~z*++%V(z999;9T*,X@xx8 SNeɒ%\pSPPqqqS[[K޽uHihh$+wMk!Ӧ%q466dRv1IHH@R1j(v4&***֮]9x +=999TTTg} &[f۶m3֭# @2ZMVV\xŋ Jyh"}6̙3޽{YV;}(**? --LHi;=111|԰yf>Cˍի+̝;j㉊ԩS͛گ96l[la˖-TWWӿsh 7o믿W^t GGG>#>LF`` ( +W4)/KbccC~򢪪JYch|n_666y_,ư[ޖ5cE434XS6G[[[9G}ٳgyG~U[pg}jq7/}PjInݺRZеkW[=___L&3f0c Μ9֭[Rڤlyy/csqF}JgÆ 1p@:uDhhθ ղvRcJ~lquuvG6޽{ٱck֬FT֮]!'qrrjuo9]vin޼'W\ʕ+端bKIYQQq_>kK9WVVۧTmti9۶mclݺÇceeǘ-k׮ѽ{wkϖ-[o՞hkoϟo2c  @ii)_۷#Nbڴiۦ϶XjZel^R͹]KR1Ĉ#HLLdr}o9sHkKP(ÃL€8}4Gߟyc7n`Μ9III!{?'Oz; Sce%Qw'`ܸqlٲOOO|||())~ ?S,Y(..fDFFr%֯_7>|Xon>ruue֬YZʤĖK9=lI67nK,^\; u5 ___'""\bpa\s IΡL&yYS?~yjO_%%%T*yvڪs>Z[nrTTmUVVrYOn IcQ9%U}RTT(J._%6eE*+WPVVF=x' /S^~TLҥKyuuj~225O_oƺ&M`"?~WG .^ȉ'x[ݛ'//:^mR}U^^NAA~~~899.%rnK6&//WWWp%%% &9N>Q'vT*ɒCcI>}~8aڵkׯ}|1b;bRuu!rr?._4h^1Kj172|>Fc^ 1ЙH"#Q*}{Czrm7%sqcݻo0 1Wn>o0j2sq<. ;   X8   X8   Xv|3A*99ds!s---%77\`>}0tPsa\JKK X/  X➹  X8   XirMSIENDB`libdessert0.87-0.87.2/doxygen/html/ftv2node.png0000644000175000017500000000035311331020526017251 0ustar dvddvdPNG  IHDRL10PLTEӠtRNS@ftEXtSoftwaregif2png 2.4.2^G&tEXtCommentUlead GIF SmartSaver Ver 2.0io?IDATxc`0O V.RE:IENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_ga60e3f08eba0d38f2764e75f5d4cda5da_icgraph.map0000644000175000017500000000051311331020526026540 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/dessert_8h__incl.map0000644000175000017500000000003511331020526020724 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/todo.html0000644000175000017500000000303111331020526016643 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Todo List

Todo List

Global <globalScope>::dessert_meshif_add (const char *dev, uint8_t flags)

Document the flags parameter.


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/ftv2folderopen.png0000644000175000017500000000040511331020526020457 0ustar dvddvdPNG  IHDR_Tq-PLTE2tRNS@ftEXtSoftwaregif2png 2.4.2^G|IDATxڅA0E_-S׍: !o j<*aCipʻ&FL}FTFN*Ε=d squ C )GDIENDB`libdessert0.87-0.87.2/doxygen/html/globals_type.html0000644000175000017500000000753511331020526020377 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields
 

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_gac1fa7dd6d73701eea3a1b9a734b69093_icgraph.md50000644000175000017500000000004011331020526026276 0ustar dvddvd203c67cb2ab8365f014d3abb862f7e14libdessert0.87-0.87.2/doxygen/html/tree.html0000644000175000017500000002370311331020526016645 0ustar dvddvd TreeView libdessert0.87-0.87.2/doxygen/html/structdessert__ext.html0000644000175000017500000000760611331020526021647 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_ext Struct Reference

dessert_ext Struct Reference
[G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S]

a extension record to add to a dessert_msg More...

#include <dessert.h>

Data Fields

uint8_t type
 type of the extension user supplied types must be >= DESSERT_EXT_USER
uint8_t len
 length of the extension in bytes including the 2 bytes of the extension header itself
uint8_t data [DESSERT_MAXEXTDATALEN]
 pointer to the data - real length is len-2 bytes

Detailed Description

a extension record to add to a dessert_msg


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__mesh_ga8eeaddc9c5386a2eb116e602beb41936_icgraph.png0000644000175000017500000001014011331020526026627 0ustar dvddvdPNG  IHDR((m|bKGDIDATx{PTe ܼZ2@&Q88*Dd&JHf5%5514PIDX(sx~ٳy^dUUUU B-{ IA^@ ү@VVΝk"ӧOo!4Klll{AZСCy5վIٳt`¿ϳLCcu j>3%?? 6 oO(**",,b5UFF_}U*ԩS5FDD999= JJJصkWm=zTn:222ӣX}OJ[1>|ıcVӖbcc9{l{7|7o0tRTܹSŋqf{2JO>iXMζmZ~)%%N/"|z[P]VǏ+9s:￿G.nܸq8v* ׮]Sogee`zj1"ӬE ĉ'9s&XBFff&!!!L0s璘n۹s'^^^?i볠ŋO?oAAAVҥK9Jll,xyy֭[bڴi8qy=z&NHxx8UUUY~}zr?XVjpgϞW=m۶ck˵1"56}tg珘1c+qq())o޽{^K˗>|8;vW^D+V`aa!cƌΝ; j֧BÃsssBLJ$]<ԼLOO'::]vŋ)//'-- ,,,?>I mp999Y{zAll,6&aCF_˫>ɨx~DEEѣ9rPdၯ/*m۶;pY~GvMrr2JSSS֮] &ÇIJJСC$$$Hnؾ};yTTTpI O?%00   .dʕ:Ǘ/7n$//^z矓'T@7n{l޼qQTTD@@}۷e˖˝;w:u*k׮ER1m41$O*?y" ܻw8ٿ~uiy9r$$$$L.]`L8SNѿ322bʕYԩ2N:!˵Wj{bb" ___<3FOc߾nܸ=>~QxRLL SNeԩ,X@}q`رѣbbbORIJii)_~%tssscFee%K.E&>H۳g&LP_ ,[͛77jNСfffW5'TrT*=Z} /Y}}}JKK%ͭNZ۷Ok~R"e߾}Zs077',, \Έ# !&&ooFkm.Jz {b̙r\]]6lcll̠A3gƒmR}BuA)MѱcGu?r===vk4[Auj{K/iJgUXXT`e?EOOFeePMqsgǎ]ntЩSM>}4uR&M''N sssƏ177lд;ljcYzW&akk믿A.]O.tRu\D')R9i}j,{7U լִrd2UUUč78p1;vlSR075R(,,xHݦ-Wa:wBxLT`jjȑ#9v옺T},EFFIjj*_|ӦM#55UMOR&ϝLLLx4֡CX|9 ===?]:Ǹq$9'5/Rr .]H.$22___vJff&.]bذauVn߾MϞ=)//g޼y̝;Ν;͛ݻ7[&էSsiҤ1\\\ #00sss\۷Kkr.!r¹s'O6#JVvoƍc޼y,[ +++.]ӧݝEqU())aРA\L8s C ??? ڤY nmڵk 99?YΝ;8::KNNV? ;w9sP($j֬YM'ԼH09'EEEl߾&gfÇ?=w=zHPP{&++}2vXJ%VSvo6ZtY[Νٴi%Zs45&5O܇ʰaΎ2ח̵11j޽3AAc 8t(dg#=W!Lqttdff+իquue憏weǎ899aiiɅ y׵6KKKBBBشi\R4i'OO>8;;S\\3M7eV^ͨQ000@.ckkKhh(?%9'5/Rƌ5WWW.\HDDׯ_g[MZQ?I~~>i)JnݺEn4***z*>^cNM W_ĤQ9ҔSSF'Rx1???VX^+זkc\jmJ%.W5Ŗ-s+L |2gȐ!ul\B5WBYYXZZ6MrssIKKctܹm|(J*** %mUVVcaa!)))XZZ_Eff&Fƍܼy{njH[[[pDmGW?f˖-Z={riKtttJUWgL$'gp@*_/Oٹq;vDDDӧ[=~kӖ_FFwkxnϨ?e133^ml][[[tR)**{lذU@=ы#z͉Wѣ7r9ݺu^{e ݻY~=yyyۓQomzq[}ck CC vx~IAhQ Az! KA^@ BA( B~j̘1m9Ax̞=ٳg0)#FP0 y3t:$  ! h! P/Q Az ŗ IENDB`libdessert0.87-0.87.2/doxygen/html/group__msg_ga36014dbdcc5597ada3d4b23e104f4bb0_icgraph.md50000644000175000017500000000004011331020526026331 0ustar dvddvd66ac0f2760cf1e8131ff4a9cb3dee529libdessert0.87-0.87.2/doxygen/html/structdessert__meshif__coll__graph.png0000644000175000017500000000617711331020526024634 0ustar dvddvdPNG  IHDR0jZbKGD 4IDATxyPT׶C3 4QLberK3Å D *2J12XK/ !\H$Z!ѧ8> r804݌NrS9k{iAh1`&:E*b"1xD$55uP;sL~m r9<㔗x!w?~)S5ޮtuuQPPp"-[%%%:z&M6lAA"p_@s@ax"~sss'''z{{MKKC.sEy36p.\0nGύ7&: ۹s=miyH$zʄT̯I+T4Յ~h¼yёA)ĉOtC2m4KyCCQQQ8;;d?5G-wa4#嘊z2VVVxxxx0fl2yWˆZێ;`Ŭ[atlii_'xիW›oɹs͛OTTgO?MiiPTT\.gɒ%dffhhnnW^ 33z}Cqux3+Do 18/.=O~hޟFx1&^t{dϜ9s(//sJQQiiideeqEN˦MdݻgyF;T]nݢv܉B̙3twwSQQ@JJ Y__Q=KS_v"x6saj!A0@^Yyć_?-.pz zn*bL,X@TTckkKDD>(K,ȑ#̙3ZT*^&===:m|FGGڵk2e пvgiih4,_AC"=Ԯ$$$`llqqqXXX  /OԅxdT)9&uyG/i`NV8X愲-Y5mLq1TTs1cuuujgӧINNҒsb ,--~Qh077111N\ ]п+#ɴ 5/'f=cϥCTCUۅ h4,1ib%oN$ɓ'>mA!kASDG1=zx<<<~:~~~899@RR^^^͢EP*߿d2? nlll裏HMMs,M2v*S 4_BYA6~6skؐ4?Kll^zzT:T*|2vvvWZMee%===xxx y/Bi.4 XYG۸q#SN%''gȲ;~.:G͌q7g#+V@ ihh@.WFqf޼y}G[5܏ZBݝJ]/NFF?~H\\\x'?$..krAA ;;BAvvv^)D*2>aLMMquuJŁ> b׮]̟?dڵc}HEF߷ץ\6,]WWWV\)))qHEP\z\<==ټye8_}.h'==<6o DES-SERT - A Simple and Extensible Routing Framework for Testbeds: U S E F U L L _ MA C R O S

U S E F U L L _ MA C R O S

EXTERNAL / PUBLIC. More...

Defines

#define MESHIFLIST_ITERATOR_START(__interface)
 A convenience macro to safely iterate the list of mesh interfaces.
#define MESHIFLIST_ITERATOR_STOP   } pthread_rwlock_unlock(&dessert_cfglock)
 A convenience macro to safely iterate the list of mesh interfaces.
#define TIMEVAL_ADD(__tv, __sec, __usec)
 A convenience macro to safely add __sec seconds and __usec microseconds to the struct timeval __tv in an invariant respecting manner.
#define likely(x)   (__builtin_expect((x),1))
#define unlikely(x)   (__builtin_expect((x),0))
#define __dessert_assert(func, file, line, e)   ((void)_dessert_log(LOG_EMERG, func, file, line, "assertion `%s' failed!\n", e), abort)
#define assert(e)   (__builtin_expect(!(e), 0) ? __dessert_assert(__FUNCTION__, __FILE__, __LINE__, #e) : (void)0)

Detailed Description

EXTERNAL / PUBLIC.


Define Documentation

#define MESHIFLIST_ITERATOR_START ( __interface   ) 
Value:
pthread_rwlock_rdlock(&dessert_cfglock); \
DL_FOREACH(dessert_meshiflist_get(), __interface) {

A convenience macro to safely iterate the list of mesh interfaces.

Parameters:
__interface pointer to a temporal dessert_meshif_t
Warning:
You must pair it with an ending MESHIFLIST_ITERATOR_STOP() macro! Please find an usage example in the Examples paragraph below.
Examples:
#define MESHIFLIST_ITERATOR_STOP   } pthread_rwlock_unlock(&dessert_cfglock)

A convenience macro to safely iterate the list of mesh interfaces.

See also:
MESHIFLIST_ITERATOR_START()
#define TIMEVAL_ADD ( __tv,
__sec,
__usec   ) 
Value:
do {                                       \
        (__tv)->tv_sec  += __sec;              \
        (__tv)->tv_usec += __usec;             \
        if((__tv)->tv_usec >= 1000000) {       \
            ++(__tv)->tv_sec;                  \
            (__tv)->tv_usec -= 1000000;        \
        }                                      \
    } while(0)

A convenience macro to safely add __sec seconds and __usec microseconds to the struct timeval __tv in an invariant respecting manner.

Parameters:
__tv the struct timeval to add to
__sec the number of seconds to add up to __tv->tv_sec
__usec the number of microseconds to add up to __tv.->tv_usec

DESCRIPTION:
The GNU C Library Documentation states about the tv_usec member of the struct timeval: This is the rest of the elapsed time (a fraction of a second), represented as the number of microseconds. It is always less than one million.


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__agentx.html0000644000175000017500000014166011331020526020552 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: NET - S N M P // A G E N T _ X

NET - S N M P // A G E N T _ X

EXTERNAL / PUBLIC. More...

Data Structures

struct  dessert_agentx_appstats
 An abstract data type representing some statistical datum. More...
struct  dessert_agentx_appparams
 An abstract data type representing some parameter. More...
struct  dessert_agentx_appstats_cb_entry
 A callback entry representing a statistical datum. More...
struct  dessert_agentx_appparams_cb_entry
 A callback entry representing a parameter. More...

Defines

#define DESSERT_APPSTATS_VALUETYPE_BOOL   0
 Flag indicating the dessert_agentx_appstats_t is of type bool.
#define DESSERT_APPSTATS_VALUETYPE_INT32   1
 Flag indicating the dessert_agentx_appstats_t is of type int32.
#define DESSERT_APPSTATS_VALUETYPE_UINT32   2
 Flag indicating the dessert_agentx_appstats_t is of type uint32.
#define DESSERT_APPSTATS_VALUETYPE_COUNTER64   3
 Flag indicating the dessert_agentx_appstats_t is of type counter64.
#define DESSERT_APPSTATS_VALUETYPE_OCTETSTRING   4
 Flag indicating the dessert_agentx_appstats_t is of type octetstring.
#define DESSERT_APPSTATS_NODEORLINK_NONE   0
 Flag indicating the dessert_agentx_appstats_t does not contain information regarding a node or a link.
#define DESSERT_APPSTATS_NODEORLINK_NODE   1
 Flag indicating the dessert_agentx_appstats_t contains information regarding a node.
#define DESSERT_APPSTATS_NODEORLINK_LINK   2
 Flag indicating the dessert_agentx_appstats_t contains information regarding a link.
#define DESSERT_APPSTATS_BOOL_TRUE   1
 What is considered to be TRUE in a dessert_agentx_appstats_t.
#define DESSERT_APPSTATS_BOOL_FALSE   0
 What is considered to be FALSE in a dessert_agentx_appstats_t.
#define DESSERT_APPPARAMS_VALUETYPE_BOOL   0
 Flag indicating the dessert_agentx_appparams_t is of type bool.
#define DESSERT_APPPARAMS_VALUETYPE_INT32   1
 Flag indicating the dessert_agentx_appparams_t is of type int32.
#define DESSERT_APPPARAMS_VALUETYPE_UINT32   2
 Flag indicating the dessert_agentx_appparams_t is of type uint32.
#define DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING   3
 Flag indicating the dessert_agentx_appparams_t is of type octetstring.
#define DESSERT_APPPARAMS_BOOL_TRUE   1
 What is considered to be TRUE in a dessert_agentx_appparams_t.
#define DESSERT_APPPARAMS_BOOL_FALSE   0
 What is considered to be FALSE in a dessert_agentx_appparams_t.
#define DESSERT_APPSTATS_CB_BULK   1
 Flag indicating if a appstats callback entry is of type bulk.
#define DESSERT_APPSTATS_CB_NOBULK   2
 Flag indicating if a appstats callback entry is of type nobulk.

Typedefs

typedef struct
dessert_agentx_appstats 
dessert_agentx_appstats_t
 An abstract data type representing some statistical datum.
typedef struct
dessert_agentx_appparams 
dessert_agentx_appparams_t
 An abstract data type representing some parameter.
typedef int dessert_agentx_appstatscb_get_t (struct dessert_agentx_appstats *appstats)
 Callback type to call if the AppstatsTable is asked for by some snmp client.
typedef int dessert_agentx_appparamscb_get_t (struct dessert_agentx_appparams *appparams)
 Callback type to call if the AppparamsTable is asked for by some snmp client.
typedef int dessert_agentx_appparamscb_set_t (struct dessert_agentx_appparams *appparams)
 Callback type to call if the specific row represented by this callback is going to be set by some snmp client.
typedef struct
dessert_agentx_appstats_cb_entry 
dessert_agentx_appstats_cb_entry_t
 A callback entry representing a statistical datum.
typedef struct
dessert_agentx_appparams_cb_entry 
dessert_agentx_appparams_cb_entry_t
 A callback entry representing a parameter.

Functions

dessert_agentx_appstats_tdessert_agentx_appstats_new (void)
 Creates and initializes a new dessert_agentx_appstats_t.
void dessert_agentx_appstats_destroy (dessert_agentx_appstats_t *appstat)
 Frees a dessert_agentx_appstats_t.
dessert_agentx_appstats_cb_entry_tdessert_agentx_appstats_add (dessert_agentx_appstatscb_get_t *c)
 Adds an application statistics callback.
dessert_agentx_appstats_cb_entry_tdessert_agentx_appstats_add_bulk (dessert_agentx_appstatscb_get_t *c)
 Adds an application statistics bulk callback.
int dessert_agentx_appstats_del (dessert_agentx_appstats_cb_entry_t *e)
 Deletes an application statistics callback.
dessert_agentx_appparams_tdessert_agentx_appparam_new (void)
 Creates and initializes a new dessert_agentx_appparams_t.
void dessert_agentx_appparam_destroy (dessert_agentx_appparams_t *appparam)
 Frees a dessert_agentx_appparams_t.
dessert_agentx_appparams_cb_entry_tdessert_agentx_appparams_add (dessert_agentx_appparamscb_get_t *get, dessert_agentx_appparamscb_set_t *set)
 Adds an application parameter callback.
int dessert_agentx_appparams_del (dessert_agentx_appparams_cb_entry_t *e)
 Deletes an application parameter callback.

Detailed Description

EXTERNAL / PUBLIC.


Define Documentation

#define DESSERT_APPPARAMS_BOOL_FALSE   0

What is considered to be FALSE in a dessert_agentx_appparams_t.

#define DESSERT_APPPARAMS_BOOL_TRUE   1

What is considered to be TRUE in a dessert_agentx_appparams_t.

#define DESSERT_APPPARAMS_VALUETYPE_BOOL   0

Flag indicating the dessert_agentx_appparams_t is of type bool.

#define DESSERT_APPPARAMS_VALUETYPE_INT32   1

Flag indicating the dessert_agentx_appparams_t is of type int32.

#define DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING   3

Flag indicating the dessert_agentx_appparams_t is of type octetstring.

#define DESSERT_APPPARAMS_VALUETYPE_UINT32   2

Flag indicating the dessert_agentx_appparams_t is of type uint32.

#define DESSERT_APPSTATS_BOOL_FALSE   0

What is considered to be FALSE in a dessert_agentx_appstats_t.

#define DESSERT_APPSTATS_BOOL_TRUE   1

What is considered to be TRUE in a dessert_agentx_appstats_t.

#define DESSERT_APPSTATS_CB_BULK   1

Flag indicating if a appstats callback entry is of type bulk.

#define DESSERT_APPSTATS_CB_NOBULK   2

Flag indicating if a appstats callback entry is of type nobulk.

#define DESSERT_APPSTATS_NODEORLINK_LINK   2

Flag indicating the dessert_agentx_appstats_t contains information regarding a link.

#define DESSERT_APPSTATS_NODEORLINK_NODE   1

Flag indicating the dessert_agentx_appstats_t contains information regarding a node.

#define DESSERT_APPSTATS_NODEORLINK_NONE   0

Flag indicating the dessert_agentx_appstats_t does not contain information regarding a node or a link.

#define DESSERT_APPSTATS_VALUETYPE_BOOL   0

Flag indicating the dessert_agentx_appstats_t is of type bool.

#define DESSERT_APPSTATS_VALUETYPE_COUNTER64   3

Flag indicating the dessert_agentx_appstats_t is of type counter64.

#define DESSERT_APPSTATS_VALUETYPE_INT32   1

Flag indicating the dessert_agentx_appstats_t is of type int32.

#define DESSERT_APPSTATS_VALUETYPE_OCTETSTRING   4

Flag indicating the dessert_agentx_appstats_t is of type octetstring.

#define DESSERT_APPSTATS_VALUETYPE_UINT32   2

Flag indicating the dessert_agentx_appstats_t is of type uint32.


Typedef Documentation

A callback entry representing a parameter.

An abstract data type representing some parameter.

Callback type to call if the AppparamsTable is asked for by some snmp client.

Parameters:
*appstats dessert_agentx_appparams_t the parameter to be filled out
Return values:
DESSERT_OK on success
DESSERT_ERR to remove the corresponding callback entry

Callback type to call if the specific row represented by this callback is going to be set by some snmp client.

Parameters:
*appstats dessert_agentx_appparams_t the new value
Return values:
DESSERT_OK on success
DESSERT_ERR otherwise

A callback entry representing a statistical datum.

An abstract data type representing some statistical datum.

Callback type to call if the AppstatsTable is asked for by some snmp client.

Parameters:
*appstats dessert_agentx_appstats_t the statistical datum to be filled out
Return values:
DESSERT_OK on success
DESSERT_ERR to remove the corresponding callback entry

Function Documentation

void dessert_agentx_appparam_destroy ( dessert_agentx_appparams_t appparam  ) 

Frees a dessert_agentx_appparams_t.

Parameters:
appparam the dessert_agentx_appparams_t to be freed
Warning:
Only use this method to free a dessert_agentx_appparams_t which was allocated with dessert_agentx_appparams_new().
See also:
dessert_agentx_appparams_new()
Description:
dessert_agentx_appparams_t* dessert_agentx_appparam_new ( void   ) 

Creates and initializes a new dessert_agentx_appparams_t.

Returns:
the new dessert_agentx_appparams_t
Warning:
A dessert_agentx_appparams_t allocated with this function must be freed with dessert_agentx_appparams_destroy().
See also:
dessert_agentx_appparams_destroy()
Description:

Adds an application parameter callback.

Parameters:
[in] *c the callback to add
Return values:
pointer to the corresponding callback entry on success
NULL otherwise
Description:
int dessert_agentx_appparams_del ( dessert_agentx_appparams_cb_entry_t e  ) 

Deletes an application parameter callback.

Parameters:
*e pointer to a callback entry
Return values:
DESSERT_OK on success
DESSERT_ERR otherwise
See also:
dessert_agentx_appparams_add()
Description:
dessert_agentx_appstats_cb_entry_t* dessert_agentx_appstats_add ( dessert_agentx_appstatscb_get_t c  ) 

Adds an application statistics callback.

Parameters:
[in] *c the callback to add
Return values:
pointer to the corresponding callback entry on success
NULL otherwise
Description:
dessert_agentx_appstats_cb_entry_t* dessert_agentx_appstats_add_bulk ( dessert_agentx_appstatscb_get_t c  ) 

Adds an application statistics bulk callback.

Parameters:
[in] *c the callback to add
Return values:
pointer to the corresponding callback entry on success
NULL otherwise
Description:
int dessert_agentx_appstats_del ( dessert_agentx_appstats_cb_entry_t e  ) 

Deletes an application statistics callback.

Parameters:
*e pointer to a callback entry
Return values:
DESSERT_OK on success
DESSERT_ERR otherwise
See also:
dessert_agentx_appstats_add()
dessert_agentx_appstats_add_bulk()
Description:
void dessert_agentx_appstats_destroy ( dessert_agentx_appstats_t appstat  ) 

Frees a dessert_agentx_appstats_t.

Parameters:
appstat the dessert_agentx_appstats_t to be freed
Warning:
Only use this method to free a dessert_agentx_appstats_t which was allocated with dessert_agentx_appstats_new().
See also:
dessert_agentx_appstats_new()
Description:
dessert_agentx_appstats_t* dessert_agentx_appstats_new ( void   ) 

Creates and initializes a new dessert_agentx_appstats_t.

Returns:
the new dessert_agentx_appstats_t
Warning:
A dessert_agentx_appstats_t allocated with this function must be freed with dessert_agentx_appstats_destroy().
See also:
dessert_agentx_appstats_destroy()
Description:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_gab9a2f77494c8ca73de1194574492c317_icgraph.map0000644000175000017500000000145611331020526026126 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/ftv2folderclosed.png0000644000175000017500000000040311331020526020765 0ustar dvddvdPNG  IHDR_Tq-PLTEB@tRNS@ftEXtSoftwaregif2png 2.4.2^G}IDATxڍ 0C#wB+em3Z@SQB%zvyyIs2_I#` 6f@Kx m‹nPdpP x]%` IENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appparams__cb__entry__coll__graph.map0000644000175000017500000000003511331020526031211 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__mesh_ga16f52ad209a9d5885c61f320da3e8118_icgraph.map0000644000175000017500000000112511331020526026324 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats__cb__entry.html0000644000175000017500000001373111331020526026572 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_agentx_appstats_cb_entry Struct Reference

dessert_agentx_appstats_cb_entry Struct Reference
[NET - S N M P // A G E N T _ X]

A callback entry representing a statistical datum. More...

#include <dessert.h>

Collaboration diagram for dessert_agentx_appstats_cb_entry:

Data Fields

struct
dessert_agentx_appstats_cb_entry
prev
 Interal.
struct
dessert_agentx_appstats_cb_entry
next
 Interal.
uint8_t isbulk_flag
 Flag indicating whether this entry represents a bulk entry.
dessert_agentx_appstatscb_get_tc
 The getter callback.

Detailed Description

A callback entry representing a statistical datum.


Field Documentation

Flag indicating whether this entry represents a bulk entry.


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__mesh_gad7ff09f7d63c4ff2d9669f88fbe12f12_icgraph.md50000644000175000017500000000004011331020526026567 0ustar dvddvd9a3bb4ce3736fcb69a43f6b1f75da7d8libdessert0.87-0.87.2/doxygen/html/group__periodic_ga37438b35b803d62fd1792f269cfd9126_icgraph.map0000644000175000017500000000027511331020526027132 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/structdessert__msg.html0000644000175000017500000001707211331020526021633 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_msg Struct Reference

dessert_msg Struct Reference
[G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S]

A basic message send on des-sert layer2.5. More...

#include <dessert.h>

Data Fields

struct ether_header l2h
 the layer2 header on the wire
char proto [DESSERT_PROTO_STRLEN]
 short name of the protocol as passed to dessert_init()
uint8_t ver
 version of the app as passed to dessert_init()
uint8_t flags
 flags - bits 1-4 reserved for dessert, bits 5-8 for app usage
union {
   uint32_t   u32
 reserved for app usage
   struct {
      uint8_t   ttl
 ttl or hopcount field for app usage - 0xff if not used
      uint8_t   u8
 reserved for app usage - 0x00 if not used
      uint16_t   u16
 reserved for app usage - 0xbeef if not used
   } 
}; 
uint16_t hlen
 header length incl.
uint16_t plen
 payload length - in network byte order

Detailed Description

A basic message send on des-sert layer2.5.


Field Documentation

header length incl.

extensions - in network byte order


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/structdessert__agentx__appstats.html0000644000175000017500000004116511331020526024411 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_agentx_appstats Struct Reference

dessert_agentx_appstats Struct Reference
[NET - S N M P // A G E N T _ X]

An abstract data type representing some statistical datum. More...

#include <dessert.h>

Collaboration diagram for dessert_agentx_appstats:

Data Fields

struct dessert_agentx_appstatsprev
 A prev pointer.
struct dessert_agentx_appstatsnext
 A next pointer.
char name [256]
 The name of the datum.
char desc [256]
 A description of the datum.
int value_type
 The type of the datum.
int node_or_link
 Indicates if this datum contains information about a node or a link.
uint8_t macaddress1 [ETHER_ADDR_LEN]
 Field representing a mac address if this datum contains information about a node or a link.
uint8_t macaddress2 [ETHER_ADDR_LEN]
 Field representing a mac address if this datum contains information about a link.
union {
   uint8_t   bool
 A boolean.
   int32_t   int32
 A 32bit signed integer.
   uint32_t   uint32
 A 32bit unsigned integer.
   uint64_t   counter64
 A 64bit unsigned integer with counter semantics.
   struct {
      uint8_t   octetstring_len
 The length of the octetstring field.
      char *   octetstring
 Character pointer to some raw bytes.
   } 
}; 

Detailed Description

An abstract data type representing some statistical datum.


Field Documentation

A boolean.

See also:
For valid values please refer to:
DESSERT_APPSTATS_BOOL_TRUE
DESSERT_APPSTATS_BOOL_FALSE

A 32bit signed integer.

uint8_t dessert_agentx_appstats::macaddress1[ETHER_ADDR_LEN]

Field representing a mac address if this datum contains information about a node or a link.

uint8_t dessert_agentx_appstats::macaddress2[ETHER_ADDR_LEN]

Field representing a mac address if this datum contains information about a link.

The name of the datum.

Indicates if this datum contains information about a node or a link.

See also:
For valid values please refer to:
DESSERT_APPSTATS_NODEORLINK_NONE
DESSERT_APPSTATS_NODEORLINK_NODE
DESSERT_APPSTATS_NODEORLINK_LINK

Character pointer to some raw bytes.

The length of the octetstring field.

A 32bit unsigned integer.


The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_gaf7c69abdbce2f190e18104eddf245c62_icgraph.md50000644000175000017500000000004011331020526026437 0ustar dvddvd984cd3f70e9022cf97323781613d5e20libdessert0.87-0.87.2/doxygen/html/group__msg_gafebf49518288be044d479fe7e3ab2799_icgraph.png0000644000175000017500000000766511331020526026403 0ustar dvddvdPNG  IHDRp(糡bKGDjIDATx{PTe?,( .WL1V1/dM2{'0})%K*ZB& $hxyE  !>=s9wݳjjjjACq.m'h4O#Gҽ{vQ"hn;?j&mjZiozWx{{K"Ƿ MFVnBd2c@ QD6H@F \ (" AE$p@ h4[?uͥ޽{jѺ9tiii-3͖?ٳgK}ذa-Fy4rvai|3g;;AAAory,11W_}ooo 33M6K/ĴiLl7Jٶ8>>xyO\z[[+yҳgOڷoJ03f ڵo߾ٳG' KKKƏϵk׌YXXwFT2x` 9s&gs͚5lܸQ_QQÆ C6K7oZ3:t ((jZQQQ888`ggǎ;xw^7 3VVV|r~>$ ?dݺu;ZヒfٲeDEEӧIHH`˖-:t+++kIΪ*8y$DEEѩS'8pd'##FCpp0ׯGTr^y]Bʿ֬YŋqttDpmIRq#Zfǎ$''4z<7o7UVQSSCyy9,\#Gj*bbbj\.c|WF}aC-GNEڌGkqu5p֭[xyy@YY~~~RZZ֭[Yp!)))=z;wJqq1666]@R&d$b,ǎcܸq;ӧ@jj*=* !C0i$?;𰣬Xr%RLJ3`ɒ%<tp555̞=Lfff̘1Cy߾}KLLdذaxzzȁ ږ+44qP(pppgϞ֨񰳳ݝ_|YfaffF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beds: M E S S A G E _ H A N D L I N G

M E S S A G E _ H A N D L I N G

EXTERNAL / PUBLIC. More...

Defines

#define DESSERT_FLAG_SPARSE   0x1
 flag for dessert_msg.flags - message len is hlen+plen if not set buffer len is assumed as DESSERT_MAXFRAMELEN + DESSERT_MSGPROCLEN
#define DESSERT_LFLAG_SRC_SELF   0x0002
 flag for dessert_msg_proc.lflags - l25 src is one of our interfaces
#define DESSERT_LFLAG_DST_MULTICAST   0x0004
 flag for dessert_msg_proc.lflags - l25 dst is multicast address
#define DESSERT_LFLAG_DST_SELF   0x0008
 flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces
#define DESSERT_LFLAG_DST_BROADCAST   0x0010
 flag for dessert_msg_proc.lflags - l25 dst is broadcast
#define DESSERT_LFLAG_PREVHOP_SELF   0x0020
 flag for dessert_msg_proc.lflags - l2 src is one of our interfaces
#define DESSERT_LFLAG_NEXTHOP_SELF   0x0040
 flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces
#define DESSERT_LFLAG_NEXTHOP_BROADCAST   0x0080
 flag for dessert_msg_proc.lflags - l2 dst is broadcast
#define DESSERT_LFLAG_DST_SELF_OVERHEARD   0x0100
 flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces, but we received the message not via the indented interface, e.g.
#define DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD   0x0200
 flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces, but we received the message not via the indented interface, e.g.
#define DESSERT_EXTLEN   (sizeof(struct dessert_ext) - DESSERT_MAXEXTDATALEN)
 length of dessert_ext header
#define DESSERT_EXT_ANY   0x00
 dessert_ext type wildcard - any extension
#define DESSERT_EXT_ETH   0x01
 dessert_ext type for ethernet header
#define DESSERT_EXT_TRACE   0x02
 dessert_ext type for packet tracing
#define DESSERT_EXT_USER   0x40
 first dessert_ext type for usage by the user
#define DESSERT_MSG_TRACE_HOST   (ETHER_ADDR_LEN)
 packet tracing flag - only record hosts
#define DESSERT_MSG_TRACE_IFACE   (3*ETHER_ADDR_LEN)
 packet tracing flag - record interfaces
#define dessert_ext_getdatalen(ext)   (ext->len - DESSERT_EXTLEN)
 Returns the length of a given extension.

Functions

int dessert_msg_new (dessert_msg_t **msgout)
 creates a new dessert_msg_t and initializes it.
int dessert_msg_clone (dessert_msg_t **msgnew, const dessert_msg_t *msgold, uint8_t sparse)
 generates a copy of a dessert_msg
int dessert_msg_check (const dessert_msg_t *msg, size_t len)
 checks whether a dessert_msg is consistent
void dessert_msg_dump (const dessert_msg_t *msg, size_t len, char *buf, size_t blen)
 dump a dessert_msg_t to a string
void dessert_msg_destroy (dessert_msg_t *msg)
 free a dessert_msg
int dessert_msg_ethencap (const struct ether_header *eth, size_t eth_len, dessert_msg_t **msgout)
 creates a new dessert_msg from an ethernet frame.
int dessert_msg_ethdecap (const dessert_msg_t *msg, struct ether_header **ethout)
 extracts an ethernet frame from a dessert_msg
struct ether_header * dessert_msg_getl25ether (const dessert_msg_t *msg)
 get the ether_header sent as DESSERT_EXT_ETH in a dessert_msg
int dessert_msg_proc_clone (dessert_msg_proc_t **procnew, const dessert_msg_proc_t *procold)
 generates a copy of a dessert_msg_proc
void dessert_msg_proc_dump (const dessert_msg_t *msg, size_t len, const dessert_msg_proc_t *proc, char *buf, size_t blen)
 dump a dessert_msg_t to a string
void dessert_msg_proc_destroy (dessert_msg_proc_t *proc)
 free a dessert_prc_msg
int dessert_msg_addpayload (dessert_msg_t *msg, void **payload, int len)
 add or replace payload to a dessert_msg
int dessert_msg_getpayload (dessert_msg_t *msg, void **payload)
 Retrieves a pointer to the payload of a dessert message msg.
int dessert_msg_addext (dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, size_t len)
 add an extension record to a dessert_msg
int dessert_msg_delext (dessert_msg_t *msg, dessert_ext_t *ext)
 remove an extension record from a dessert_msg
int dessert_msg_resizeext (dessert_msg_t *msg, dessert_ext_t *ext, size_t new_len)
 Resizes a given extension record ext within in a dessert message msg to the new length new_len.
int dessert_msg_getext (const dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, int index)
 get an specific or all extensions
int dessert_msg_get_ext_count (const dessert_msg_t *msg, uint8_t type)
 get an specific or all extensions
int dessert_msg_trace_initiate (dessert_msg_t *msg, int mode)
 add initial trace header to dessert message
int dessert_msg_trace_dump (const dessert_msg_t *msg, char *buf, int blen)
 dump packet trace to string
int dessert_msg_dump_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 dump a dessert_msg_t to debug log
int dessert_msg_check_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 callback that checks whether a dessert_msg is consistent
int dessert_msg_trace_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
 check if the message carries a trace extension and add the current trace info if iface is NULL, the packet is ignored
int dessert_msg_ifaceflags_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *riface, dessert_frameid_t id)
 callback to set the local processing flags in dessert_msg_proc_t on an arriving dessert_msg_t

Detailed Description

EXTERNAL / PUBLIC.


Define Documentation

#define dessert_ext_getdatalen ( ext   )     (ext->len - DESSERT_EXTLEN)

Returns the length of a given extension.

#define DESSERT_LFLAG_DST_SELF_OVERHEARD   0x0100

flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces, but we received the message not via the indented interface, e.g.

we overheard it

#define DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD   0x0200

flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces, but we received the message not via the indented interface, e.g.

we overheard it


Function Documentation

int dessert_msg_addext ( dessert_msg_t msg,
dessert_ext_t **  ext,
uint8_t  type,
size_t  len 
)

add an extension record to a dessert_msg

  • *msg the message the extension should be added to
  • **ext (out) the extension pointer to the reserved extension space
  • type the type of the extension
  • len the length of the ext data (without 2 byte extension header)
    Returns:
    DESSERT_OK on success,

Here is the caller graph for this function:

int dessert_msg_addpayload ( dessert_msg_t msg,
void **  payload,
int  len 
)

add or replace payload to a dessert_msg

  • *msg the message the payload should be added to
  • **payload (out) the pointer to place the payload
  • len the length of the payload
    Returns:
    DESSERT_OK on success, DESSERT_ERR otherwise

Here is the caller graph for this function:

int dessert_msg_check ( const dessert_msg_t msg,
size_t  len 
)

checks whether a dessert_msg is consistent

  • msg the message to be checked
  • len the length of the buffer
    Returns:
    DESSERT_OK on success
    -1 of the message is too large for the buffer
    -2 if the message was not intended to this daemon
    -3 if some extension is not consistent DESCRIPTION:

Here is the caller graph for this function:

int dessert_msg_check_cb ( dessert_msg_t msg,
size_t  len,
dessert_msg_proc_t proc,
const dessert_meshif_t iface,
dessert_frameid_t  id 
)

callback that checks whether a dessert_msg is consistent

  • *msg dessert_msg_t frame received
  • len length of ethernet frame received
  • *iface interface received packet on
    Returns:
    DESSERT_MSG_KEEP if message is valid, DESSERT_MSG_DROP otherwise
int dessert_msg_clone ( dessert_msg_t **  msgnew,
const dessert_msg_t msgold,
uint8_t  sparse 
)

generates a copy of a dessert_msg

  • **msgnew (out) pointer to return message address
  • *msgold pointer to the message to clone
  • sparse whether to allocate DESSERT_MAXFRAMELEN or only hlen+plen
    Returns:
    DESSERT_OK on success, -errno otherwise

Here is the caller graph for this function:

int dessert_msg_delext ( dessert_msg_t msg,
dessert_ext_t ext 
)

remove an extension record from a dessert_msg

  • *msg the message the extension should be added to
  • *ext (out) the extension pointer to the extension to be removed
    Returns:
    DESSERT_OK on success,
void dessert_msg_destroy ( dessert_msg_t msg  ) 

free a dessert_msg

  • *msg message to free

Here is the caller graph for this function:

void dessert_msg_dump ( const dessert_msg_t msg,
size_t  len,
char *  buf,
size_t  blen 
)

dump a dessert_msg_t to a string

  • *msg the message to be dumped
  • len the length of the buffer
  • *buf text output buffer
  • blen text output buffer length
int dessert_msg_dump_cb ( dessert_msg_t msg,
size_t  len,
dessert_msg_proc_t proc,
const dessert_meshif_t iface,
dessert_frameid_t  id 
)

dump a dessert_msg_t to debug log

  • *msg dessert_msg_t frame received
  • len length of ethernet frame received
  • *iface interface received packet on ®return DESSERT_MSG_KEEP always
int dessert_msg_ethdecap ( const dessert_msg_t msg,
struct ether_header **  ethout 
)

extracts an ethernet frame from a dessert_msg

  • *msg pointer to dessert_msg message to decapsulate
  • **ethout (out) pointer to return ethernet message
    Returns:
    eth_len on success, -1 otherwise

Here is the caller graph for this function:

int dessert_msg_ethencap ( const struct ether_header *  eth,
size_t  eth_len,
dessert_msg_t **  msgout 
)

creates a new dessert_msg from an ethernet frame.

  • *eth ethernet frame to encapsulate
  • len length of the ethernet frame
  • **msgout (out) pointer to return message address
    Returns:
    DESSERT_OK on success, -errno otherwise
int dessert_msg_get_ext_count ( const dessert_msg_t msg,
uint8_t  type 
)

get an specific or all extensions

  • *msg the message
  • type type of the ext to retrieve - use DESSERT_EXT_ANY to get any ext
    Returns:
    0 if the message has no such extension,
    count of extensions of that type
int dessert_msg_getext ( const dessert_msg_t msg,
dessert_ext_t **  ext,
uint8_t  type,
int  index 
)

get an specific or all extensions

  • *msg the message
  • **ext (out) pointer to extracted extension sets *ext=NULL if extension not found may be NULL in this case only count/existence matters
  • type type of the ext to retrieve - use DESSERT_EXT_ANY to get any ext
  • index the index of the extension of that type, starting with 0
    Returns:
    0 if the message has no such extension,
    count of extensions of that type if count > index
    -count of extensions of that type if count <= index

Here is the caller graph for this function:

struct ether_header* dessert_msg_getl25ether ( const dessert_msg_t msg  )  [read]

get the ether_header sent as DESSERT_EXT_ETH in a dessert_msg

  • *msg the message
    Returns:
    pointer to ether_header data, NULL if DESSERT_EXT_ETH not present

Here is the caller graph for this function:

int dessert_msg_getpayload ( dessert_msg_t msg,
void **  payload 
)

Retrieves a pointer to the payload of a dessert message msg.

Parameters:
[in] *msg the message the payload should be retrieved from
[out] **payload the pointer to place the payload in
Returns:
the length of the payload in bytes if any, 0 otherwise
int dessert_msg_ifaceflags_cb ( dessert_msg_t msg,
size_t  len,
dessert_msg_proc_t proc,
const dessert_meshif_t riface,
dessert_frameid_t  id 
)

callback to set the local processing flags in dessert_msg_proc_t on an arriving dessert_msg_t

  • *msg dessert_msg_t frame received
  • len length of ethernet frame received
  • *iface interface received packet on ®return DESSERT_MSG_KEEP or DESSERT_MSG_NEEDMSGPROC
int dessert_msg_new ( dessert_msg_t **  msgout  ) 

creates a new dessert_msg_t and initializes it.

  • **msgout (out) pointer to return message address
    Returns:
    0 on success, -errno on error

Here is the caller graph for this function:

int dessert_msg_proc_clone ( dessert_msg_proc_t **  procnew,
const dessert_msg_proc_t procold 
)

generates a copy of a dessert_msg_proc

  • **procnew (out) pointer to return message address
  • *procold pointer to the message to clone
    Returns:
    DESSERT_OK on success, -errno otherwise
void dessert_msg_proc_destroy ( dessert_msg_proc_t proc  ) 

free a dessert_prc_msg

  • *proc processing buffer to free
void dessert_msg_proc_dump ( const dessert_msg_t msg,
size_t  len,
const dessert_msg_proc_t proc,
char *  buf,
size_t  blen 
)

dump a dessert_msg_t to a string

  • *msg the message to be dumped
  • len the length of the buffer
  • *proc the processing buffer
  • *buf text output buffer
  • blen text output buffer length

Here is the caller graph for this function:

int dessert_msg_resizeext ( dessert_msg_t msg,
dessert_ext_t ext,
size_t  new_len 
)

Resizes a given extension record ext within in a dessert message msg to the new length new_len.

Parameters:
[in] *msg the message
[in] *ext the extension record
[in] new_len the new length of the extension record
Return values:
DESSERT_OK on success

DESCRIPTION:

int dessert_msg_trace_cb ( dessert_msg_t msg,
size_t  len,
dessert_msg_proc_t proc,
const dessert_meshif_t iface,
dessert_frameid_t  id 
)

check if the message carries a trace extension and add the current trace info if iface is NULL, the packet is ignored

  • *msg dessert_msg_t frame received
  • len length of ethernet frame received
  • *iface interface received packet on ®return DESSERT_MSG_KEEP always
int dessert_msg_trace_dump ( const dessert_msg_t msg,
char *  buf,
int  blen 
)

dump packet trace to string

  • *msg dessert_msg_t message used for tracing
  • *buf char buffer to place string use DESSERT_MSG_TRACE_HOST to only record default mac of hosts on the way use DESSERT_MSG_TRACE_IFACE to also trace input interface and last hop ®return length of the string - 0 if msg has no trace header

Here is the caller graph for this function:

int dessert_msg_trace_initiate ( dessert_msg_t msg,
int  mode 
)

add initial trace header to dessert message

  • *msg dessert_msg_t message used for tracing
  • mode trace mode use DESSERT_MSG_TRACE_HOST to only record default mac of hosts on the way use DESSERT_MSG_TRACE_IFACE to also trace input interface and last hop ®return DESSERT_OK on success

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/ftv2pnode.png0000644000175000017500000000031011331020526017422 0ustar dvddvdPNG  IHDRL1$PLTEStRNS@ftEXtSoftwaregif2png 2.4.2^G0IDATxc`.Bn&8T >DIIYS;:k/oIENDB`libdessert0.87-0.87.2/doxygen/html/group__mesh_ga16f52ad209a9d5885c61f320da3e8118_icgraph.png0000644000175000017500000001760411331020526026344 0ustar dvddvdPNG  IHDR]@kXbKGD9IDATx{tSe7o.%IM\DD˭r/b=RF 9;ˌ 80Pek),ZQ Z.RE.r)NoiޯId)$$m'y﷟_w-B >䞎SX Ѡb- "UXX'Oz: 2ǰ&N=z  ?wMD a"dqDD Ѡb-DDDD4h&"""A0 Z,hb1LDft^Gcٱ&^Ǐ{: իq5OK/il<0 tDDeX QIIIAdd$|}}v(>ϝ;3gbС;v,m/"Z-T*Νb:d2aػw/4 `2tRdeeIPYYXرZذaZ-z=RRR1bj*l6sn;)) G?V\.džhPDDHJJ&Μ9#T*HKKMMMbΝعsz^Y:tHjq1! bbڵB!&gQQ=8~(//z^>|XJa4\.6m6M[زelb۶mb̘1] hc=&ZZZիWEPPt;g( 3??_h4qAɱQ?jD)W7e˖uX%v)RRRĔ)S:[N_^۷O qy!૪B6>QRRh ]^ !rP*b!aaa] {:L&y111"==,--u͞=[J+X 3磉h)))wat"##mMMMxh"dff"&&qqqxh$ۤ\v>LJRyBVu< z}J `9D#a2:,3ZYfw!}vTVV"55x@MOc[KJwr v,G̛7)))0go"++ /^466"::غu+̙RiӦaŊ(--6>yI鍜Ɔh4 "'`4i 3f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cg6;]9@fo>'.]_vM;&//O剳gϊ#G^{qswl|r|Z[bȑϋÇ?+c;pwmx0Qr޸qXlYeQQQbΝ"%%EL2Cۺuž}`ϟB UUUB!&gQQ JJJm"77<<B\rE(JaXB䈰.c}&񼘘v}:fϞ-RSS%Ǧ+G'NB,N>h+***JI-ƱZ9bږ,Y"6o_xKvXԸuglڵmm6qU^_[Eߋakϫk߻Kü;l\t &<Xh233F8 h4mR}\.`p;L&Jr|L&9n^P(jk;9^ERc JӧO#^aÆ9U~՜1vm~;;37?oˤbt{l((ǤI/lRjq8pƥuIX|^@9pw|3,<(88&2 P՘5k222mMMMdB`ؾ};rrr{n<ɑll6wy %ݜ;Sjl\o> HKKCLL  |oZ^7^*AAA.zO>NyI鍜?~>ɸ pDFFb.3l6ƭ;cHJJ갼Պ̋?sp9X,6d>]Zӥu 5Xӝ^an1F#:i{TT&N؇y'soAF9ѣyhk?ގq[,b#. 44v??>Ƴ<-=# @%Kƒ%w|}\p#9q[DԥP,XaxOl n ʕ3rLO23nëIѠb-DDDD4h&"""A0 Z,hb1LDDDD3L yO@DRSS|rO-ɰX,_HMM0Q@|| .cmӧOg!LfMS3LDDDDa""""X Ѡ !q:ۡIENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__sysif.html0000644000175000017500000002074411331020526022202 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: dessert_sysif Struct Reference

dessert_sysif Struct Reference
[G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S]

A tun/tap interface used to inject packets to dessert implemented daemons. More...

#include <dessert.h>

Collaboration diagram for dessert_sysif:

Data Fields

struct dessert_sysifnext
 pointer to next interface
char if_name [IFNAMSIZ]
 name of interface
unsigned int if_index
 system ifindex
uint8_t hwaddr [ETHER_ADDR_LEN]
 hardware address of the interface
pthread_mutex_t cnt_mutex
 counter mutex
uint64_t ipkts
 packet counter in
uint64_t opkts
 packet counter out
uint64_t ibytes
 packet counter in
uint64_t obytes
 packet counter out
int fd
 file descriptor to read/write from/to
uint8_t flags
 if it is a tun or tap interface
pthread_t worker
 pthread running the request loop

Detailed Description

A tun/tap interface used to inject packets to dessert implemented daemons.

Note:
Please make sure first fields are equal to dessert_meshif to re-use _dessert_meshif_gethwaddr().

The documentation for this struct was generated from the following file:

Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__msg_ga173dd4e9ef2d63e5ef2413468415b518_icgraph.map0000644000175000017500000000153611331020526026176 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/group__mesh_gaa93f48da25750346bc75ed224874b389_icgraph.png0000644000175000017500000001104611331020526026275 0ustar dvddvdPNG  IHDR(]<4bKGDIDATxyT03P,LMrAE,T qD ôJci*Ӣ@\p +@EP"bQd@Y| sasf<|}E}}}=$I$$I"9J$IV$I@ ::3㐤#Gr}: %&&c0$$ZuC>vBppP>T_`~mƍ'z$I0fS`DFF: IT 9XI$I29J$IV$I@$Idr$I$#$I$أGno[׮]37DEEtBTbUUUDEEw~~>{5ehĐd0J/_n:7W\aʕɷ~k$ ~3Vj*.]d0aÆ &}|r233Q*Z!ڿR#wNN;w4Y\KlYSa0;va0{.q` һk:7Η_~W]tWL'%%QYYi0n;L2÷U*bZoiKyyÐn>2Ǵinł xxgؿ믿&00dzh"Tβ2^{5~gx(++#,,ah42e _ɓp^{!((é߿'ƸGpp0\7n7seVXAbb"gƌ7ɓ'yV ks]xǙ4iv E5yoXXiii-uiBCC?~<3gѣ@+ u뻊^ΧBNN ]Wgڼy3};$00ɇٳg;О;9::baa1ckS: cƍ1x` ">>^CII DDDгgOٰa*ѣ6o^_}{ʊYfi?}rn;22 ȦM۷/*=zjժVq/2666899b oYPPGdȐ!XXXJLLLrIGdYr%g׮] :믿/{aDDDlje͚5`iiw} ,Y[[ٳg9rDDD`kkFa<8u7̚5>;;;oSO=7/hؠӉdÆ sis#%%3gΰqF=JrroD,X#/2TUU΋/޽{yX~=eee¸5M_ J%۶m>`ӦM:t777[*--eɒ%P),,dż; ?~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4qqqĈLm!_7{"oO&:899%5g.]$fSȶMk)ۅJhLm!ۿ㜝hhHI%?_acj5: ɶhkkkL ͭnnZ7od[߿^Ē$I+I$IF XI$I29J$IV$I@$Idr$I$#vٲe,[b$6ETTÐ.A;;IW9r$w[bb"999CLW+I$I9XI$I29J$IV$IT`1^?aIENDB`libdessert0.87-0.87.2/doxygen/html/structdessert__periodic__coll__graph.map0000644000175000017500000000003511331020526025133 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/functions_vars.html0000644000175000017500000003226511331020526020754 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields - Variables
 

- b -

- c -

- d -

- f -

- g -

- h -

- i -

- l -

- m -

- n -

- o -

- p -

- s -

- t -

- u -

- v -

- w -


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/doxygen/html/group__sys_ga3e9b0a0ce49597c62e519f1721225803_icgraph.md50000644000175000017500000000004011331020526025753 0ustar dvddvdbcc48e09ac59653f4e3f6d36dad70446libdessert0.87-0.87.2/doxygen/html/group__msg_ga8863aa26b4d7a7ea1fc3e93ce29d97ab_icgraph.map0000644000175000017500000000074211331020526026554 0ustar dvddvd libdessert0.87-0.87.2/doxygen/html/globals_defs.html0000644000175000017500000002776311331020526020344 0ustar dvddvd DES-SERT - A Simple and Extensible Routing Framework for Testbeds: Data Fields
 

- _ -

- d -

- m -

- t -


Generated by  doxygen 1.6.2
libdessert0.87-0.87.2/DESSERT-MIB.txt0000644000175000017500000005032411331020526014655 0ustar dvddvd-- ----------------------------------------------------------------------------- -- Copyright 2009, David Gutzmann, Freie Universitaet Berlin (FUB). -- All rights reserved. -- -- These sources were originally developed by David Gutzmann -- at Freie Universitaet Berlin (http://www.fu-berlin.de/), -- Computer Systems and Telematics / Distributed, Embedded Systems (DES) group -- (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) -- ----------------------------------------------------------------------------- -- 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 3 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/ . -- ----------------------------------------------------------------------------- -- For further information and questions please use the web site -- http://www.des-testbed.net/ -- ----------------------------------------------------------------------------- DESSERT-MIB DEFINITIONS ::= BEGIN IMPORTS DisplayString, MacAddress, TruthValue, TEXTUAL-CONVENTION FROM SNMPv2-TC MODULE-IDENTITY, OBJECT-TYPE, Counter64, Integer32, Unsigned32, enterprises FROM SNMPv2-SMI OBJECT-GROUP, MODULE-COMPLIANCE FROM SNMPv2-CONF; dessertMIB MODULE-IDENTITY LAST-UPDATED "200911191000Z" ORGANIZATION "Freie Universitaet Berlin (http://www.fu-berlin.de/)" CONTACT-INFO "Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/) For further information and questions please use the web site http://www.des-testbed.net/" DESCRIPTION "Some pre-release cleanup." REVISION "200911191000Z" DESCRIPTION "Added DessertMeshifEntry type assignment." REVISION "200910121300Z" DESCRIPTION "Moved the module-identity to the sub-pen assigned by the Rechnerbetrieb at IMP/FUB." REVISION "200910121200Z" DESCRIPTION "Added dessertAppStatsTable and desserAppParamsTable and related *Entry types." REVISION "200909181427Z" DESCRIPTION "Added Copyright information." REVISION "200909181400Z" DESCRIPTION "Added DessertSysifEntry type and dessertSysifTable." REVISION "200908271542Z" DESCRIPTION "Added contact information." REVISION "200908271437Z" DESCRIPTION "Added DessertMeshifEntry type assignment." ::= { enterprises 18898 0 19 10 1 } -- ######################################################## -- ## TEXTUAL CONVENTIONS ## -- ######################################################## InterfaceIndex ::= TEXTUAL-CONVENTION DISPLAY-HINT "d" STATUS current DESCRIPTION "A unique value for each mesh interface present in the managed system." SYNTAX Integer32 (0..255) DessertAppStatsIndex ::= TEXTUAL-CONVENTION DISPLAY-HINT "d" STATUS current DESCRIPTION "A unique value for each statistical datum provided by the managed application." SYNTAX Integer32 (0..255) DessertAppParamsIndex ::= TEXTUAL-CONVENTION DISPLAY-HINT "d" STATUS current DESCRIPTION "A unique value for each parameter provided by the managed application." SYNTAX Integer32 (0..255) DessertApplicationOctetString ::= TEXTUAL-CONVENTION DISPLAY-HINT "1024a" STATUS current DESCRIPTION "A octet string provided by the application." SYNTAX OCTET STRING (SIZE(0..1024)) DessertAppValueType ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION "The AppValueType textual convention is used to determine which of the columns in the dessertAppStatsTable or dessertAppParamsTable is actually valid." SYNTAX INTEGER { bool(0), -- TruthValue // INTEGER { true(1), false(2) } int32(1), -- Integer32 uint32(2), -- Unsigned32 counter64(3), -- Counter64 // only valid for AppStatsTable octetstring(4) -- DessertApplicationOctetString -- OCTET STRING (SIZE(0..1024)) } DessertAppNodeOrLink ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION "The AppNodeOrLink textual convention is used to determine which of the appStatsMacAddress{1,2} columns is valid." SYNTAX INTEGER { none(0), -- neither appStatsMacAddress1 nor -- appStatsMacAddress2 is valid node(1), -- only appStatsMacAddress1 is valid link(2) -- only appStatsMacAddress2 is valid } -- ######################################################## -- ## OBJECTS ## -- ######################################################## dessertNotifications OBJECT IDENTIFIER ::= { dessertMIB 0 } dessertObjects OBJECT IDENTIFIER ::= { dessertMIB 1 } dessertConformance OBJECT IDENTIFIER ::= { dessertMIB 2 } dessertStats OBJECT IDENTIFIER ::= { dessertObjects 1 } dessertConfig OBJECT IDENTIFIER ::= { dessertObjects 2 } dessertGeneralInformation OBJECT IDENTIFIER ::= { dessertObjects 3 } dessertMeshifNumber OBJECT-TYPE SYNTAX Integer32 (0..256) MAX-ACCESS read-only STATUS current DESCRIPTION "The number of mesh interfaces present on this system." ::= { dessertObjects 4 } dessertMeshifTable OBJECT-TYPE SYNTAX SEQUENCE OF DessertMeshifEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A list of interface entries. The number of entries is given by the value of dessertMeshifNumber." ::= { dessertObjects 5 } dessertSysifNumber OBJECT-TYPE SYNTAX Integer32 (0..256) MAX-ACCESS read-only STATUS current DESCRIPTION "The number of system (tun/tap) interfaces present on this system." ::= { dessertObjects 6 } dessertSysifTable OBJECT-TYPE SYNTAX SEQUENCE OF DessertSysifEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A list of interface entries. The number of entries is given by the value of dessertSysifNumber." ::= { dessertObjects 7} dessertAppStatsTable OBJECT-TYPE SYNTAX SEQUENCE OF DessertAppStatsEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Application provided statistics. The number of entries is given by the value of dessertAppStatsNumber." ::= { dessertObjects 8} dessertAppParamsTable OBJECT-TYPE SYNTAX SEQUENCE OF DessertAppParamsEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Application provided parameters. The number of entries is given by the value of dessertAppParamsNumber." ::= { dessertObjects 9} dessertCompliances OBJECT IDENTIFIER ::= { dessertConformance 1 } dessertGroups OBJECT IDENTIFIER ::= { dessertConformance 2 } -- ######################################################## -- ## GENERAL INFORMATION ## -- ######################################################## applicationVersion OBJECT-TYPE SYNTAX Integer32 (0..255) MAX-ACCESS read-only STATUS current DESCRIPTION "version of the app as passed to dessert_init()" ::= { dessertGeneralInformation 2 } protocollShortName OBJECT-TYPE SYNTAX OCTET STRING (SIZE (0..4)) MAX-ACCESS read-only STATUS current DESCRIPTION "short name of the protocol as passed to dessert_init()" ::= { dessertGeneralInformation 3 } -- ######################################################## -- ## MESH INTERFACES ## -- ######################################################## meshifIndex OBJECT-TYPE SYNTAX InterfaceIndex MAX-ACCESS not-accessible STATUS current DESCRIPTION "system ifindex" ::= { dessertMeshifEntry 1 } meshifName OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "name of interface" ::= { dessertMeshifEntry 2 } meshifMacAddress OBJECT-TYPE SYNTAX MacAddress MAX-ACCESS read-only STATUS current DESCRIPTION "hardware address of interface" ::= { dessertMeshifEntry 3 } meshifInPkts OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "packet counter in" ::= { dessertMeshifEntry 4 } meshifOutPkts OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "packet counter out" ::= { dessertMeshifEntry 5 } meshifInOctets OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "octet counter in" ::= { dessertMeshifEntry 6 } meshifOutOctets OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "octet counter out" ::= { dessertMeshifEntry 7 } dessertMeshifEntry OBJECT-TYPE SYNTAX DessertMeshifEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry containing management information applicable to a particular mesh interface." INDEX { meshifIndex } ::= { dessertMeshifTable 1 } DessertMeshifEntry ::= SEQUENCE { meshifIndex InterfaceIndex, meshifName DisplayString, meshifMacAddress MacAddress, meshifInPkts Counter64, meshifOutPkts Counter64, meshifInOctets Counter64, meshifOutOctets Counter64 } -- ######################################################## -- ## SYSTEM (TUN/TAP) INTERFACES ## -- ######################################################## sysifIndex OBJECT-TYPE SYNTAX InterfaceIndex MAX-ACCESS not-accessible STATUS current DESCRIPTION "system ifindex" ::= { dessertSysifEntry 1 } sysifName OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "name of interface" ::= { dessertSysifEntry 2 } sysifMacAddress OBJECT-TYPE SYNTAX MacAddress MAX-ACCESS read-only STATUS current DESCRIPTION "hardware address of interface" ::= { dessertSysifEntry 3 } sysifInPkts OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "packet counter in" ::= { dessertSysifEntry 4 } sysifOutPkts OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "packet counter out" ::= { dessertSysifEntry 5 } sysifInOctets OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "octet counter in" ::= { dessertSysifEntry 6 } sysifOutOctets OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "octet counter out" ::= { dessertSysifEntry 7 } dessertSysifEntry OBJECT-TYPE SYNTAX DessertSysifEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry containing management information applicable to a particular system (tun/tap) interface." INDEX { sysifIndex } ::= { dessertSysifTable 1 } DessertSysifEntry ::= SEQUENCE { sysifIndex InterfaceIndex, sysifName DisplayString, sysifMacAddress MacAddress, sysifInPkts Counter64, sysifOutPkts Counter64, sysifInOctets Counter64, sysifOutOctets Counter64 } -- ######################################################## -- ## APPLICATION STATISTICS ## -- ######################################################## appStatsIndex OBJECT-TYPE SYNTAX DessertAppStatsIndex MAX-ACCESS not-accessible STATUS current DESCRIPTION "Index of the statistical datum" ::= { dessertAppStatsEntry 1 } appStatsName OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The name of the statistical datum" ::= { dessertAppStatsEntry 2 } appStatsDesc OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "A short description of the statistical datum" ::= { dessertAppStatsEntry 3 } appStatsNodeOrLink OBJECT-TYPE SYNTAX DessertAppNodeOrLink MAX-ACCESS read-only STATUS current DESCRIPTION "Determines which of the appStatsMacAddress{1,2} columns is valid and therefore indicates whether the information provided by this row relates to a node or a link. " ::= { dessertAppStatsEntry 4 } appStatsValueType OBJECT-TYPE SYNTAX DessertAppValueType MAX-ACCESS read-only STATUS current DESCRIPTION "Indicates which of the columns (appStatsTruthValue, appStatsInterger32, appStatsUInteger32, appStatsCounter64, appStatsOctetString) in the dessertAppStatsTable is actually valid." ::= { dessertAppStatsEntry 5 } appStatsMacAddress1 OBJECT-TYPE SYNTAX MacAddress MAX-ACCESS read-only STATUS current DESCRIPTION "The hardware address of a node." ::= { dessertAppStatsEntry 6 } appStatsMacAddress2 OBJECT-TYPE SYNTAX MacAddress MAX-ACCESS read-only STATUS current DESCRIPTION "The hardware address of a second node." ::= { dessertAppStatsEntry 7 } appStatsTruthValue OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current DESCRIPTION "A statistical datum with TruthValue semantics." ::= { dessertAppStatsEntry 8 } appStatsInteger32 OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only STATUS current DESCRIPTION "A statistical datum with Integer32 semantics." ::= { dessertAppStatsEntry 9 } appStatsUnsigned32 OBJECT-TYPE SYNTAX Unsigned32 MAX-ACCESS read-only STATUS current DESCRIPTION "A statistical datum with Unsigned32 semantics." ::= { dessertAppStatsEntry 10 } appStatsCounter64 OBJECT-TYPE SYNTAX Counter64 MAX-ACCESS read-only STATUS current DESCRIPTION "A statistical datum with Counter64 semantics." ::= { dessertAppStatsEntry 11 } appStatsOctetString OBJECT-TYPE SYNTAX DessertApplicationOctetString MAX-ACCESS read-only STATUS current DESCRIPTION "A statistical datum containing of up to 1024 octets." ::= { dessertAppStatsEntry 12 } dessertAppStatsEntry OBJECT-TYPE SYNTAX DessertAppStatsEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry containing a single application provided statistical datum." INDEX { appStatsIndex } ::= { dessertAppStatsTable 1 } DessertAppStatsEntry ::= SEQUENCE { appStatsIndex DessertAppStatsIndex, appStatsName DisplayString, appStatsDesc DisplayString, appStatsNodeOrLink DessertAppNodeOrLink, appStatsValueType DessertAppValueType, appStatsMacAddress1 MacAddress, appStatsMacAddress2 MacAddress, appStatsTruthValue TruthValue, appStatsInteger32 Integer32, appStatsUnsigned32 Unsigned32, appStatsCounter64 Counter64, appStatsOctetString DessertApplicationOctetString } -- ######################################################## -- ## APPLICATION PARAMETERS ## -- ######################################################## appParamsIndex OBJECT-TYPE SYNTAX DessertAppParamsIndex MAX-ACCESS not-accessible STATUS current DESCRIPTION "Index of the parameter." ::= { dessertAppParamsEntry 1 } appParamsName OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The name of the parameter." ::= { dessertAppParamsEntry 2 } appParamsDesc OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "A short description of the parameter" ::= { dessertAppParamsEntry 3 } appParamsValueType OBJECT-TYPE SYNTAX DessertAppValueType MAX-ACCESS read-only STATUS current DESCRIPTION "Indicates which of the columns (appParamsTruthValue, appParamsInterger32, appParamsUInteger32, appParamsOctetString) in the dessertAppParamsTable is actually valid." ::= { dessertAppParamsEntry 4 } appParamsTruthValue OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-write STATUS current DESCRIPTION "A parameter with TruthValue semantics." ::= { dessertAppParamsEntry 5 } appParamsInteger32 OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-write STATUS current DESCRIPTION "A parameter with Integer32 semantics." ::= { dessertAppParamsEntry 6 } appParamsUnsigned32 OBJECT-TYPE SYNTAX Unsigned32 MAX-ACCESS read-write STATUS current DESCRIPTION "A parameter with Unsigned32 semantics." ::= { dessertAppParamsEntry 7 } appParamsOctetString OBJECT-TYPE SYNTAX DessertApplicationOctetString MAX-ACCESS read-write STATUS current DESCRIPTION "A parameter containing of up to 1024 octets." ::= { dessertAppParamsEntry 9 } dessertAppParamsEntry OBJECT-TYPE SYNTAX DessertAppParamsEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry containing a single application provided parameter." INDEX { appParamsIndex } ::= { dessertAppParamsTable 1 } DessertAppParamsEntry ::= SEQUENCE { appParamsIndex DessertAppParamsIndex, appParamsName DisplayString, appParamsDesc DisplayString, appParamsValueType DessertAppValueType, appParamsTruthValue TruthValue, appParamsInteger32 Integer32, appParamsUnsigned32 Unsigned32, appParamsOctetString DessertApplicationOctetString } -- ######################################################## -- ## GROUPS ## -- ######################################################## dessertGeneralInformationGroup OBJECT-GROUP OBJECTS { applicationVersion, protocollShortName, dessertMeshifNumber, dessertSysifNumber } STATUS current DESCRIPTION "General Information Group" ::= { dessertGroups 1 } dessertMeshifGroup OBJECT-GROUP OBJECTS { meshifName, meshifMacAddress, meshifInPkts, meshifOutPkts, meshifInOctets, meshifOutOctets } STATUS current DESCRIPTION "meshif Group" ::= { dessertGroups 2 } dessertSysifGroup OBJECT-GROUP OBJECTS { sysifName, sysifMacAddress, sysifInPkts, sysifOutPkts, sysifInOctets, sysifOutOctets } STATUS current DESCRIPTION "sysif Group" ::= { dessertGroups 3 } dessertAppStatGroup OBJECT-GROUP OBJECTS { appStatsName, appStatsDesc, appStatsNodeOrLink, appStatsValueType, appStatsMacAddress1, appStatsMacAddress2, appStatsTruthValue, appStatsInteger32, appStatsUnsigned32, appStatsCounter64, appStatsOctetString } STATUS current DESCRIPTION "appStats Group" ::= { dessertGroups 4 } dessertAppParamsGroup OBJECT-GROUP OBJECTS { appParamsName, appParamsDesc, appParamsValueType, appParamsTruthValue, appParamsInteger32, appParamsUnsigned32, appParamsOctetString } STATUS current DESCRIPTION "appParams Group" ::= { dessertGroups 5 } dessertCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The following groups have to be implemented to be in compliance with this MIB." MODULE MANDATORY-GROUPS { dessertGeneralInformationGroup, dessertMeshifGroup, dessertSysifGroup, dessertAppStatGroup, dessertAppParamsGroup } ::= { dessertCompliances 1} END libdessert0.87-0.87.2/dessert_sysiface.c0000644000175000017500000003467111331020526016110 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" #ifdef TARGET_DARWIN #define TUNSIFHEAD _IOW('t', 96, int) #define TUNGIFHEAD _IOR('t', 97, int) #endif #ifdef TARGET_FREEBSD #include #endif #ifdef TARGET_LINUX #include #endif uint8_t dessert_sysif_hwaddr[ETHER_ADDR_LEN]; // TODO unused! to be removed ??!? /* global data storage // P U B L I C */ /* nothing here - yet */ /* global data storage // P R I V A T E */ dessert_sysif_t *_dessert_sysif = NULL; /* local data storage*/ dessert_sysrxcbe_t *_dessert_sysrxcblist = NULL; int _dessert_sysrxcblistver = 0; /* internal functions forward declarations*/ static void *_dessert_sysif_init_thread(void* arg); static int _dessert_sysif_init_getmachack(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id); /****************************************************************************** * * EXTERNAL / PUBLIC * * S Y S - I N T E R F A C E S * ******************************************************************************/ /** Initializes the tun/tap Interface dev for des-sert. * @arg *device interface name * @arg flags @see DESSERT_TUN @see DESSERT_TAP @see DESSERT_MAKE_DEFSRC * @return 0 -- on success * @return EINVAL -- if message is broken * @return EFAULT -- if interface not specified and not guessed **/ int dessert_sysif_init(char* device, uint8_t flags) { char *buf; #ifdef TARGET_LINUX struct ifreq ifr; #endif /* initialize _dessert_sysif */ _dessert_sysif = malloc(sizeof(dessert_sysif_t)); if (_dessert_sysif == NULL) return (-errno); memset((void *) _dessert_sysif, 0, sizeof(dessert_sysif_t)); _dessert_sysif->flags = flags; strncpy(_dessert_sysif->if_name, device, IF_NAMESIZE); _dessert_sysif->if_name[IF_NAMESIZE - 1] = '\0'; pthread_mutex_init(&(_dessert_sysif->cnt_mutex), NULL); #ifdef TARGET_BSD /* open device */ buf = malloc(IF_NAMESIZE+6); snprintf(buf, IF_NAMESIZE+6, "/dev/%s", device); _dessert_sysif->fd = open(buf, O_RDWR); if(_dessert_sysif->fd < 0) { dessert_err("could not open interface %s using %s: %s", device, buf, strerror(errno)); free(buf); return (-errno); } free(buf); /* set header mode on for mode tun */ if(flags & DESSERT_TUN) { const int one = 1; if(ioctl(_dessert_sysif->fd, TUNSIFHEAD, &one, sizeof one) == -1) { dessert_err("setting TUNSIFHEAD failed: %s",strerror(errno)); goto dessert_sysif_init_err; return (-errno); } } #elif TARGET_LINUX /* open device */ buf = "/dev/net/tun"; _dessert_sysif->fd = open(buf, O_RDWR); memset(&ifr, 0, sizeof(ifr)); if (flags & DESSERT_TUN) { ifr.ifr_flags = IFF_TUN; /* we want the service flag - no IFF_NO_PI */ } else { ifr.ifr_flags = IFF_TAP | IFF_NO_PI; /* we want the service flag and IFF_NO_PI */ } strcpy(ifr.ifr_name, _dessert_sysif->if_name); if (ioctl(_dessert_sysif->fd, TUNSETIFF, (void *) &ifr) < 0) { dessert_err("ioctl(TUNSETIFF) failed: %s", strerror(errno)); goto dessert_sysif_init_err; return (-errno); } strcpy(_dessert_sysif->if_name, ifr.ifr_name); #else goto not_implemented; #endif /* check interface - abusing dessert_meshif methods */ _dessert_sysif->if_index = if_nametoindex(device); if (!_dessert_sysif->if_index) { dessert_err("interface %s - no such interface", _dessert_sysif->if_name); goto dessert_sysif_init_err; } /* do ifconfig to set the interface up - strange things happen otherwise */ buf = malloc(IF_NAMESIZE + 16); snprintf(buf, IF_NAMESIZE + 15, "ifconfig %s up", _dessert_sysif->if_name); system(buf); free(buf); /* get hardware address in tap mode if possible */ if (flags & DESSERT_TAP) { if (_dessert_meshif_gethwaddr((dessert_meshif_t *) _dessert_sysif) != 0) { dessert_err("failed to get hwaddr of interface %s(%d) - hope src of first packet received from is it", _dessert_sysif->if_name, _dessert_sysif->if_index, _dessert_sysif); _dessert_sysif->flags |= _DESSERT_TAP_NOMAC; dessert_sysrxcb_add(_dessert_sysif_init_getmachack, 0); } else { /* check whether we need to set defsrc */ if ((flags & DESSERT_MAKE_DEFSRC) || memcmp(dessert_l25_defsrc, ether_null, ETHER_ADDR_LEN) == 0) { memcpy(dessert_l25_defsrc, _dessert_sysif->hwaddr, ETHER_ADDR_LEN); dessert_info("set dessert_l25_defsrc to hwaddr %02x:%02x:%02x:%02x:%02x:%02x", dessert_l25_defsrc[0], dessert_l25_defsrc[1],dessert_l25_defsrc[2], dessert_l25_defsrc[3], dessert_l25_defsrc[4], dessert_l25_defsrc[5]); } } } /* info message */ if (flags & DESSERT_TAP) { dessert_info("starting worker thread for tap interface %s(%d) hwaddr %02x:%02x:%02x:%02x:%02x:%02x", _dessert_sysif->if_name, _dessert_sysif->if_index, _dessert_sysif->hwaddr[0], _dessert_sysif->hwaddr[1], _dessert_sysif->hwaddr[2], _dessert_sysif->hwaddr[3], _dessert_sysif->hwaddr[4], _dessert_sysif->hwaddr[5]); } else { dessert_info("starting worker thread for tap interface %s(%d) fd %d", _dessert_sysif->if_name, _dessert_sysif->if_index, _dessert_sysif->fd); } /* start worker thread */ if (pthread_create(&(_dessert_sysif->worker), NULL, _dessert_sysif_init_thread, (void *) _dessert_sysif)) { dessert_err("creating worker thread failed for interface %s(%d)", _dessert_sysif->if_name, _dessert_sysif->if_index); goto dessert_sysif_init_err; } /* done */ return (DESSERT_OK); dessert_sysif_init_err: close(_dessert_sysif->fd); return (-errno); } /** adds a callback function to call if a packet should be injected into dessert via a tun/tap interface * @arg *c callback function * @arg prio priority of the function - lower first! * @return DESSERT_OK on success * @return -errno on error **/ int dessert_sysrxcb_add(dessert_sysrxcb_t* c, int prio) { dessert_sysrxcbe_t *cb, *i; cb = (struct dessert_sysrxcbe*) malloc(sizeof(struct dessert_sysrxcbe)); if (cb == NULL) { dessert_err("failed to allocate memory for registering sys callback: %s", strerror(errno)); return (-errno); } if (c == NULL) { dessert_err("tried to add a null pointer as dessert_sysrxcb"); return (-EINVAL); } pthread_rwlock_wrlock(&dessert_cfglock); cb->c = c; cb->prio = prio; cb->next = NULL; if (_dessert_sysrxcblist == NULL) { _dessert_sysrxcblist = cb; _dessert_sysrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_OK; } if (_dessert_sysrxcblist->prio > cb->prio) { cb->next = _dessert_sysrxcblist; _dessert_sysrxcblist = cb; _dessert_sysrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_OK; } /* find right place for callback */ for (i = _dessert_sysrxcblist; i->next != NULL && i->next->prio <= cb->prio; i = i->next) ; /* insert it */ cb->next = i->next; i->next = cb; _dessert_sysrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_OK; } /** removes all occurrences of the callback function from the list of callbacks. * @arg c callback function * @return DESSERT_OK on success, DESSERT_ERR on error **/ int dessert_sysrxcb_del(dessert_sysrxcb_t* c) { int count = 0; dessert_sysrxcbe_t *i, *last; pthread_rwlock_wrlock(&dessert_cfglock); if (_dessert_sysrxcblist == NULL) { goto dessert_sysrxcb_del_out; } while (_dessert_sysrxcblist->c == c) { count++; i = _dessert_sysrxcblist; _dessert_sysrxcblist = _dessert_sysrxcblist->next; free(i); if (_dessert_sysrxcblist == NULL) { goto dessert_sysrxcb_del_out; } } for (i = _dessert_sysrxcblist; i->next != NULL; i = i->next) { if (i->c == c) { count++; last->next = i->next; free(i); i = last; } last = i; } dessert_sysrxcb_del_out: _dessert_sysrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return ((count > 0) ? DESSERT_OK : DESSERT_ERR); } /** sends a packet via tun/tap interface to the kernel * @arg *msg message to send * @return DESSERT_OK on success * @return -EIO if message failed to be sent **/ int dessert_syssend_msg(dessert_msg_t *msg) { struct ether_header *eth; size_t eth_len; eth_len = dessert_msg_ethdecap(msg, ð); if (eth_len == -1) { return (-EIO); } dessert_syssend(eth, eth_len); free(eth); return DESSERT_OK; } /** sends a packet via tun/tap interface to the kernel * @arg *eth message to send * @arg len length of message to send * @return DESSERT_OK on success * @return -EIO if message failed to be sent **/ int dessert_syssend(const struct ether_header *eth, size_t len) { ssize_t res = 0; if (_dessert_sysif == NULL) return (-EIO); if (_dessert_sysif->flags & DESSERT_TUN) { eth = (struct ether_header *) (((uint8_t *) eth) + (ETHER_ADDR_LEN * 2)); len -= (ETHER_ADDR_LEN * 2); } res = write(_dessert_sysif->fd, (const void *) eth, len); if (res == len) { pthread_mutex_lock(&(_dessert_sysif->cnt_mutex)); _dessert_sysif->opkts++; _dessert_sysif->obytes += res; pthread_mutex_unlock(&(_dessert_sysif->cnt_mutex)); return (DESSERT_OK); } else { return (-EIO); } } /****************************************************************************** * * INTERNAL / PRIVATE * * S Y S - I N T E R F A C E S * ******************************************************************************/ /* nothing here - yet */ /****************************************************************************** * * LOCAL * * S Y S - I N T E R F A C E S * ******************************************************************************/ /** internal callback which gets registered if we can't find out mac address of tap interface */ static int _dessert_sysif_init_getmachack(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id) { struct ether_header *eth; dessert_msg_ethdecap(msg, ð); /* hack to get the hardware address */ if (sysif->flags & _DESSERT_TAP_NOMAC) { /* copy from first packet received */ memcpy(sysif->hwaddr, eth->ether_shost, ETHER_ADDR_LEN); dessert_info("guessed hwaddr for %s: %02x:%02x:%02x:%02x:%02x:%02x", sysif->if_name, sysif->hwaddr[0], sysif->hwaddr[1], sysif->hwaddr[2], sysif->hwaddr[3], sysif->hwaddr[4], sysif->hwaddr[5]); /* check whether we need to set defsrc */ if ((sysif->flags & DESSERT_MAKE_DEFSRC) || memcmp(dessert_l25_defsrc, ether_null, ETHER_ADDR_LEN) == 0) { memcpy(dessert_l25_defsrc, sysif->hwaddr, ETHER_ADDR_LEN); dessert_info("set dessert_l25_defsrc to hwaddr %02x:%02x:%02x:%02x:%02x:%02x", dessert_l25_defsrc[0], dessert_l25_defsrc[1],dessert_l25_defsrc[2], dessert_l25_defsrc[3], dessert_l25_defsrc[4], dessert_l25_defsrc[5]); } sysif->flags &= ~_DESSERT_TAP_NOMAC; } /* unregister me */ dessert_sysrxcb_del(_dessert_sysif_init_getmachack); return DESSERT_MSG_KEEP; } /** internal packet processing thread body */ static void *_dessert_sysif_init_thread(void* arg) { dessert_sysif_t *sysif = (dessert_sysif_t *) arg; size_t len; size_t buflen = ETHER_MAX_LEN; char buf[buflen]; dessert_msg_proc_t proc; dessert_frameid_t id; dessert_sysrxcbe_t *cb; int res; int ex = 0; dessert_sysrxcb_t **cbl = NULL; int cbllen = 0; int cblcur = -1; int cblver = -1; while (!ex) { memset(buf, 0, buflen); if (sysif->flags & DESSERT_TUN) { #ifdef TARGET_LINUX len = read((sysif->fd), buf + (ETHER_ADDR_LEN * 2)-2, buflen - (ETHER_ADDR_LEN * 2)-2); #else len = read((sysif->fd), buf + (ETHER_ADDR_LEN * 2), buflen - (ETHER_ADDR_LEN * 2)); #endif } else { len = read((sysif->fd), buf, buflen); } if (len == -1) { dessert_debug("got %s while reading on %s (fd %d) - is the sys (tun/tap) interface up?", strerror(errno), sysif->if_name, sysif->fd); sleep(1); continue; } if (sysif->flags & DESSERT_TUN) { len += (ETHER_ADDR_LEN * 2); } /* copy callbacks to internal list to release dessert_cfglock before invoking callbacks*/ pthread_rwlock_rdlock(&dessert_cfglock); if (cblver < _dessert_sysrxcblistver) { /* callback list changed - rebuild it */ cbllen = 0; for (cb = _dessert_sysrxcblist; cb != NULL; cb = cb->next) cbllen++; cbl = realloc(cbl, cbllen * sizeof(dessert_sysrxcb_t *)); if (cbl == NULL && cbllen > 0) { dessert_err("failed to allocate memory for internal callback list"); pthread_rwlock_unlock(&dessert_cfglock); return (NULL); } cblcur = 0; for (cb = _dessert_sysrxcblist; cb != NULL; cb = cb->next) cbl[cblcur++] = cb->c; cblver = _dessert_sysrxcblistver; } pthread_rwlock_unlock(&dessert_cfglock); /* generate frame id */ id = _dessert_newframeid(); /* count packet */ pthread_mutex_lock(&(sysif->cnt_mutex)); sysif->ipkts++; sysif->ibytes += len; pthread_mutex_unlock(&(sysif->cnt_mutex)); /* call the interested */ res = 0; cblcur = 0; memset(&proc, 0, DESSERT_MSGPROCLEN); dessert_msg_t *msg = NULL; while (res > DESSERT_MSG_DROP && cblcur < cbllen) { if (dessert_msg_ethencap((struct ether_header *) buf, len, &msg) < 0) { dessert_err("failed to encapsulate ethernet frame on host-to-network-pipeline: %s", errno); }; res = cbl[cblcur++](msg, len, &proc, sysif, id); } if (msg != NULL) dessert_msg_destroy(msg); } dessert_info("stopped reading on %s (fd %d): %s", sysif->if_name, sysif->fd, strerror(errno)); free(cbl); close(sysif->fd); return (NULL); } libdessert0.87-0.87.2/dessert_internal.h0000644000175000017500000001714411331020526016117 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #ifndef DESSERT_INTERNAL_H #define DESSERT_INTERNAL_H /* load needed libs - quite dirty */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "snmp/dessertObjects.h" #include "snmp/dessertMeshifTable.h" #include "snmp/dessertSysifTable.h" #include "snmp/dessertAppStatsTable.h" #include "snmp/dessertAppParamsTable.h" /****************************************************************************** * * INTERNAL / PRIVATE * * C O R E * ******************************************************************************/ /** flag for _dessert_status - program is daemon */ #define _DESSERT_STATUS_DAEMON 0x1 /** global status flag holder */ extern int _dessert_status; dessert_frameid_t _dessert_newframeid(void); int _dessert_cli_cmd_shutdown(struct cli_def *cli, char *command, char *argv[], int argc); /****************************************************************************** * * INTERNAL / PRIVATE * * C L I - C O M M A N D L I N E I N T E R F A C E * ******************************************************************************/ int _dessert_cli_init(void); /****************************************************************************** * * INTERNAL / PRIVATE * * L O G F A C I L I T Y * ******************************************************************************/ /** maximum size of a log line */ #define DESSERT_LOGLINE_MAX 1024 /** logfile file pointer to use with DESSERT_OPT_LOGFILE */ extern FILE *dessert_logfd; int _dessert_cli_cmd_logging(struct cli_def *cli, char *command, char *argv[], int argc); int _dessert_cli_logging_file(struct cli_def *cli, char *command, char *argv[], int argc); int _dessert_cli_no_logging_file(struct cli_def *cli, char *command, char *argv[], int argc); int _dessert_cli_logging_ringbuffer(struct cli_def *cli, char *command, char *argv[], int argc); int _dessert_cli_no_logging_ringbuffer(struct cli_def *cli, char *command, char *argv[], int argc); /****************************************************************************** * * INTERNAL / PRIVATE * * M E S H - I N T E R F A C E S * ******************************************************************************/ /** callback list entry for dessert mesh interface callbacks */ typedef struct dessert_meshrxcbe { /** pointer to callback to call */ dessert_meshrxcb_t *c; /** priority - lowest first */ int prio; /** next entry in list */ struct dessert_meshrxcbe *next; } dessert_meshrxcbe_t; int _dessert_meshif_gethwaddr(dessert_meshif_t *meshif); int _dessert_meshrxcb_runall(dessert_msg_t* msg_in, size_t len, dessert_msg_proc_t *proc_in, const dessert_meshif_t *meshif, dessert_frameid_t id); /****************************************************************************** * * INTERNAL / PRIVATE * * S Y S - I N T E R F A C E S * ******************************************************************************/ /** callback list entry for tun/tap callbacks */ typedef struct dessert_sysrxcbe { /** pointer to callback to call */ dessert_sysrxcb_t *c; /** priority - lowest first */ int prio; /** next entry in list */ struct dessert_sysrxcbe *next; } dessert_sysrxcbe_t; extern struct dessert_sysif *_dessert_sysif; /****************************************************************************** * * INTERNAL / PRIVATE * * M E S S A G E H A N D L I N G * ******************************************************************************/ /** size of a dessert_msg struct */ #define DESSERT_MSGLEN sizeof(struct dessert_msg) /** size of a dessert_msg_proc struct */ #define DESSERT_MSGPROCLEN sizeof(struct dessert_msg_proc) /** maximum frame size to assemble as dessert_msg */ #define DESSERT_MAXFRAMEBUFLEN DESSERT_MAXFRAMELEN /****************************************************************************** * * INTERNAL / PRIVATE * * P E R I O D I C T A S K S * ******************************************************************************/ void _dessert_periodic_init(void); /****************************************************************************** * * INTERNAL / PRIVATE * * NET - S N M P // A G E N T _ X * ******************************************************************************/ /****************************************************************************** * #defines ******************************************************************************/ #define AGENT "dessertAGENTX" #define DESSERT_AGENTX_SYSIFTABLE_CACHE_TIMEOUT 10 #define DESSERT_AGENTX_MESHIFTABLE_CACHE_TIMEOUT 10 #define DESSERT_AGENTX_APPSTATSTABLE_CACHE_TIMEOUT 10 #define DESSERT_AGENTX_APPPARAMTABLE_CACHE_TIMEOUT 1 /****************************************************************************** * globals ******************************************************************************/ extern pthread_rwlock_t _dessert_appstats_cblist_lock; extern dessert_agentx_appstats_cb_entry_t *_dessert_appstats_cblist; extern pthread_rwlock_t _dessert_appparams_cblist_lock; extern dessert_agentx_appparams_cb_entry_t *_dessert_appparams_cblist; /****************************************************************************** * functions ******************************************************************************/ int _dessert_agentx_appstats_harvest_callbacks(dessert_agentx_appstats_t **appstats_list); void _dessert_agentx_appstats_free(dessert_agentx_appstats_t *appstat); void _dessert_agentx_appstats_free_list(dessert_agentx_appstats_t **appstats_list); int _dessert_agentx_appparams_harvest_callbacks(dessert_agentx_appparams_t **appparams_list); void _dessert_agentx_appparams_free(dessert_agentx_appparams_t *appparam); void _dessert_agentx_appparams_free_list(dessert_agentx_appparams_t **appparams_list); dessert_agentx_appparamscb_set_t *_dessert_agentx_appparams_getsettercbforindex(int index); void _dessert_agentx_init_subagent(void); void dessert_agentx_stop_subagent(void); #endif /* DESSERT_INTERNAL_H */ libdessert0.87-0.87.2/Makefile0000644000175000017500000001523611331020526014041 0ustar dvddvdSHLIB_VERSION = 0.87.2 SHLIB_COMPAT_VERSION = 0.87 MODULES=dessert_core.o dessert_log.o dessert_sysiface.o dessert_meshiface.o dessert_msg.o dessert_cli.o dessert_periodic.o dessert_agentx.o UNAME = $(shell uname | tr 'a-z' 'A-Z') TARFILES = *.c *.h Makefile Intro.txt DES-SERT.doxyfile AUTHORS DESSERT-MIB.txt PREFIX ?= $(DESTDIR)/usr DIR_LIB=$(PREFIX)/lib DIR_INCLUDE=$(PREFIX)/include DIR_SHARE=$(PREFIX)/share DIR_MIBS=$(DIR_SHARE)/mibs ifeq ($(UNAME),LINUX) LIBS = pthread pcap cli CFLAGS += -ggdb -Wall -fPIC -DTARGET_$(UNAME) -D_GNU_SOURCE -DSHLIB_VERSION=\"$(SHLIB_VERSION)\" LDFLAGS += -dy -static-libgcc $(addprefix -l,$(LIBS)) SHLIB = libdessert.so.$(SHLIB_VERSION) SHLIB_COMPAT = libdessert.so.$(SHLIB_COMPAT_VERSION) SHLIB_DEFAULT = libdessert.so SHLIB_LDFLAGS = -shared -Wl,-soname,$(SHLIB_COMPAT) -o $(SHLIB) else ifeq ($(UNAME),DARWIN) LIBS = pthread pcap cli CFLAGS += -ggdb -Wall -fPIC -DTARGET_$(UNAME) -DTARGET_BSD -DSHLIB_VERSION=\"$(SHLIB_VERSION)\" LDFLAGS += $(addprefix -l,$(LIBS)) SHLIB = libdessert.$(SHLIB_VERSION).dylib SHLIB_COMPAT = libdessert.$(SHLIB_COMPAT_VERSION).dylib SHLIB_DEFAULT = libdessert.dylib SHLIB_LDFLAGS = -dynamiclib -compatibility_version $(SHLIB_COMPAT_VERSION) -current_version $(SHLIB_VERSION) -o $(SHLIB) else ifeq ($(UNAME),FREEBSD) LIBS = pcap cli CFLAGS += -ggdb -Wall -fPIC -DTARGET_$(UNAME) -DTARGET_BSD -DSHLIB_VERSION=\"$(SHLIB_VERSION)\" -pthread -I/usr/local/include -I/usr/include LDFLAGS += -dy -L/usr/local/lib -L/usr/lib $(addprefix -l,$(LIBS)) SHLIB = libdessert.so.$(SHLIB_VERSION) SHLIB_COMPAT = libdessert.so.$(SHLIB_COMPAT_VERSION) SHLIB_DEFAULT = libdessert.so SHLIB_LDFLAGS = -shared -Wl,-soname,$(SHLIB_COMPAT) -o $(SHLIB) endif ## >>> SNMP ## NETSNMPCONFIG=net-snmp-config STRICT_FLAGS = -Wstrict-prototypes NETSNMPCFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags) $(STRICT_FLAGS) NETSNMPLIBS := $(shell $(NETSNMPCONFIG) --agent-libs) SNMPMODULES = snmp/dessertObjects \ snmp/dessertMeshifTable \ snmp/dessertMeshifTable_data_get \ snmp/dessertMeshifTable_data_set \ snmp/dessertMeshifTable_data_access \ snmp/dessertMeshifTable_interface \ snmp/dessertSysifTable \ snmp/dessertSysifTable_data_get \ snmp/dessertSysifTable_data_set \ snmp/dessertSysifTable_data_access \ snmp/dessertSysifTable_interface \ snmp/dessertAppStatsTable \ snmp/dessertAppStatsTable_data_get \ snmp/dessertAppStatsTable_data_set \ snmp/dessertAppStatsTable_data_access \ snmp/dessertAppStatsTable_interface \ snmp/dessertAppParamsTable \ snmp/dessertAppParamsTable_data_get \ snmp/dessertAppParamsTable_data_set \ snmp/dessertAppParamsTable_data_access \ snmp/dessertAppParamsTable_interface CFLAGS += $(NETSNMPCFLAGS) LDFLAGS += $(NETSNMPLIBS) MODULES += $(addsuffix .o,$(SNMPMODULES)) SNMPTARFILES = snmp/*.c snmp/*.h snmp/*.txt ## <<< SNMP ## DOXYGEN = /usr/bin/doxygen DOXYFILE = DES-SERT.doxyfile DOXYGENTARFILES = doxygen/html/* CFLAGS += LDFLAGS += all: libdessert.a $(SHLIB) clean: rm -r *.o *.a *.so *.so.* *.dylib *.tar.gz || true rm snmp/*.o || true rm test/*.o || true rm test-periodic_add || true rm test-periodic_add-delete-modify-add || true rm test-periodic_wladimir || true rm test-meshif-iterator || true rm test-agentx-appstats || true rm test-agentx-appparams || true rm test-agentx || true # rm -rf doxygen || true rm Manual.pdf || true install: echo "ECHO:: $(DIR_LIB) $(SHLIB)" install -d $(DIR_LIB) $(DIR_INCLUDE) install -m755 $(SHLIB) $(DIR_LIB) (cd $(DIR_LIB) ; ln -fs $(SHLIB) $(SHLIB_COMPAT)) (cd $(DIR_LIB) ; ln -fs $(SHLIB) $(SHLIB_DEFAULT)) install -m644 dessert.h $(DIR_INCLUDE) install -d $(DIR_SHARE) $(DIR_MIBS) install -m644 DESSERT-MIB.txt $(DIR_MIBS) libdessert.a: $(MODULES) $(AR) -r libdessert.a $(MODULES) ranlib libdessert.a $(SHLIB): $(MODULES) $(CC) $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) $(MODULES) ln -fs $(SHLIB) $(SHLIB_COMPAT) ln -fs $(SHLIB) $(SHLIB_DEFAULT) tarball: clean doxygen mkdir libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION) cp -R $(TARFILES) libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION) mkdir libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION)/snmp cp -R $(SNMPTARFILES) libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION)/snmp mkdir libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION)/doxygen mkdir libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION)/doxygen/html cp -R $(DOXYGENTARFILES) libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION)/doxygen/html gzip -9 -c changelog > libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION)/changelog.gz tar -czf libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION).tar.gz libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION) rm -rf libdessert$(SHLIB_COMPAT_VERSION)-$(SHLIB_VERSION) doxygen: (cat $(DOXYFILE); echo "PROJECT_NUMBER=$(SHLIB_VERSION)") | $(DOXYGEN) - manual: doxygen cd doxygen/latex; $(MAKE) pdf cp doxygen/latex/refman.pdf Manual.pdf test-periodic_add: test/test-periodic_add.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-periodic_add test/test-periodic_add.o $(MODULES) test-periodic_add-delete-modify-add: test/test-periodic_add-delete-modify-add.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-periodic_add-delete-modify-add test/test-periodic_add-delete-modify-add.o $(MODULES) test-periodic_wladimir: test/test-periodic_wladimir.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-periodic_wladimir test/test-periodic_wladimir.o $(MODULES) test-agentx-appparams: test/test-agentx-appparams.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-agentx-appparams test/test-agentx-appparams.o $(MODULES) test-agentx-appstats: test/test-agentx-appstats.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-agentx-appstats test/test-agentx-appstats.o $(MODULES) test-meshif-iterator: test/test-meshif-iterator.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-meshif-iterator test/test-meshif-iterator.o $(MODULES) test-cli_getcfg: test/test-cli_getcfg.o $(MODULES) $(CC) -ggdb -Wall -DTARGET_$(UNAME) -D_GNU_SOURCE $(NETSNMPCFLAGS) $(LDFLAGS) -o test-cli_getcfg test/test-cli_getcfg.o $(MODULES) libdessert0.87-0.87.2/snmp/0000755000175000017500000000000011331020526013347 5ustar dvddvdlibdessert0.87-0.87.2/snmp/dessertSysifTable_data_access.h0000644000175000017500000000615111331020526021474 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTSYSIFTABLE_DATA_ACCESS_H #define DESSERTSYSIFTABLE_DATA_ACCESS_H #include "../dessert_internal.h" #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * function declarations */ /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ int dessertSysifTable_init_data(dessertSysifTable_registration * dessertSysifTable_reg); /* * TODO:180:o: Review dessertSysifTable cache timeout. * The number of seconds before the cache times out */ #define DESSERTSYSIFTABLE_CACHE_TIMEOUT DESSERT_AGENTX_SYSIFTABLE_CACHE_TIMEOUT void dessertSysifTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache); void dessertSysifTable_container_shutdown(netsnmp_container * container_ptr); int dessertSysifTable_container_load(netsnmp_container * container); void dessertSysifTable_container_free(netsnmp_container * container); int dessertSysifTable_cache_load(netsnmp_container * container); void dessertSysifTable_cache_free(netsnmp_container * container); /* *************************************************** *** START EXAMPLE CODE *** ***---------------------------------------------***/ /* ********************************************************************* * Since we have no idea how you really access your data, we'll go with * a worst case example: a flat text file. */ #define MAX_LINE_SIZE 256 /* ***---------------------------------------------*** *** END EXAMPLE CODE *** ***************************************************/ int dessertSysifTable_row_prep(dessertSysifTable_rowreq_ctx * rowreq_ctx); #ifdef __cplusplus } #endif #endif /* DESSERTSYSIFTABLE_DATA_ACCESS_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable-README-dessertSysifTable.txt0000644000175000017500000005074011331020526024145 0ustar dvddvd************************************************************************ dessertSysifTable README ------------------------------------------------------------------------ This readme file describes the code generated by mib2c (using the MIBs for Dummies (MFD) configuration file). The code generated was generated specifically for the following SNMP table: dessertSysifTable Your code will be called when the snmp agent receives requests for the dessertSysifTable table. The agent will start by looking for the right row in your existing data to operate on, if one exists. Configuration Variables ------------------------------------------------------------ Some variables used for code generation may be set to affect the code generation. You may override these variables by setting them in the file defaults/table-dessertSysifTable.m2d, and then re-running mib2c. m2c_table_settable (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support MIB object which have an access of read-write or read-create. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_settable = 0@ m2c_table_dependencies (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking dependencies between columns, rows or tables. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_dependencies = 0@ m2c_table_row_creation (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking creation of new rows via SNMP. The default is set based on whether or not the table contains read-create objects, but can be over-ridden. Syntax: @eval $m2c_table_row_creation = 0@ m2c_context_reg (currently 'netsnmp_data_list') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertSysifTable_registration. During initilization, you will provide a pointer to a structure of this type. This pointer is used as a parameter to many functions so that you have access to your registration data. The default is a netsnmp_data_list pointer, which will allow you to keep multiple pointers tagged by a text name. If you have a new or existing structure you would rather use, you can redefine this variable. To avoid regenerating code, you may also change this typedef directly in the dessertSysifTable.h header. Syntax: @eval $m2c_context_reg = "struct my_registration_context@ m2c_data_context (currently 'generated') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertSysifTable_data. This typedef is used in the row request context structure for the table, dessertSysifTable_rowreq_ctx. The typedef in the primary table context will be used for the data and undo structure types. This structure should contain all the data needed for all the columns in the table. The default is 'generated', which will cuase a new data strcuture to be generated with data members for each column. To avoid regenerating code, you may also change this typedef directly in the dessertSysifTable.h header. Syntax: @eval $m2c_data_context = "struct my_data_context"@ m2c_data_allocate (currently '0') -------------------------------------------------------- This variable determines whether or not the data context (see above) requires memory to be allocated. The default generated data structure does not. If you are using a custom data context which needs to allocate memory, override this value and two additional functions will be generated: dessertSysifTable_allocate_data dessertSysifTable_release_data Syntax: @eval $m2c_data_allocate = 1@ m2c_data_init (currently '1') -------------------------------------------------------- This variable determines whether or not the data context (see above) or any other items you have added to the table context requires initialization. The default generated data structure does not. If you are using a custom data context or have added items needing initialization to the table context, override this value and two additional functions will be generated: dessertSysifTable_rowreq_ctx_init dessertSysifTable_rowreq_ctx_cleanup Syntax: @eval 1 = 1@ m2c_table_access (currently 'container-cached') ------------------------------------------------------------------ This variable determines which data interface will be use to generate code for looking up data for a given index. The default is the 'container-cached' access code, which caches the data in a netsnmp- container (usually a sorted array). Available options can be determined by checking for mib2c configuration files that begin with 'mfd-access-*'. Syntax: @eval $m2c_table_access = 'container-cached'@ m2c_include_examples (currently '1') ------------------------------------------------------------------ This variable determines whether or not to generate example code. The default is to generate example code. Syntax: @eval $m2c_include_examples = 0@ m2c_data_transient (currently '0') ------------------------------------------------------------------ This variable determines how the generated example code deals with the data during data lookup. See the table readme file for details on how the current table access method interprets this value. In general, a value of 0 indicates persistent data, 1 indicates semi-transient and 2 indicates transient data. Syntax: @eval $m2c_data_transient = 0@ Index(es) for the dessertSysifTable table ------------------------------------------------------------ The index(es) for the dessertSysifTable table are: sysifIndex: Syntax: DataType: ASN type: C-code type: You should know how to set all these values from your data context, dessertSysifTable_data. ************************************************************************ dessertSysifTable File Overview ------------------------------------------------------------------------ Several files have been generated to implement the dessertSysifTable table. We'll go through these files, one by one, explaining each and letting you know which you need to edit. File: dessertSysifTable_data_access.[c|h] ------------------------------------------------------------------------ The dessertSysifTable_data_access file contains the interface to your data in its raw format. These functions are used to build the row cache or locate the row (depending on the table access method). Set MIB context ----------------- TODO : Set MIB index values FUNC : dessertSysifTable_indexes_set WHERE: dessertSysifTable_data_access.c This is a convenience function for setting the index context from the native C data. Where necessary, value mapping should be done. This function should update the table index values (found in tbl_idx) for the given raw data. container summary ------------------------ The container data access code is for cases when you want to store your data in the agent/sub-agent. ... to be continued... cache summary ------------------------ The container-cached data access code is for cases when you want to cache your data in the agent/sub-agent. ... to be continued... File: dessertSysifTable_enums.h ------------------------------------------------------------------------ This file contains macros for mapping enumeration values when the enumerated values defined by the MIB do not match the values used internally. Review this file to see if any values need to be updated. File: dessertSysifTable_data_get.c ------------------------------------------------------------------------ Get data for column ------------------- TODO : retrieve column data from raw data FUNC : sysifName_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : sysifMacAddress_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : sysifInPkts_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : sysifOutPkts_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : sysifInOctets_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : sysifOutOctets_get File: dessertSysifTable_data_set.c ------------------------------------------------------------------------ This table does not support set requests. ************************************************************************ dessertSysifTable Reference ------------------------------------------------------------------------ Function flow ---------------------------------------------------- To give you the general idea of how the functions flow works, this example flow is from a complete table implementation. NOTE: Depending on your configuration, some of the functions used in the examples below may not have been generated for the dessertSysifTable table. Conversely, the examples below may not include some functions that were generated for the dessertSysifTable table. To watch the flow of the dessertSysifTable table, use the following debug tokens: snmp_agent helper:table:req dessertSysifTable verbose:dessertSysifTable internal:dessertSysifTable e.g. snmpd -f -Le -DdessertSysifTable,verbose:dessertSysifTable,internal:dessertSysifTable Initialization -------------------------------- init_xxxTable: called xxx.c initialize_table_xxxTable xxx.c _xxxTable_initialize_interface xxx_interface.c xxxTable_init_data xxx_data_access.c _xxxTable_container_init xxx_interface.c xxxTable_container_init xxx_data_access.c GET Request -------------------------------- _cache_load xxx_interface.c xxxTable_cache_load xxx_data_access.c xxxTable_allocate_rowreq_ctx xxx_interface.c xxxTable_allocate_data xxx_data_get.c xxxTable_rowreq_ctx_init xxx_data_get.c xxxTable_indexes_set xxx_data_get.c xxxTable_indexes_set_tbl_idx xxx_data_get.c xxxTable_pre_request _mfd_xxxTable_object_lookup xxx_interface.c xxxTable_row_prep xxx_data_access.c _mfd_xxxTable_get_values xxx_interface.c _mfd_xxxTable_get_column xxx_interface.c yyy_get xxx_data_get.c xxxTable_post_request GETNEXT Request -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_get_values ... xxxTable_post_request ... SET Request: success -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects xxx_interface.c _xxxTable_check_column xxx_interface.c yyy_check_value xxx_data_set.c _mfd_xxxTable_undo_setup xxx_interface.c xxxTable_allocate_data ... xxxTable_undo_setup xxx_interface.c _xxxTable_undo_setup_column xxx_interface.c yyy_undo_setup xxx_data_set.c _mfd_xxxTable_set_values xxx_interface.c _xxxTable_set_column xxx_interface.c yyy_set xxx_data_set.c _mfd_xxxTable_check_dependencies xxx_interface.c xxxTable_check_dependencies xxx_data_set.c _mfd_xxxTable_commit xxx_interface.c xxxTable_commit xxx_data_set.c _mfd_xxxTable_undo_cleanup xxx_interface.c xxxTable_undo_cleanup xxx_data_set.c xxxTable_release_data ... xxxTable_post_request ... SET Request: row creation -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... xxxTable_index_from_oid xxx_interface.c xxxTable_allocate_rowreq_ctx ... ... _xxxTable_check_indexes xxx_interface.c yyy_check_index xxx_data_set.c xxxTable_validate_index xxx_data_set.c _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... _xxxTable_check_column ... yyy_check_value ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... SET Resuest: value error -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... ERROR:"yyy value not supported" xxxTable_post_request ... SET Request: commit failure -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... xxxTable_commit ... ERROR: bad rc -1 _mfd_xxxTable_undo_commit xxx_interface.c xxxTable_undo_commit xxx_data_set.c _mfd_xxxTable_undo_values xxx_interface.c _xxxTable_undo_column xxx_interface.c yyy_undo xxx_data_set.c _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... Row release (user initiated) -------------------------------- xxxTable_release_rowreq_ctx xxx_interface.c xxxTable_rowreq_ctx_cleanup xxx_data_get.c xxxTable_release_data xxx_data_get.c Table / column details ---------------------------------------------------- /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifIndex * sysifIndex is subid 1 of dessertSysifEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.1 * Description: system ifindex * * Attributes: * accessible 0 isscalar 0 enums 0 hasdefval 0 * readable 0 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is (based on perltype ) * The net-snmp type is . The C type decl is () * * * * NOTE: NODE sysifIndex IS NOT ACCESSIBLE * * */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifName * sysifName is subid 2 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.2 * Description: name of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifMacAddress * sysifMacAddress is subid 3 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.3 * Description: hardware address of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifInPkts * sysifInPkts is subid 4 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.4 * Description: packet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifOutPkts * sysifOutPkts is subid 5 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.5 * Description: packet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifInOctets * sysifInOctets is subid 6 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.6 * Description: octet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifOutOctets * sysifOutOctets is subid 7 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.7 * Description: octet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_data_get.h0000644000175000017500000001362111331020526021601 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ * * @file dessertAppParamsTable_data_get.h * * @addtogroup get * * Prototypes for get functions * * @{ */ #ifndef DESSERTAPPPARAMSTABLE_DATA_GET_H #define DESSERTAPPPARAMSTABLE_DATA_GET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * GET function declarations */ /* ********************************************************************* * GET Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ /* * indexes */ int appParamsIndex_map(long *mib_appParamsIndex_val_ptr, long raw_appParamsIndex_val); int appParamsName_map(char **mib_appParamsName_val_ptr_ptr, size_t *mib_appParamsName_val_ptr_len_ptr, char *raw_appParamsName_val_ptr, size_t raw_appParamsName_val_ptr_len, int allow_realloc); int appParamsName_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char **appParamsName_val_ptr_ptr, size_t *appParamsName_val_ptr_len_ptr); int appParamsDesc_map(char **mib_appParamsDesc_val_ptr_ptr, size_t *mib_appParamsDesc_val_ptr_len_ptr, char *raw_appParamsDesc_val_ptr, size_t raw_appParamsDesc_val_ptr_len, int allow_realloc); int appParamsDesc_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char **appParamsDesc_val_ptr_ptr, size_t *appParamsDesc_val_ptr_len_ptr); int appParamsValueType_map(u_long * mib_appParamsValueType_val_ptr, u_long raw_appParamsValueType_val); int appParamsValueType_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long * appParamsValueType_val_ptr); int appParamsTruthValue_map(u_long * mib_appParamsTruthValue_val_ptr, u_long raw_appParamsTruthValue_val); int appParamsTruthValue_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long * appParamsTruthValue_val_ptr); int appParamsInteger32_map(long *mib_appParamsInteger32_val_ptr, long raw_appParamsInteger32_val); int appParamsInteger32_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long *appParamsInteger32_val_ptr); int appParamsUnsigned32_map(u_long * mib_appParamsUnsigned32_val_ptr, u_long raw_appParamsUnsigned32_val); int appParamsUnsigned32_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long * appParamsUnsigned32_val_ptr); int appParamsOctetString_map(char **mib_appParamsOctetString_val_ptr_ptr, size_t *mib_appParamsOctetString_val_ptr_len_ptr, char *raw_appParamsOctetString_val_ptr, size_t raw_appParamsOctetString_val_ptr_len, int allow_realloc); int appParamsOctetString_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char **appParamsOctetString_val_ptr_ptr, size_t *appParamsOctetString_val_ptr_len_ptr); int dessertAppParamsTable_indexes_set_tbl_idx (dessertAppParamsTable_mib_index * tbl_idx, long appParamsIndex_val); int dessertAppParamsTable_indexes_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long appParamsIndex_val); #ifdef __cplusplus } #endif #endif /* DESSERTAPPPARAMSTABLE_DATA_GET_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_data_access.h0000644000175000017500000000636011331020526022140 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTAPPSTATSTABLE_DATA_ACCESS_H #define DESSERTAPPSTATSTABLE_DATA_ACCESS_H #include "../dessert_internal.h" #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * function declarations */ /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ int dessertAppStatsTable_init_data(dessertAppStatsTable_registration * dessertAppStatsTable_reg); /* * TODO:180:o: Review dessertAppStatsTable cache timeout. * The number of seconds before the cache times out */ #define DESSERTAPPSTATSTABLE_CACHE_TIMEOUT DESSERT_AGENTX_APPSTATSTABLE_CACHE_TIMEOUT void dessertAppStatsTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache); void dessertAppStatsTable_container_shutdown(netsnmp_container * container_ptr); int dessertAppStatsTable_container_load(netsnmp_container * container); void dessertAppStatsTable_container_free(netsnmp_container * container); int dessertAppStatsTable_cache_load(netsnmp_container * container); void dessertAppStatsTable_cache_free(netsnmp_container * container); /* *************************************************** *** START EXAMPLE CODE *** ***---------------------------------------------***/ /* ********************************************************************* * Since we have no idea how you really access your data, we'll go with * a worst case example: a flat text file. */ #define MAX_LINE_SIZE 256 /* ***---------------------------------------------*** *** END EXAMPLE CODE *** ***************************************************/ int dessertAppStatsTable_row_prep(dessertAppStatsTable_rowreq_ctx * rowreq_ctx); #ifdef __cplusplus } #endif #endif /* DESSERTAPPSTATSTABLE_DATA_ACCESS_H */ libdessert0.87-0.87.2/snmp/README.txt0000644000175000017500000000110411331020526015041 0ustar dvddvdThe files in this directory where once generated by the tool 'mib2c' [1]. However, they where edited afterwards to bind the generated template (a.k.a skeleton) code to the libdessert code. The generation of the skeletons was guided by a tutorial available at [2]. The parameters used in generating the skeletons are documented in the various dessert*Table-README*.txt files. Please find the associated SNMP MIB as ../DESSERT-MIB.txt. [1] Provided by the Debian package libsnmp-dev (5.4.1~dfsg-12) [2] http://net-snmp.sourceforge.net/wiki/index.php/TUT:mib2c_General_Overviewlibdessert0.87-0.87.2/snmp/dessertMeshifTable_data_get.c0000644000175000017500000004232111331020526021122 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertMeshifTable.h" /** @defgroup data_get data_get: Routines to get data * * TODO:230:M: Implement dessertMeshifTable get routines. * TODO:240:M: Implement dessertMeshifTable mapping routines (if any). * * These routine are used to get the value for individual objects. The * row context is passed, along with a pointer to the memory where the * value should be copied. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ /* * --------------------------------------------------------------------- * * TODO:200:r: Implement dessertMeshifTable data context functions. */ /** * set mib index(es) * * @param tbl_idx mib index structure * @param meshifIndex_val * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This convenience function is useful for setting all the MIB index * components with a single function call. It is assume that the C values * have already been mapped from their native/rawformat to the MIB format. */ int dessertMeshifTable_indexes_set_tbl_idx(dessertMeshifTable_mib_index * tbl_idx, long meshifIndex_val) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_indexes_set_tbl_idx", "called\n")); /* * meshifIndex(1)///()//L/a/w/e/r/d/h */ tbl_idx->meshifIndex = meshifIndex_val; return MFD_SUCCESS; } /* dessertMeshifTable_indexes_set_tbl_idx */ /** * @internal * set row context indexes * * @param reqreq_ctx the row context that needs updated indexes * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This function sets the mib indexs, then updates the oid indexs * from the mib index. */ int dessertMeshifTable_indexes_set(dessertMeshifTable_rowreq_ctx * rowreq_ctx, long meshifIndex_val) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_indexes_set", "called\n")); if (MFD_SUCCESS != dessertMeshifTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, meshifIndex_val)) return MFD_ERROR; /* * convert mib index to oid index */ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); if (0 != dessertMeshifTable_index_to_oid(&rowreq_ctx->oid_idx, &rowreq_ctx->tbl_idx)) { return MFD_ERROR; } return MFD_SUCCESS; } /* dessertMeshifTable_indexes_set */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifName * meshifName is subid 2 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.2 * Description: name of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /** * Extract the current value of the meshifName data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param meshifName_val_ptr_ptr * Pointer to storage for a char variable * @param meshifName_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by meshifName. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*meshifName_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update meshifName_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int meshifName_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, char **meshifName_val_ptr_ptr, size_t *meshifName_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != meshifName_val_ptr_ptr) && (NULL != *meshifName_val_ptr_ptr)); netsnmp_assert(NULL != meshifName_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertMeshifTable:meshifName_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the meshifName data. * copy (* meshifName_val_ptr_ptr ) data and (* meshifName_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for meshifName data */ if ((NULL == (*meshifName_val_ptr_ptr)) || ((*meshifName_val_ptr_len_ptr) < (rowreq_ctx->data.meshifName_len * sizeof(rowreq_ctx->data.meshifName[0])))) { /* * allocate space for meshifName data */ (*meshifName_val_ptr_ptr) = malloc(rowreq_ctx->data.meshifName_len * sizeof(rowreq_ctx->data.meshifName[0])); if (NULL == (*meshifName_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*meshifName_val_ptr_len_ptr) = rowreq_ctx->data.meshifName_len * sizeof(rowreq_ctx->data.meshifName[0]); memcpy((*meshifName_val_ptr_ptr), rowreq_ctx->data.meshifName, rowreq_ctx->data.meshifName_len * sizeof(rowreq_ctx->data.meshifName[0])); return MFD_SUCCESS; } /* meshifName_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifMacAddress * meshifMacAddress is subid 3 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.3 * Description: hardware address of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /** * Extract the current value of the meshifMacAddress data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param meshifMacAddress_val_ptr_ptr * Pointer to storage for a char variable * @param meshifMacAddress_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by meshifMacAddress. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*meshifMacAddress_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update meshifMacAddress_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int meshifMacAddress_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, char **meshifMacAddress_val_ptr_ptr, size_t *meshifMacAddress_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != meshifMacAddress_val_ptr_ptr) && (NULL != *meshifMacAddress_val_ptr_ptr)); netsnmp_assert(NULL != meshifMacAddress_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertMeshifTable:meshifMacAddress_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the meshifMacAddress data. * copy (* meshifMacAddress_val_ptr_ptr ) data and (* meshifMacAddress_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for meshifMacAddress data */ if ((NULL == (*meshifMacAddress_val_ptr_ptr)) || ((*meshifMacAddress_val_ptr_len_ptr) < (rowreq_ctx->data.meshifMacAddress_len * sizeof(rowreq_ctx->data.meshifMacAddress[0])))) { /* * allocate space for meshifMacAddress data */ (*meshifMacAddress_val_ptr_ptr) = malloc(rowreq_ctx->data.meshifMacAddress_len * sizeof(rowreq_ctx->data.meshifMacAddress[0])); if (NULL == (*meshifMacAddress_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*meshifMacAddress_val_ptr_len_ptr) = rowreq_ctx->data.meshifMacAddress_len * sizeof(rowreq_ctx->data.meshifMacAddress[0]); memcpy((*meshifMacAddress_val_ptr_ptr), rowreq_ctx->data.meshifMacAddress, rowreq_ctx->data.meshifMacAddress_len * sizeof(rowreq_ctx->data.meshifMacAddress[0])); return MFD_SUCCESS; } /* meshifMacAddress_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifInPkts * meshifInPkts is subid 4 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.4 * Description: packet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the meshifInPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param meshifInPkts_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int meshifInPkts_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifInPkts_val_ptr) { char inPkts[I64CHARSZ+1]; /** we should have a non-NULL pointer */ netsnmp_assert(NULL != meshifInPkts_val_ptr); /* * TODO:231:o: |-> copy meshifInPkts data. * get (* meshifInPkts_val_ptr ).low and (* meshifInPkts_val_ptr ).high from rowreq_ctx->data */ (*meshifInPkts_val_ptr).high = rowreq_ctx->data.meshifInPkts.high; (*meshifInPkts_val_ptr).low = rowreq_ctx->data.meshifInPkts.low; printU64(inPkts, meshifInPkts_val_ptr); return MFD_SUCCESS; } /* meshifInPkts_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifOutPkts * meshifOutPkts is subid 5 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.5 * Description: packet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the meshifOutPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param meshifOutPkts_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int meshifOutPkts_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifOutPkts_val_ptr) { char outPkts[I64CHARSZ+1]; /** we should have a non-NULL pointer */ netsnmp_assert(NULL != meshifOutPkts_val_ptr); /* * TODO:231:o: |-> copy meshifOutPkts data. * get (* meshifOutPkts_val_ptr ).low and (* meshifOutPkts_val_ptr ).high from rowreq_ctx->data */ (*meshifOutPkts_val_ptr).high = rowreq_ctx->data.meshifOutPkts.high; (*meshifOutPkts_val_ptr).low = rowreq_ctx->data.meshifOutPkts.low; printU64(outPkts, meshifOutPkts_val_ptr); return MFD_SUCCESS; } /* meshifOutPkts_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifInOctets * meshifInOctets is subid 6 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.6 * Description: octet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the meshifInOctets data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param meshifInOctets_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int meshifInOctets_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifInOctets_val_ptr) { char inOctets[I64CHARSZ+1]; /** we should have a non-NULL pointer */ netsnmp_assert(NULL != meshifInOctets_val_ptr); /* * TODO:231:o: |-> copy meshifInOctets data. * get (* meshifInOctets_val_ptr ).low and (* meshifInOctets_val_ptr ).high from rowreq_ctx->data */ (*meshifInOctets_val_ptr).high = rowreq_ctx->data.meshifInOctets.high; (*meshifInOctets_val_ptr).low = rowreq_ctx->data.meshifInOctets.low; printU64(inOctets, meshifInOctets_val_ptr); return MFD_SUCCESS; } /* meshifInOctets_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifOutOctets * meshifOutOctets is subid 7 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.7 * Description: octet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the meshifOutOctets data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param meshifOutOctets_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int meshifOutOctets_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifOutOctets_val_ptr) { char outOctets[I64CHARSZ+1]; /** we should have a non-NULL pointer */ netsnmp_assert(NULL != meshifOutOctets_val_ptr); /* * TODO:231:o: |-> copy meshifOutOctets data. * get (* meshifOutOctets_val_ptr ).low and (* meshifOutOctets_val_ptr ).high from rowreq_ctx->data */ (*meshifOutOctets_val_ptr).high = rowreq_ctx->data.meshifOutOctets.high; (*meshifOutOctets_val_ptr).low = rowreq_ctx->data.meshifOutOctets.low; printU64(outOctets, meshifOutOctets_val_ptr); return MFD_SUCCESS; } /* meshifOutOctets_get */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable-README-dessertAppParamsTable.txt0000644000175000017500000007032111331020526025520 0ustar dvddvd************************************************************************ dessertAppParamsTable README ------------------------------------------------------------------------ This readme file describes the code generated by mib2c (using the MIBs for Dummies (MFD) configuration file). The code generated was generated specifically for the following SNMP table: dessertAppParamsTable Your code will be called when the snmp agent receives requests for the dessertAppParamsTable table. The agent will start by looking for the right row in your existing data to operate on, if one exists. Configuration Variables ------------------------------------------------------------ Some variables used for code generation may be set to affect the code generation. You may override these variables by setting them in the file defaults/table-dessertAppParamsTable.m2d, and then re-running mib2c. m2c_table_settable (currently '1') -------------------------------------------------------- This variable determines whether or not code is generated to support MIB object which have an access of read-write or read-create. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_settable = 0@ m2c_table_dependencies (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking dependencies between columns, rows or tables. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_dependencies = 0@ m2c_table_row_creation (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking creation of new rows via SNMP. The default is set based on whether or not the table contains read-create objects, but can be over-ridden. Syntax: @eval $m2c_table_row_creation = 0@ m2c_context_reg (currently 'netsnmp_data_list') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertAppParamsTable_registration. During initilization, you will provide a pointer to a structure of this type. This pointer is used as a parameter to many functions so that you have access to your registration data. The default is a netsnmp_data_list pointer, which will allow you to keep multiple pointers tagged by a text name. If you have a new or existing structure you would rather use, you can redefine this variable. To avoid regenerating code, you may also change this typedef directly in the dessertAppParamsTable.h header. Syntax: @eval $m2c_context_reg = "struct my_registration_context@ m2c_data_context (currently 'generated') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertAppParamsTable_data. This typedef is used in the row request context structure for the table, dessertAppParamsTable_rowreq_ctx. The typedef in the primary table context will be used for the data and undo structure types. This structure should contain all the data needed for all the columns in the table. The default is 'generated', which will cuase a new data strcuture to be generated with data members for each column. To avoid regenerating code, you may also change this typedef directly in the dessertAppParamsTable.h header. Syntax: @eval $m2c_data_context = "struct my_data_context"@ m2c_data_allocate (currently '0') -------------------------------------------------------- This variable determines whether or not the data context (see above) requires memory to be allocated. The default generated data structure does not. If you are using a custom data context which needs to allocate memory, override this value and two additional functions will be generated: dessertAppParamsTable_allocate_data dessertAppParamsTable_release_data Syntax: @eval $m2c_data_allocate = 1@ m2c_data_init (currently '1') -------------------------------------------------------- This variable determines whether or not the data context (see above) or any other items you have added to the table context requires initialization. The default generated data structure does not. If you are using a custom data context or have added items needing initialization to the table context, override this value and two additional functions will be generated: dessertAppParamsTable_rowreq_ctx_init dessertAppParamsTable_rowreq_ctx_cleanup Syntax: @eval 1 = 1@ m2c_table_access (currently 'container-cached') ------------------------------------------------------------------ This variable determines which data interface will be use to generate code for looking up data for a given index. The default is the 'container-cached' access code, which caches the data in a netsnmp- container (usually a sorted array). Available options can be determined by checking for mib2c configuration files that begin with 'mfd-access-*'. Syntax: @eval $m2c_table_access = 'container-cached'@ m2c_include_examples (currently '1') ------------------------------------------------------------------ This variable determines whether or not to generate example code. The default is to generate example code. Syntax: @eval $m2c_include_examples = 0@ m2c_data_transient (currently '0') ------------------------------------------------------------------ This variable determines how the generated example code deals with the data during data lookup. See the table readme file for details on how the current table access method interprets this value. In general, a value of 0 indicates persistent data, 1 indicates semi-transient and 2 indicates transient data. Syntax: @eval $m2c_data_transient = 0@ Index(es) for the dessertAppParamsTable table ------------------------------------------------------------ The index(es) for the dessertAppParamsTable table are: appParamsIndex: Syntax: DessertAppParamsIndex DataType: INTEGER32 ASN type: ASN_INTEGER C-code type: long You should know how to set all these values from your data context, dessertAppParamsTable_data. ************************************************************************ dessertAppParamsTable File Overview ------------------------------------------------------------------------ Several files have been generated to implement the dessertAppParamsTable table. We'll go through these files, one by one, explaining each and letting you know which you need to edit. File: dessertAppParamsTable_data_access.[c|h] ------------------------------------------------------------------------ The dessertAppParamsTable_data_access file contains the interface to your data in its raw format. These functions are used to build the row cache or locate the row (depending on the table access method). Set MIB context ----------------- TODO : Set MIB index values FUNC : dessertAppParamsTable_indexes_set WHERE: dessertAppParamsTable_data_access.c This is a convenience function for setting the index context from the native C data. Where necessary, value mapping should be done. This function should update the table index values (found in tbl_idx) for the given raw data. container summary ------------------------ The container data access code is for cases when you want to store your data in the agent/sub-agent. ... to be continued... File: dessertAppParamsTable_enums.h ------------------------------------------------------------------------ This file contains macros for mapping enumeration values when the enumerated values defined by the MIB do not match the values used internally. Review this file to see if any values need to be updated. File: dessertAppParamsTable_data_get.c ------------------------------------------------------------------------ Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsName_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsDesc_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsValueType_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsTruthValue_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsInteger32_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsUnsigned32_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appParamsOctetString_get File: dessertAppParamsTable_data_set.c ------------------------------------------------------------------------ This code was generated based on the following assumptions or settings: 1) Some of the values for this table have DEPENDENCIES on other objects. DEPENDENCIES on other objects complicates SET request processing. When one or more columns in a table depend on another object (in the same table, or in another table), a DEPENDENCY exists. For example, if you have a table that determine a color with three columns (red, green and blue) that define the percentage of each primary color, the total for the three columns must equal 100 percent. So, in addition to checking that each colums has a valid value between 0 and 100, the total of all three columns must equal 100. Set $m2c_table_dependencies = 0 in defaults/table-dessertAppParamsTable.m2d and regenerate code if this assumption is incorrect. 2) This table does not support ROW CREATION. Supporting ROW CREATION allows new rows to be created via SNMP requests. Undo setup ---------- TODO : save data for undo FUNC : dessertAppParamsTable_undo_setup This function will be called before the individual undo_setup functions are called. This is where you should save any undo information which is not directly related to a particular column. This function will only be called once per row. After this function is called, any column which is being set will have its individual node undo_setup function called. Check value for column ---------------------- TODO : perform additional validations on values for a set request FUNC : appParamsTruthValue_check_value The generated code will automatically validate incoming requests against all the requirements specified by the syntax of the MIB. However, it is often the case that additional requirements are specified in the description of a MIB object. Those type of validations should be checked in this function. Undo setup for column --------------------- TODO : save the value for column FUNC : appParamsTruthValue_undo_setup After the table level undo setup function has been called, the individual node undo setup functions will be called for columns which are being set. Set value for column -------------------- TODO : set the value for column FUNC : appParamsTruthValue_set After all the validations have been passed, this function will be called to set the new value. Undo value for column --------------------- TODO : undo set for column FUNC : appParamsTruthValue_undo If an error occurs after a column has been set, this function will be called to undo the set and restore the previous state. Check value for column ---------------------- TODO : perform additional validations on values for a set request FUNC : appParamsInteger32_check_value The generated code will automatically validate incoming requests against all the requirements specified by the syntax of the MIB. However, it is often the case that additional requirements are specified in the description of a MIB object. Those type of validations should be checked in this function. Undo setup for column --------------------- TODO : save the value for column FUNC : appParamsInteger32_undo_setup After the table level undo setup function has been called, the individual node undo setup functions will be called for columns which are being set. Set value for column -------------------- TODO : set the value for column FUNC : appParamsInteger32_set After all the validations have been passed, this function will be called to set the new value. Undo value for column --------------------- TODO : undo set for column FUNC : appParamsInteger32_undo If an error occurs after a column has been set, this function will be called to undo the set and restore the previous state. Check value for column ---------------------- TODO : perform additional validations on values for a set request FUNC : appParamsUnsigned32_check_value The generated code will automatically validate incoming requests against all the requirements specified by the syntax of the MIB. However, it is often the case that additional requirements are specified in the description of a MIB object. Those type of validations should be checked in this function. Undo setup for column --------------------- TODO : save the value for column FUNC : appParamsUnsigned32_undo_setup After the table level undo setup function has been called, the individual node undo setup functions will be called for columns which are being set. Set value for column -------------------- TODO : set the value for column FUNC : appParamsUnsigned32_set After all the validations have been passed, this function will be called to set the new value. Undo value for column --------------------- TODO : undo set for column FUNC : appParamsUnsigned32_undo If an error occurs after a column has been set, this function will be called to undo the set and restore the previous state. Check value for column ---------------------- TODO : perform additional validations on values for a set request FUNC : appParamsOctetString_check_value The generated code will automatically validate incoming requests against all the requirements specified by the syntax of the MIB. However, it is often the case that additional requirements are specified in the description of a MIB object. Those type of validations should be checked in this function. Undo setup for column --------------------- TODO : save the value for column FUNC : appParamsOctetString_undo_setup After the table level undo setup function has been called, the individual node undo setup functions will be called for columns which are being set. Set value for column -------------------- TODO : set the value for column FUNC : appParamsOctetString_set After all the validations have been passed, this function will be called to set the new value. Undo value for column --------------------- TODO : undo set for column FUNC : appParamsOctetString_undo If an error occurs after a column has been set, this function will be called to undo the set and restore the previous state. Commit changes -------------- TODO : commit changes FUNC : dessertAppParamsTable_commit After all values have been set, the commit function will be called. ************************************************************************ dessertAppParamsTable Reference ------------------------------------------------------------------------ Function flow ---------------------------------------------------- To give you the general idea of how the functions flow works, this example flow is from a complete table implementation. NOTE: Depending on your configuration, some of the functions used in the examples below may not have been generated for the dessertAppParamsTable table. Conversely, the examples below may not include some functions that were generated for the dessertAppParamsTable table. To watch the flow of the dessertAppParamsTable table, use the following debug tokens: snmp_agent helper:table:req dessertAppParamsTable verbose:dessertAppParamsTable internal:dessertAppParamsTable e.g. snmpd -f -Le -DdessertAppParamsTable,verbose:dessertAppParamsTable,internal:dessertAppParamsTable Initialization -------------------------------- init_xxxTable: called xxx.c initialize_table_xxxTable xxx.c _xxxTable_initialize_interface xxx_interface.c xxxTable_init_data xxx_data_access.c _xxxTable_container_init xxx_interface.c xxxTable_container_init xxx_data_access.c GET Request -------------------------------- _cache_load xxx_interface.c xxxTable_cache_load xxx_data_access.c xxxTable_allocate_rowreq_ctx xxx_interface.c xxxTable_allocate_data xxx_data_get.c xxxTable_rowreq_ctx_init xxx_data_get.c xxxTable_indexes_set xxx_data_get.c xxxTable_indexes_set_tbl_idx xxx_data_get.c xxxTable_pre_request _mfd_xxxTable_object_lookup xxx_interface.c xxxTable_row_prep xxx_data_access.c _mfd_xxxTable_get_values xxx_interface.c _mfd_xxxTable_get_column xxx_interface.c yyy_get xxx_data_get.c xxxTable_post_request GETNEXT Request -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_get_values ... xxxTable_post_request ... SET Request: success -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects xxx_interface.c _xxxTable_check_column xxx_interface.c yyy_check_value xxx_data_set.c _mfd_xxxTable_undo_setup xxx_interface.c xxxTable_allocate_data ... xxxTable_undo_setup xxx_interface.c _xxxTable_undo_setup_column xxx_interface.c yyy_undo_setup xxx_data_set.c _mfd_xxxTable_set_values xxx_interface.c _xxxTable_set_column xxx_interface.c yyy_set xxx_data_set.c _mfd_xxxTable_check_dependencies xxx_interface.c xxxTable_check_dependencies xxx_data_set.c _mfd_xxxTable_commit xxx_interface.c xxxTable_commit xxx_data_set.c _mfd_xxxTable_undo_cleanup xxx_interface.c xxxTable_undo_cleanup xxx_data_set.c xxxTable_release_data ... xxxTable_post_request ... SET Request: row creation -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... xxxTable_index_from_oid xxx_interface.c xxxTable_allocate_rowreq_ctx ... ... _xxxTable_check_indexes xxx_interface.c yyy_check_index xxx_data_set.c xxxTable_validate_index xxx_data_set.c _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... _xxxTable_check_column ... yyy_check_value ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... SET Resuest: value error -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... ERROR:"yyy value not supported" xxxTable_post_request ... SET Request: commit failure -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... xxxTable_commit ... ERROR: bad rc -1 _mfd_xxxTable_undo_commit xxx_interface.c xxxTable_undo_commit xxx_data_set.c _mfd_xxxTable_undo_values xxx_interface.c _xxxTable_undo_column xxx_interface.c yyy_undo xxx_data_set.c _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... Row release (user initiated) -------------------------------- xxxTable_release_rowreq_ctx xxx_interface.c xxxTable_rowreq_ctx_cleanup xxx_data_get.c xxxTable_release_data xxx_data_get.c Table / column details ---------------------------------------------------- /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsIndex * appParamsIndex is subid 1 of dessertAppParamsEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.1 * Description: Index of the parameter. * * Attributes: * accessible 0 isscalar 0 enums 0 hasdefval 0 * readable 0 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: d * * Ranges: 0 - 255; * * Its syntax is DessertAppParamsIndex (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) * * * * NOTE: NODE appParamsIndex IS NOT ACCESSIBLE * * */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsName * appParamsName is subid 2 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.2 * Description: The name of the parameter. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsDesc * appParamsDesc is subid 3 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.3 * Description: A short description of the parameter * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsValueType * appParamsValueType is subid 4 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.4 * Description: Indicates which of the columns (appParamsTruthValue, appParamsInterger32, appParamsUInteger32, appParamsOctetString) in the dessertAppParamsTable is actually valid. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 3/8. Values: bool(0), int32(1), uint32(2), counter64(3), octetstring(4) * * Its syntax is DessertAppValueType (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsTruthValue * appParamsTruthValue is subid 5 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.5 * Description: A parameter with TruthValue semantics. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * Enum range: 2/8. Values: true(1), false(2) * * Its syntax is TruthValue (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsInteger32 * appParamsInteger32 is subid 6 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.6 * Description: A parameter with Integer32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsUnsigned32 * appParamsUnsigned32 is subid 7 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.7 * Description: A parameter with Unsigned32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsOctetString * appParamsOctetString is subid 9 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.9 * Description: A parameter containing of up to 1024 octets. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 1 * hint: 1024a * * Ranges: 0 - 1024; * * Its syntax is DessertApplicationOctetString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 1024) */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_data_access.c0000644000175000017500000003234511331020526022135 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppStatsTable.h" #include "dessertAppStatsTable_data_access.h" #include "../dessert.h" #include "../dessert_internal.h" /** @ingroup interface * @addtogroup data_access data_access: Routines to access data * * These routines are used to locate the data used to satisfy * requests. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ /** * initialization for dessertAppStatsTable data access * * This function is called during startup to allow you to * allocate any resources you need for the data table. * * @param dessertAppStatsTable_reg * Pointer to dessertAppStatsTable_registration * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : unrecoverable error. */ int dessertAppStatsTable_init_data(dessertAppStatsTable_registration * dessertAppStatsTable_reg) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_init_data", "called\n")); /* * TODO:303:o: Initialize dessertAppStatsTable data. */ /* *************************************************** *** START EXAMPLE CODE *** ***---------------------------------------------***/ /* * if you are the sole writer for the file, you could * open it here. However, as stated earlier, we are assuming * the worst case, which in this case means that the file is * written to by someone else, and might not even exist when * we start up. So we can't do anything here. */ /* ***---------------------------------------------*** *** END EXAMPLE CODE *** ***************************************************/ return MFD_SUCCESS; } /* dessertAppStatsTable_init_data */ /** * container overview * */ /** * container initialization * * @param container_ptr_ptr A pointer to a container pointer. If you * create a custom container, use this parameter to return it * to the MFD helper. If set to NULL, the MFD helper will * allocate a container for you. * @param cache A pointer to a cache structure. You can set the timeout * and other cache flags using this pointer. * * This function is called at startup to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. If no custom * container is allocated, the MFD code will create one for your. * * This is also the place to set up cache behavior. The default, to * simply set the cache timeout, will work well with the default * container. If you are using a custom container, you may want to * look at the cache helper documentation to see if there are any * flags you want to set. * * @remark * This would also be a good place to do any initialization needed * for you data source. For example, opening a connection to another * process that will supply the data, opening a database, etc. */ void dessertAppStatsTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_container_init", "called\n")); if (NULL == container_ptr_ptr) { snmp_log(LOG_ERR, "bad container param to dessertAppStatsTable_container_init\n"); return; } /* * For advanced users, you can use a custom container. If you * do not create one, one will be created for you. */ *container_ptr_ptr = NULL; if (NULL == cache) { snmp_log(LOG_ERR, "bad cache param to dessertAppStatsTable_container_init\n"); return; } /* * TODO:345:A: Set up dessertAppStatsTable cache properties. * * Also for advanced users, you can set parameters for the * cache. Do not change the magic pointer, as it is used * by the MFD helper. To completely disable caching, set * cache->enabled to 0. */ cache->timeout = DESSERTAPPSTATSTABLE_CACHE_TIMEOUT; /* seconds */ } /* dessertAppStatsTable_container_init */ /** * container shutdown * * @param container_ptr A pointer to the container. * * This function is called at shutdown to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. * * This function is called before dessertAppStatsTable_container_free(). * * @remark * This would also be a good place to do any cleanup needed * for you data source. For example, closing a connection to another * process that supplied the data, closing a database, etc. */ void dessertAppStatsTable_container_shutdown(netsnmp_container * container_ptr) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_container_shutdown", "called\n")); if (NULL == container_ptr) { snmp_log(LOG_ERR, "bad params to dessertAppStatsTable_container_shutdown\n"); return; } } /* dessertAppStatsTable_container_shutdown */ /** * load initial data * * This function will also be called by the cache helper to load * the container again (after the container free function has been * called to free the previous contents). * * @param container container to which items should be inserted * * @retval MFD_SUCCESS : success. * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source * @retval MFD_ERROR : other error. * * This function is called to load the index(es) (and data, optionally) * for the every row in the data set. * * @remark * While loading the data, the only important thing is the indexes. * If access to your data is cheap/fast (e.g. you have a pointer to a * structure in memory), it would make sense to update the data here. * If, however, the accessing the data invovles more work (e.g. parsing * some other existing data, or peforming calculations to derive the data), * then you can limit yourself to setting the indexes and saving any * information you will need later. Then use the saved information in * dessertAppStatsTable_row_prep() for populating data. * * @note * If you need consistency between rows (like you want statistics * for each row to be from the same time frame), you should set all * data here. * */ int dessertAppStatsTable_container_load(netsnmp_container * container) { dessertAppStatsTable_rowreq_ctx *rowreq_ctx; size_t count = 0; dessert_agentx_appstats_t *appstats_list = NULL; dessert_agentx_appstats_t *appstat; /* * temporary storage for index values */ long appStatsIndex; DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_container_load", "called\n")); dessert_debug("dessertAppStatsTable_container_load called"); /* harvest the appstats from the callbacks registered via *dessert_agentx_appstats_add* */ if (_dessert_agentx_appstats_harvest_callbacks(&appstats_list) == DESSERT_ERR) return MFD_RESOURCE_UNAVAILABLE; /* * Load/update data in the dessertAppStatsTable container. * loop over your dessertAppStatsTable data, allocate a rowreq context, * set the index(es) [and data, optionally] and insert into * the container. */ DL_FOREACH(appstats_list, appstat) { appStatsIndex = count++; /* * set indexes in new dessertAppStatsTable rowreq context. */ rowreq_ctx = dessertAppStatsTable_allocate_rowreq_ctx(); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "memory allocation failed\n"); return MFD_RESOURCE_UNAVAILABLE; } if (MFD_SUCCESS != dessertAppStatsTable_indexes_set(rowreq_ctx, appStatsIndex)) { snmp_log(LOG_ERR, "error setting index while loading " "dessertAppStatsTable data.\n"); dessertAppStatsTable_release_rowreq_ctx(rowreq_ctx); continue; } /* clear all column flags */ rowreq_ctx->column_exists_flags = 0; /* these columns are always present*/ rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSNAME_FLAG | COLUMN_APPSTATSDESC_FLAG | COLUMN_APPSTATSNODEORLINK_FLAG | COLUMN_APPSTATSVALUETYPE_FLAG; rowreq_ctx->data.appStatsName_len = strlen(appstat->name); strcpy(rowreq_ctx->data.appStatsName, appstat->name); rowreq_ctx->data.appStatsDesc_len = strlen(appstat->desc); strcpy(rowreq_ctx->data.appStatsDesc, appstat->desc); appStatsNodeOrLink_map(&(rowreq_ctx->data.appStatsNodeOrLink),appstat->node_or_link); appStatsValueType_map(&(rowreq_ctx->data.appStatsValueType),appstat->value_type); /* are the macaddress? columns present?*/ switch (appstat->node_or_link) { case DESSERT_APPSTATS_NODEORLINK_NONE: break; case DESSERT_APPSTATS_NODEORLINK_NODE: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSMACADDRESS1_FLAG; rowreq_ctx->data.appStatsMacAddress1_len = ETHER_ADDR_LEN; memcpy(rowreq_ctx->data.appStatsMacAddress1, appstat->macaddress1, ETHER_ADDR_LEN); break; case DESSERT_APPSTATS_NODEORLINK_LINK: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSMACADDRESS1_FLAG | COLUMN_APPSTATSMACADDRESS2_FLAG; rowreq_ctx->data.appStatsMacAddress1_len = ETHER_ADDR_LEN; memcpy(rowreq_ctx->data.appStatsMacAddress1, appstat->macaddress1, ETHER_ADDR_LEN); rowreq_ctx->data.appStatsMacAddress2_len = ETHER_ADDR_LEN; memcpy(rowreq_ctx->data.appStatsMacAddress2, appstat->macaddress2, ETHER_ADDR_LEN); break; default: dessert_err("appstats->node_or_link not valid!"); } /* which of the 'value'-columns is actually present? */ switch (appstat->value_type) { case DESSERT_APPSTATS_VALUETYPE_BOOL: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSTRUTHVALUE_FLAG; appStatsTruthValue_map(&(rowreq_ctx->data.appStatsTruthValue),appstat->bool); break; case DESSERT_APPSTATS_VALUETYPE_INT32: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSINTEGER32_FLAG; rowreq_ctx->data.appStatsInteger32 = appstat->int32; break; case DESSERT_APPSTATS_VALUETYPE_UINT32: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSUNSIGNED32_FLAG; rowreq_ctx->data.appStatsUnsigned32 = appstat->uint32; break; case DESSERT_APPSTATS_VALUETYPE_COUNTER64: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSCOUNTER64_FLAG; rowreq_ctx->data.appStatsCounter64.low = appstat->counter64 & 0xffffffff; rowreq_ctx->data.appStatsCounter64.high = appstat->counter64 >> 32; break; case DESSERT_APPSTATS_VALUETYPE_OCTETSTRING: rowreq_ctx->column_exists_flags |= COLUMN_APPSTATSOCTETSTRING_FLAG; rowreq_ctx->data.appStatsOctetString_len = appstat->octetstring_len; memcpy(&(rowreq_ctx->data.appStatsOctetString), appstat->octetstring, appstat->octetstring_len); break; default: dessert_err("appstats->value_type not valid! [%s]", appstat->name); } /* * insert into table container */ CONTAINER_INSERT(container, rowreq_ctx); } _dessert_agentx_appstats_free_list(&appstats_list); DEBUGMSGT(("verbose:dessertAppStatsTable:dessertAppStatsTable_container_load", "inserted %d records\n", count)); return MFD_SUCCESS; } /* dessertAppStatsTable_container_load */ /** * container clean up * * @param container container with all current items * * This optional callback is called prior to all * item's being removed from the container. If you * need to do any processing before that, do it here. * * @note * The MFD helper will take care of releasing all the row contexts. * */ void dessertAppStatsTable_container_free(netsnmp_container * container) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_container_free", "called\n")); /* * TODO:380:M: Free dessertAppStatsTable container data. */ } /* dessertAppStatsTable_container_free */ /** * prepare row for processing. * * When the agent has located the row for a request, this function is * called to prepare the row for processing. If you fully populated * the data context during the index setup phase, you may not need to * do anything. * * @param rowreq_ctx pointer to a context. * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. */ int dessertAppStatsTable_row_prep(dessertAppStatsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_row_prep", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:390:o: Prepare row for request. * If populating row data was delayed, this is the place to * fill in the row for this request. */ return MFD_SUCCESS; } /* dessertAppStatsTable_row_prep */ /** @} */ libdessert0.87-0.87.2/snmp/dessertSysifTable_data_get.c0000644000175000017500000004134611331020526021012 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertSysifTable.h" /** @defgroup data_get data_get: Routines to get data * * TODO:230:M: Implement dessertSysifTable get routines. * TODO:240:M: Implement dessertSysifTable mapping routines (if any). * * These routine are used to get the value for individual objects. The * row context is passed, along with a pointer to the memory where the * value should be copied. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ /* * --------------------------------------------------------------------- * * TODO:200:r: Implement dessertSysifTable data context functions. */ /** * set mib index(es) * * @param tbl_idx mib index structure * @param sysifIndex_val * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This convenience function is useful for setting all the MIB index * components with a single function call. It is assume that the C values * have already been mapped from their native/rawformat to the MIB format. */ int dessertSysifTable_indexes_set_tbl_idx(dessertSysifTable_mib_index * tbl_idx, long sysifIndex_val) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_indexes_set_tbl_idx", "called\n")); /* * sysifIndex(1)///()//L/a/w/e/r/d/h */ tbl_idx->sysifIndex = sysifIndex_val; return MFD_SUCCESS; } /* dessertSysifTable_indexes_set_tbl_idx */ /** * @internal * set row context indexes * * @param reqreq_ctx the row context that needs updated indexes * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This function sets the mib indexs, then updates the oid indexs * from the mib index. */ int dessertSysifTable_indexes_set(dessertSysifTable_rowreq_ctx * rowreq_ctx, long sysifIndex_val) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_indexes_set", "called\n")); if (MFD_SUCCESS != dessertSysifTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, sysifIndex_val)) return MFD_ERROR; /* * convert mib index to oid index */ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); if (0 != dessertSysifTable_index_to_oid(&rowreq_ctx->oid_idx, &rowreq_ctx->tbl_idx)) { return MFD_ERROR; } return MFD_SUCCESS; } /* dessertSysifTable_indexes_set */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifName * sysifName is subid 2 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.2 * Description: name of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /** * Extract the current value of the sysifName data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param sysifName_val_ptr_ptr * Pointer to storage for a char variable * @param sysifName_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by sysifName. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*sysifName_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update sysifName_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int sysifName_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, char **sysifName_val_ptr_ptr, size_t *sysifName_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != sysifName_val_ptr_ptr) && (NULL != *sysifName_val_ptr_ptr)); netsnmp_assert(NULL != sysifName_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertSysifTable:sysifName_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the sysifName data. * copy (* sysifName_val_ptr_ptr ) data and (* sysifName_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for sysifName data */ if ((NULL == (*sysifName_val_ptr_ptr)) || ((*sysifName_val_ptr_len_ptr) < (rowreq_ctx->data.sysifName_len * sizeof(rowreq_ctx->data.sysifName[0])))) { /* * allocate space for sysifName data */ (*sysifName_val_ptr_ptr) = malloc(rowreq_ctx->data.sysifName_len * sizeof(rowreq_ctx->data.sysifName[0])); if (NULL == (*sysifName_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*sysifName_val_ptr_len_ptr) = rowreq_ctx->data.sysifName_len * sizeof(rowreq_ctx->data.sysifName[0]); memcpy((*sysifName_val_ptr_ptr), rowreq_ctx->data.sysifName, rowreq_ctx->data.sysifName_len * sizeof(rowreq_ctx->data.sysifName[0])); return MFD_SUCCESS; } /* sysifName_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifMacAddress * sysifMacAddress is subid 3 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.3 * Description: hardware address of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /** * Extract the current value of the sysifMacAddress data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param sysifMacAddress_val_ptr_ptr * Pointer to storage for a char variable * @param sysifMacAddress_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by sysifMacAddress. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*sysifMacAddress_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update sysifMacAddress_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int sysifMacAddress_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, char **sysifMacAddress_val_ptr_ptr, size_t *sysifMacAddress_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != sysifMacAddress_val_ptr_ptr) && (NULL != *sysifMacAddress_val_ptr_ptr)); netsnmp_assert(NULL != sysifMacAddress_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertSysifTable:sysifMacAddress_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the sysifMacAddress data. * copy (* sysifMacAddress_val_ptr_ptr ) data and (* sysifMacAddress_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for sysifMacAddress data */ if ((NULL == (*sysifMacAddress_val_ptr_ptr)) || ((*sysifMacAddress_val_ptr_len_ptr) < (rowreq_ctx->data.sysifMacAddress_len * sizeof(rowreq_ctx->data.sysifMacAddress[0])))) { /* * allocate space for sysifMacAddress data */ (*sysifMacAddress_val_ptr_ptr) = malloc(rowreq_ctx->data.sysifMacAddress_len * sizeof(rowreq_ctx->data.sysifMacAddress[0])); if (NULL == (*sysifMacAddress_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*sysifMacAddress_val_ptr_len_ptr) = rowreq_ctx->data.sysifMacAddress_len * sizeof(rowreq_ctx->data.sysifMacAddress[0]); memcpy((*sysifMacAddress_val_ptr_ptr), rowreq_ctx->data.sysifMacAddress, rowreq_ctx->data.sysifMacAddress_len * sizeof(rowreq_ctx->data.sysifMacAddress[0])); return MFD_SUCCESS; } /* sysifMacAddress_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifInPkts * sysifInPkts is subid 4 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.4 * Description: packet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the sysifInPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param sysifInPkts_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int sysifInPkts_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifInPkts_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != sysifInPkts_val_ptr); /* * TODO:231:o: |-> copy sysifInPkts data. * get (* sysifInPkts_val_ptr ).low and (* sysifInPkts_val_ptr ).high from rowreq_ctx->data */ (*sysifInPkts_val_ptr).high = rowreq_ctx->data.sysifInPkts.high; (*sysifInPkts_val_ptr).low = rowreq_ctx->data.sysifInPkts.low; return MFD_SUCCESS; } /* sysifInPkts_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifOutPkts * sysifOutPkts is subid 5 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.5 * Description: packet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the sysifOutPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param sysifOutPkts_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int sysifOutPkts_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifOutPkts_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != sysifOutPkts_val_ptr); /* * TODO:231:o: |-> copy sysifOutPkts data. * get (* sysifOutPkts_val_ptr ).low and (* sysifOutPkts_val_ptr ).high from rowreq_ctx->data */ (*sysifOutPkts_val_ptr).high = rowreq_ctx->data.sysifOutPkts.high; (*sysifOutPkts_val_ptr).low = rowreq_ctx->data.sysifOutPkts.low; return MFD_SUCCESS; } /* sysifOutPkts_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifInOctets * sysifInOctets is subid 6 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.6 * Description: octet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the sysifInOctets data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param sysifInOctets_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int sysifInOctets_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifInOctets_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != sysifInOctets_val_ptr); /* * TODO:231:o: |-> copy sysifInOctets data. * get (* sysifInOctets_val_ptr ).low and (* sysifInOctets_val_ptr ).high from rowreq_ctx->data */ (*sysifInOctets_val_ptr).high = rowreq_ctx->data.sysifInOctets.high; (*sysifInOctets_val_ptr).low = rowreq_ctx->data.sysifInOctets.low; return MFD_SUCCESS; } /* sysifInOctets_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertSysifEntry.sysifOutOctets * sysifOutOctets is subid 7 of dessertSysifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7.1.7 * Description: octet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the sysifOutOctets data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param sysifOutOctets_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int sysifOutOctets_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifOutOctets_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != sysifOutOctets_val_ptr); /* * TODO:231:o: |-> copy sysifOutOctets data. * get (* sysifOutOctets_val_ptr ).low and (* sysifOutOctets_val_ptr ).high from rowreq_ctx->data */ (*sysifOutOctets_val_ptr).high = rowreq_ctx->data.sysifOutOctets.high; (*sysifOutOctets_val_ptr).low = rowreq_ctx->data.sysifOutOctets.low; return MFD_SUCCESS; } /* sysifOutOctets_get */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_data_set.c0000644000175000017500000000105711331020526021137 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertMeshifTable.h" /** @defgroup data_set data_set: Routines to set data * * These routines are used to set the value for individual objects. The * row context is passed, along with the new value. * * @{ */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_oids.h0000644000175000017500000000332411331020526020641 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ * * $Id:$ */ #ifndef DESSERTAPPSTATSTABLE_OIDS_H #define DESSERTAPPSTATSTABLE_OIDS_H #ifdef __cplusplus extern "C" { #endif /* * column number definitions for table dessertAppStatsTable */ #define DESSERTAPPSTATSTABLE_OID 1,3,6,1,4,1,18898,0,19,10,1,1,8 #define COLUMN_APPSTATSINDEX 1 #define COLUMN_APPSTATSNAME 2 #define COLUMN_APPSTATSNAME_FLAG (0x1 << 1) #define COLUMN_APPSTATSDESC 3 #define COLUMN_APPSTATSDESC_FLAG (0x1 << 2) #define COLUMN_APPSTATSNODEORLINK 4 #define COLUMN_APPSTATSNODEORLINK_FLAG (0x1 << 3) #define COLUMN_APPSTATSVALUETYPE 5 #define COLUMN_APPSTATSVALUETYPE_FLAG (0x1 << 4) #define COLUMN_APPSTATSMACADDRESS1 6 #define COLUMN_APPSTATSMACADDRESS1_FLAG (0x1 << 5) #define COLUMN_APPSTATSMACADDRESS2 7 #define COLUMN_APPSTATSMACADDRESS2_FLAG (0x1 << 6) #define COLUMN_APPSTATSTRUTHVALUE 8 #define COLUMN_APPSTATSTRUTHVALUE_FLAG (0x1 << 7) #define COLUMN_APPSTATSINTEGER32 9 #define COLUMN_APPSTATSINTEGER32_FLAG (0x1 << 8) #define COLUMN_APPSTATSUNSIGNED32 10 #define COLUMN_APPSTATSUNSIGNED32_FLAG (0x1 << 9) #define COLUMN_APPSTATSCOUNTER64 11 #define COLUMN_APPSTATSCOUNTER64_FLAG (0x1 << 10) #define COLUMN_APPSTATSOCTETSTRING 12 #define COLUMN_APPSTATSOCTETSTRING_FLAG (0x1 << 11) #define DESSERTAPPSTATSTABLE_MIN_COL COLUMN_APPSTATSNAME #define DESSERTAPPSTATSTABLE_MAX_COL COLUMN_APPSTATSOCTETSTRING #ifdef __cplusplus } #endif #endif /* DESSERTAPPSTATSTABLE_OIDS_H */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable.h0000644000175000017500000002024111331020526017745 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTAPPPARAMSTABLE_H #define DESSERTAPPPARAMSTABLE_H #ifdef __cplusplus extern "C" { #endif /** @addtogroup misc misc: Miscellaneous routines * * @{ */ #include /* * other required module components */ /* *INDENT-OFF* */ config_add_mib(DESSERT-MIB) config_require(DESSERT-MIB/dessertAppParamsTable/dessertAppParamsTable_interface) config_require(DESSERT-MIB/dessertAppParamsTable/dessertAppParamsTable_data_access) config_require(DESSERT-MIB/dessertAppParamsTable/dessertAppParamsTable_data_get) config_require(DESSERT-MIB/dessertAppParamsTable/dessertAppParamsTable_data_set) /* *INDENT-ON* */ /* * OID and column number definitions for dessertAppParamsTable */ #include "dessertAppParamsTable_oids.h" /* * enum definions */ #include "dessertAppParamsTable_enums.h" /* ********************************************************************* * function declarations */ void init_dessertAppParamsTable(void); void shutdown_dessertAppParamsTable(void); /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ /* ********************************************************************* * 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 dessertAppParamsTable registration context. */ typedef netsnmp_data_list dessertAppParamsTable_registration; /**********************************************************************/ /* * TODO:110:r: |-> Review dessertAppParamsTable data context structure. * This structure is used to represent the data for dessertAppParamsTable. */ /* * This structure contains storage for all the columns defined in the * dessertAppParamsTable. */ typedef struct dessertAppParamsTable_data_s { /* * appParamsName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char appParamsName[255]; size_t appParamsName_len; /* # of char elements, not bytes */ /* * appParamsDesc(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char appParamsDesc[255]; size_t appParamsDesc_len; /* # of char elements, not bytes */ /* * appParamsValueType(4)/DessertAppValueType/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ u_long appParamsValueType; /* * appParamsTruthValue(5)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ u_long appParamsTruthValue; /* * appParamsInteger32(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */ long appParamsInteger32; /* * appParamsUnsigned32(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/d/h */ u_long appParamsUnsigned32; /* * appParamsOctetString(9)/DessertApplicationOctetString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ char appParamsOctetString[1024]; size_t appParamsOctetString_len; /* # of char elements, not bytes */ } dessertAppParamsTable_data; /* ********************************************************************* * TODO:115:o: |-> Review dessertAppParamsTable 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 dessertAppParamsTable_data dessertAppParamsTable_undo_data; /* * TODO:120:r: |-> Review dessertAppParamsTable mib index. * This structure is used to represent the index for dessertAppParamsTable. */ typedef struct dessertAppParamsTable_mib_index_s { /* * appParamsIndex(1)/DessertAppParamsIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H */ long appParamsIndex; } dessertAppParamsTable_mib_index; /* * TODO:121:r: | |-> Review dessertAppParamsTable max index length. * If you KNOW that your indexes will never exceed a certain * length, update this macro to that length. */ #define MAX_dessertAppParamsTable_IDX_LEN 1 /* ********************************************************************* * TODO:130:o: |-> Review dessertAppParamsTable Row request (rowreq) context. * When your functions are called, you will be passed a * dessertAppParamsTable_rowreq_ctx pointer. */ typedef struct dessertAppParamsTable_rowreq_ctx_s { /** this must be first for container compare to work */ netsnmp_index oid_idx; oid oid_tmp[MAX_dessertAppParamsTable_IDX_LEN]; dessertAppParamsTable_mib_index tbl_idx; dessertAppParamsTable_data data; unsigned int column_exists_flags; /* flags for existence */ dessertAppParamsTable_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 dessertAppParamsTable rowreq context. */ /* * storage for future expansion */ netsnmp_data_list *dessertAppParamsTable_data_list; } dessertAppParamsTable_rowreq_ctx; typedef struct dessertAppParamsTable_ref_rowreq_ctx_s { dessertAppParamsTable_rowreq_ctx *rowreq_ctx; } dessertAppParamsTable_ref_rowreq_ctx; /* ********************************************************************* * function prototypes */ int dessertAppParamsTable_pre_request (dessertAppParamsTable_registration * user_context); int dessertAppParamsTable_post_request (dessertAppParamsTable_registration * user_context, int rc); int dessertAppParamsTable_rowreq_ctx_init (dessertAppParamsTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx); void dessertAppParamsTable_rowreq_ctx_cleanup (dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_commit(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); dessertAppParamsTable_rowreq_ctx *dessertAppParamsTable_row_find_by_mib_index (dessertAppParamsTable_mib_index * mib_idx); extern oid dessertAppParamsTable_oid[]; extern int dessertAppParamsTable_oid_size; #include "dessertAppParamsTable_interface.h" #include "dessertAppParamsTable_data_access.h" #include "dessertAppParamsTable_data_get.h" #include "dessertAppParamsTable_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 /* DESSERTAPPPARAMSTABLE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertSysifTable_enums.h0000644000175000017500000000210311331020526020362 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ * * $Id:$ */ #ifndef DESSERTSYSIFTABLE_ENUMS_H #define DESSERTSYSIFTABLE_ENUMS_H #ifdef __cplusplus extern "C" { #endif /* * NOTES on enums * ============== * * Value Mapping * ------------- * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them * below. For example, a boolean flag (1/0) is usually represented * as a TruthValue in a MIB, which maps to the values (1/2). * */ /************************************************************************* ************************************************************************* * * enum definitions for table dessertSysifTable * ************************************************************************* *************************************************************************/ #ifdef __cplusplus } #endif #endif /* DESSERTSYSIFTABLE_ENUMS_H */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_data_set.h0000644000175000017500000000111211331020526021460 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ */ #ifndef DESSERTAPPSTATSTABLE_DATA_SET_H #define DESSERTAPPSTATSTABLE_DATA_SET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * SET function declarations */ /* ********************************************************************* * SET Table declarations */ #ifdef __cplusplus } #endif #endif /* DESSERTAPPSTATSTABLE_DATA_SET_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable_oids.h0000644000175000017500000000157511331020526020205 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ * * $Id:$ */ #ifndef DESSERTSYSIFTABLE_OIDS_H #define DESSERTSYSIFTABLE_OIDS_H #ifdef __cplusplus extern "C" { #endif /* * column number definitions for table dessertSysifTable */ #define DESSERTSYSIFTABLE_OID 1,3,6,1,4,1,18898,0,19,10,1,1,7 #define COLUMN_SYSIFINDEX 1 #define COLUMN_SYSIFNAME 2 #define COLUMN_SYSIFMACADDRESS 3 #define COLUMN_SYSIFINPKTS 4 #define COLUMN_SYSIFOUTPKTS 5 #define COLUMN_SYSIFINOCTETS 6 #define COLUMN_SYSIFOUTOCTETS 7 #define DESSERTSYSIFTABLE_MIN_COL COLUMN_SYSIFNAME #define DESSERTSYSIFTABLE_MAX_COL COLUMN_SYSIFOUTOCTETS #ifdef __cplusplus } #endif #endif /* DESSERTSYSIFTABLE_OIDS_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable_data_set.c0000644000175000017500000000105611331020526021020 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertSysifTable.h" /** @defgroup data_set data_set: Routines to set data * * These routines are used to set the value for individual objects. The * row context is passed, along with the new value. * * @{ */ /** @} */ libdessert0.87-0.87.2/snmp/dessertSysifTable-README-FIRST.txt0000644000175000017500000001464511331020526021401 0ustar dvddvd************************************************************************ dessertSysifTable README ------------------------------------------------------------------------ This document describes the results of the mib2c code generation system using the mfd code generation template. The resulting files are documented both in this README file as well as per-table specific README files. All of the files generated by this run of mib2c will begin with the dessertSysifTable prefix. Quick Start ----------- For those interested in a quick start, to get a pseudo-todo list, try this command in directory with the generated code: grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n Key: :o: Optional :r: Recommended :M: Mandatory :A: Advanced users This will give you and ordered list of places in the code that you may (or must) take a closer look at). You may also want to take a look at the on-line tutorial, found here: http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html MIBs For Dummies Overview ------------------------- The MIBs For Dummies (MFD) configuration files have been written to help SNMP novices implement SNMP MIBs. This section will be a brief introduction to some of the general concepts you should be familar with. Managed Information Base (MIB) ------------------------------ A SNMP MIB (Managed information base) is a text file that describes the syntax for some set of data objects. The MIB creates a correlation between an ASCII name for an object and a number OID (Object Identifier). The SNMP protocol communicates information using the OIDs, and the MIB allows tools to display a name, which we humans find easier to deal with. To use an analogy, a MIB is much like a menu at a restaurant. If you've ever been to a reataurant and ordered a meal, and later received a bill that simply had '#6' on it, you get the idea. The name is easier for the customers to remember, and the waiters and chefs use the number for efficency. Scalars ------- A scalar variable is a unique object in a MIB which can represent a single value. For example, the SNMP standard MIB-II defines a variable, sysContact.0, which is a string containing the contact information for the person in charge of a particular agent. Note that scalar variable always end with '.0'. Rows and Tables --------------- When a group of related attributes occur more than once, they can be grouped together in a table. A table has an index, which uniquely identifies a particular row, and data columns, which contain the attributes for that row. For example, the SNMP standard MIB-II defines a table, ifTable, which contains information on the ethernet interfaces on a system. Data Structures --------------- The code generated by the MFD configuration files has a few important structures. The Data Context ---------------- The data context structure should contain the necessary information to provide the data for the columns in a given row. As long as you can extract the data for a column for the data context, the data context can be anything you want: a pointer to an existing structure, the parameters needed for a function call or an actual copy of the data. By default, a data context structure is generated with storage for all the data in a row. Information on changing the default is presented later on in this help. The MIB Context --------------- The MIB context structure is generated with storage for all the indexes of a table. This data will be used when searching for the correct row to process for a request. The Row Request Context ----------------------- Each table will have a unique data structure for holding data during the processing of a particular row. The row request context contains the registration context (that you supply during initilization), the data context, the MIB context, the undo context (for settable tables) and other data. There is also a netsnmp_data_list, which can be used to temporary storage during processing. The Table Registration Pointer ------------------------------ During initilization, you may provide a pointer to arbitrary data for you own use. This pointer will be saved in the row request context, and is passed as a parameter to several functions. It is not required, and is provided as a way for you to access table specific data in the generated code. These files are top-level files potentially useful for all the tables: ------------------------------------------------------------------------ File : dessertSysifTable_Makefile ---------------------------------------------------------------------- Purpose : Make file for compiling a (sub)agent. This file is only useful if you don't want to compile your code directly into the Net-SNMP master agent. Editable: Optional Usage : make -f dessertSysifTable_Makefile File : dessertSysifTable_subagent.c ---------------------------------------------------------------------- Purpose : This file contains a main() function for an agent or sub-agent and is compiled using the Makefile above. Table specific README files ------------------------------------------------------------------------ Each table for which code was generated has its own README file describing the files specifically associated with each table. You should probably read these next: dessertSysifTable-README-dessertSysifTable.txt These are miscellaneous auto-generated code files you generally shouldn't edit. They contain code that ties your code together with the Net-SNMP agent. ------------------------------------------------------------------------ File : dessertSysifTable.h Purpose : Header file for the module set. Includes config_require macros to auto-load the other code pieces when compiled into the agent. File : dessertSysifTable_oids.h Purpose : C #define definitions of the tables, columns, and OIDs File : dessertSysifTable_enums.h Purpose : C #define definitions of the enumerated type values for each column of each table that requires them. File : dessertSysifTable_interface.c Purpose : MFD interface to Net-SNMP. This auto-generated code ties the functions you will fill out to the code that the agent needs. libdessert0.87-0.87.2/snmp/dessertAppStatsTable_enums.h0000644000175000017500000001006011331020526021025 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ * * $Id:$ */ #ifndef DESSERTAPPSTATSTABLE_ENUMS_H #define DESSERTAPPSTATSTABLE_ENUMS_H #include "../dessert.h" #ifdef __cplusplus extern "C" { #endif /* * NOTES on enums * ============== * * Value Mapping * ------------- * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them * below. For example, a boolean flag (1/0) is usually represented * as a TruthValue in a MIB, which maps to the values (1/2). * */ /************************************************************************* ************************************************************************* * * enum definitions for table dessertAppStatsTable * ************************************************************************* *************************************************************************/ /************************************************************* * constants for enums for the MIB node * appStatsNodeOrLink (INTEGER / ASN_INTEGER) * * since a Textual Convention may be referenced more than once in a * MIB, protect againt redefinitions of the enum values. */ #ifndef APPSTATSNODEORLINK_ENUMS #define APPSTATSNODEORLINK_ENUMS #define APPSTATSNODEORLINK_NONE 0 #define APPSTATSNODEORLINK_NODE 1 #define APPSTATSNODEORLINK_LINK 2 #endif /* APPSTATSNODEORLINK_ENUMS */ /* * TODO:140:o: Define your interal representation of appStatsNodeOrLink enums. * (used for value mapping; see notes at top of file) */ #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSNODEORLINK_NONE DESSERT_APPSTATS_NODEORLINK_NONE #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSNODEORLINK_NODE DESSERT_APPSTATS_NODEORLINK_NODE #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSNODEORLINK_LINK DESSERT_APPSTATS_NODEORLINK_LINK /************************************************************* * constants for enums for the MIB node * appStatsValueType (INTEGER / ASN_INTEGER) * * since a Textual Convention may be referenced more than once in a * MIB, protect againt redefinitions of the enum values. */ #ifndef APPSTATSVALUETYPE_ENUMS #define APPSTATSVALUETYPE_ENUMS #define APPSTATSVALUETYPE_BOOL 0 #define APPSTATSVALUETYPE_INT32 1 #define APPSTATSVALUETYPE_UINT32 2 #define APPSTATSVALUETYPE_COUNTER64 3 #define APPSTATSVALUETYPE_OCTETSTRING 4 #endif /* APPSTATSVALUETYPE_ENUMS */ /* * TODO:140:o: Define your interal representation of appStatsValueType enums. * (used for value mapping; see notes at top of file) */ #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_BOOL DESSERT_APPSTATS_VALUETYPE_BOOL #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_INT32 DESSERT_APPSTATS_VALUETYPE_INT32 #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_UINT32 DESSERT_APPSTATS_VALUETYPE_UINT32 #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_COUNTER64 DESSERT_APPSTATS_VALUETYPE_COUNTER64 #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_OCTETSTRING DESSERT_APPSTATS_VALUETYPE_OCTETSTRING /************************************************************* * constants for enums for the MIB node * appStatsTruthValue (TruthValue / ASN_INTEGER) * * since a Textual Convention may be referenced more than once in a * MIB, protect againt redefinitions of the enum values. */ #ifndef TRUTHVALUE_ENUMS #define TRUTHVALUE_ENUMS #define TRUTHVALUE_TRUE 1 #define TRUTHVALUE_FALSE 2 #endif /* TRUTHVALUE_ENUMS */ /* * TODO:140:o: Define your interal representation of appStatsTruthValue enums. * (used for value mapping; see notes at top of file) */ #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSTRUTHVALUE_TRUE DESSERT_APPSTATS_BOOL_TRUE #define INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSTRUTHVALUE_FALSE DESSERT_APPSTATS_BOOL_FALSE #ifdef __cplusplus } #endif #endif /* DESSERTAPPSTATSTABLE_ENUMS_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable_subagent.c0000644000175000017500000001350611331020526021047 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15795 $ of $ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertSysifTable.h" #include static int keep_running; static RETSIGTYPE stop_server(int a) { keep_running = 0; } static void usage(void) { printf ("usage: dessertSysifTable [-D] [-f] [-L] [-M] [-H] [LISTENING ADDRESSES]\n" "\t-f Do not fork() from the calling shell.\n" "\t-DTOKEN[,TOKEN,...]\n" "\t\tTurn on debugging output for the given TOKEN(s).\n" "\t\tWithout any tokens specified, it defaults to printing\n" "\t\tall the tokens (which is equivalent to the keyword 'ALL').\n" "\t\tYou might want to try ALL for extremely verbose output.\n" "\t\tNote: You can't put a space between the -D and the TOKENs.\n" "\t-H\tDisplay a list of configuration file directives\n" "\t\tunderstood by the agent and then exit.\n" "\t-M\tRun as a normal SNMP Agent instead of an AgentX sub-agent.\n" "\t-x ADDRESS\tconnect to master agent at ADDRESS (default /var/agentx/master).\n" "\t-L\tDo not open a log file; print all messages to stderr.\n"); exit(0); } int main(int argc, char **argv) { int agentx_subagent = 1; /* change this if you want to be a SNMP master agent */ /* * Defs for arg-handling code: handles setting of policy-related variables */ int ch; extern char *optarg; int dont_fork = 0, use_syslog = 0; char *agentx_socket = NULL; while ((ch = getopt(argc, argv, "D:fHLMx:")) != EOF) switch (ch) { case 'D': debug_register_tokens(optarg); snmp_set_do_debugging(1); break; case 'f': dont_fork = 1; break; case 'H': netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1); init_agent("dessertSysifTable"); /* register our .conf handlers */ init_dessertSysifTable(); init_snmp("dessertSysifTable"); fprintf(stderr, "Configuration directives understood:\n"); read_config_print_usage(" "); exit(0); case 'M': agentx_subagent = 0; break; case 'L': use_syslog = 0; /* use stderr */ break; case 'x': agentx_socket = optarg; break; default: fprintf(stderr, "unknown option %c\n", ch); usage(); } if (optind < argc) { int i; /* * There are optional transport addresses on the command line. */ DEBUGMSGTL(("snmpd/main", "optind %d, argc %d\n", optind, argc)); for (i = optind; i < argc; i++) { char *c, *astring; if ((c = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS))) { astring = malloc(strlen(c) + 2 + strlen(argv[i])); if (astring == NULL) { fprintf(stderr, "malloc failure processing argv[%d]\n", i); exit(1); } sprintf(astring, "%s,%s", c, argv[i]); netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS, astring); SNMP_FREE(astring); } else { netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS, argv[i]); } } DEBUGMSGTL(("snmpd/main", "port spec: %s\n", netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS))); } /* * we're an agentx subagent? */ if (agentx_subagent) { /* * make us a agentx client. */ netsnmp_enable_subagent(); if (NULL != agentx_socket) netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET, agentx_socket); } snmp_disable_log(); if (use_syslog) snmp_enable_calllog(); else snmp_enable_stderrlog(); /* * daemonize */ if (!dont_fork) { int rc = netsnmp_daemonize(1, !use_syslog); if (rc) exit(-1); } /* * initialize tcp/ip if necessary */ SOCK_STARTUP; /* * initialize the agent library */ init_agent("dessertSysifTable"); /* * init dessertSysifTable mib code */ init_dessertSysifTable(); /* * read dessertSysifTable.conf files. */ init_snmp("dessertSysifTable"); /* * If we're going to be a snmp master agent, initial the ports */ if (!agentx_subagent) init_master_agent(); /* open the port to listen on (defaults to udp:161) */ /* * In case we recevie a request to stop (kill -TERM or kill -INT) */ keep_running = 1; signal(SIGTERM, stop_server); signal(SIGINT, stop_server); /* * you're main loop here... */ while (keep_running) { /* * if you use select(), see snmp_select_info() in snmp_api(3) */ /* * --- OR --- */ agent_check_and_process(1); /* 0 == don't block */ } /* * at shutdown time */ snmp_shutdown("dessertSysifTable"); SOCK_CLEANUP; exit(0); } libdessert0.87-0.87.2/snmp/dessertAppParamsTable_data_access.c0000644000175000017500000002637411331020526022267 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppParamsTable.h" #include "dessertAppParamsTable_data_access.h" #include "../dessert.h" #include "../dessert_internal.h" /** @ingroup interface * @addtogroup data_access data_access: Routines to access data * * These routines are used to locate the data used to satisfy * requests. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ /** * initialization for dessertAppParamsTable data access * * This function is called during startup to allow you to * allocate any resources you need for the data table. * * @param dessertAppParamsTable_reg * Pointer to dessertAppParamsTable_registration * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : unrecoverable error. */ int dessertAppParamsTable_init_data(dessertAppParamsTable_registration * dessertAppParamsTable_reg) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_init_data", "called\n")); /* * TODO:303:o: Initialize dessertAppParamsTable data. */ return MFD_SUCCESS; } /* dessertAppParamsTable_init_data */ /** * container overview * */ /** * container initialization * * @param container_ptr_ptr A pointer to a container pointer. If you * create a custom container, use this parameter to return it * to the MFD helper. If set to NULL, the MFD helper will * allocate a container for you. * * This function is called at startup to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. If no custom * container is allocated, the MFD code will create one for your. * * @remark * This would also be a good place to do any initialization needed * for you data source. For example, opening a connection to another * process that will supply the data, opening a database, etc. */ void dessertAppParamsTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_container_init", "called\n")); if (NULL == container_ptr_ptr) { snmp_log(LOG_ERR, "bad container param to dessertAppParamsTable_container_init\n"); return; } /* * For advanced users, you can use a custom container. If you * do not create one, one will be created for you. */ *container_ptr_ptr = NULL; if (NULL == cache) { snmp_log(LOG_ERR, "bad cache param to dessertAppParamsTable_container_init\n"); return; } /* * TODO:345:A: Set up dessertAppStatsTable cache properties. * * Also for advanced users, you can set parameters for the * cache. Do not change the magic pointer, as it is used * by the MFD helper. To completely disable caching, set * cache->enabled to 0. */ cache->timeout = DESSERTAPPPARAMSTABLE_CACHE_TIMEOUT; /* seconds */ } /* dessertAppParamsTable_container_init */ /** * container shutdown * * @param container_ptr A pointer to the container. * * This function is called at shutdown to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. * * This function is called before dessertAppParamsTable_container_free(). * * @remark * This would also be a good place to do any cleanup needed * for you data source. For example, closing a connection to another * process that supplied the data, closing a database, etc. */ void dessertAppParamsTable_container_shutdown(netsnmp_container * container_ptr) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_container_shutdown", "called\n")); if (NULL == container_ptr) { snmp_log(LOG_ERR, "bad params to dessertAppParamsTable_container_shutdown\n"); return; } } /* dessertAppParamsTable_container_shutdown */ /** * load initial data * * TODO:350:M: Implement dessertAppParamsTable data load * * @param container container to which items should be inserted * * @retval MFD_SUCCESS : success. * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source * @retval MFD_ERROR : other error. * * This function is called to load the index(es) (and data, optionally) * for the every row in the data set. * * @remark * While loading the data, the only important thing is the indexes. * If access to your data is cheap/fast (e.g. you have a pointer to a * structure in memory), it would make sense to update the data here. * If, however, the accessing the data invovles more work (e.g. parsing * some other existing data, or peforming calculations to derive the data), * then you can limit yourself to setting the indexes and saving any * information you will need later. Then use the saved information in * dessertAppParamsTable_row_prep() for populating data. * * @note * If you need consistency between rows (like you want statistics * for each row to be from the same time frame), you should set all * data here. * */ int dessertAppParamsTable_container_load(netsnmp_container * container) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx; size_t count = 0; dessert_agentx_appparams_t *appparams_list = NULL; dessert_agentx_appparams_t *appparam; /* * temporary storage for index values */ long appParamsIndex; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_container_load", "called\n")); dessert_debug("dessertAppParamsTable_container_load called"); /* harvest the appparams from the getter callbacks registered via *dessert_agentx_appparams_add* */ if (_dessert_agentx_appparams_harvest_callbacks(&appparams_list) == DESSERT_ERR) { return MFD_RESOURCE_UNAVAILABLE; } /* * TODO:351:M: |-> Load/update data in the dessertAppParamsTable container. * loop over your dessertAppParamsTable data, allocate a rowreq context, * set the index(es) [and data, optionally] and insert into * the container. */ DL_FOREACH(appparams_list, appparam) { appParamsIndex = appparam->index; /* * TODO:352:M: | |-> set indexes in new dessertAppParamsTable rowreq context. * data context will be set from the param (unless NULL, * in which case a new data context will be allocated) */ rowreq_ctx = dessertAppParamsTable_allocate_rowreq_ctx(); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "memory allocation failed\n"); return MFD_RESOURCE_UNAVAILABLE; } if (MFD_SUCCESS != dessertAppParamsTable_indexes_set(rowreq_ctx, appParamsIndex)) { snmp_log(LOG_ERR, "error setting index while loading " "dessertAppParamsTable data.\n"); dessertAppParamsTable_release_rowreq_ctx(rowreq_ctx); continue; } /* clear all column flags */ rowreq_ctx->column_exists_flags = 0; /* these columns are always present*/ rowreq_ctx->column_exists_flags |= COLUMN_APPPARAMSNAME_FLAG | COLUMN_APPPARAMSDESC_FLAG | COLUMN_APPPARAMSVALUETYPE_FLAG; rowreq_ctx->data.appParamsName_len = strlen(appparam->name); strcpy(rowreq_ctx->data.appParamsName, appparam->name); rowreq_ctx->data.appParamsDesc_len = strlen(appparam->desc); strcpy(rowreq_ctx->data.appParamsDesc, appparam->desc); appParamsValueType_map(&(rowreq_ctx->data.appParamsValueType), appparam->value_type); /* which of the 'value'-columns is actually present? */ switch (appparam->value_type) { case DESSERT_APPPARAMS_VALUETYPE_BOOL: rowreq_ctx->column_exists_flags |= COLUMN_APPPARAMSTRUTHVALUE_FLAG; appParamsTruthValue_map(&(rowreq_ctx->data.appParamsTruthValue) , appparam->bool); break; case DESSERT_APPPARAMS_VALUETYPE_INT32: rowreq_ctx->column_exists_flags |= COLUMN_APPPARAMSINTEGER32_FLAG; rowreq_ctx->data.appParamsInteger32 = appparam->int32; break; case DESSERT_APPPARAMS_VALUETYPE_UINT32: rowreq_ctx->column_exists_flags |= COLUMN_APPPARAMSUNSIGNED32_FLAG; rowreq_ctx->data.appParamsUnsigned32 = appparam->uint32; break; case DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING: rowreq_ctx->column_exists_flags |= COLUMN_APPPARAMSOCTETSTRING_FLAG; rowreq_ctx->data.appParamsOctetString_len = appparam->octetstring_len; memcpy(&(rowreq_ctx->data.appParamsOctetString), appparam->octetstring, appparam->octetstring_len); break; default: dessert_err("appparam->value_type not valid!"); } /* * insert into table container */ CONTAINER_INSERT(container, rowreq_ctx); } _dessert_agentx_appparams_free_list(&appparams_list); DEBUGMSGT(("verbose:dessertAppParamsTable:dessertAppParamsTable_container_load", "inserted %d records\n", count)); return MFD_SUCCESS; } /* dessertAppParamsTable_container_load */ /** * container clean up * * @param container container with all current items * * This optional callback is called prior to all * item's being removed from the container. If you * need to do any processing before that, do it here. * * @note * The MFD helper will take care of releasing all the row contexts. * */ void dessertAppParamsTable_container_free(netsnmp_container * container) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_container_free", "called\n")); /* * TODO:380:M: Free dessertAppParamsTable container data. */ } /* dessertAppParamsTable_container_free */ /** * prepare row for processing. * * When the agent has located the row for a request, this function is * called to prepare the row for processing. If you fully populated * the data context during the index setup phase, you may not need to * do anything. * * @param rowreq_ctx pointer to a context. * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. */ int dessertAppParamsTable_row_prep(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_row_prep", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:390:o: Prepare row for request. * If populating row data was delayed, this is the place to * fill in the row for this request. */ return MFD_SUCCESS; } /* dessertAppParamsTable_row_prep */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_data_access.h0000644000175000017500000000505511331020526021614 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTMESHIFTABLE_DATA_ACCESS_H #define DESSERTMESHIFTABLE_DATA_ACCESS_H #include "../dessert_internal.h" #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * function declarations */ /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ int dessertMeshifTable_init_data(dessertMeshifTable_registration * dessertMeshifTable_reg); /* * TODO:180:o: Review dessertMeshifTable cache timeout. * The number of seconds before the cache times out */ #define DESSERTMESHIFTABLE_CACHE_TIMEOUT DESSERT_AGENTX_MESHIFTABLE_CACHE_TIMEOUT void dessertMeshifTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache); void dessertMeshifTable_container_shutdown(netsnmp_container * container_ptr); int dessertMeshifTable_container_load(netsnmp_container * container); void dessertMeshifTable_container_free(netsnmp_container * container); int dessertMeshifTable_cache_load(netsnmp_container * container); void dessertMeshifTable_cache_free(netsnmp_container * container); int dessertMeshifTable_row_prep(dessertMeshifTable_rowreq_ctx * rowreq_ctx); #ifdef __cplusplus } #endif #endif /* DESSERTMESHIFTABLE_DATA_ACCESS_H */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable.h0000644000175000017500000001767411331020526017640 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTAPPSTATSTABLE_H #define DESSERTAPPSTATSTABLE_H #ifdef __cplusplus extern "C" { #endif /** @addtogroup misc misc: Miscellaneous routines * * @{ */ #include /* * other required module components */ /* *INDENT-OFF* */ config_add_mib(DESSERT-MIB) config_require(DESSERT-MIB/dessertAppStatsTable/dessertAppStatsTable_interface) config_require(DESSERT-MIB/dessertAppStatsTable/dessertAppStatsTable_data_access) config_require(DESSERT-MIB/dessertAppStatsTable/dessertAppStatsTable_data_get) config_require(DESSERT-MIB/dessertAppStatsTable/dessertAppStatsTable_data_set) /* *INDENT-ON* */ /* * OID and column number definitions for dessertAppStatsTable */ #include "dessertAppStatsTable_oids.h" /* * enum definions */ #include "dessertAppStatsTable_enums.h" /* ********************************************************************* * function declarations */ void init_dessertAppStatsTable(void); void shutdown_dessertAppStatsTable(void); /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ /* ********************************************************************* * 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 dessertAppStatsTable registration context. */ typedef netsnmp_data_list dessertAppStatsTable_registration; /**********************************************************************/ /* * TODO:110:r: |-> Review dessertAppStatsTable data context structure. * This structure is used to represent the data for dessertAppStatsTable. */ /* * This structure contains storage for all the columns defined in the * dessertAppStatsTable. */ typedef struct dessertAppStatsTable_data_s { /* * appStatsName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char appStatsName[255]; size_t appStatsName_len; /* # of char elements, not bytes */ /* * appStatsDesc(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char appStatsDesc[255]; size_t appStatsDesc_len; /* # of char elements, not bytes */ /* * appStatsNodeOrLink(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ u_long appStatsNodeOrLink; /* * appStatsValueType(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ u_long appStatsValueType; /* * appStatsMacAddress1(6)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char appStatsMacAddress1[6]; size_t appStatsMacAddress1_len; /* # of char elements, not bytes */ /* * appStatsMacAddress2(7)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char appStatsMacAddress2[6]; size_t appStatsMacAddress2_len; /* # of char elements, not bytes */ /* * appStatsTruthValue(8)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ u_long appStatsTruthValue; /* * appStatsInteger32(9)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */ long appStatsInteger32; /* * appStatsUnsigned32(10)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h */ u_long appStatsUnsigned32; /* * appStatsCounter64(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 appStatsCounter64; /* * appStatsOctetString(12)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */ char appStatsOctetString[1024]; size_t appStatsOctetString_len; /* # of char elements, not bytes */ } dessertAppStatsTable_data; /* * TODO:120:r: |-> Review dessertAppStatsTable mib index. * This structure is used to represent the index for dessertAppStatsTable. */ typedef struct dessertAppStatsTable_mib_index_s { /* * appStatsIndex(1)///()//L/a/w/e/r/d/h */ long appStatsIndex; } dessertAppStatsTable_mib_index; /* * TODO:121:r: | |-> Review dessertAppStatsTable max index length. * If you KNOW that your indexes will never exceed a certain * length, update this macro to that length. */ #define MAX_dessertAppStatsTable_IDX_LEN 1 /* ********************************************************************* * TODO:130:o: |-> Review dessertAppStatsTable Row request (rowreq) context. * When your functions are called, you will be passed a * dessertAppStatsTable_rowreq_ctx pointer. */ typedef struct dessertAppStatsTable_rowreq_ctx_s { /** this must be first for container compare to work */ netsnmp_index oid_idx; oid oid_tmp[MAX_dessertAppStatsTable_IDX_LEN]; dessertAppStatsTable_mib_index tbl_idx; dessertAppStatsTable_data data; unsigned int column_exists_flags; /* flags for existence */ /* * 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 dessertAppStatsTable rowreq context. */ /* * storage for future expansion */ netsnmp_data_list *dessertAppStatsTable_data_list; } dessertAppStatsTable_rowreq_ctx; typedef struct dessertAppStatsTable_ref_rowreq_ctx_s { dessertAppStatsTable_rowreq_ctx *rowreq_ctx; } dessertAppStatsTable_ref_rowreq_ctx; /* ********************************************************************* * function prototypes */ int dessertAppStatsTable_pre_request(dessertAppStatsTable_registration * user_context); int dessertAppStatsTable_post_request(dessertAppStatsTable_registration * user_context, int rc); dessertAppStatsTable_rowreq_ctx *dessertAppStatsTable_row_find_by_mib_index (dessertAppStatsTable_mib_index * mib_idx); extern oid dessertAppStatsTable_oid[]; extern int dessertAppStatsTable_oid_size; #include "dessertAppStatsTable_interface.h" #include "dessertAppStatsTable_data_access.h" #include "dessertAppStatsTable_data_get.h" #include "dessertAppStatsTable_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 /* DESSERTAPPSTATSTABLE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable-README-FIRST.txt0000644000175000017500000001470611331020526022041 0ustar dvddvd************************************************************************ dessertAppStatsTable README ------------------------------------------------------------------------ This document describes the results of the mib2c code generation system using the mfd code generation template. The resulting files are documented both in this README file as well as per-table specific README files. All of the files generated by this run of mib2c will begin with the dessertAppStatsTable prefix. Quick Start ----------- For those interested in a quick start, to get a pseudo-todo list, try this command in directory with the generated code: grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n Key: :o: Optional :r: Recommended :M: Mandatory :A: Advanced users This will give you and ordered list of places in the code that you may (or must) take a closer look at). You may also want to take a look at the on-line tutorial, found here: http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html MIBs For Dummies Overview ------------------------- The MIBs For Dummies (MFD) configuration files have been written to help SNMP novices implement SNMP MIBs. This section will be a brief introduction to some of the general concepts you should be familar with. Managed Information Base (MIB) ------------------------------ A SNMP MIB (Managed information base) is a text file that describes the syntax for some set of data objects. The MIB creates a correlation between an ASCII name for an object and a number OID (Object Identifier). The SNMP protocol communicates information using the OIDs, and the MIB allows tools to display a name, which we humans find easier to deal with. To use an analogy, a MIB is much like a menu at a restaurant. If you've ever been to a reataurant and ordered a meal, and later received a bill that simply had '#6' on it, you get the idea. The name is easier for the customers to remember, and the waiters and chefs use the number for efficency. Scalars ------- A scalar variable is a unique object in a MIB which can represent a single value. For example, the SNMP standard MIB-II defines a variable, sysContact.0, which is a string containing the contact information for the person in charge of a particular agent. Note that scalar variable always end with '.0'. Rows and Tables --------------- When a group of related attributes occur more than once, they can be grouped together in a table. A table has an index, which uniquely identifies a particular row, and data columns, which contain the attributes for that row. For example, the SNMP standard MIB-II defines a table, ifTable, which contains information on the ethernet interfaces on a system. Data Structures --------------- The code generated by the MFD configuration files has a few important structures. The Data Context ---------------- The data context structure should contain the necessary information to provide the data for the columns in a given row. As long as you can extract the data for a column for the data context, the data context can be anything you want: a pointer to an existing structure, the parameters needed for a function call or an actual copy of the data. By default, a data context structure is generated with storage for all the data in a row. Information on changing the default is presented later on in this help. The MIB Context --------------- The MIB context structure is generated with storage for all the indexes of a table. This data will be used when searching for the correct row to process for a request. The Row Request Context ----------------------- Each table will have a unique data structure for holding data during the processing of a particular row. The row request context contains the registration context (that you supply during initilization), the data context, the MIB context, the undo context (for settable tables) and other data. There is also a netsnmp_data_list, which can be used to temporary storage during processing. The Table Registration Pointer ------------------------------ During initilization, you may provide a pointer to arbitrary data for you own use. This pointer will be saved in the row request context, and is passed as a parameter to several functions. It is not required, and is provided as a way for you to access table specific data in the generated code. These files are top-level files potentially useful for all the tables: ------------------------------------------------------------------------ File : dessertAppStatsTable_Makefile ---------------------------------------------------------------------- Purpose : Make file for compiling a (sub)agent. This file is only useful if you don't want to compile your code directly into the Net-SNMP master agent. Editable: Optional Usage : make -f dessertAppStatsTable_Makefile File : dessertAppStatsTable_subagent.c ---------------------------------------------------------------------- Purpose : This file contains a main() function for an agent or sub-agent and is compiled using the Makefile above. Table specific README files ------------------------------------------------------------------------ Each table for which code was generated has its own README file describing the files specifically associated with each table. You should probably read these next: dessertAppStatsTable-README-dessertAppStatsTable.txt These are miscellaneous auto-generated code files you generally shouldn't edit. They contain code that ties your code together with the Net-SNMP agent. ------------------------------------------------------------------------ File : dessertAppStatsTable.h Purpose : Header file for the module set. Includes config_require macros to auto-load the other code pieces when compiled into the agent. File : dessertAppStatsTable_oids.h Purpose : C #define definitions of the tables, columns, and OIDs File : dessertAppStatsTable_enums.h Purpose : C #define definitions of the enumerated type values for each column of each table that requires them. File : dessertAppStatsTable_interface.c Purpose : MFD interface to Net-SNMP. This auto-generated code ties the functions you will fill out to the code that the agent needs. libdessert0.87-0.87.2/snmp/dessertObjects.c0000644000175000017500000001223611331020526016502 0ustar dvddvd/** * Note: this file originally auto-generated by mib2c using * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $ */ #include #include #include #include "../dessert_internal.h" /** Initializes the dessertObjects module */ void init_dessertObjects(void) { static oid dessertMeshifNumber_oid[] = { 1, 3, 6, 1, 4, 1, 18898, 0, 19, 10, 1, 1, 4 }; static oid applicationVersion_oid[] = { 1, 3, 6, 1, 4, 1, 18898, 0, 19, 10, 1, 1, 3, 2 }; static oid protocollShortName_oid[] = { 1, 3, 6, 1, 4, 1, 18898, 0, 19, 10, 1, 1, 3, 3 }; DEBUGMSGTL((AGENT, "Initializing\n")); netsnmp_register_scalar(netsnmp_create_handler_registration ("dessertMeshifNumber", handle_dessertMeshifNumber, dessertMeshifNumber_oid, OID_LENGTH(dessertMeshifNumber_oid), HANDLER_CAN_RONLY)); netsnmp_register_scalar(netsnmp_create_handler_registration ("applicationVersion", handle_applicationVersion, applicationVersion_oid, OID_LENGTH(applicationVersion_oid), HANDLER_CAN_RONLY)); netsnmp_register_scalar(netsnmp_create_handler_registration ("protocollShortName", handle_protocollShortName, protocollShortName_oid, OID_LENGTH(protocollShortName_oid), HANDLER_CAN_RONLY)); } int handle_dessertMeshifNumber(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { u_char meshif_count; dessert_meshif_t *meshif; DL_FOREACH(dessert_meshiflist_get(), meshif){ meshif_count++; } /* * We are never called for a GETNEXT if it's registered as a * "instance", as it's "magically" handled for us. */ /* * a instance handler also only hands us one request at a time, so * we don't need to loop over a list of requests; we'll only get one. */ switch (reqinfo->mode) { case MODE_GET: DEBUGMSGTL((AGENT, "handle_dessertMeshifNumber:MODE_GET\n")); snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER, (u_char *) &meshif_count, sizeof(u_char)); break; default: /* * we should never get here, so this is a really bad error */ snmp_log(LOG_ERR, "unknown mode (%d) in handle_dessertMeshifNumber\n", reqinfo->mode); return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } int handle_applicationVersion(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { /* * We are never called for a GETNEXT if it's registered as a * "instance", as it's "magically" handled for us. */ /* * a instance handler also only hands us one request at a time, so * we don't need to loop over a list of requests; we'll only get one. */ switch (reqinfo->mode) { case MODE_GET: DEBUGMSGTL((AGENT, "handle_applicationVersion:MODE_GET\n")); snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER, (u_char *) &dessert_ver, sizeof(dessert_ver)); break; default: /* * we should never get here, so this is a really bad error */ snmp_log(LOG_ERR, "unknown mode (%d) in handle_applicationVersion\n", reqinfo->mode); return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } int handle_protocollShortName(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { /* * We are never called for a GETNEXT if it's registered as a * "instance", as it's "magically" handled for us. */ /* * a instance handler also only hands us one request at a time, so * we don't need to loop over a list of requests; we'll only get one. */ switch (reqinfo->mode) { case MODE_GET: DEBUGMSGTL((AGENT, "handle_protocollShortName:MODE_GET\n")); snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *) dessert_proto, DESSERT_PROTO_STRLEN+1); break; default: /* * we should never get here, so this is a really bad error */ snmp_log(LOG_ERR, "unknown mode (%d) in handle_protocollShortName\n", reqinfo->mode); return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } libdessert0.87-0.87.2/snmp/dessertSysifTable_data_get.h0000644000175000017500000001030111331020526021002 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ * * @file dessertSysifTable_data_get.h * * @addtogroup get * * Prototypes for get functions * * @{ */ #ifndef DESSERTSYSIFTABLE_DATA_GET_H #define DESSERTSYSIFTABLE_DATA_GET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * GET function declarations */ /* ********************************************************************* * GET Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ /* * indexes */ int sysifIndex_map(uint* *mib_sysifIndex_val_ptr, uint raw_sysifIndex_val); int sysifName_map(char **mib_sysifName_val_ptr_ptr, size_t *mib_sysifName_val_ptr_len_ptr, char *raw_sysifName_val_ptr, size_t raw_sysifName_val_ptr_len, int allow_realloc); int sysifName_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, char **sysifName_val_ptr_ptr, size_t *sysifName_val_ptr_len_ptr); int sysifMacAddress_map(char **mib_sysifMacAddress_val_ptr_ptr, size_t *mib_sysifMacAddress_val_ptr_len_ptr, char *raw_sysifMacAddress_val_ptr, size_t raw_sysifMacAddress_val_ptr_len, int allow_realloc); int sysifMacAddress_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, char **sysifMacAddress_val_ptr_ptr, size_t *sysifMacAddress_val_ptr_len_ptr); int sysifInPkts_map(U64 * mib_sysifInPkts_val_ptr, U64 raw_sysifInPkts_val); int sysifInPkts_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifInPkts_val_ptr); int sysifOutPkts_map(U64 * mib_sysifOutPkts_val_ptr, U64 raw_sysifOutPkts_val); int sysifOutPkts_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifOutPkts_val_ptr); int sysifInOctets_map(U64 * mib_sysifInOctets_val_ptr, U64 raw_sysifInOctets_val); int sysifInOctets_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifInOctets_val_ptr); int sysifOutOctets_map(U64 * mib_sysifOutOctets_val_ptr, U64 raw_sysifOutOctets_val); int sysifOutOctets_get(dessertSysifTable_rowreq_ctx * rowreq_ctx, U64 * sysifOutOctets_val_ptr); int dessertSysifTable_indexes_set_tbl_idx(dessertSysifTable_mib_index * tbl_idx, long sysifIndex_val); int dessertSysifTable_indexes_set(dessertSysifTable_rowreq_ctx * rowreq_ctx, long sysifIndex_val); #ifdef __cplusplus } #endif #endif /* DESSERTSYSIFTABLE_DATA_GET_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_data_get.c0000644000175000017500000006272011331020526021600 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppParamsTable.h" /** @defgroup data_get data_get: Routines to get data * * TODO:230:M: Implement dessertAppParamsTable get routines. * TODO:240:M: Implement dessertAppParamsTable mapping routines (if any). * * These routine are used to get the value for individual objects. The * row context is passed, along with a pointer to the memory where the * value should be copied. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ /* * --------------------------------------------------------------------- * * TODO:200:r: Implement dessertAppParamsTable data context functions. */ /** * set mib index(es) * * @param tbl_idx mib index structure * @param appParamsIndex_val * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This convenience function is useful for setting all the MIB index * components with a single function call. It is assume that the C values * have already been mapped from their native/rawformat to the MIB format. */ int dessertAppParamsTable_indexes_set_tbl_idx(dessertAppParamsTable_mib_index * tbl_idx, long appParamsIndex_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_indexes_set_tbl_idx", "called\n")); /* * appParamsIndex(1)/DessertAppParamsIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H */ tbl_idx->appParamsIndex = appParamsIndex_val; return MFD_SUCCESS; } /* dessertAppParamsTable_indexes_set_tbl_idx */ /** * @internal * set row context indexes * * @param reqreq_ctx the row context that needs updated indexes * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This function sets the mib indexs, then updates the oid indexs * from the mib index. */ int dessertAppParamsTable_indexes_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long appParamsIndex_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_indexes_set", "called\n")); if (MFD_SUCCESS != dessertAppParamsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, appParamsIndex_val)) return MFD_ERROR; /* * convert mib index to oid index */ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); if (0 != dessertAppParamsTable_index_to_oid(&rowreq_ctx->oid_idx, &rowreq_ctx->tbl_idx)) { return MFD_ERROR; } return MFD_SUCCESS; } /* dessertAppParamsTable_indexes_set */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsName * appParamsName is subid 2 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.2 * Description: The name of the parameter. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /** * Extract the current value of the appParamsName data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsName_val_ptr_ptr * Pointer to storage for a char variable * @param appParamsName_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appParamsName. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appParamsName_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appParamsName_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appParamsName_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char **appParamsName_val_ptr_ptr, size_t *appParamsName_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appParamsName_val_ptr_ptr) && (NULL != *appParamsName_val_ptr_ptr)); netsnmp_assert(NULL != appParamsName_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsName_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsName data. * copy (* appParamsName_val_ptr_ptr ) data and (* appParamsName_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appParamsName data */ if ((NULL == (*appParamsName_val_ptr_ptr)) || ((*appParamsName_val_ptr_len_ptr) < (rowreq_ctx->data.appParamsName_len * sizeof(rowreq_ctx->data.appParamsName[0])))) { /* * allocate space for appParamsName data */ (*appParamsName_val_ptr_ptr) = malloc(rowreq_ctx->data.appParamsName_len * sizeof(rowreq_ctx->data.appParamsName[0])); if (NULL == (*appParamsName_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appParamsName_val_ptr_len_ptr) = rowreq_ctx->data.appParamsName_len * sizeof(rowreq_ctx->data.appParamsName[0]); memcpy((*appParamsName_val_ptr_ptr), rowreq_ctx->data.appParamsName, rowreq_ctx->data.appParamsName_len * sizeof(rowreq_ctx->data.appParamsName[0])); return MFD_SUCCESS; } /* appParamsName_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsDesc * appParamsDesc is subid 3 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.3 * Description: A short description of the parameter * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /** * Extract the current value of the appParamsDesc data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsDesc_val_ptr_ptr * Pointer to storage for a char variable * @param appParamsDesc_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appParamsDesc. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appParamsDesc_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appParamsDesc_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appParamsDesc_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char **appParamsDesc_val_ptr_ptr, size_t *appParamsDesc_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appParamsDesc_val_ptr_ptr) && (NULL != *appParamsDesc_val_ptr_ptr)); netsnmp_assert(NULL != appParamsDesc_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsDesc_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsDesc data. * copy (* appParamsDesc_val_ptr_ptr ) data and (* appParamsDesc_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appParamsDesc data */ if ((NULL == (*appParamsDesc_val_ptr_ptr)) || ((*appParamsDesc_val_ptr_len_ptr) < (rowreq_ctx->data.appParamsDesc_len * sizeof(rowreq_ctx->data.appParamsDesc[0])))) { /* * allocate space for appParamsDesc data */ (*appParamsDesc_val_ptr_ptr) = malloc(rowreq_ctx->data.appParamsDesc_len * sizeof(rowreq_ctx->data.appParamsDesc[0])); if (NULL == (*appParamsDesc_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appParamsDesc_val_ptr_len_ptr) = rowreq_ctx->data.appParamsDesc_len * sizeof(rowreq_ctx->data.appParamsDesc[0]); memcpy((*appParamsDesc_val_ptr_ptr), rowreq_ctx->data.appParamsDesc, rowreq_ctx->data.appParamsDesc_len * sizeof(rowreq_ctx->data.appParamsDesc[0])); return MFD_SUCCESS; } /* appParamsDesc_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsValueType * appParamsValueType is subid 4 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.4 * Description: Indicates which of the columns (appParamsTruthValue, appParamsInterger32, appParamsUInteger32, appParamsOctetString) in the dessertAppParamsTable is actually valid. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 3/8. Values: bool(0), int32(1), uint32(2), counter64(3), octetstring(4) * * Its syntax is DessertAppValueType (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /** * map a value from its original native format to the MIB format. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : Any other error * * @note parameters follow the memset convention (dest, src). * * @note generation and use of this function can be turned off by re-running * mib2c after adding the following line to the file * defaults/node-appParamsValueType.m2d : * @eval $m2c_node_skip_mapping = 1@ * * @remark * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. * Otherwise, just do a direct copy. */ int appParamsValueType_map(u_long * mib_appParamsValueType_val_ptr, u_long raw_appParamsValueType_val) { netsnmp_assert(NULL != mib_appParamsValueType_val_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsValueType_map", "called\n")); /* * TODO:241:o: |-> Implement appParamsValueType enum mapping. * uses INTERNAL_* macros defined in the header files */ switch (raw_appParamsValueType_val) { case INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_BOOL: *mib_appParamsValueType_val_ptr = DESSERTAPPVALUETYPE_BOOL; break; case INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_INT32: *mib_appParamsValueType_val_ptr = DESSERTAPPVALUETYPE_INT32; break; case INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_UINT32: *mib_appParamsValueType_val_ptr = DESSERTAPPVALUETYPE_UINT32; break; case INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_OCTETSTRING: *mib_appParamsValueType_val_ptr = DESSERTAPPVALUETYPE_OCTETSTRING; break; default: snmp_log(LOG_ERR, "couldn't map value %ld for appParamsValueType\n", raw_appParamsValueType_val); return MFD_ERROR; } return MFD_SUCCESS; } /* appParamsValueType_map */ /** * Extract the current value of the appParamsValueType data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsValueType_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appParamsValueType_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long * appParamsValueType_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appParamsValueType_val_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsValueType_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsValueType data. * copy (* appParamsValueType_val_ptr ) from rowreq_ctx->data */ (*appParamsValueType_val_ptr) = rowreq_ctx->data.appParamsValueType; return MFD_SUCCESS; } /* appParamsValueType_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsTruthValue * appParamsTruthValue is subid 5 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.5 * Description: A parameter with TruthValue semantics. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * Enum range: 2/8. Values: true(1), false(2) * * Its syntax is TruthValue (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /** * map a value from its original native format to the MIB format. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : Any other error * * @note parameters follow the memset convention (dest, src). * * @note generation and use of this function can be turned off by re-running * mib2c after adding the following line to the file * defaults/node-appParamsTruthValue.m2d : * @eval $m2c_node_skip_mapping = 1@ * * @remark * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. * Otherwise, just do a direct copy. */ int appParamsTruthValue_map(u_long * mib_appParamsTruthValue_val_ptr, u_long raw_appParamsTruthValue_val) { netsnmp_assert(NULL != mib_appParamsTruthValue_val_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsTruthValue_map", "called\n")); /* * TODO:241:o: |-> Implement appParamsTruthValue enum mapping. * uses INTERNAL_* macros defined in the header files */ switch (raw_appParamsTruthValue_val) { case INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSTRUTHVALUE_TRUE: *mib_appParamsTruthValue_val_ptr = TRUTHVALUE_TRUE; break; case INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSTRUTHVALUE_FALSE: *mib_appParamsTruthValue_val_ptr = TRUTHVALUE_FALSE; break; default: snmp_log(LOG_ERR, "couldn't map value %ld for appParamsTruthValue\n", raw_appParamsTruthValue_val); return MFD_ERROR; } return MFD_SUCCESS; } /* appParamsTruthValue_map */ /** * Extract the current value of the appParamsTruthValue data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsTruthValue_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appParamsTruthValue_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long * appParamsTruthValue_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appParamsTruthValue_val_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsTruthValue_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsTruthValue data. * copy (* appParamsTruthValue_val_ptr ) from rowreq_ctx->data */ (*appParamsTruthValue_val_ptr) = rowreq_ctx->data.appParamsTruthValue; return MFD_SUCCESS; } /* appParamsTruthValue_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsInteger32 * appParamsInteger32 is subid 6 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.6 * Description: A parameter with Integer32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) */ /** * Extract the current value of the appParamsInteger32 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsInteger32_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appParamsInteger32_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long *appParamsInteger32_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appParamsInteger32_val_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsInteger32_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsInteger32 data. * copy (* appParamsInteger32_val_ptr ) from rowreq_ctx->data */ (*appParamsInteger32_val_ptr) = rowreq_ctx->data.appParamsInteger32; return MFD_SUCCESS; } /* appParamsInteger32_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsUnsigned32 * appParamsUnsigned32 is subid 7 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.7 * Description: A parameter with Unsigned32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) */ /** * Extract the current value of the appParamsUnsigned32 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsUnsigned32_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appParamsUnsigned32_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long * appParamsUnsigned32_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appParamsUnsigned32_val_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsUnsigned32_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsUnsigned32 data. * copy (* appParamsUnsigned32_val_ptr ) from rowreq_ctx->data */ (*appParamsUnsigned32_val_ptr) = rowreq_ctx->data.appParamsUnsigned32; return MFD_SUCCESS; } /* appParamsUnsigned32_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsOctetString * appParamsOctetString is subid 9 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.9 * Description: A parameter containing of up to 1024 octets. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 1 * hint: 1024a * * Ranges: 0 - 1024; * * Its syntax is DessertApplicationOctetString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 1024) */ /** * Extract the current value of the appParamsOctetString data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsOctetString_val_ptr_ptr * Pointer to storage for a char variable * @param appParamsOctetString_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appParamsOctetString. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appParamsOctetString_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appParamsOctetString_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appParamsOctetString_get(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char **appParamsOctetString_val_ptr_ptr, size_t *appParamsOctetString_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appParamsOctetString_val_ptr_ptr) && (NULL != *appParamsOctetString_val_ptr_ptr)); netsnmp_assert(NULL != appParamsOctetString_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsOctetString_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appParamsOctetString data. * copy (* appParamsOctetString_val_ptr_ptr ) data and (* appParamsOctetString_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appParamsOctetString data */ if ((NULL == (*appParamsOctetString_val_ptr_ptr)) || ((*appParamsOctetString_val_ptr_len_ptr) < (rowreq_ctx->data.appParamsOctetString_len * sizeof(rowreq_ctx->data.appParamsOctetString[0])))) { /* * allocate space for appParamsOctetString data */ (*appParamsOctetString_val_ptr_ptr) = malloc(rowreq_ctx->data.appParamsOctetString_len * sizeof(rowreq_ctx->data.appParamsOctetString[0])); if (NULL == (*appParamsOctetString_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appParamsOctetString_val_ptr_len_ptr) = rowreq_ctx->data.appParamsOctetString_len * sizeof(rowreq_ctx->data.appParamsOctetString[0]); memcpy((*appParamsOctetString_val_ptr_ptr), rowreq_ctx->data.appParamsOctetString, rowreq_ctx->data.appParamsOctetString_len * sizeof(rowreq_ctx->data.appParamsOctetString[0])); return MFD_SUCCESS; } /* appParamsOctetString_get */ /** @} */ libdessert0.87-0.87.2/snmp/dessertSysifTable.h0000644000175000017500000001565211331020526017170 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTSYSIFTABLE_H #define DESSERTSYSIFTABLE_H #ifdef __cplusplus extern "C" { #endif /** @addtogroup misc misc: Miscellaneous routines * * @{ */ #include /* * other required module components */ /* *INDENT-OFF* */ config_add_mib(DESSERT-MIB) config_require(DESSERT-MIB/dessertSysifTable/dessertSysifTable_interface) config_require(DESSERT-MIB/dessertSysifTable/dessertSysifTable_data_access) config_require(DESSERT-MIB/dessertSysifTable/dessertSysifTable_data_get) config_require(DESSERT-MIB/dessertSysifTable/dessertSysifTable_data_set) /* *INDENT-ON* */ /* * OID and column number definitions for dessertSysifTable */ #include "dessertSysifTable_oids.h" /* * enum definions */ #include "dessertSysifTable_enums.h" /* ********************************************************************* * function declarations */ void init_dessertSysifTable(void); void shutdown_dessertSysifTable(void); /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ /* ********************************************************************* * 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 dessertSysifTable registration context. */ typedef netsnmp_data_list dessertSysifTable_registration; /**********************************************************************/ /* * TODO:110:r: |-> Review dessertSysifTable data context structure. * This structure is used to represent the data for dessertSysifTable. */ /* * This structure contains storage for all the columns defined in the * dessertSysifTable. */ typedef struct dessertSysifTable_data_s { /* * sysifName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char sysifName[255]; size_t sysifName_len; /* # of char elements, not bytes */ /* * sysifMacAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char sysifMacAddress[6]; size_t sysifMacAddress_len; /* # of char elements, not bytes */ /* * sysifInPkts(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 sysifInPkts; /* * sysifOutPkts(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 sysifOutPkts; /* * sysifInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 sysifInOctets; /* * sysifOutOctets(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 sysifOutOctets; } dessertSysifTable_data; /* * TODO:120:r: |-> Review dessertSysifTable mib index. * This structure is used to represent the index for dessertSysifTable. */ typedef struct dessertSysifTable_mib_index_s { /* * sysifIndex(1)///()//L/a/w/e/r/d/h */ long sysifIndex; } dessertSysifTable_mib_index; /* * TODO:121:r: | |-> Review dessertSysifTable max index length. * If you KNOW that your indexes will never exceed a certain * length, update this macro to that length. */ #define MAX_dessertSysifTable_IDX_LEN 1 /* ********************************************************************* * TODO:130:o: |-> Review dessertSysifTable Row request (rowreq) context. * When your functions are called, you will be passed a * dessertSysifTable_rowreq_ctx pointer. */ typedef struct dessertSysifTable_rowreq_ctx_s { /** this must be first for container compare to work */ netsnmp_index oid_idx; oid oid_tmp[MAX_dessertSysifTable_IDX_LEN]; dessertSysifTable_mib_index tbl_idx; dessertSysifTable_data data; /* * 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 dessertSysifTable rowreq context. */ /* * storage for future expansion */ netsnmp_data_list *dessertSysifTable_data_list; } dessertSysifTable_rowreq_ctx; typedef struct dessertSysifTable_ref_rowreq_ctx_s { dessertSysifTable_rowreq_ctx *rowreq_ctx; } dessertSysifTable_ref_rowreq_ctx; /* ********************************************************************* * function prototypes */ int dessertSysifTable_pre_request(dessertSysifTable_registration * user_context); int dessertSysifTable_post_request(dessertSysifTable_registration * user_context, int rc); int dessertSysifTable_rowreq_ctx_init(dessertSysifTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx); void dessertSysifTable_rowreq_ctx_cleanup(dessertSysifTable_rowreq_ctx * rowreq_ctx); dessertSysifTable_rowreq_ctx *dessertSysifTable_row_find_by_mib_index (dessertSysifTable_mib_index * mib_idx); extern oid dessertSysifTable_oid[]; extern int dessertSysifTable_oid_size; #include "dessertSysifTable_interface.h" #include "dessertSysifTable_data_access.h" #include "dessertSysifTable_data_get.h" #include "dessertSysifTable_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 /* DESSERTSYSIFTABLE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable.c0000644000175000017500000001406511331020526017747 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /** \page MFD helper for dessertAppParamsTable * * \section intro Introduction * Introductory text. * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppParamsTable.h" #include #include "dessertAppParamsTable_interface.h" oid dessertAppParamsTable_oid[] = { DESSERTAPPPARAMSTABLE_OID }; int dessertAppParamsTable_oid_size = OID_LENGTH(dessertAppParamsTable_oid); dessertAppParamsTable_registration dessertAppParamsTable_user_context; void initialize_table_dessertAppParamsTable(void); void shutdown_table_dessertAppParamsTable(void); /** * Initializes the dessertAppParamsTable module */ void init_dessertAppParamsTable(void) { DEBUGMSGTL(("verbose:dessertAppParamsTable:init_dessertAppParamsTable", "called\n")); /* * TODO:300:o: Perform dessertAppParamsTable one-time module initialization. */ /* * here we initialize all the tables we're planning on supporting */ if (should_init("dessertAppParamsTable")) initialize_table_dessertAppParamsTable(); } /* init_dessertAppParamsTable */ /** * Shut-down the dessertAppParamsTable module (agent is exiting) */ void shutdown_dessertAppParamsTable(void) { if (should_init("dessertAppParamsTable")) shutdown_table_dessertAppParamsTable(); } /** * Initialize the table dessertAppParamsTable * (Define its contents and how it's structured) */ void initialize_table_dessertAppParamsTable(void) { dessertAppParamsTable_registration *user_context; u_long flags; DEBUGMSGTL(("verbose:dessertAppParamsTable:initialize_table_dessertAppParamsTable", "called\n")); /* * TODO:301:o: Perform dessertAppParamsTable one-time table initialization. */ /* * TODO:302:o: |->Initialize dessertAppParamsTable 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("dessertAppParamsTable", NULL, NULL); /* * No support for any flags yet, but in the future you would * set any flags here. */ flags = 0; /* * call interface initialization code */ _dessertAppParamsTable_initialize_interface(user_context, flags); } /* initialize_table_dessertAppParamsTable */ /** * Shutdown the table dessertAppParamsTable */ void shutdown_table_dessertAppParamsTable(void) { /* * call interface shutdown code */ _dessertAppParamsTable_shutdown_interface (&dessertAppParamsTable_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 dessertAppParamsTable_rowreq_ctx_init(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_rowreq_ctx_init", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:210:o: |-> Perform extra dessertAppParamsTable rowreq initialization. (eg DEFVALS) */ return MFD_SUCCESS; } /* dessertAppParamsTable_rowreq_ctx_init */ /** * extra context cleanup * */ void dessertAppParamsTable_rowreq_ctx_cleanup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_rowreq_ctx_cleanup", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:211:o: |-> Perform extra dessertAppParamsTable rowreq cleanup. */ } /* dessertAppParamsTable_rowreq_ctx_cleanup */ /** * pre-request callback * * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error */ int dessertAppParamsTable_pre_request(dessertAppParamsTable_registration * user_context) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_pre_request", "called\n")); /* * TODO:510:o: Perform dessertAppParamsTable pre-request actions. */ return MFD_SUCCESS; } /* dessertAppParamsTable_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 dessertAppParamsTable_post_request(dessertAppParamsTable_registration * user_context, int rc) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_post_request", "called\n")); /* * TODO:511:o: Perform dessertAppParamsTable post-request actions. */ /* * check to set if any rows were changed. */ if (dessertAppParamsTable_dirty_get()) { /* * check if request was successful. If so, this would be * a good place to save data to its persistent store. */ if (MFD_SUCCESS == rc) { /* * save changed rows, if you haven't already */ } dessertAppParamsTable_dirty_set(0); /* clear table dirty flag */ } return MFD_SUCCESS; } /* dessertAppParamsTable_post_request */ /** @{ */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable-README-dessertAppStatsTable.txt0000644000175000017500000006247711331020526025263 0ustar dvddvd************************************************************************ dessertAppStatsTable README ------------------------------------------------------------------------ This readme file describes the code generated by mib2c (using the MIBs for Dummies (MFD) configuration file). The code generated was generated specifically for the following SNMP table: dessertAppStatsTable Your code will be called when the snmp agent receives requests for the dessertAppStatsTable table. The agent will start by looking for the right row in your existing data to operate on, if one exists. Configuration Variables ------------------------------------------------------------ Some variables used for code generation may be set to affect the code generation. You may override these variables by setting them in the file defaults/table-dessertAppStatsTable.m2d, and then re-running mib2c. m2c_table_settable (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support MIB object which have an access of read-write or read-create. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_settable = 0@ m2c_table_dependencies (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking dependencies between columns, rows or tables. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_dependencies = 0@ m2c_table_row_creation (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking creation of new rows via SNMP. The default is set based on whether or not the table contains read-create objects, but can be over-ridden. Syntax: @eval $m2c_table_row_creation = 0@ m2c_context_reg (currently 'netsnmp_data_list') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertAppStatsTable_registration. During initilization, you will provide a pointer to a structure of this type. This pointer is used as a parameter to many functions so that you have access to your registration data. The default is a netsnmp_data_list pointer, which will allow you to keep multiple pointers tagged by a text name. If you have a new or existing structure you would rather use, you can redefine this variable. To avoid regenerating code, you may also change this typedef directly in the dessertAppStatsTable.h header. Syntax: @eval $m2c_context_reg = "struct my_registration_context@ m2c_data_context (currently 'generated') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertAppStatsTable_data. This typedef is used in the row request context structure for the table, dessertAppStatsTable_rowreq_ctx. The typedef in the primary table context will be used for the data and undo structure types. This structure should contain all the data needed for all the columns in the table. The default is 'generated', which will cuase a new data strcuture to be generated with data members for each column. To avoid regenerating code, you may also change this typedef directly in the dessertAppStatsTable.h header. Syntax: @eval $m2c_data_context = "struct my_data_context"@ m2c_data_allocate (currently '0') -------------------------------------------------------- This variable determines whether or not the data context (see above) requires memory to be allocated. The default generated data structure does not. If you are using a custom data context which needs to allocate memory, override this value and two additional functions will be generated: dessertAppStatsTable_allocate_data dessertAppStatsTable_release_data Syntax: @eval $m2c_data_allocate = 1@ m2c_data_init (currently '0') -------------------------------------------------------- This variable determines whether or not the data context (see above) or any other items you have added to the table context requires initialization. The default generated data structure does not. If you are using a custom data context or have added items needing initialization to the table context, override this value and two additional functions will be generated: dessertAppStatsTable_rowreq_ctx_init dessertAppStatsTable_rowreq_ctx_cleanup Syntax: @eval 0 = 1@ m2c_table_access (currently 'container-cached') ------------------------------------------------------------------ This variable determines which data interface will be use to generate code for looking up data for a given index. The default is the 'container-cached' access code, which caches the data in a netsnmp- container (usually a sorted array). Available options can be determined by checking for mib2c configuration files that begin with 'mfd-access-*'. Syntax: @eval $m2c_table_access = 'container-cached'@ m2c_include_examples (currently '1') ------------------------------------------------------------------ This variable determines whether or not to generate example code. The default is to generate example code. Syntax: @eval $m2c_include_examples = 0@ m2c_data_transient (currently '0') ------------------------------------------------------------------ This variable determines how the generated example code deals with the data during data lookup. See the table readme file for details on how the current table access method interprets this value. In general, a value of 0 indicates persistent data, 1 indicates semi-transient and 2 indicates transient data. Syntax: @eval $m2c_data_transient = 0@ Index(es) for the dessertAppStatsTable table ------------------------------------------------------------ The index(es) for the dessertAppStatsTable table are: appStatsIndex: Syntax: DataType: ASN type: C-code type: You should know how to set all these values from your data context, dessertAppStatsTable_data. ************************************************************************ dessertAppStatsTable File Overview ------------------------------------------------------------------------ Several files have been generated to implement the dessertAppStatsTable table. We'll go through these files, one by one, explaining each and letting you know which you need to edit. File: dessertAppStatsTable_data_access.[c|h] ------------------------------------------------------------------------ The dessertAppStatsTable_data_access file contains the interface to your data in its raw format. These functions are used to build the row cache or locate the row (depending on the table access method). Set MIB context ----------------- TODO : Set MIB index values FUNC : dessertAppStatsTable_indexes_set WHERE: dessertAppStatsTable_data_access.c This is a convenience function for setting the index context from the native C data. Where necessary, value mapping should be done. This function should update the table index values (found in tbl_idx) for the given raw data. container summary ------------------------ The container data access code is for cases when you want to store your data in the agent/sub-agent. ... to be continued... cache summary ------------------------ The container-cached data access code is for cases when you want to cache your data in the agent/sub-agent. ... to be continued... File: dessertAppStatsTable_enums.h ------------------------------------------------------------------------ This file contains macros for mapping enumeration values when the enumerated values defined by the MIB do not match the values used internally. Review this file to see if any values need to be updated. File: dessertAppStatsTable_data_get.c ------------------------------------------------------------------------ Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsName_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsDesc_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsNodeOrLink_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsValueType_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsMacAddress1_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsMacAddress2_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsTruthValue_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsInteger32_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsUnsigned32_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsCounter64_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : appStatsOctetString_get File: dessertAppStatsTable_data_set.c ------------------------------------------------------------------------ This table does not support set requests. ************************************************************************ dessertAppStatsTable Reference ------------------------------------------------------------------------ Function flow ---------------------------------------------------- To give you the general idea of how the functions flow works, this example flow is from a complete table implementation. NOTE: Depending on your configuration, some of the functions used in the examples below may not have been generated for the dessertAppStatsTable table. Conversely, the examples below may not include some functions that were generated for the dessertAppStatsTable table. To watch the flow of the dessertAppStatsTable table, use the following debug tokens: snmp_agent helper:table:req dessertAppStatsTable verbose:dessertAppStatsTable internal:dessertAppStatsTable e.g. snmpd -f -Le -DdessertAppStatsTable,verbose:dessertAppStatsTable,internal:dessertAppStatsTable Initialization -------------------------------- init_xxxTable: called xxx.c initialize_table_xxxTable xxx.c _xxxTable_initialize_interface xxx_interface.c xxxTable_init_data xxx_data_access.c _xxxTable_container_init xxx_interface.c xxxTable_container_init xxx_data_access.c GET Request -------------------------------- _cache_load xxx_interface.c xxxTable_cache_load xxx_data_access.c xxxTable_allocate_rowreq_ctx xxx_interface.c xxxTable_allocate_data xxx_data_get.c xxxTable_rowreq_ctx_init xxx_data_get.c xxxTable_indexes_set xxx_data_get.c xxxTable_indexes_set_tbl_idx xxx_data_get.c xxxTable_pre_request _mfd_xxxTable_object_lookup xxx_interface.c xxxTable_row_prep xxx_data_access.c _mfd_xxxTable_get_values xxx_interface.c _mfd_xxxTable_get_column xxx_interface.c yyy_get xxx_data_get.c xxxTable_post_request GETNEXT Request -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_get_values ... xxxTable_post_request ... SET Request: success -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects xxx_interface.c _xxxTable_check_column xxx_interface.c yyy_check_value xxx_data_set.c _mfd_xxxTable_undo_setup xxx_interface.c xxxTable_allocate_data ... xxxTable_undo_setup xxx_interface.c _xxxTable_undo_setup_column xxx_interface.c yyy_undo_setup xxx_data_set.c _mfd_xxxTable_set_values xxx_interface.c _xxxTable_set_column xxx_interface.c yyy_set xxx_data_set.c _mfd_xxxTable_check_dependencies xxx_interface.c xxxTable_check_dependencies xxx_data_set.c _mfd_xxxTable_commit xxx_interface.c xxxTable_commit xxx_data_set.c _mfd_xxxTable_undo_cleanup xxx_interface.c xxxTable_undo_cleanup xxx_data_set.c xxxTable_release_data ... xxxTable_post_request ... SET Request: row creation -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... xxxTable_index_from_oid xxx_interface.c xxxTable_allocate_rowreq_ctx ... ... _xxxTable_check_indexes xxx_interface.c yyy_check_index xxx_data_set.c xxxTable_validate_index xxx_data_set.c _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... _xxxTable_check_column ... yyy_check_value ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... SET Resuest: value error -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... ERROR:"yyy value not supported" xxxTable_post_request ... SET Request: commit failure -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... xxxTable_commit ... ERROR: bad rc -1 _mfd_xxxTable_undo_commit xxx_interface.c xxxTable_undo_commit xxx_data_set.c _mfd_xxxTable_undo_values xxx_interface.c _xxxTable_undo_column xxx_interface.c yyy_undo xxx_data_set.c _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... Row release (user initiated) -------------------------------- xxxTable_release_rowreq_ctx xxx_interface.c xxxTable_rowreq_ctx_cleanup xxx_data_get.c xxxTable_release_data xxx_data_get.c Table / column details ---------------------------------------------------- /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsIndex * appStatsIndex is subid 1 of dessertAppStatsEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.1 * Description: Index of the statistical datum * * Attributes: * accessible 0 isscalar 0 enums 0 hasdefval 0 * readable 0 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is (based on perltype ) * The net-snmp type is . The C type decl is () * * * * NOTE: NODE appStatsIndex IS NOT ACCESSIBLE * * */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsName * appStatsName is subid 2 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.2 * Description: The name of the statistical datum * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsDesc * appStatsDesc is subid 3 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.3 * Description: A short description of the statistical datum * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsNodeOrLink * appStatsNodeOrLink is subid 4 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.4 * Description: Determines which of the appStatsMacAddress{1,2} coloumns is valid and therefore indicates whether the information provided by this row relates to a node or a link. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 3/8. Values: none(0), node(1), link(2) * * Its syntax is INTEGER (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsValueType * appStatsValueType is subid 5 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.5 * Description: Indicates which of the coloumns (appStatsTruthValue, appStatsInterger32, appStatsUInteger32, appStatsCounter64, appStatsOctetString) in the dessertAppStatsTable is actually valid. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 3/8. Values: bool(0), int32(1), uint32(2), counter64(3), octetstring(4) * * Its syntax is INTEGER (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsMacAddress1 * appStatsMacAddress1 is subid 6 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.6 * Description: The hardware address of a node. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsMacAddress2 * appStatsMacAddress2 is subid 7 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.7 * Description: The hardware address of a second node. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsTruthValue * appStatsTruthValue is subid 8 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.8 * Description: A statistical datum with TruthValue semantics. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 2/8. Values: true(1), false(2) * * Its syntax is TruthValue (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsInteger32 * appStatsInteger32 is subid 9 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.9 * Description: A statistical datum with Integer32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsUnsigned32 * appStatsUnsigned32 is subid 10 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.10 * Description: A statistical datum with Unsigned32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsCounter64 * appStatsCounter64 is subid 11 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.11 * Description: A statistical datum with Counter64 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsOctetString * appStatsOctetString is subid 12 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.12 * Description: A statistical datum containing of up to 1024 octets. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 0 * settable 0 * * Ranges: 0 - 1024; * * Its syntax is OCTETSTR (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 1024) */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable.c0000644000175000017500000001044211331020526017615 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /** \page MFD helper for dessertAppStatsTable * * \section intro Introduction * Introductory text. * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppStatsTable.h" #include #include "dessertAppStatsTable_interface.h" oid dessertAppStatsTable_oid[] = { DESSERTAPPSTATSTABLE_OID }; int dessertAppStatsTable_oid_size = OID_LENGTH(dessertAppStatsTable_oid); dessertAppStatsTable_registration dessertAppStatsTable_user_context; void initialize_table_dessertAppStatsTable(void); void shutdown_table_dessertAppStatsTable(void); /** * Initializes the dessertAppStatsTable module */ void init_dessertAppStatsTable(void) { DEBUGMSGTL(("verbose:dessertAppStatsTable:init_dessertAppStatsTable", "called\n")); /* * TODO:300:o: Perform dessertAppStatsTable one-time module initialization. */ /* * here we initialize all the tables we're planning on supporting */ if (should_init("dessertAppStatsTable")) initialize_table_dessertAppStatsTable(); } /* init_dessertAppStatsTable */ /** * Shut-down the dessertAppStatsTable module (agent is exiting) */ void shutdown_dessertAppStatsTable(void) { if (should_init("dessertAppStatsTable")) shutdown_table_dessertAppStatsTable(); } /** * Initialize the table dessertAppStatsTable * (Define its contents and how it's structured) */ void initialize_table_dessertAppStatsTable(void) { dessertAppStatsTable_registration *user_context; u_long flags; DEBUGMSGTL(("verbose:dessertAppStatsTable:initialize_table_dessertAppStatsTable", "called\n")); /* * TODO:301:o: Perform dessertAppStatsTable one-time table initialization. */ /* * TODO:302:o: |->Initialize dessertAppStatsTable 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("dessertAppStatsTable", NULL, NULL); /* * No support for any flags yet, but in the future you would * set any flags here. */ flags = 0; /* * call interface initialization code */ _dessertAppStatsTable_initialize_interface(user_context, flags); } /* initialize_table_dessertAppStatsTable */ /** * Shutdown the table dessertAppStatsTable */ void shutdown_table_dessertAppStatsTable(void) { /* * call interface shutdown code */ _dessertAppStatsTable_shutdown_interface (&dessertAppStatsTable_user_context); } /** * pre-request callback * * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error */ int dessertAppStatsTable_pre_request(dessertAppStatsTable_registration * user_context) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_pre_request", "called\n")); /* * TODO:510:o: Perform dessertAppStatsTable pre-request actions. */ return MFD_SUCCESS; } /* dessertAppStatsTable_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 dessertAppStatsTable_post_request(dessertAppStatsTable_registration * user_context, int rc) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_post_request", "called\n")); /* * TODO:511:o: Perform dessertAppStatsTable post-request actions. */ return MFD_SUCCESS; } /* dessertAppStatsTable_post_request */ /** @{ */ libdessert0.87-0.87.2/snmp/dessertMeshifTable-README-dessertMeshifTable.txt0000644000175000017500000005105111331020526024375 0ustar dvddvd************************************************************************ dessertMeshifTable README ------------------------------------------------------------------------ This readme file describes the code generated by mib2c (using the MIBs for Dummies (MFD) configuration file). The code generated was generated specifically for the following SNMP table: dessertMeshifTable Your code will be called when the snmp agent receives requests for the dessertMeshifTable table. The agent will start by looking for the right row in your existing data to operate on, if one exists. Configuration Variables ------------------------------------------------------------ Some variables used for code generation may be set to affect the code generation. You may override these variables by setting them in the file defaults/table-dessertMeshifTable.m2d, and then re-running mib2c. m2c_table_settable (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support MIB object which have an access of read-write or read-create. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_settable = 0@ m2c_table_dependencies (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking dependencies between columns, rows or tables. The default is set based on whether or not the table contains writable objects, but can be over-ridden. Syntax: @eval $m2c_table_dependencies = 0@ m2c_table_row_creation (currently '0') -------------------------------------------------------- This variable determines whether or not code is generated to support checking creation of new rows via SNMP. The default is set based on whether or not the table contains read-create objects, but can be over-ridden. Syntax: @eval $m2c_table_row_creation = 0@ m2c_context_reg (currently 'netsnmp_data_list') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertMeshifTable_registration. During initilization, you will provide a pointer to a structure of this type. This pointer is used as a parameter to many functions so that you have access to your registration data. The default is a netsnmp_data_list pointer, which will allow you to keep multiple pointers tagged by a text name. If you have a new or existing structure you would rather use, you can redefine this variable. To avoid regenerating code, you may also change this typedef directly in the dessertMeshifTable.h header. Syntax: @eval $m2c_context_reg = "struct my_registration_context@ m2c_data_context (currently 'generated') -------------------------------------------------------- This variable contains the structure name to typedef for the dessertMeshifTable_data. This typedef is used in the row request context structure for the table, dessertMeshifTable_rowreq_ctx. The typedef in the primary table context will be used for the data and undo structure types. This structure should contain all the data needed for all the columns in the table. The default is 'generated', which will cuase a new data strcuture to be generated with data members for each column. To avoid regenerating code, you may also change this typedef directly in the dessertMeshifTable.h header. Syntax: @eval $m2c_data_context = "struct my_data_context"@ m2c_data_allocate (currently '0') -------------------------------------------------------- This variable determines whether or not the data context (see above) requires memory to be allocated. The default generated data structure does not. If you are using a custom data context which needs to allocate memory, override this value and two additional functions will be generated: dessertMeshifTable_allocate_data dessertMeshifTable_release_data Syntax: @eval $m2c_data_allocate = 1@ m2c_data_init (currently '1') -------------------------------------------------------- This variable determines whether or not the data context (see above) or any other items you have added to the table context requires initialization. The default generated data structure does not. If you are using a custom data context or have added items needing initialization to the table context, override this value and two additional functions will be generated: dessertMeshifTable_rowreq_ctx_init dessertMeshifTable_rowreq_ctx_cleanup Syntax: @eval 1 = 1@ m2c_table_access (currently 'container-cached') ------------------------------------------------------------------ This variable determines which data interface will be use to generate code for looking up data for a given index. The default is the 'container-cached' access code, which caches the data in a netsnmp- container (usually a sorted array). Available options can be determined by checking for mib2c configuration files that begin with 'mfd-access-*'. Syntax: @eval $m2c_table_access = 'container-cached'@ m2c_include_examples (currently '1') ------------------------------------------------------------------ This variable determines whether or not to generate example code. The default is to generate example code. Syntax: @eval $m2c_include_examples = 0@ m2c_data_transient (currently '0') ------------------------------------------------------------------ This variable determines how the generated example code deals with the data during data lookup. See the table readme file for details on how the current table access method interprets this value. In general, a value of 0 indicates persistent data, 1 indicates semi-transient and 2 indicates transient data. Syntax: @eval $m2c_data_transient = 0@ Index(es) for the dessertMeshifTable table ------------------------------------------------------------ The index(es) for the dessertMeshifTable table are: meshifIndex: Syntax: DataType: ASN type: C-code type: You should know how to set all these values from your data context, dessertMeshifTable_data. ************************************************************************ dessertMeshifTable File Overview ------------------------------------------------------------------------ Several files have been generated to implement the dessertMeshifTable table. We'll go through these files, one by one, explaining each and letting you know which you need to edit. File: dessertMeshifTable_data_access.[c|h] ------------------------------------------------------------------------ The dessertMeshifTable_data_access file contains the interface to your data in its raw format. These functions are used to build the row cache or locate the row (depending on the table access method). Set MIB context ----------------- TODO : Set MIB index values FUNC : dessertMeshifTable_indexes_set WHERE: dessertMeshifTable_data_access.c This is a convenience function for setting the index context from the native C data. Where necessary, value mapping should be done. This function should update the table index values (found in tbl_idx) for the given raw data. container summary ------------------------ The container data access code is for cases when you want to store your data in the agent/sub-agent. ... to be continued... cache summary ------------------------ The container-cached data access code is for cases when you want to cache your data in the agent/sub-agent. ... to be continued... File: dessertMeshifTable_enums.h ------------------------------------------------------------------------ This file contains macros for mapping enumeration values when the enumerated values defined by the MIB do not match the values used internally. Review this file to see if any values need to be updated. File: dessertMeshifTable_data_get.c ------------------------------------------------------------------------ Get data for column ------------------- TODO : retrieve column data from raw data FUNC : meshifName_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : meshifMacAddress_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : meshifInPkts_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : meshifOutPkts_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : meshifInOctets_get Get data for column ------------------- TODO : retrieve column data from raw data FUNC : meshifOutOctets_get File: dessertMeshifTable_data_set.c ------------------------------------------------------------------------ This table does not support set requests. ************************************************************************ dessertMeshifTable Reference ------------------------------------------------------------------------ Function flow ---------------------------------------------------- To give you the general idea of how the functions flow works, this example flow is from a complete table implementation. NOTE: Depending on your configuration, some of the functions used in the examples below may not have been generated for the dessertMeshifTable table. Conversely, the examples below may not include some functions that were generated for the dessertMeshifTable table. To watch the flow of the dessertMeshifTable table, use the following debug tokens: snmp_agent helper:table:req dessertMeshifTable verbose:dessertMeshifTable internal:dessertMeshifTable e.g. snmpd -f -Le -DdessertMeshifTable,verbose:dessertMeshifTable,internal:dessertMeshifTable Initialization -------------------------------- init_xxxTable: called xxx.c initialize_table_xxxTable xxx.c _xxxTable_initialize_interface xxx_interface.c xxxTable_init_data xxx_data_access.c _xxxTable_container_init xxx_interface.c xxxTable_container_init xxx_data_access.c GET Request -------------------------------- _cache_load xxx_interface.c xxxTable_cache_load xxx_data_access.c xxxTable_allocate_rowreq_ctx xxx_interface.c xxxTable_allocate_data xxx_data_get.c xxxTable_rowreq_ctx_init xxx_data_get.c xxxTable_indexes_set xxx_data_get.c xxxTable_indexes_set_tbl_idx xxx_data_get.c xxxTable_pre_request _mfd_xxxTable_object_lookup xxx_interface.c xxxTable_row_prep xxx_data_access.c _mfd_xxxTable_get_values xxx_interface.c _mfd_xxxTable_get_column xxx_interface.c yyy_get xxx_data_get.c xxxTable_post_request GETNEXT Request -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_get_values ... xxxTable_post_request ... SET Request: success -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects xxx_interface.c _xxxTable_check_column xxx_interface.c yyy_check_value xxx_data_set.c _mfd_xxxTable_undo_setup xxx_interface.c xxxTable_allocate_data ... xxxTable_undo_setup xxx_interface.c _xxxTable_undo_setup_column xxx_interface.c yyy_undo_setup xxx_data_set.c _mfd_xxxTable_set_values xxx_interface.c _xxxTable_set_column xxx_interface.c yyy_set xxx_data_set.c _mfd_xxxTable_check_dependencies xxx_interface.c xxxTable_check_dependencies xxx_data_set.c _mfd_xxxTable_commit xxx_interface.c xxxTable_commit xxx_data_set.c _mfd_xxxTable_undo_cleanup xxx_interface.c xxxTable_undo_cleanup xxx_data_set.c xxxTable_release_data ... xxxTable_post_request ... SET Request: row creation -------------------------------- _cache_load ... xxxTable_pre_request _mfd_xxxTable_object_lookup ... xxxTable_index_from_oid xxx_interface.c xxxTable_allocate_rowreq_ctx ... ... _xxxTable_check_indexes xxx_interface.c yyy_check_index xxx_data_set.c xxxTable_validate_index xxx_data_set.c _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... _xxxTable_check_column ... yyy_check_value ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... SET Resuest: value error -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _xxxTable_check_column ... yyy_check_value ... ERROR:"yyy value not supported" xxxTable_post_request ... SET Request: commit failure -------------------------------- _cache_load ... xxxTable_pre_request ... _mfd_xxxTable_object_lookup ... _mfd_xxxTable_check_objects ... _mfd_xxxTable_undo_setup ... _mfd_xxxTable_set_values ... _mfd_xxxTable_check_dependencies ... _mfd_xxxTable_commit ... xxxTable_commit ... ERROR: bad rc -1 _mfd_xxxTable_undo_commit xxx_interface.c xxxTable_undo_commit xxx_data_set.c _mfd_xxxTable_undo_values xxx_interface.c _xxxTable_undo_column xxx_interface.c yyy_undo xxx_data_set.c _mfd_xxxTable_undo_cleanup ... xxxTable_post_request ... Row release (user initiated) -------------------------------- xxxTable_release_rowreq_ctx xxx_interface.c xxxTable_rowreq_ctx_cleanup xxx_data_get.c xxxTable_release_data xxx_data_get.c Table / column details ---------------------------------------------------- /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifIndex * meshifIndex is subid 1 of dessertMeshifEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.1 * Description: system ifindex * * Attributes: * accessible 0 isscalar 0 enums 0 hasdefval 0 * readable 0 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is (based on perltype ) * The net-snmp type is . The C type decl is () * * * * NOTE: NODE meshifIndex IS NOT ACCESSIBLE * * */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifName * meshifName is subid 2 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.2 * Description: name of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifMacAddress * meshifMacAddress is subid 3 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.3 * Description: hardware address of interface * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifInPkts * meshifInPkts is subid 4 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.4 * Description: packet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifOutPkts * meshifOutPkts is subid 5 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.5 * Description: packet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifInOctets * meshifInOctets is subid 6 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.6 * Description: octet counter in * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertMeshifEntry.meshifOutOctets * meshifOutOctets is subid 7 of dessertMeshifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5.1.7 * Description: octet counter out * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_interface.c0000644000175000017500000007175011331020526021322 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertMeshifTable.h" #include #include #include "dessertMeshifTable_interface.h" #include /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ typedef struct dessertMeshifTable_interface_ctx_s { netsnmp_container *container; netsnmp_cache *cache; dessertMeshifTable_registration *user_ctx; netsnmp_table_registration_info tbl_info; netsnmp_baby_steps_access_methods access_multiplexer; } dessertMeshifTable_interface_ctx; static dessertMeshifTable_interface_ctx dessertMeshifTable_if_ctx; static void _dessertMeshifTable_container_init(dessertMeshifTable_interface_ctx * if_ctx); static void _dessertMeshifTable_container_shutdown(dessertMeshifTable_interface_ctx * if_ctx); netsnmp_container * dessertMeshifTable_container_get(void) { return dessertMeshifTable_if_ctx.container; } dessertMeshifTable_registration * dessertMeshifTable_registration_get(void) { return dessertMeshifTable_if_ctx.user_ctx; } dessertMeshifTable_registration * dessertMeshifTable_registration_set(dessertMeshifTable_registration * newreg) { dessertMeshifTable_registration *old = dessertMeshifTable_if_ctx.user_ctx; dessertMeshifTable_if_ctx.user_ctx = newreg; return old; } int dessertMeshifTable_container_size(void) { return CONTAINER_SIZE(dessertMeshifTable_if_ctx.container); } /* * mfd multiplexer modes */ static Netsnmp_Node_Handler _mfd_dessertMeshifTable_pre_request; static Netsnmp_Node_Handler _mfd_dessertMeshifTable_post_request; static Netsnmp_Node_Handler _mfd_dessertMeshifTable_object_lookup; static Netsnmp_Node_Handler _mfd_dessertMeshifTable_get_values; /** * @internal * Initialize the table dessertMeshifTable * (Define its contents and how it's structured) */ void _dessertMeshifTable_initialize_interface(dessertMeshifTable_registration * reg_ptr, u_long flags) { netsnmp_baby_steps_access_methods *access_multiplexer = &dessertMeshifTable_if_ctx.access_multiplexer; netsnmp_table_registration_info *tbl_info = &dessertMeshifTable_if_ctx.tbl_info; netsnmp_handler_registration *reginfo; netsnmp_mib_handler *handler; int mfd_modes = 0; DEBUGMSGTL(("internal:dessertMeshifTable:_dessertMeshifTable_initialize_interface", "called\n")); /************************************************* * * save interface context for dessertMeshifTable */ /* * Setting up the table's definition */ netsnmp_table_helper_add_indexes(tbl_info,ASN_INTEGER, /** index: meshifIndex */ 0); /* * Define the minimum and maximum accessible columns. This * optimizes retrival. */ tbl_info->min_column = DESSERTMESHIFTABLE_MIN_COL; tbl_info->max_column = DESSERTMESHIFTABLE_MAX_COL; /* * save users context */ dessertMeshifTable_if_ctx.user_ctx = reg_ptr; /* * call data access initialization code */ dessertMeshifTable_init_data(reg_ptr); /* * set up the container */ _dessertMeshifTable_container_init(&dessertMeshifTable_if_ctx); if (NULL == dessertMeshifTable_if_ctx.container) { snmp_log(LOG_ERR, "could not initialize container for dessertMeshifTable\n"); return; } /* * access_multiplexer: REQUIRED wrapper for get request handling */ access_multiplexer->object_lookup = _mfd_dessertMeshifTable_object_lookup; access_multiplexer->get_values = _mfd_dessertMeshifTable_get_values; /* * no wrappers yet */ access_multiplexer->pre_request = _mfd_dessertMeshifTable_pre_request; access_multiplexer->post_request = _mfd_dessertMeshifTable_post_request; /************************************************* * * Create a registration, save our reg data, register table. */ DEBUGMSGTL(("dessertMeshifTable:init_dessertMeshifTable", "Registering dessertMeshifTable as a mibs-for-dummies table.\n")); handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); reginfo = netsnmp_handler_registration_create("dessertMeshifTable", handler, dessertMeshifTable_oid, dessertMeshifTable_oid_size, HANDLER_CAN_BABY_STEP | HANDLER_CAN_RONLY); if (NULL == reginfo) { snmp_log(LOG_ERR, "error registering table dessertMeshifTable\n"); return; } reginfo->my_reg_void = &dessertMeshifTable_if_ctx; /************************************************* * * set up baby steps handler, create it and inject it */ if (access_multiplexer->object_lookup) mfd_modes |= BABY_STEP_OBJECT_LOOKUP; if (access_multiplexer->set_values) mfd_modes |= BABY_STEP_SET_VALUES; if (access_multiplexer->irreversible_commit) mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT; if (access_multiplexer->object_syntax_checks) mfd_modes |= BABY_STEP_CHECK_OBJECT; if (access_multiplexer->pre_request) mfd_modes |= BABY_STEP_PRE_REQUEST; if (access_multiplexer->post_request) mfd_modes |= BABY_STEP_POST_REQUEST; if (access_multiplexer->undo_setup) mfd_modes |= BABY_STEP_UNDO_SETUP; if (access_multiplexer->undo_cleanup) mfd_modes |= BABY_STEP_UNDO_CLEANUP; if (access_multiplexer->undo_sets) mfd_modes |= BABY_STEP_UNDO_SETS; if (access_multiplexer->row_creation) mfd_modes |= BABY_STEP_ROW_CREATE; if (access_multiplexer->consistency_checks) mfd_modes |= BABY_STEP_CHECK_CONSISTENCY; if (access_multiplexer->commit) mfd_modes |= BABY_STEP_COMMIT; if (access_multiplexer->undo_commit) mfd_modes |= BABY_STEP_UNDO_COMMIT; handler = netsnmp_baby_steps_handler_get(mfd_modes); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject row_merge helper with prefix rootoid_len + 2 (entry.col) */ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject container_table helper */ handler = netsnmp_container_table_handler_get(tbl_info, dessertMeshifTable_if_ctx. container, TABLE_CONTAINER_KEY_NETSNMP_INDEX); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject cache helper */ if (NULL != dessertMeshifTable_if_ctx.cache) { handler = netsnmp_cache_handler_get(dessertMeshifTable_if_ctx.cache); netsnmp_inject_handler(reginfo, handler); } /* * register table */ netsnmp_register_table(reginfo, tbl_info); } /* _dessertMeshifTable_initialize_interface */ /** * @internal * Shutdown the table dessertMeshifTable */ void _dessertMeshifTable_shutdown_interface(dessertMeshifTable_registration * reg_ptr) { /* * shutdown the container */ _dessertMeshifTable_container_shutdown(&dessertMeshifTable_if_ctx); } void dessertMeshifTable_valid_columns_set(netsnmp_column_info *vc) { dessertMeshifTable_if_ctx.tbl_info.valid_columns = vc; } /* dessertMeshifTable_valid_columns_set */ /** * @internal * convert the index component stored in the context to an oid */ int dessertMeshifTable_index_to_oid(netsnmp_index * oid_idx, dessertMeshifTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * meshifIndex(1)///()//L/a/w/e/r/d/h */ netsnmp_variable_list var_meshifIndex; /* * set up varbinds */ memset(&var_meshifIndex, 0x00, sizeof(var_meshifIndex)); var_meshifIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_meshifIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_index_to_oid", "called\n")); /* * meshifIndex(1)///()//L/a/w/e/r/d/h */ snmp_set_var_value(&var_meshifIndex, (u_char *) & mib_idx->meshifIndex, sizeof(mib_idx->meshifIndex)); err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, NULL, 0, &var_meshifIndex); if (err) snmp_log(LOG_ERR, "error %d converting index to oid\n", err); /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_meshifIndex); return err; } /* dessertMeshifTable_index_to_oid */ /** * extract dessertMeshifTable indexes from a netsnmp_index * * @retval SNMP_ERR_NOERROR : no error * @retval SNMP_ERR_GENERR : error */ int dessertMeshifTable_index_from_oid(netsnmp_index * oid_idx, dessertMeshifTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * meshifIndex(1)///()//L/a/w/e/r/d/h */ netsnmp_variable_list var_meshifIndex; /* * set up varbinds */ memset(&var_meshifIndex, 0x00, sizeof(var_meshifIndex)); var_meshifIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_meshifIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_index_from_oid", "called\n")); /* * parse the oid into the individual index components */ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, &var_meshifIndex); if (err == SNMP_ERR_NOERROR) { /* * copy out values */ mib_idx->meshifIndex = *((long *)var_meshifIndex.val.string); } /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_meshifIndex); return err; } /* dessertMeshifTable_index_from_oid */ /* ********************************************************************* * @internal * allocate resources for a dessertMeshifTable_rowreq_ctx */ dessertMeshifTable_rowreq_ctx * dessertMeshifTable_allocate_rowreq_ctx(void *user_init_ctx) { dessertMeshifTable_rowreq_ctx *rowreq_ctx = SNMP_MALLOC_TYPEDEF(dessertMeshifTable_rowreq_ctx); DEBUGMSGTL(("internal:dessertMeshifTable:dessertMeshifTable_allocate_rowreq_ctx", "called\n")); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "Couldn't allocate memory for a " "dessertMeshifTable_rowreq_ctx.\n"); return NULL; } rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; rowreq_ctx->dessertMeshifTable_data_list = NULL; /* * if we allocated data, call init routine */ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { if (SNMPERR_SUCCESS != dessertMeshifTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) { dessertMeshifTable_release_rowreq_ctx(rowreq_ctx); rowreq_ctx = NULL; } } return rowreq_ctx; } /* dessertMeshifTable_allocate_rowreq_ctx */ /* * @internal * release resources for a dessertMeshifTable_rowreq_ctx */ void dessertMeshifTable_release_rowreq_ctx(dessertMeshifTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("internal:dessertMeshifTable:dessertMeshifTable_release_rowreq_ctx", "called\n")); netsnmp_assert(NULL != rowreq_ctx); dessertMeshifTable_rowreq_ctx_cleanup(rowreq_ctx); /* * free index oid pointer */ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp) free(rowreq_ctx->oid_idx.oids); SNMP_FREE(rowreq_ctx); } /* dessertMeshifTable_release_rowreq_ctx */ /** * @internal * wrapper */ static int _mfd_dessertMeshifTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; DEBUGMSGTL(("internal:dessertMeshifTable:_mfd_dessertMeshifTable_pre_request", "called\n")); if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertMeshifTable", "skipping additional pre_request\n")); return SNMP_ERR_NOERROR; } rc = dessertMeshifTable_pre_request(dessertMeshifTable_if_ctx. user_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertMeshifTable", "error %d from " "dessertMeshifTable_pre_request\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertMeshifTable_pre_request */ /** * @internal * wrapper */ static int _mfd_dessertMeshifTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertMeshifTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); int rc, packet_rc; DEBUGMSGTL(("internal:dessertMeshifTable:_mfd_dessertMeshifTable_post_request", "called\n")); /* * release row context, if deleted */ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) dessertMeshifTable_release_rowreq_ctx(rowreq_ctx); /* * wait for last call before calling user */ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertMeshifTable", "waiting for last post_request\n")); return SNMP_ERR_NOERROR; } packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); rc = dessertMeshifTable_post_request(dessertMeshifTable_if_ctx. user_ctx, packet_rc); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertMeshifTable", "error %d from " "dessertMeshifTable_post_request\n", rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertMeshifTable_post_request */ /** * @internal * wrapper */ static int _mfd_dessertMeshifTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc = SNMP_ERR_NOERROR; dessertMeshifTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertMeshifTable:_mfd_dessertMeshifTable_object_lookup", "called\n")); /* * get our context from mfd * dessertMeshifTable_interface_ctx *if_ctx = * (dessertMeshifTable_interface_ctx *)reginfo->my_reg_void; */ if (NULL == rowreq_ctx) { rc = SNMP_ERR_NOCREATION; } if (MFD_SUCCESS != rc) netsnmp_request_set_error_all(requests, rc); else dessertMeshifTable_row_prep(rowreq_ctx); return SNMP_VALIDATE_ERR(rc); } /* _mfd_dessertMeshifTable_object_lookup */ /*********************************************************************** * * GET processing * ***********************************************************************/ /* * @internal * Retrieve the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertMeshifTable_get_column(dessertMeshifTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertMeshifTable:_mfd_dessertMeshifTable_get_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * meshifName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_MESHIFNAME: var->type = ASN_OCTET_STR; rc = meshifName_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * meshifMacAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_MESHIFMACADDRESS: var->type = ASN_OCTET_STR; rc = meshifMacAddress_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * meshifInPkts(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_MESHIFINPKTS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = meshifInPkts_get(rowreq_ctx, (U64 *) var->val.string); break; /* * meshifOutPkts(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_MESHIFOUTPKTS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = meshifOutPkts_get(rowreq_ctx, (U64 *) var->val.string); break; /* * meshifInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_MESHIFINOCTETS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = meshifInOctets_get(rowreq_ctx, (U64 *) var->val.string); break; /* * meshifOutOctets(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_MESHIFOUTOCTETS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = meshifOutOctets_get(rowreq_ctx, (U64 *) var->val.string); break; default: if (DESSERTMESHIFTABLE_MIN_COL <= column && column <= DESSERTMESHIFTABLE_MAX_COL) { DEBUGMSGTL(("internal:dessertMeshifTable:_mfd_dessertMeshifTable_get_column", "assume column %d is reserved\n", column)); rc = MFD_SKIP; } else { snmp_log(LOG_ERR, "unknown column %d in _dessertMeshifTable_get_column\n", column); } break; } return rc; } /* _dessertMeshifTable_get_column */ int _mfd_dessertMeshifTable_get_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertMeshifTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; u_char *old_string; void (*dataFreeHook) (void *); int rc; DEBUGMSGTL(("internal:dessertMeshifTable:_mfd_dessertMeshifTable_get_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); for (; requests; requests = requests->next) { /* * save old pointer, so we can free it if replaced */ old_string = requests->requestvb->val.string; dataFreeHook = requests->requestvb->dataFreeHook; if (NULL == requests->requestvb->val.string) { requests->requestvb->val.string = requests->requestvb->buf; requests->requestvb->val_len = sizeof(requests->requestvb->buf); } else if (requests->requestvb->buf == requests->requestvb->val.string) { if (requests->requestvb->val_len != sizeof(requests->requestvb->buf)) requests->requestvb->val_len = sizeof(requests->requestvb->buf); } /* * get column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertMeshifTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum); if (rc) { if (MFD_SKIP == rc) { requests->requestvb->type = SNMP_NOSUCHINSTANCE; rc = SNMP_ERR_NOERROR; } } else if (NULL == requests->requestvb->val.string) { snmp_log(LOG_ERR, "NULL varbind data pointer!\n"); rc = SNMP_ERR_GENERR; } if (rc) netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc)); /* * if the buffer wasn't used previously for the old data (i.e. it * was allcoated memory) and the get routine replaced the pointer, * we need to free the previous pointer. */ if (old_string && (old_string != requests->requestvb->buf) && (requests->requestvb->val.string != old_string)) { if (dataFreeHook) (*dataFreeHook) (old_string); else free(old_string); } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertMeshifTable_get_values */ /*********************************************************************** * * SET processing * ***********************************************************************/ /* * SET PROCESSING NOT APPLICABLE (per MIB or user setting) */ /*********************************************************************** * * DATA ACCESS * ***********************************************************************/ static void _container_free(netsnmp_container * container); /** * @internal */ static int _cache_load(netsnmp_cache * cache, void *vmagic) { DEBUGMSGTL(("internal:dessertMeshifTable:_cache_load", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache for dessertMeshifTable_cache_load\n"); return -1; } /** should only be called for an invalid or expired cache */ netsnmp_assert((0 == cache->valid) || (1 == cache->expired)); /* * call user code */ return dessertMeshifTable_container_load((netsnmp_container *) cache-> magic); } /* _cache_load */ /** * @internal */ static void _cache_free(netsnmp_cache * cache, void *magic) { netsnmp_container *container; DEBUGMSGTL(("internal:dessertMeshifTable:_cache_free", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache in dessertMeshifTable_cache_free\n"); return; } container = (netsnmp_container *) cache->magic; _container_free(container); } /* _cache_free */ /** * @internal */ static void _container_item_free(dessertMeshifTable_rowreq_ctx * rowreq_ctx, void *context) { DEBUGMSGTL(("internal:dessertMeshifTable:_container_item_free", "called\n")); if (NULL == rowreq_ctx) return; dessertMeshifTable_release_rowreq_ctx(rowreq_ctx); } /* _container_item_free */ /** * @internal */ static void _container_free(netsnmp_container * container) { DEBUGMSGTL(("internal:dessertMeshifTable:_container_free", "called\n")); if (NULL == container) { snmp_log(LOG_ERR, "invalid container in dessertMeshifTable_container_free\n"); return; } /* * call user code */ dessertMeshifTable_container_free(container); /* * free all items. inefficient, but easy. */ CONTAINER_CLEAR(container, (netsnmp_container_obj_func *) _container_item_free, NULL); } /* _container_free */ /** * @internal * initialize the container with functions or wrappers */ void _dessertMeshifTable_container_init(dessertMeshifTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertMeshifTable:_dessertMeshifTable_container_init", "called\n")); /* * cache init */ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ _cache_load, _cache_free, dessertMeshifTable_oid, dessertMeshifTable_oid_size); if (NULL == if_ctx->cache) { snmp_log(LOG_ERR, "error creating cache for dessertMeshifTable\n"); return; } if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; dessertMeshifTable_container_init(&if_ctx->container, if_ctx->cache); if (NULL == if_ctx->container) if_ctx->container = netsnmp_container_find("dessertMeshifTable:table_container"); if (NULL == if_ctx->container) { snmp_log(LOG_ERR, "error creating container in " "dessertMeshifTable_container_init\n"); return; } if (NULL != if_ctx->cache) if_ctx->cache->magic = (void *) if_ctx->container; } /* _dessertMeshifTable_container_init */ /** * @internal * shutdown the container with functions or wrappers */ void _dessertMeshifTable_container_shutdown(dessertMeshifTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertMeshifTable:_dessertMeshifTable_container_shutdown", "called\n")); dessertMeshifTable_container_shutdown(if_ctx->container); _container_free(if_ctx->container); } /* _dessertMeshifTable_container_shutdown */ dessertMeshifTable_rowreq_ctx * dessertMeshifTable_row_find_by_mib_index(dessertMeshifTable_mib_index * mib_idx) { dessertMeshifTable_rowreq_ctx *rowreq_ctx; oid oid_tmp[MAX_OID_LEN]; netsnmp_index oid_idx; int rc; /* * set up storage for OID */ oid_idx.oids = oid_tmp; oid_idx.len = sizeof(oid_tmp) / sizeof(oid); /* * convert */ rc = dessertMeshifTable_index_to_oid(&oid_idx, mib_idx); if (MFD_SUCCESS != rc) return NULL; rowreq_ctx = CONTAINER_FIND(dessertMeshifTable_if_ctx.container, &oid_idx); return rowreq_ctx; } libdessert0.87-0.87.2/snmp/dessertAppParamsTable-README-FIRST.txt0000644000175000017500000001472111331020526022163 0ustar dvddvd************************************************************************ dessertAppParamsTable README ------------------------------------------------------------------------ This document describes the results of the mib2c code generation system using the mfd code generation template. The resulting files are documented both in this README file as well as per-table specific README files. All of the files generated by this run of mib2c will begin with the dessertAppParamsTable prefix. Quick Start ----------- For those interested in a quick start, to get a pseudo-todo list, try this command in directory with the generated code: grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n Key: :o: Optional :r: Recommended :M: Mandatory :A: Advanced users This will give you and ordered list of places in the code that you may (or must) take a closer look at). You may also want to take a look at the on-line tutorial, found here: http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html MIBs For Dummies Overview ------------------------- The MIBs For Dummies (MFD) configuration files have been written to help SNMP novices implement SNMP MIBs. This section will be a brief introduction to some of the general concepts you should be familar with. Managed Information Base (MIB) ------------------------------ A SNMP MIB (Managed information base) is a text file that describes the syntax for some set of data objects. The MIB creates a correlation between an ASCII name for an object and a number OID (Object Identifier). The SNMP protocol communicates information using the OIDs, and the MIB allows tools to display a name, which we humans find easier to deal with. To use an analogy, a MIB is much like a menu at a restaurant. If you've ever been to a reataurant and ordered a meal, and later received a bill that simply had '#6' on it, you get the idea. The name is easier for the customers to remember, and the waiters and chefs use the number for efficency. Scalars ------- A scalar variable is a unique object in a MIB which can represent a single value. For example, the SNMP standard MIB-II defines a variable, sysContact.0, which is a string containing the contact information for the person in charge of a particular agent. Note that scalar variable always end with '.0'. Rows and Tables --------------- When a group of related attributes occur more than once, they can be grouped together in a table. A table has an index, which uniquely identifies a particular row, and data columns, which contain the attributes for that row. For example, the SNMP standard MIB-II defines a table, ifTable, which contains information on the ethernet interfaces on a system. Data Structures --------------- The code generated by the MFD configuration files has a few important structures. The Data Context ---------------- The data context structure should contain the necessary information to provide the data for the columns in a given row. As long as you can extract the data for a column for the data context, the data context can be anything you want: a pointer to an existing structure, the parameters needed for a function call or an actual copy of the data. By default, a data context structure is generated with storage for all the data in a row. Information on changing the default is presented later on in this help. The MIB Context --------------- The MIB context structure is generated with storage for all the indexes of a table. This data will be used when searching for the correct row to process for a request. The Row Request Context ----------------------- Each table will have a unique data structure for holding data during the processing of a particular row. The row request context contains the registration context (that you supply during initilization), the data context, the MIB context, the undo context (for settable tables) and other data. There is also a netsnmp_data_list, which can be used to temporary storage during processing. The Table Registration Pointer ------------------------------ During initilization, you may provide a pointer to arbitrary data for you own use. This pointer will be saved in the row request context, and is passed as a parameter to several functions. It is not required, and is provided as a way for you to access table specific data in the generated code. These files are top-level files potentially useful for all the tables: ------------------------------------------------------------------------ File : dessertAppParamsTable_Makefile ---------------------------------------------------------------------- Purpose : Make file for compiling a (sub)agent. This file is only useful if you don't want to compile your code directly into the Net-SNMP master agent. Editable: Optional Usage : make -f dessertAppParamsTable_Makefile File : dessertAppParamsTable_subagent.c ---------------------------------------------------------------------- Purpose : This file contains a main() function for an agent or sub-agent and is compiled using the Makefile above. Table specific README files ------------------------------------------------------------------------ Each table for which code was generated has its own README file describing the files specifically associated with each table. You should probably read these next: dessertAppParamsTable-README-dessertAppParamsTable.txt These are miscellaneous auto-generated code files you generally shouldn't edit. They contain code that ties your code together with the Net-SNMP agent. ------------------------------------------------------------------------ File : dessertAppParamsTable.h Purpose : Header file for the module set. Includes config_require macros to auto-load the other code pieces when compiled into the agent. File : dessertAppParamsTable_oids.h Purpose : C #define definitions of the tables, columns, and OIDs File : dessertAppParamsTable_enums.h Purpose : C #define definitions of the enumerated type values for each column of each table that requires them. File : dessertAppParamsTable_interface.c Purpose : MFD interface to Net-SNMP. This auto-generated code ties the functions you will fill out to the code that the agent needs. libdessert0.87-0.87.2/snmp/dessertAppStatsTable_data_set.c0000644000175000017500000000106111331020526021456 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppStatsTable.h" /** @defgroup data_set data_set: Routines to set data * * These routines are used to set the value for individual objects. The * row context is passed, along with the new value. * * @{ */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_data_get.h0000644000175000017500000001066211331020526021132 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ * * @file dessertMeshifTable_data_get.h * * @addtogroup get * * Prototypes for get functions * * @{ */ #ifndef DESSERTMESHIFTABLE_DATA_GET_H #define DESSERTMESHIFTABLE_DATA_GET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * GET function declarations */ /* ********************************************************************* * GET Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ /* * indexes */ int meshifIndex_map(uint *mib_meshifIndex_val_ptr, uint raw_meshifIndex_val); int meshifName_map(char **mib_meshifName_val_ptr_ptr, size_t *mib_meshifName_val_ptr_len_ptr, char *raw_meshifName_val_ptr, size_t raw_meshifName_val_ptr_len, int allow_realloc); int meshifName_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, char **meshifName_val_ptr_ptr, size_t *meshifName_val_ptr_len_ptr); int meshifMacAddress_map(char **mib_meshifMacAddress_val_ptr_ptr, size_t *mib_meshifMacAddress_val_ptr_len_ptr, char *raw_meshifMacAddress_val_ptr, size_t raw_meshifMacAddress_val_ptr_len, int allow_realloc); int meshifMacAddress_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, char **meshifMacAddress_val_ptr_ptr, size_t *meshifMacAddress_val_ptr_len_ptr); int meshifInPkts_map(U64 * mib_meshifInPkts_val_ptr, U64 raw_meshifInPkts_val); int meshifInPkts_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifInPkts_val_ptr); int meshifOutPkts_map(U64 * mib_meshifOutPkts_val_ptr, U64 raw_meshifOutPkts_val); int meshifOutPkts_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifOutPkts_val_ptr); int meshifInOctets_map(U64 * mib_meshifInOctets_val_ptr, U64 raw_meshifInOctets_val); int meshifInOctets_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifInOctets_val_ptr); int meshifOutOctets_map(U64 * mib_meshifOutOctets_val_ptr, U64 raw_meshifOutOctets_val); int meshifOutOctets_get(dessertMeshifTable_rowreq_ctx * rowreq_ctx, U64 * meshifOutOctets_val_ptr); int dessertMeshifTable_indexes_set_tbl_idx(dessertMeshifTable_mib_index * tbl_idx, long meshifIndex_val); int dessertMeshifTable_indexes_set(dessertMeshifTable_rowreq_ctx * rowreq_ctx, long meshifIndex_val); #ifdef __cplusplus } #endif #endif /* DESSERTMESHIFTABLE_DATA_GET_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertObjects.h0000644000175000017500000000071511331020526016506 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $ */ #ifndef DESSERTOBJECTS_H #define DESSERTOBJECTS_H /* * function declarations */ void init_dessertObjects(void); Netsnmp_Node_Handler handle_dessertMeshifNumber; Netsnmp_Node_Handler handle_applicationVersion; Netsnmp_Node_Handler handle_protocollShortName; #endif /* DESSERTOBJECTS_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable_data_access.c0000644000175000017500000002573311331020526021476 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "../dessert_internal.h" #include "dessertSysifTable_data_access.h" /** @ingroup interface * @addtogroup data_access data_access: Routines to access data * * These routines are used to locate the data used to satisfy * requests. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ /** * initialization for dessertSysifTable data access * * This function is called during startup to allow you to * allocate any resources you need for the data table. * * @param dessertSysifTable_reg * Pointer to dessertSysifTable_registration * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : unrecoverable error. */ int dessertSysifTable_init_data(dessertSysifTable_registration * dessertSysifTable_reg) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_init_data", "called\n")); return MFD_SUCCESS; } /* dessertSysifTable_init_data */ /** * container overview * */ /** * container initialization * * @param container_ptr_ptr A pointer to a container pointer. If you * create a custom container, use this parameter to return it * to the MFD helper. If set to NULL, the MFD helper will * allocate a container for you. * @param cache A pointer to a cache structure. You can set the timeout * and other cache flags using this pointer. * * This function is called at startup to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. If no custom * container is allocated, the MFD code will create one for your. * * This is also the place to set up cache behavior. The default, to * simply set the cache timeout, will work well with the default * container. If you are using a custom container, you may want to * look at the cache helper documentation to see if there are any * flags you want to set. * * @remark * This would also be a good place to do any initialization needed * for you data source. For example, opening a connection to another * process that will supply the data, opening a database, etc. */ void dessertSysifTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_container_init", "called\n")); dessert_debug("dessertSysifTable_container_load called"); if (NULL == container_ptr_ptr) { snmp_log(LOG_ERR, "bad container param to dessertSysifTable_container_init\n"); return; } /* * For advanced users, you can use a custom container. If you * do not create one, one will be created for you. */ *container_ptr_ptr = NULL; if (NULL == cache) { snmp_log(LOG_ERR, "bad cache param to dessertSysifTable_container_init\n"); return; } /* * TODO:345:A: Set up dessertSysifTable cache properties. * * Also for advanced users, you can set parameters for the * cache. Do not change the magic pointer, as it is used * by the MFD helper. To completely disable caching, set * cache->enabled to 0. */ cache->timeout = DESSERTSYSIFTABLE_CACHE_TIMEOUT; /* seconds */ } /* dessertSysifTable_container_init */ /** * container shutdown * * @param container_ptr A pointer to the container. * * This function is called at shutdown to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. * * This function is called before dessertSysifTable_container_free(). * * @remark * This would also be a good place to do any cleanup needed * for you data source. For example, closing a connection to another * process that supplied the data, closing a database, etc. */ void dessertSysifTable_container_shutdown(netsnmp_container * container_ptr) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_container_shutdown", "called\n")); if (NULL == container_ptr) { snmp_log(LOG_ERR, "bad params to dessertSysifTable_container_shutdown\n"); return; } } /* dessertSysifTable_container_shutdown */ /** * load initial data * * TODO:350:M: Implement dessertSysifTable data load * This function will also be called by the cache helper to load * the container again (after the container free function has been * called to free the previous contents). * * @param container container to which items should be inserted * * @retval MFD_SUCCESS : success. * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source * @retval MFD_ERROR : other error. * * This function is called to load the index(es) (and data, optionally) * for the every row in the data set. * * @remark * While loading the data, the only important thing is the indexes. * If access to your data is cheap/fast (e.g. you have a pointer to a * structure in memory), it would make sense to update the data here. * If, however, the accessing the data invovles more work (e.g. parsing * some other existing data, or peforming calculations to derive the data), * then you can limit yourself to setting the indexes and saving any * information you will need later. Then use the saved information in * dessertSysifTable_row_prep() for populating data. * * @note * If you need consistency between rows (like you want statistics * for each row to be from the same time frame), you should set all * data here. * */ int dessertSysifTable_container_load(netsnmp_container * container) { dessertSysifTable_rowreq_ctx *rowreq_ctx; dessert_sysif_t *sysif = _dessert_sysif; /* TODO: change if multiple tun/tap interfaces are supported*/ char inPkts[I64CHARSZ + 1]; char outPkts[I64CHARSZ + 1]; char inOctets[I64CHARSZ + 1]; char outOctets[I64CHARSZ + 1]; /* * temporary storage for index values */ /* * sysifIndex(1)///()//L/a/w/e/r/d/h */ long sysifIndex = 0; dessert_debug("dessertSysifTable_container_load called"); DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_container_load", "called\n")); /* * TODO:351:M: |-> Load/update data in the dessertSysTable container. * loop over your dessertSysifTable data, allocate a rowreq context, * set the index(es) [and data, optionally] and insert into * the container. */ /* * TODO:352:M: | |-> set indexes in new dessertSysifTable rowreq context. * data context will be set from the param (unless NULL, * in which case a new data context will be allocated) */ rowreq_ctx = dessertSysifTable_allocate_rowreq_ctx(NULL); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "memory allocation failed\n"); return MFD_RESOURCE_UNAVAILABLE; } if (MFD_SUCCESS != dessertSysifTable_indexes_set(rowreq_ctx, sysifIndex)) { snmp_log(LOG_ERR, "error setting index while loading " "dessertSysTable data.\n"); dessertSysifTable_release_rowreq_ctx(rowreq_ctx); return MFD_RESOURCE_UNAVAILABLE; } /* * TODO:352:r: | |-> populate dessertMeshifTable data context. * Populate data context here. (optionally, delay until row prep) */ /* * non-TRANSIENT data: no need to copy. set pointer to data */ rowreq_ctx->data.sysifName_len = strlen(sysif->if_name); strcpy(rowreq_ctx->data.sysifName, sysif->if_name); rowreq_ctx->data.sysifMacAddress_len = 6; memcpy(rowreq_ctx->data.sysifMacAddress, sysif->hwaddr, 6); pthread_mutex_lock(&(sysif->cnt_mutex)); rowreq_ctx->data.sysifInPkts.low = sysif->ipkts & 0xffffffff; rowreq_ctx->data.sysifInPkts.high = sysif->ipkts >> 32; rowreq_ctx->data.sysifOutPkts.low = sysif->opkts & 0xffffffff; rowreq_ctx->data.sysifOutPkts.high = sysif->opkts >> 32; rowreq_ctx->data.sysifInOctets.low = sysif->ibytes & 0xffffffff; rowreq_ctx->data.sysifInOctets.high = sysif->ibytes >> 32; rowreq_ctx->data.sysifOutOctets.low = sysif->obytes & 0xffffffff; rowreq_ctx->data.sysifOutOctets.high = sysif->obytes >> 32; printU64(inPkts, &rowreq_ctx->data.sysifInPkts); printU64(outPkts, &rowreq_ctx->data.sysifOutPkts); printU64(inOctets, &rowreq_ctx->data.sysifInOctets); printU64(outOctets, &rowreq_ctx->data.sysifOutOctets); dessert_debug("inPkts [%s] [%u]", inPkts, sysif->ipkts); dessert_debug("outPkts [%s] [%u]", outPkts, sysif->opkts); dessert_debug("inOctets [%s] [%u]", inOctets, sysif->ibytes); dessert_debug("outOctets [%s] [%u]", outOctets, sysif->obytes); pthread_mutex_unlock(&(sysif->cnt_mutex)); /* * insert into table container */ CONTAINER_INSERT(container, rowreq_ctx); DEBUGMSGT(("verbose:dessertSysifTable:dessertSysifTable_container_load", "inserted 1 record(s)\n")); return MFD_SUCCESS; } /* dessertSysifTable_container_load */ /** * container clean up * * @param container container with all current items * * This optional callback is called prior to all * item's being removed from the container. If you * need to do any processing before that, do it here. * * @note * The MFD helper will take care of releasing all the row contexts. * */ void dessertSysifTable_container_free(netsnmp_container * container) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_container_free", "called\n")); /* * TODO:380:M: Free dessertSysifTable container data. */ } /* dessertSysifTable_container_free */ /** * prepare row for processing. * * When the agent has located the row for a request, this function is * called to prepare the row for processing. If you fully populated * the data context during the index setup phase, you may not need to * do anything. * * @param rowreq_ctx pointer to a context. * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. */ int dessertSysifTable_row_prep(dessertSysifTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_row_prep", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:390:o: Prepare row for request. * If populating row data was delayed, this is the place to * fill in the row for this request. */ return MFD_SUCCESS; } /* dessertSysifTable_row_prep */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_interface.h0000644000175000017500000000754611331020526022002 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /** @ingroup interface: Routines to interface to Net-SNMP * * \warning This code should not be modified, called directly, * or used to interpret functionality. It is subject to * change at any time. * * @{ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ #ifndef DESSERTAPPPARAMSTABLE_INTERFACE_H #define DESSERTAPPPARAMSTABLE_INTERFACE_H #ifdef __cplusplus extern "C" { #endif #include "dessertAppParamsTable.h" /* ******************************************************************** * Table declarations */ /* * PUBLIC interface initialization routine */ void _dessertAppParamsTable_initialize_interface (dessertAppParamsTable_registration * user_ctx, u_long flags); void _dessertAppParamsTable_shutdown_interface (dessertAppParamsTable_registration * user_ctx); dessertAppParamsTable_registration *dessertAppParamsTable_registration_get(void); dessertAppParamsTable_registration *dessertAppParamsTable_registration_set (dessertAppParamsTable_registration * newreg); netsnmp_container *dessertAppParamsTable_container_get(void); int dessertAppParamsTable_container_size(void); u_int dessertAppParamsTable_dirty_get(void); void dessertAppParamsTable_dirty_set(u_int status); dessertAppParamsTable_rowreq_ctx *dessertAppParamsTable_allocate_rowreq_ctx(void); void dessertAppParamsTable_release_rowreq_ctx (dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_index_to_oid(netsnmp_index * oid_idx, dessertAppParamsTable_mib_index * mib_idx); int dessertAppParamsTable_index_from_oid(netsnmp_index * oid_idx, dessertAppParamsTable_mib_index * mib_idx); /* * access to certain internals. use with caution! */ void dessertAppParamsTable_valid_columns_set(netsnmp_column_info *vc); #ifdef __cplusplus } #endif #endif /* DESSERTAPPPARAMSTABLE_INTERFACE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable.c0000644000175000017500000001262711331020526017300 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /** \page MFD helper for dessertMeshifTable * * \section intro Introduction * Introductory text. * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertMeshifTable.h" #include #include "dessertMeshifTable_interface.h" oid dessertMeshifTable_oid[] = { DESSERTMESHIFTABLE_OID }; int dessertMeshifTable_oid_size = OID_LENGTH(dessertMeshifTable_oid); dessertMeshifTable_registration dessertMeshifTable_user_context; void initialize_table_dessertMeshifTable(void); void shutdown_table_dessertMeshifTable(void); /** * Initializes the dessertMeshifTable module */ void init_dessertMeshifTable(void) { DEBUGMSGTL(("verbose:dessertMeshifTable:init_dessertMeshifTable", "called\n")); /* * TODO:300:o: Perform dessertMeshifTable one-time module initialization. */ /* * here we initialize all the tables we're planning on supporting */ if (should_init("dessertMeshifTable")) initialize_table_dessertMeshifTable(); } /* init_dessertMeshifTable */ /** * Shut-down the dessertMeshifTable module (agent is exiting) */ void shutdown_dessertMeshifTable(void) { if (should_init("dessertMeshifTable")) shutdown_table_dessertMeshifTable(); } /** * Initialize the table dessertMeshifTable * (Define its contents and how it's structured) */ void initialize_table_dessertMeshifTable(void) { dessertMeshifTable_registration *user_context; u_long flags; DEBUGMSGTL(("verbose:dessertMeshifTable:initialize_table_dessertMeshifTable", "called\n")); /* * TODO:301:o: Perform dessertMeshifTable one-time table initialization. */ /* * TODO:302:o: |->Initialize dessertMeshifTable 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("dessertMeshifTable", NULL, NULL); /* * No support for any flags yet, but in the future you would * set any flags here. */ flags = 0; /* * call interface initialization code */ _dessertMeshifTable_initialize_interface(user_context, flags); } /* initialize_table_dessertMeshifTable */ /** * Shutdown the table dessertMeshifTable */ void shutdown_table_dessertMeshifTable(void) { /* * call interface shutdown code */ _dessertMeshifTable_shutdown_interface (&dessertMeshifTable_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 dessertMeshifTable_rowreq_ctx_init(dessertMeshifTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_rowreq_ctx_init", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:210:o: |-> Perform extra dessertMeshifTable rowreq initialization. (eg DEFVALS) */ return MFD_SUCCESS; } /* dessertMeshifTable_rowreq_ctx_init */ /** * extra context cleanup * */ void dessertMeshifTable_rowreq_ctx_cleanup(dessertMeshifTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_rowreq_ctx_cleanup", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:211:o: |-> Perform extra dessertMeshifTable rowreq cleanup. */ } /* dessertMeshifTable_rowreq_ctx_cleanup */ /** * pre-request callback * * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error */ int dessertMeshifTable_pre_request(dessertMeshifTable_registration * user_context) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_pre_request", "called\n")); /* * TODO:510:o: Perform dessertMeshifTable pre-request actions. */ return MFD_SUCCESS; } /* dessertMeshifTable_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 dessertMeshifTable_post_request(dessertMeshifTable_registration * user_context, int rc) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_post_request", "called\n")); /* * TODO:511:o: Perform dessertMeshifTable post-request actions. */ return MFD_SUCCESS; } /* dessertMeshifTable_post_request */ /** @{ */ libdessert0.87-0.87.2/snmp/dessertMeshifTable.h0000644000175000017500000001365011331020526017302 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTMESHIFTABLE_H #define DESSERTMESHIFTABLE_H #ifdef __cplusplus extern "C" { #endif /** @addtogroup misc misc: Miscellaneous routines * * @{ */ #include /* * other required module components */ /* *INDENT-OFF* */ config_add_mib(DESSERT-MIB) config_require(DESSERT-MIB/dessertMeshifTable/dessertMeshifTable_interface) config_require(DESSERT-MIB/dessertMeshifTable/dessertMeshifTable_data_access) config_require(DESSERT-MIB/dessertMeshifTable/dessertMeshifTable_data_get) config_require(DESSERT-MIB/dessertMeshifTable/dessertMeshifTable_data_set) /* *INDENT-ON* */ /* * OID and column number definitions for dessertMeshifTable */ #include "dessertMeshifTable_oids.h" /* * enum definions */ #include "dessertMeshifTable_enums.h" /* ********************************************************************* * function declarations */ void init_dessertMeshifTable(void); void shutdown_dessertMeshifTable(void); /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: 1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ /* ********************************************************************* * 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 dessertMeshifTable registration context. */ typedef netsnmp_data_list dessertMeshifTable_registration; /**********************************************************************/ /* * TODO:110:r: |-> Review dessertMeshifTable data context structure. * This structure is used to represent the data for dessertMeshifTable. */ /* * This structure contains storage for all the columns defined in the * dessertMeshifTable. */ typedef struct dessertMeshifTable_data_s { /* * meshifName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char meshifName[255]; size_t meshifName_len; /* # of char elements, not bytes */ /* * meshifMacAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ char meshifMacAddress[6]; size_t meshifMacAddress_len; /* # of char elements, not bytes */ /* * meshifInPkts(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 meshifInPkts; /* * meshifOutPkts(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 meshifOutPkts; /* * meshifInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 meshifInOctets; /* * meshifOutOctets(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 meshifOutOctets; } dessertMeshifTable_data; /* * TODO:120:r: |-> Review dessertMeshifTable mib index. * This structure is used to represent the index for dessertMeshifTable. */ typedef struct dessertMeshifTable_mib_index_s { /* * meshifIndex(1)///()//L/a/w/e/r/d/h */ long meshifIndex; } dessertMeshifTable_mib_index; /* * TODO:121:r: | |-> Review dessertMeshifTable max index length. * If you KNOW that your indexes will never exceed a certain * length, update this macro to that length. */ #define MAX_dessertMeshifTable_IDX_LEN 1 /* ********************************************************************* * TODO:130:o: |-> Review dessertMeshifTable Row request (rowreq) context. * When your functions are called, you will be passed a * dessertMeshifTable_rowreq_ctx pointer. */ typedef struct dessertMeshifTable_rowreq_ctx_s { /** this must be first for container compare to work */ netsnmp_index oid_idx; oid oid_tmp[MAX_dessertMeshifTable_IDX_LEN]; dessertMeshifTable_mib_index tbl_idx; dessertMeshifTable_data data; /* * 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 dessertMeshifTable rowreq context. */ /* * storage for future expansion */ netsnmp_data_list *dessertMeshifTable_data_list; } dessertMeshifTable_rowreq_ctx; typedef struct dessertMeshifTable_ref_rowreq_ctx_s { dessertMeshifTable_rowreq_ctx *rowreq_ctx; } dessertMeshifTable_ref_rowreq_ctx; /* ********************************************************************* * function prototypes */ int dessertMeshifTable_pre_request(dessertMeshifTable_registration * user_context); int dessertMeshifTable_post_request(dessertMeshifTable_registration * user_context, int rc); int dessertMeshifTable_rowreq_ctx_init(dessertMeshifTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx); void dessertMeshifTable_rowreq_ctx_cleanup( dessertMeshifTable_rowreq_ctx * rowreq_ctx); dessertMeshifTable_rowreq_ctx *dessertMeshifTable_row_find_by_mib_index( dessertMeshifTable_mib_index * mib_idx); extern oid dessertMeshifTable_oid[]; extern int dessertMeshifTable_oid_size; #include "dessertMeshifTable_interface.h" #include "dessertMeshifTable_data_access.h" #include "dessertMeshifTable_data_get.h" #include "dessertMeshifTable_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 /* DESSERTMESHIFTABLE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_enums.h0000644000175000017500000000210711331020526020504 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ * * $Id:$ */ #ifndef DESSERTMESHIFTABLE_ENUMS_H #define DESSERTMESHIFTABLE_ENUMS_H #ifdef __cplusplus extern "C" { #endif /* * NOTES on enums * ============== * * Value Mapping * ------------- * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them * below. For example, a boolean flag (1/0) is usually represented * as a TruthValue in a MIB, which maps to the values (1/2). * */ /************************************************************************* ************************************************************************* * * enum definitions for table dessertMeshifTable * ************************************************************************* *************************************************************************/ #ifdef __cplusplus } #endif #endif /* DESSERTMESHIFTABLE_ENUMS_H */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_oids.h0000644000175000017500000000161511331020526020316 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ * * $Id:$ */ #ifndef DESSERTMESHIFTABLE_OIDS_H #define DESSERTMESHIFTABLE_OIDS_H #ifdef __cplusplus extern "C" { #endif /* * column number definitions for table dessertMeshifTable */ #define DESSERTMESHIFTABLE_OID 1,3,6,1,4,1,18898,0,19,10,1,1,5 #define COLUMN_MESHIFINDEX 1 #define COLUMN_MESHIFNAME 2 #define COLUMN_MESHIFMACADDRESS 3 #define COLUMN_MESHIFINPKTS 4 #define COLUMN_MESHIFOUTPKTS 5 #define COLUMN_MESHIFINOCTETS 6 #define COLUMN_MESHIFOUTOCTETS 7 #define DESSERTMESHIFTABLE_MIN_COL COLUMN_MESHIFNAME #define DESSERTMESHIFTABLE_MAX_COL COLUMN_MESHIFOUTOCTETS #ifdef __cplusplus } #endif #endif /* DESSERTMESHIFTABLE_OIDS_H */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_interface.c0000644000175000017500000017317311331020526021775 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppParamsTable.h" #include #include #include "dessertAppParamsTable_interface.h" #include /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ typedef struct dessertAppParamsTable_interface_ctx_s { netsnmp_container *container; netsnmp_cache *cache; dessertAppParamsTable_registration *user_ctx; netsnmp_table_registration_info tbl_info; netsnmp_baby_steps_access_methods access_multiplexer; u_int table_dirty; } dessertAppParamsTable_interface_ctx; static dessertAppParamsTable_interface_ctx dessertAppParamsTable_if_ctx; static void _dessertAppParamsTable_container_init(dessertAppParamsTable_interface_ctx * if_ctx); static void _dessertAppParamsTable_container_shutdown (dessertAppParamsTable_interface_ctx * if_ctx); netsnmp_container * dessertAppParamsTable_container_get(void) { return dessertAppParamsTable_if_ctx.container; } dessertAppParamsTable_registration * dessertAppParamsTable_registration_get(void) { return dessertAppParamsTable_if_ctx.user_ctx; } dessertAppParamsTable_registration * dessertAppParamsTable_registration_set(dessertAppParamsTable_registration * newreg) { dessertAppParamsTable_registration *old = dessertAppParamsTable_if_ctx.user_ctx; dessertAppParamsTable_if_ctx.user_ctx = newreg; return old; } int dessertAppParamsTable_container_size(void) { return CONTAINER_SIZE(dessertAppParamsTable_if_ctx.container); } u_int dessertAppParamsTable_dirty_get(void) { return dessertAppParamsTable_if_ctx.table_dirty; } void dessertAppParamsTable_dirty_set(u_int status) { DEBUGMSGTL(("dessertAppParamsTable:dessertAppParamsTable_dirty_set", "called. was %d, now %d\n", dessertAppParamsTable_if_ctx.table_dirty, status)); dessertAppParamsTable_if_ctx.table_dirty = status; } /* * mfd multiplexer modes */ static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_pre_request; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_post_request; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_object_lookup; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_get_values; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_check_objects; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_undo_setup; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_set_values; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_undo_cleanup; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_undo_values; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_commit; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_undo_commit; static Netsnmp_Node_Handler _mfd_dessertAppParamsTable_irreversible_commit; NETSNMP_STATIC_INLINE int _dessertAppParamsTable_undo_column(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column); dessertAppParamsTable_data *dessertAppParamsTable_allocate_data(void); /** * @internal * Initialize the table dessertAppParamsTable * (Define its contents and how it's structured) */ void _dessertAppParamsTable_initialize_interface (dessertAppParamsTable_registration * reg_ptr, u_long flags) { netsnmp_baby_steps_access_methods *access_multiplexer = &dessertAppParamsTable_if_ctx.access_multiplexer; netsnmp_table_registration_info *tbl_info = &dessertAppParamsTable_if_ctx.tbl_info; netsnmp_handler_registration *reginfo; netsnmp_mib_handler *handler; int mfd_modes = 0; DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_initialize_interface", "called\n")); /************************************************* * * save interface context for dessertAppParamsTable */ /* * Setting up the table's definition */ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, /** index: appParamsIndex */ 0); /* * Define the minimum and maximum accessible columns. This * optimizes retrival. */ tbl_info->min_column = DESSERTAPPPARAMSTABLE_MIN_COL; tbl_info->max_column = DESSERTAPPPARAMSTABLE_MAX_COL; /* * save users context */ dessertAppParamsTable_if_ctx.user_ctx = reg_ptr; /* * call data access initialization code */ dessertAppParamsTable_init_data(reg_ptr); /* * set up the container */ _dessertAppParamsTable_container_init(&dessertAppParamsTable_if_ctx); if (NULL == dessertAppParamsTable_if_ctx.container) { snmp_log(LOG_ERR, "could not initialize container for dessertAppParamsTable\n"); return; } /* * access_multiplexer: REQUIRED wrapper for get request handling */ access_multiplexer->object_lookup = _mfd_dessertAppParamsTable_object_lookup; access_multiplexer->get_values = _mfd_dessertAppParamsTable_get_values; /* * no wrappers yet */ access_multiplexer->pre_request = _mfd_dessertAppParamsTable_pre_request; access_multiplexer->post_request = _mfd_dessertAppParamsTable_post_request; /* * REQUIRED wrappers for set request handling */ access_multiplexer->object_syntax_checks = _mfd_dessertAppParamsTable_check_objects; access_multiplexer->undo_setup = _mfd_dessertAppParamsTable_undo_setup; access_multiplexer->undo_cleanup = _mfd_dessertAppParamsTable_undo_cleanup; access_multiplexer->set_values = _mfd_dessertAppParamsTable_set_values; access_multiplexer->undo_sets = _mfd_dessertAppParamsTable_undo_values; /* * no wrappers yet */ access_multiplexer->commit = _mfd_dessertAppParamsTable_commit; access_multiplexer->undo_commit = _mfd_dessertAppParamsTable_undo_commit; access_multiplexer->irreversible_commit = _mfd_dessertAppParamsTable_irreversible_commit; /************************************************* * * Create a registration, save our reg data, register table. */ DEBUGMSGTL(("dessertAppParamsTable:init_dessertAppParamsTable", "Registering dessertAppParamsTable as a mibs-for-dummies table.\n")); handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); reginfo = netsnmp_handler_registration_create("dessertAppParamsTable", handler, dessertAppParamsTable_oid, dessertAppParamsTable_oid_size, HANDLER_CAN_BABY_STEP | HANDLER_CAN_RWRITE); if (NULL == reginfo) { snmp_log(LOG_ERR, "error registering table dessertAppParamsTable\n"); return; } reginfo->my_reg_void = &dessertAppParamsTable_if_ctx; /************************************************* * * set up baby steps handler, create it and inject it */ if (access_multiplexer->object_lookup) mfd_modes |= BABY_STEP_OBJECT_LOOKUP; if (access_multiplexer->set_values) mfd_modes |= BABY_STEP_SET_VALUES; if (access_multiplexer->irreversible_commit) mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT; if (access_multiplexer->object_syntax_checks) mfd_modes |= BABY_STEP_CHECK_OBJECT; if (access_multiplexer->pre_request) mfd_modes |= BABY_STEP_PRE_REQUEST; if (access_multiplexer->post_request) mfd_modes |= BABY_STEP_POST_REQUEST; if (access_multiplexer->undo_setup) mfd_modes |= BABY_STEP_UNDO_SETUP; if (access_multiplexer->undo_cleanup) mfd_modes |= BABY_STEP_UNDO_CLEANUP; if (access_multiplexer->undo_sets) mfd_modes |= BABY_STEP_UNDO_SETS; if (access_multiplexer->row_creation) mfd_modes |= BABY_STEP_ROW_CREATE; if (access_multiplexer->consistency_checks) mfd_modes |= BABY_STEP_CHECK_CONSISTENCY; if (access_multiplexer->commit) mfd_modes |= BABY_STEP_COMMIT; if (access_multiplexer->undo_commit) mfd_modes |= BABY_STEP_UNDO_COMMIT; handler = netsnmp_baby_steps_handler_get(mfd_modes); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject row_merge helper with prefix rootoid_len + 2 (entry.col) */ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject container_table helper */ handler = netsnmp_container_table_handler_get(tbl_info, dessertAppParamsTable_if_ctx. container, TABLE_CONTAINER_KEY_NETSNMP_INDEX); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject cache helper */ if (NULL != dessertAppParamsTable_if_ctx.cache) { handler = netsnmp_cache_handler_get(dessertAppParamsTable_if_ctx.cache); netsnmp_inject_handler(reginfo, handler); } /* * register table */ netsnmp_register_table(reginfo, tbl_info); } /* _dessertAppParamsTable_initialize_interface */ /** * @internal * Shutdown the table dessertAppParamsTable */ void _dessertAppParamsTable_shutdown_interface (dessertAppParamsTable_registration * reg_ptr) { /* * shutdown the container */ _dessertAppParamsTable_container_shutdown (&dessertAppParamsTable_if_ctx); } void dessertAppParamsTable_valid_columns_set(netsnmp_column_info *vc) { dessertAppParamsTable_if_ctx.tbl_info.valid_columns = vc; } /* dessertAppParamsTable_valid_columns_set */ /** * @internal * convert the index component stored in the context to an oid */ int dessertAppParamsTable_index_to_oid(netsnmp_index * oid_idx, dessertAppParamsTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * appParamsIndex(1)/DessertAppParamsIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H */ netsnmp_variable_list var_appParamsIndex; /* * set up varbinds */ memset(&var_appParamsIndex, 0x00, sizeof(var_appParamsIndex)); var_appParamsIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_appParamsIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_index_to_oid", "called\n")); /* * appParamsIndex(1)/DessertAppParamsIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H */ snmp_set_var_value(&var_appParamsIndex, (u_char *) & mib_idx->appParamsIndex, sizeof(mib_idx->appParamsIndex)); err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, NULL, 0, &var_appParamsIndex); if (err) snmp_log(LOG_ERR, "error %d converting index to oid\n", err); /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_appParamsIndex); return err; } /* dessertAppParamsTable_index_to_oid */ /** * extract dessertAppParamsTable indexes from a netsnmp_index * * @retval SNMP_ERR_NOERROR : no error * @retval SNMP_ERR_GENERR : error */ int dessertAppParamsTable_index_from_oid(netsnmp_index * oid_idx, dessertAppParamsTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * appParamsIndex(1)/DessertAppParamsIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H */ netsnmp_variable_list var_appParamsIndex; /* * set up varbinds */ memset(&var_appParamsIndex, 0x00, sizeof(var_appParamsIndex)); var_appParamsIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_appParamsIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_index_from_oid", "called\n")); /* * parse the oid into the individual index components */ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, &var_appParamsIndex); if (err == SNMP_ERR_NOERROR) { /* * copy out values */ mib_idx->appParamsIndex = *((long *) var_appParamsIndex.val.string); } /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_appParamsIndex); return err; } /* dessertAppParamsTable_index_from_oid */ /* * dessertAppParamsTable_allocate_data * * Purpose: create new dessertAppParamsTable_data. */ dessertAppParamsTable_data * dessertAppParamsTable_allocate_data(void) { dessertAppParamsTable_data *rtn = SNMP_MALLOC_TYPEDEF(dessertAppParamsTable_data); DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_allocate_data", "called\n")); if (NULL == rtn) { snmp_log(LOG_ERR, "unable to malloc memory for new " "dessertAppParamsTable_data.\n"); } return rtn; } /* dessertAppParamsTable_allocate_data */ /* * dessertAppParamsTable_release_data * * Purpose: release dessertAppParamsTable data. */ void dessertAppParamsTable_release_data(dessertAppParamsTable_data * data) { DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_release_data", "called\n")); free(data); } /* dessertAppParamsTable_release_data */ /* ********************************************************************* * @internal * allocate resources for a dessertAppParamsTable_rowreq_ctx */ dessertAppParamsTable_rowreq_ctx * dessertAppParamsTable_allocate_rowreq_ctx(void) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = SNMP_MALLOC_TYPEDEF(dessertAppParamsTable_rowreq_ctx); DEBUGMSGTL(("internal:dessertAppParamsTable:dessertAppParamsTable_allocate_rowreq_ctx", "called\n")); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "Couldn't allocate memory for a " "dessertAppParamsTable_rowreq_ctx.\n"); return NULL; } rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; rowreq_ctx->dessertAppParamsTable_data_list = NULL; return rowreq_ctx; } /* dessertAppParamsTable_allocate_rowreq_ctx */ /* * @internal * release resources for a dessertAppParamsTable_rowreq_ctx */ void dessertAppParamsTable_release_rowreq_ctx(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("internal:dessertAppParamsTable:dessertAppParamsTable_release_rowreq_ctx", "called\n")); netsnmp_assert(NULL != rowreq_ctx); if (rowreq_ctx->undo) dessertAppParamsTable_release_data(rowreq_ctx->undo); /* * free index oid pointer */ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp) free(rowreq_ctx->oid_idx.oids); SNMP_FREE(rowreq_ctx); } /* dessertAppParamsTable_release_rowreq_ctx */ /** * @internal * wrapper */ static int _mfd_dessertAppParamsTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_pre_request", "called\n")); if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertAppParamsTable", "skipping additional pre_request\n")); return SNMP_ERR_NOERROR; } rc = dessertAppParamsTable_pre_request(dessertAppParamsTable_if_ctx. user_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppParamsTable", "error %d from " "dessertAppParamsTable_pre_request\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_pre_request */ /** * @internal * wrapper */ static int _mfd_dessertAppParamsTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); int rc, packet_rc; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_post_request", "called\n")); /* * release row context, if deleted */ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) dessertAppParamsTable_release_rowreq_ctx(rowreq_ctx); /* * wait for last call before calling user */ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertAppParamsTable", "waiting for last post_request\n")); return SNMP_ERR_NOERROR; } packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); if ((MFD_SUCCESS != packet_rc) && dessertAppParamsTable_dirty_get()) { /* * we shouldn't get here. the undo steps should also clear * the dirty flags. */ snmp_log(LOG_WARNING, "dessertAppParamsTable dirty flag set in post_request " "but status != SUCCESS.\n"); } rc = dessertAppParamsTable_post_request(dessertAppParamsTable_if_ctx. user_ctx, packet_rc); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppParamsTable", "error %d from " "dessertAppParamsTable_post_request\n", rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_post_request */ /** * @internal * wrapper */ static int _mfd_dessertAppParamsTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc = SNMP_ERR_NOERROR; dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_object_lookup", "called\n")); /* * get our context from mfd * dessertAppParamsTable_interface_ctx *if_ctx = * (dessertAppParamsTable_interface_ctx *)reginfo->my_reg_void; */ if (NULL == rowreq_ctx) { rc = SNMP_ERR_NOCREATION; } if (MFD_SUCCESS != rc) netsnmp_request_set_error_all(requests, rc); else dessertAppParamsTable_row_prep(rowreq_ctx); return SNMP_VALIDATE_ERR(rc); } /* _mfd_dessertAppParamsTable_object_lookup */ /*********************************************************************** * * GET processing * ***********************************************************************/ /* * @internal * Retrieve the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertAppParamsTable_get_column(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * appParamsName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPPARAMSNAME: if (!(COLUMN_APPPARAMSNAME_FLAG & rowreq_ctx->column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsName) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appParamsName_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * appParamsDesc(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPPARAMSDESC: if (!(COLUMN_APPPARAMSDESC_FLAG & rowreq_ctx->column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsDesc) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appParamsDesc_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * appParamsValueType(4)/DessertAppValueType/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ case COLUMN_APPPARAMSVALUETYPE: if (! (COLUMN_APPPARAMSVALUETYPE_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsValueType) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_INTEGER; rc = appParamsValueType_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appParamsTruthValue(5)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_APPPARAMSTRUTHVALUE: if (! (COLUMN_APPPARAMSTRUTHVALUE_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsTruthValue) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_INTEGER; rc = appParamsTruthValue_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appParamsInteger32(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSINTEGER32: if (! (COLUMN_APPPARAMSINTEGER32_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsInteger32) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(long); var->type = ASN_INTEGER; rc = appParamsInteger32_get(rowreq_ctx, (long *) var->val.string); break; /* * appParamsUnsigned32(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSUNSIGNED32: if (! (COLUMN_APPPARAMSUNSIGNED32_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsUnsigned32) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_UNSIGNED; rc = appParamsUnsigned32_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appParamsOctetString(9)/DessertApplicationOctetString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ case COLUMN_APPPARAMSOCTETSTRING: if (! (COLUMN_APPPARAMSOCTETSTRING_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "column %d (appParamsOctetString) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appParamsOctetString_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; default: if (DESSERTAPPPARAMSTABLE_MIN_COL <= column && column <= DESSERTAPPPARAMSTABLE_MAX_COL) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_column", "assume column %d is reserved\n", column)); rc = MFD_SKIP; } else { snmp_log(LOG_ERR, "unknown column %d in _dessertAppParamsTable_get_column\n", column); } break; } return rc; } /* _dessertAppParamsTable_get_column */ int _mfd_dessertAppParamsTable_get_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; u_char *old_string; void (*dataFreeHook) (void *); int rc; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); DEBUGMSGTL(("9:dessertAppParamsTable:_mfd_dessertAppParamsTable_get_values", "exists %p\n", rowreq_ctx->column_exists_flags)); for (; requests; requests = requests->next) { /* * save old pointer, so we can free it if replaced */ old_string = requests->requestvb->val.string; dataFreeHook = requests->requestvb->dataFreeHook; if (NULL == requests->requestvb->val.string) { requests->requestvb->val.string = requests->requestvb->buf; requests->requestvb->val_len = sizeof(requests->requestvb->buf); } else if (requests->requestvb->buf == requests->requestvb->val.string) { if (requests->requestvb->val_len != sizeof(requests->requestvb->buf)) requests->requestvb->val_len = sizeof(requests->requestvb->buf); } /* * get column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertAppParamsTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum); if (rc) { if (MFD_SKIP == rc) { requests->requestvb->type = SNMP_NOSUCHINSTANCE; rc = SNMP_ERR_NOERROR; } } else if (NULL == requests->requestvb->val.string) { snmp_log(LOG_ERR, "NULL varbind data pointer!\n"); rc = SNMP_ERR_GENERR; } if (rc) netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc)); /* * if the buffer wasn't used previously for the old data (i.e. it * was allcoated memory) and the get routine replaced the pointer, * we need to free the previous pointer. */ if (old_string && (old_string != requests->requestvb->buf) && (requests->requestvb->val.string != old_string)) { if (dataFreeHook) (*dataFreeHook) (old_string); else free(old_string); } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_get_values */ /*********************************************************************** * * SET processing * ***********************************************************************/ /*---------------------------------------------------------------------- * * SET: Syntax checks * *---------------------------------------------------------------------*/ /* * @internal * Check the syntax for a particular column */ NETSNMP_STATIC_INLINE int _dessertAppParamsTable_check_column(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_check_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * (INDEX) appParamsIndex(1)/DessertAppParamsIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H */ case COLUMN_APPPARAMSINDEX: rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */ break; /* * appParamsName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPPARAMSNAME: rc = SNMP_ERR_NOTWRITABLE; break; /* * appParamsDesc(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPPARAMSDESC: rc = SNMP_ERR_NOTWRITABLE; break; /* * appParamsValueType(4)/DessertAppValueType/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ case COLUMN_APPPARAMSVALUETYPE: rc = SNMP_ERR_NOTWRITABLE; break; /* * appParamsTruthValue(5)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_APPPARAMSTRUTHVALUE: rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(rowreq_ctx->data. appParamsTruthValue)); /* * check that the value is one of defined enums */ if ((SNMPERR_SUCCESS == rc) && (*var->val.integer != TRUTHVALUE_TRUE) && (*var->val.integer != TRUTHVALUE_FALSE) ) { rc = SNMP_ERR_WRONGVALUE; } if (SNMPERR_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:_dessertAppParamsTable_check_column:appParamsTruthValue", "varbind validation failed (eg bad type or size)\n")); } else { rc = appParamsTruthValue_check_value(rowreq_ctx, *((u_long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from appParamsTruthValue_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * appParamsInteger32(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSINTEGER32: rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, sizeof(rowreq_ctx->data. appParamsInteger32)); if (SNMPERR_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:_dessertAppParamsTable_check_column:appParamsInteger32", "varbind validation failed (eg bad type or size)\n")); } else { rc = appParamsInteger32_check_value(rowreq_ctx, *((long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from appParamsInteger32_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * appParamsUnsigned32(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSUNSIGNED32: rc = netsnmp_check_vb_type_and_size(var, ASN_UNSIGNED, sizeof(rowreq_ctx->data. appParamsUnsigned32)); if (SNMPERR_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:_dessertAppParamsTable_check_column:appParamsUnsigned32", "varbind validation failed (eg bad type or size)\n")); } else { rc = appParamsUnsigned32_check_value(rowreq_ctx, *((u_long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from appParamsUnsigned32_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * appParamsOctetString(9)/DessertApplicationOctetString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ case COLUMN_APPPARAMSOCTETSTRING: rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR, sizeof(rowreq_ctx->data. appParamsOctetString)); /* * check defined range(s). */ if ((SNMPERR_SUCCESS == rc) && ((var->val_len < 0) || (var->val_len > 1024)) ) { rc = SNMP_ERR_WRONGLENGTH; } if (SNMPERR_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:_dessertAppParamsTable_check_column:appParamsOctetString", "varbind validation failed (eg bad type or size)\n")); } else { rc = appParamsOctetString_check_value(rowreq_ctx, (char *) var->val.string, var->val_len); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from appParamsOctetString_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; default: /** We shouldn't get here */ rc = SNMP_ERR_GENERR; snmp_log(LOG_ERR, "unknown column %d in _dessertAppParamsTable_check_column\n", column); } return rc; } /* _dessertAppParamsTable_check_column */ int _mfd_dessertAppParamsTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; int rc; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_check_objects", "called\n")); netsnmp_assert(NULL != rowreq_ctx); for (; requests; requests = requests->next) { /* * get column number from table request info, and check that column */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertAppParamsTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum); if (rc) { netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc)); break; } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_check_objects */ /*---------------------------------------------------------------------- * * SET: Undo setup * *---------------------------------------------------------------------*/ /* * @internal * Set the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertAppParamsTable_undo_setup_column(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_undo_setup_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * appParamsTruthValue(5)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_APPPARAMSTRUTHVALUE: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSTRUTHVALUE_FLAG; rc = appParamsTruthValue_undo_setup(rowreq_ctx); break; /* * appParamsInteger32(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSINTEGER32: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSINTEGER32_FLAG; rc = appParamsInteger32_undo_setup(rowreq_ctx); break; /* * appParamsUnsigned32(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSUNSIGNED32: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSUNSIGNED32_FLAG; rc = appParamsUnsigned32_undo_setup(rowreq_ctx); break; /* * appParamsOctetString(9)/DessertApplicationOctetString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ case COLUMN_APPPARAMSOCTETSTRING: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSOCTETSTRING_FLAG; rc = appParamsOctetString_undo_setup(rowreq_ctx); break; default: snmp_log(LOG_ERR, "unknown column %d in _dessertAppParamsTable_undo_setup_column\n", column); break; } return rc; } /* _dessertAppParamsTable_undo_setup_column */ /** * @internal * undo setup */ int _mfd_dessertAppParamsTable_undo_setup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_undo_setup", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * allocate undo context */ rowreq_ctx->undo = dessertAppParamsTable_allocate_data(); if (NULL == rowreq_ctx->undo) { /** msg already logged */ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE); return SNMP_ERR_NOERROR; } /* * row undo setup */ rowreq_ctx->column_set_flags = 0; rc = dessertAppParamsTable_undo_setup(rowreq_ctx); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_undo_setup\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } else { /* * column undo setup */ netsnmp_table_request_info *tri; for (; requests; requests = requests->next) { /* * set column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertAppParamsTable_undo_setup_column(rowreq_ctx, tri->colnum); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_undo_setup_column\n", rc)); netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc)); } } /* for results */ } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_undo_setup */ /** * @internal * undo setup */ int _mfd_dessertAppParamsTable_undo_cleanup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); int rc; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_undo_cleanup", "called\n")); /* * failed row create in early stages has no rowreq_ctx */ if (NULL == rowreq_ctx) return MFD_SUCCESS; /* * call user cleanup */ rc = dessertAppParamsTable_undo_cleanup(rowreq_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_undo_cleanup\n", rc)); } /* * release undo context, if needed */ if (rowreq_ctx->undo) { dessertAppParamsTable_release_data(rowreq_ctx->undo); rowreq_ctx->undo = NULL; } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_undo_cleanup */ /*---------------------------------------------------------------------- * * SET: Set values * *---------------------------------------------------------------------*/ /* * @internal * Set the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertAppParamsTable_set_column(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_set_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * appParamsTruthValue(5)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_APPPARAMSTRUTHVALUE: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSTRUTHVALUE_FLAG; rc = appParamsTruthValue_set(rowreq_ctx, *((u_long *) var->val.string)); break; /* * appParamsInteger32(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSINTEGER32: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSINTEGER32_FLAG; rc = appParamsInteger32_set(rowreq_ctx, *((long *) var->val.string)); break; /* * appParamsUnsigned32(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSUNSIGNED32: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSUNSIGNED32_FLAG; rc = appParamsUnsigned32_set(rowreq_ctx, *((u_long *) var->val.string)); break; /* * appParamsOctetString(9)/DessertApplicationOctetString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ case COLUMN_APPPARAMSOCTETSTRING: rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSOCTETSTRING_FLAG; rc = appParamsOctetString_set(rowreq_ctx, (char *) var->val.string, var->val_len); break; default: snmp_log(LOG_ERR, "unknown column %d in _dessertAppParamsTable_set_column\n", column); rc = SNMP_ERR_GENERR; break; } return rc; } /* _dessertAppParamsTable_set_column */ int _mfd_dessertAppParamsTable_set_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; int rc = SNMP_ERR_NOERROR; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_set_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); rowreq_ctx->column_set_flags = 0; for (; requests; requests = requests->next) { /* * set column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertAppParamsTable_set_column(rowreq_ctx, requests->requestvb, tri->colnum); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_set_column\n", rc)); netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc)); } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_set_values */ /*---------------------------------------------------------------------- * * SET: commit * *---------------------------------------------------------------------*/ /** * @internal * commit the values */ int _mfd_dessertAppParamsTable_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_commit", "called\n")); netsnmp_assert(NULL != rowreq_ctx); rc = dessertAppParamsTable_commit(rowreq_ctx); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_commit\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) { /* * if we successfully committed this row, set the dirty flag. Use the * current value + 1 (i.e. dirty = # rows changed). * this is checked in post_request... */ dessertAppParamsTable_dirty_set(dessertAppParamsTable_dirty_get() + 1); /* set table dirty flag */ } return SNMP_ERR_NOERROR; } int _mfd_dessertAppParamsTable_undo_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_undo_commit", "called\n")); netsnmp_assert(NULL != rowreq_ctx); if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) { u_int d = dessertAppParamsTable_dirty_get(); netsnmp_assert(d != 0); if (d) dessertAppParamsTable_dirty_set(d - 1); } rc = dessertAppParamsTable_undo_commit(rowreq_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_undo_commit\n", rc)); } if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) { snmp_log(LOG_WARNING, "dessertAppParamsTable row dirty flag still set after undo_commit\n"); rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY; } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_commit */ /*---------------------------------------------------------------------- * * SET: Undo * *---------------------------------------------------------------------*/ /** * @internal * undo the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertAppParamsTable_undo_column(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_undo_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * appParamsTruthValue(5)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_APPPARAMSTRUTHVALUE: rc = appParamsTruthValue_undo(rowreq_ctx); break; /* * appParamsInteger32(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSINTEGER32: rc = appParamsInteger32_undo(rowreq_ctx); break; /* * appParamsUnsigned32(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/d/h */ case COLUMN_APPPARAMSUNSIGNED32: rc = appParamsUnsigned32_undo(rowreq_ctx); break; /* * appParamsOctetString(9)/DessertApplicationOctetString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ case COLUMN_APPPARAMSOCTETSTRING: rc = appParamsOctetString_undo(rowreq_ctx); break; default: snmp_log(LOG_ERR, "unknown column %d in _dessertAppParamsTable_undo_column\n", column); break; } return rc; } /* _dessertAppParamsTable_undo_column */ int _mfd_dessertAppParamsTable_undo_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_undo_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); rc = dessertAppParamsTable_undo(rowreq_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_undo\n", rc)); } for (; requests; requests = requests->next) { /* * set column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertAppParamsTable_undo_column(rowreq_ctx, requests->requestvb, tri->colnum); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppParamsTable:mfd", "error %d from " "dessertAppParamsTable_undo_column\n", rc)); } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_undo_values */ /*---------------------------------------------------------------------- * * SET: irreversible commit * *---------------------------------------------------------------------*/ /** * @internal * commit irreversible actions */ int _mfd_dessertAppParamsTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_dessertAppParamsTable_irreversible:commit", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * check for and handle row creation/deletion * and update column exist flags... */ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) { if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)) CONTAINER_REMOVE(dessertAppParamsTable_if_ctx.container, rowreq_ctx); } else { if (rowreq_ctx->column_set_flags) { DEBUGMSGTL(("internal:dessertAppParamsTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags))); rowreq_ctx->column_exists_flags |= rowreq_ctx->column_set_flags; rowreq_ctx->column_set_flags = 0; } } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppParamsTable_irreversible_commit */ /*********************************************************************** * * DATA ACCESS * ***********************************************************************/ static void _container_free(netsnmp_container * container); /** * @internal */ static int _cache_load(netsnmp_cache * cache, void *vmagic) { DEBUGMSGTL(("internal:dessertAppParamsTable:_cache_load", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache for dessertAppParamsTable_cache_load\n"); return -1; } /** should only be called for an invalid or expired cache */ netsnmp_assert((0 == cache->valid) || (1 == cache->expired)); /* * call user code */ return dessertAppParamsTable_container_load((netsnmp_container *) cache->magic); } /* _cache_load */ /** * @internal */ static void _cache_free(netsnmp_cache * cache, void *magic) { netsnmp_container *container; DEBUGMSGTL(("internal:dessertAppParamsTable:_cache_free", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache in dessertAppParamsTable_cache_free\n"); return; } container = (netsnmp_container *) cache->magic; _container_free(container); } /* _cache_free */ /** * @internal */ static void _container_item_free(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, void *context) { DEBUGMSGTL(("internal:dessertAppParamsTable:_container_item_free", "called\n")); if (NULL == rowreq_ctx) return; dessertAppParamsTable_release_rowreq_ctx(rowreq_ctx); } /* _container_item_free */ /** * @internal */ static void _container_free(netsnmp_container * container) { DEBUGMSGTL(("internal:dessertAppParamsTable:_container_free", "called\n")); if (NULL == container) { snmp_log(LOG_ERR, "invalid container in dessertAppParamsTable_container_free\n"); return; } /* * call user code */ dessertAppParamsTable_container_free(container); /* * free all items. inefficient, but easy. */ CONTAINER_CLEAR(container, (netsnmp_container_obj_func *) _container_item_free, NULL); } /* _container_free */ /** * @internal * initialize the container with functions or wrappers */ void _dessertAppParamsTable_container_init(dessertAppParamsTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_container_init", "called\n")); /* * cache init */ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ _cache_load, _cache_free, dessertAppParamsTable_oid, dessertAppParamsTable_oid_size); if (NULL == if_ctx->cache) { snmp_log(LOG_ERR, "error creating cache for dessertAppParamsTable\n"); return; } if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; dessertAppParamsTable_container_init(&if_ctx->container, if_ctx->cache); if (NULL == if_ctx->container) if_ctx->container = netsnmp_container_find ("dessertAppParamsTable:table_container"); if (NULL == if_ctx->container) { snmp_log(LOG_ERR, "error creating container in " "dessertAppParamsTable_container_init\n"); return; } if (NULL != if_ctx->cache) if_ctx->cache->magic = (void *) if_ctx->container; } /* _dessertAppParamsTable_container_init */ /** * @internal * shutdown the container with functions or wrappers */ void _dessertAppParamsTable_container_shutdown (dessertAppParamsTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertAppParamsTable:_dessertAppParamsTable_container_shutdown", "called\n")); dessertAppParamsTable_container_shutdown(if_ctx->container); _container_free(if_ctx->container); } /* _dessertAppParamsTable_container_shutdown */ dessertAppParamsTable_rowreq_ctx * dessertAppParamsTable_row_find_by_mib_index(dessertAppParamsTable_mib_index * mib_idx) { dessertAppParamsTable_rowreq_ctx *rowreq_ctx; oid oid_tmp[MAX_OID_LEN]; netsnmp_index oid_idx; int rc; /* * set up storage for OID */ oid_idx.oids = oid_tmp; oid_idx.len = sizeof(oid_tmp) / sizeof(oid); /* * convert */ rc = dessertAppParamsTable_index_to_oid(&oid_idx, mib_idx); if (MFD_SUCCESS != rc) return NULL; rowreq_ctx = CONTAINER_FIND(dessertAppParamsTable_if_ctx.container, &oid_idx); return rowreq_ctx; } libdessert0.87-0.87.2/snmp/dessertAppStatsTable_data_get.c0000644000175000017500000011463711331020526021460 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppStatsTable.h" /** @defgroup data_get data_get: Routines to get data * * TODO:230:M: Implement dessertAppStatsTable get routines. * TODO:240:M: Implement dessertAppStatsTable mapping routines (if any). * * These routine are used to get the value for individual objects. The * row context is passed, along with a pointer to the memory where the * value should be copied. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ /* * --------------------------------------------------------------------- * * TODO:200:r: Implement dessertAppStatsTable data context functions. */ /** * set mib index(es) * * @param tbl_idx mib index structure * @param appStatsIndex_val * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This convenience function is useful for setting all the MIB index * components with a single function call. It is assume that the C values * have already been mapped from their native/rawformat to the MIB format. */ int dessertAppStatsTable_indexes_set_tbl_idx(dessertAppStatsTable_mib_index * tbl_idx, long appStatsIndex_val) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_indexes_set_tbl_idx", "called\n")); /* * appStatsIndex(1)///()//L/a/w/e/r/d/h */ tbl_idx->appStatsIndex = appStatsIndex_val; return MFD_SUCCESS; } /* dessertAppStatsTable_indexes_set_tbl_idx */ /** * @internal * set row context indexes * * @param reqreq_ctx the row context that needs updated indexes * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. * * @remark * This function sets the mib indexs, then updates the oid indexs * from the mib index. */ int dessertAppStatsTable_indexes_set(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, long appStatsIndex_val) { DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_indexes_set", "called\n")); if (MFD_SUCCESS != dessertAppStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, appStatsIndex_val)) return MFD_ERROR; /* * convert mib index to oid index */ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); if (0 != dessertAppStatsTable_index_to_oid(&rowreq_ctx->oid_idx, &rowreq_ctx->tbl_idx)) { return MFD_ERROR; } return MFD_SUCCESS; } /* dessertAppStatsTable_indexes_set */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsName * appStatsName is subid 2 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.2 * Description: The name of the statistical datum * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /** * Extract the current value of the appStatsName data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsName_val_ptr_ptr * Pointer to storage for a char variable * @param appStatsName_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appStatsName. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appStatsName_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appStatsName_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appStatsName_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsName_val_ptr_ptr, size_t *appStatsName_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appStatsName_val_ptr_ptr) && (NULL != *appStatsName_val_ptr_ptr)); netsnmp_assert(NULL != appStatsName_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsName_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsName data. * copy (* appStatsName_val_ptr_ptr ) data and (* appStatsName_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appStatsName data */ if ((NULL == (*appStatsName_val_ptr_ptr)) || ((*appStatsName_val_ptr_len_ptr) < (rowreq_ctx->data.appStatsName_len * sizeof(rowreq_ctx->data.appStatsName[0])))) { /* * allocate space for appStatsName data */ (*appStatsName_val_ptr_ptr) = malloc(rowreq_ctx->data.appStatsName_len * sizeof(rowreq_ctx->data.appStatsName[0])); if (NULL == (*appStatsName_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appStatsName_val_ptr_len_ptr) = rowreq_ctx->data.appStatsName_len * sizeof(rowreq_ctx->data.appStatsName[0]); memcpy((*appStatsName_val_ptr_ptr), rowreq_ctx->data.appStatsName, rowreq_ctx->data.appStatsName_len * sizeof(rowreq_ctx->data.appStatsName[0])); return MFD_SUCCESS; } /* appStatsName_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsDesc * appStatsDesc is subid 3 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.3 * Description: A short description of the statistical datum * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 255a * * Ranges: 0 - 255; * * Its syntax is DisplayString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 255) */ /** * Extract the current value of the appStatsDesc data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsDesc_val_ptr_ptr * Pointer to storage for a char variable * @param appStatsDesc_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appStatsDesc. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appStatsDesc_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appStatsDesc_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appStatsDesc_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsDesc_val_ptr_ptr, size_t *appStatsDesc_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appStatsDesc_val_ptr_ptr) && (NULL != *appStatsDesc_val_ptr_ptr)); netsnmp_assert(NULL != appStatsDesc_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsDesc_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsDesc data. * copy (* appStatsDesc_val_ptr_ptr ) data and (* appStatsDesc_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appStatsDesc data */ if ((NULL == (*appStatsDesc_val_ptr_ptr)) || ((*appStatsDesc_val_ptr_len_ptr) < (rowreq_ctx->data.appStatsDesc_len * sizeof(rowreq_ctx->data.appStatsDesc[0])))) { /* * allocate space for appStatsDesc data */ (*appStatsDesc_val_ptr_ptr) = malloc(rowreq_ctx->data.appStatsDesc_len * sizeof(rowreq_ctx->data.appStatsDesc[0])); if (NULL == (*appStatsDesc_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appStatsDesc_val_ptr_len_ptr) = rowreq_ctx->data.appStatsDesc_len * sizeof(rowreq_ctx->data.appStatsDesc[0]); memcpy((*appStatsDesc_val_ptr_ptr), rowreq_ctx->data.appStatsDesc, rowreq_ctx->data.appStatsDesc_len * sizeof(rowreq_ctx->data.appStatsDesc[0])); return MFD_SUCCESS; } /* appStatsDesc_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsNodeOrLink * appStatsNodeOrLink is subid 4 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.4 * Description: Determines which of the appStatsMacAddress{1,2} coloumns is valid and therefore indicates whether the information provided by this row relates to a node or a link. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 3/8. Values: none(0), node(1), link(2) * * Its syntax is INTEGER (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /** * map a value from its original native format to the MIB format. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : Any other error * * @note parameters follow the memset convention (dest, src). * * @note generation and use of this function can be turned off by re-running * mib2c after adding the following line to the file * defaults/node-appStatsNodeOrLink.m2d : * @eval $m2c_node_skip_mapping = 1@ * * @remark * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. * Otherwise, just do a direct copy. */ int appStatsNodeOrLink_map(u_long * mib_appStatsNodeOrLink_val_ptr, u_long raw_appStatsNodeOrLink_val) { netsnmp_assert(NULL != mib_appStatsNodeOrLink_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsNodeOrLink_map", "called\n")); /* * TODO:241:o: |-> Implement appStatsNodeOrLink enum mapping. * uses INTERNAL_* macros defined in the header files */ switch (raw_appStatsNodeOrLink_val) { case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSNODEORLINK_NONE: *mib_appStatsNodeOrLink_val_ptr = APPSTATSNODEORLINK_NONE; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSNODEORLINK_NODE: *mib_appStatsNodeOrLink_val_ptr = APPSTATSNODEORLINK_NODE; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSNODEORLINK_LINK: *mib_appStatsNodeOrLink_val_ptr = APPSTATSNODEORLINK_LINK; break; default: snmp_log(LOG_ERR, "couldn't map value %ld for appStatsNodeOrLink\n", raw_appStatsNodeOrLink_val); return MFD_ERROR; } return MFD_SUCCESS; } /* appStatsNodeOrLink_map */ /** * Extract the current value of the appStatsNodeOrLink data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsNodeOrLink_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appStatsNodeOrLink_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsNodeOrLink_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appStatsNodeOrLink_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsNodeOrLink_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsNodeOrLink data. * copy (* appStatsNodeOrLink_val_ptr ) from rowreq_ctx->data */ (*appStatsNodeOrLink_val_ptr) = rowreq_ctx->data.appStatsNodeOrLink; return MFD_SUCCESS; } /* appStatsNodeOrLink_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsValueType * appStatsValueType is subid 5 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.5 * Description: Indicates which of the coloumns (appStatsTruthValue, appStatsInterger32, appStatsUInteger32, appStatsCounter64, appStatsOctetString) in the dessertAppStatsTable is actually valid. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 3/8. Values: bool(0), int32(1), uint32(2), counter64(3), octetstring(4) * * Its syntax is INTEGER (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /** * map a value from its original native format to the MIB format. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : Any other error * * @note parameters follow the memset convention (dest, src). * * @note generation and use of this function can be turned off by re-running * mib2c after adding the following line to the file * defaults/node-appStatsValueType.m2d : * @eval $m2c_node_skip_mapping = 1@ * * @remark * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. * Otherwise, just do a direct copy. */ int appStatsValueType_map(u_long * mib_appStatsValueType_val_ptr, u_long raw_appStatsValueType_val) { netsnmp_assert(NULL != mib_appStatsValueType_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsValueType_map", "called\n")); /* * TODO:241:o: |-> Implement appStatsValueType enum mapping. * uses INTERNAL_* macros defined in the header files */ switch (raw_appStatsValueType_val) { case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_BOOL: *mib_appStatsValueType_val_ptr = APPSTATSVALUETYPE_BOOL; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_INT32: *mib_appStatsValueType_val_ptr = APPSTATSVALUETYPE_INT32; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_UINT32: *mib_appStatsValueType_val_ptr = APPSTATSVALUETYPE_UINT32; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_COUNTER64: *mib_appStatsValueType_val_ptr = APPSTATSVALUETYPE_COUNTER64; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSVALUETYPE_OCTETSTRING: *mib_appStatsValueType_val_ptr = APPSTATSVALUETYPE_OCTETSTRING; break; default: snmp_log(LOG_ERR, "couldn't map value %ld for appStatsValueType\n", raw_appStatsValueType_val); return MFD_ERROR; } return MFD_SUCCESS; } /* appStatsValueType_map */ /** * Extract the current value of the appStatsValueType data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsValueType_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appStatsValueType_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsValueType_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appStatsValueType_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsValueType_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsValueType data. * copy (* appStatsValueType_val_ptr ) from rowreq_ctx->data */ (*appStatsValueType_val_ptr) = rowreq_ctx->data.appStatsValueType; return MFD_SUCCESS; } /* appStatsValueType_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsMacAddress1 * appStatsMacAddress1 is subid 6 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.6 * Description: The hardware address of a node. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /** * Extract the current value of the appStatsMacAddress1 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsMacAddress1_val_ptr_ptr * Pointer to storage for a char variable * @param appStatsMacAddress1_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appStatsMacAddress1. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appStatsMacAddress1_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appStatsMacAddress1_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appStatsMacAddress1_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsMacAddress1_val_ptr_ptr, size_t *appStatsMacAddress1_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appStatsMacAddress1_val_ptr_ptr) && (NULL != *appStatsMacAddress1_val_ptr_ptr)); netsnmp_assert(NULL != appStatsMacAddress1_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsMacAddress1_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsMacAddress1 data. * copy (* appStatsMacAddress1_val_ptr_ptr ) data and (* appStatsMacAddress1_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appStatsMacAddress1 data */ if ((NULL == (*appStatsMacAddress1_val_ptr_ptr)) || ((*appStatsMacAddress1_val_ptr_len_ptr) < (rowreq_ctx->data.appStatsMacAddress1_len * sizeof(rowreq_ctx->data.appStatsMacAddress1[0])))) { /* * allocate space for appStatsMacAddress1 data */ (*appStatsMacAddress1_val_ptr_ptr) = malloc(rowreq_ctx->data.appStatsMacAddress1_len * sizeof(rowreq_ctx->data.appStatsMacAddress1[0])); if (NULL == (*appStatsMacAddress1_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appStatsMacAddress1_val_ptr_len_ptr) = rowreq_ctx->data.appStatsMacAddress1_len * sizeof(rowreq_ctx->data.appStatsMacAddress1[0]); memcpy((*appStatsMacAddress1_val_ptr_ptr), rowreq_ctx->data.appStatsMacAddress1, rowreq_ctx->data.appStatsMacAddress1_len * sizeof(rowreq_ctx->data.appStatsMacAddress1[0])); return MFD_SUCCESS; } /* appStatsMacAddress1_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsMacAddress2 * appStatsMacAddress2 is subid 7 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.7 * Description: The hardware address of a second node. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 1x: * * Ranges: 6; * * Its syntax is MacAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 6) */ /** * Extract the current value of the appStatsMacAddress2 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsMacAddress2_val_ptr_ptr * Pointer to storage for a char variable * @param appStatsMacAddress2_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appStatsMacAddress2. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appStatsMacAddress2_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appStatsMacAddress2_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appStatsMacAddress2_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsMacAddress2_val_ptr_ptr, size_t *appStatsMacAddress2_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appStatsMacAddress2_val_ptr_ptr) && (NULL != *appStatsMacAddress2_val_ptr_ptr)); netsnmp_assert(NULL != appStatsMacAddress2_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsMacAddress2_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsMacAddress2 data. * copy (* appStatsMacAddress2_val_ptr_ptr ) data and (* appStatsMacAddress2_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appStatsMacAddress2 data */ if ((NULL == (*appStatsMacAddress2_val_ptr_ptr)) || ((*appStatsMacAddress2_val_ptr_len_ptr) < (rowreq_ctx->data.appStatsMacAddress2_len * sizeof(rowreq_ctx->data.appStatsMacAddress2[0])))) { /* * allocate space for appStatsMacAddress2 data */ (*appStatsMacAddress2_val_ptr_ptr) = malloc(rowreq_ctx->data.appStatsMacAddress2_len * sizeof(rowreq_ctx->data.appStatsMacAddress2[0])); if (NULL == (*appStatsMacAddress2_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appStatsMacAddress2_val_ptr_len_ptr) = rowreq_ctx->data.appStatsMacAddress2_len * sizeof(rowreq_ctx->data.appStatsMacAddress2[0]); memcpy((*appStatsMacAddress2_val_ptr_ptr), rowreq_ctx->data.appStatsMacAddress2, rowreq_ctx->data.appStatsMacAddress2_len * sizeof(rowreq_ctx->data.appStatsMacAddress2[0])); return MFD_SUCCESS; } /* appStatsMacAddress2_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsTruthValue * appStatsTruthValue is subid 8 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.8 * Description: A statistical datum with TruthValue semantics. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 2/8. Values: true(1), false(2) * * Its syntax is TruthValue (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /** * map a value from its original native format to the MIB format. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : Any other error * * @note parameters follow the memset convention (dest, src). * * @note generation and use of this function can be turned off by re-running * mib2c after adding the following line to the file * defaults/node-appStatsTruthValue.m2d : * @eval $m2c_node_skip_mapping = 1@ * * @remark * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. * Otherwise, just do a direct copy. */ int appStatsTruthValue_map(u_long * mib_appStatsTruthValue_val_ptr, u_long raw_appStatsTruthValue_val) { netsnmp_assert(NULL != mib_appStatsTruthValue_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsTruthValue_map", "called\n")); /* * TODO:241:o: |-> Implement appStatsTruthValue enum mapping. * uses INTERNAL_* macros defined in the header files */ switch (raw_appStatsTruthValue_val) { case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSTRUTHVALUE_TRUE: *mib_appStatsTruthValue_val_ptr = TRUTHVALUE_TRUE; break; case INTERNAL_DESSERTAPPSTATSTABLE_APPSTATSTRUTHVALUE_FALSE: *mib_appStatsTruthValue_val_ptr = TRUTHVALUE_FALSE; break; default: snmp_log(LOG_ERR, "couldn't map value %ld for appStatsTruthValue\n", raw_appStatsTruthValue_val); return MFD_ERROR; } return MFD_SUCCESS; } /* appStatsTruthValue_map */ /** * Extract the current value of the appStatsTruthValue data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsTruthValue_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appStatsTruthValue_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsTruthValue_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appStatsTruthValue_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsTruthValue_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsTruthValue data. * copy (* appStatsTruthValue_val_ptr ) from rowreq_ctx->data */ (*appStatsTruthValue_val_ptr) = rowreq_ctx->data.appStatsTruthValue; return MFD_SUCCESS; } /* appStatsTruthValue_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsInteger32 * appStatsInteger32 is subid 9 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.9 * Description: A statistical datum with Integer32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) */ /** * Extract the current value of the appStatsInteger32 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsInteger32_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appStatsInteger32_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, long *appStatsInteger32_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appStatsInteger32_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsInteger32_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsInteger32 data. * copy (* appStatsInteger32_val_ptr ) from rowreq_ctx->data */ (*appStatsInteger32_val_ptr) = rowreq_ctx->data.appStatsInteger32; return MFD_SUCCESS; } /* appStatsInteger32_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsUnsigned32 * appStatsUnsigned32 is subid 10 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.10 * Description: A statistical datum with Unsigned32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) */ /** * Extract the current value of the appStatsUnsigned32 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsUnsigned32_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appStatsUnsigned32_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsUnsigned32_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appStatsUnsigned32_val_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsUnsigned32_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsUnsigned32 data. * copy (* appStatsUnsigned32_val_ptr ) from rowreq_ctx->data */ (*appStatsUnsigned32_val_ptr) = rowreq_ctx->data.appStatsUnsigned32; return MFD_SUCCESS; } /* appStatsUnsigned32_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsCounter64 * appStatsCounter64 is subid 11 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.11 * Description: A statistical datum with Counter64 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) */ /** * Extract the current value of the appStatsCounter64 data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsCounter64_val_ptr * Pointer to storage for a U64 variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */ int appStatsCounter64_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, U64 * appStatsCounter64_val_ptr) { /** we should have a non-NULL pointer */ netsnmp_assert(NULL != appStatsCounter64_val_ptr); /* * TODO:231:o: |-> copy appStatsCounter64 data. * get (* appStatsCounter64_val_ptr ).low and (* appStatsCounter64_val_ptr ).high from rowreq_ctx->data */ (*appStatsCounter64_val_ptr).high = rowreq_ctx->data.appStatsCounter64.high; (*appStatsCounter64_val_ptr).low = rowreq_ctx->data.appStatsCounter64.low; return MFD_SUCCESS; } /* appStatsCounter64_get */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppStatsEntry.appStatsOctetString * appStatsOctetString is subid 12 of dessertAppStatsEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8.1.12 * Description: A statistical datum containing of up to 1024 octets. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 0 * settable 0 * * Ranges: 0 - 1024; * * Its syntax is OCTETSTR (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 1024) */ /** * Extract the current value of the appStatsOctetString data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param appStatsOctetString_val_ptr_ptr * Pointer to storage for a char variable * @param appStatsOctetString_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by appStatsOctetString. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error * * @note If you need more than (*appStatsOctetString_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update appStatsOctetString_val_ptr_ptr. * DO NOT free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */ int appStatsOctetString_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsOctetString_val_ptr_ptr, size_t *appStatsOctetString_val_ptr_len_ptr) { /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != appStatsOctetString_val_ptr_ptr) && (NULL != *appStatsOctetString_val_ptr_ptr)); netsnmp_assert(NULL != appStatsOctetString_val_ptr_len_ptr); DEBUGMSGTL(("verbose:dessertAppStatsTable:appStatsOctetString_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the appStatsOctetString data. * copy (* appStatsOctetString_val_ptr_ptr ) data and (* appStatsOctetString_val_ptr_len_ptr ) from rowreq_ctx->data */ /* * make sure there is enough space for appStatsOctetString data */ if ((NULL == (*appStatsOctetString_val_ptr_ptr)) || ((*appStatsOctetString_val_ptr_len_ptr) < (rowreq_ctx->data.appStatsOctetString_len * sizeof(rowreq_ctx->data.appStatsOctetString[0])))) { /* * allocate space for appStatsOctetString data */ (*appStatsOctetString_val_ptr_ptr) = malloc(rowreq_ctx->data.appStatsOctetString_len * sizeof(rowreq_ctx->data.appStatsOctetString[0])); if (NULL == (*appStatsOctetString_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*appStatsOctetString_val_ptr_len_ptr) = rowreq_ctx->data.appStatsOctetString_len * sizeof(rowreq_ctx->data.appStatsOctetString[0]); memcpy((*appStatsOctetString_val_ptr_ptr), rowreq_ctx->data.appStatsOctetString, rowreq_ctx->data.appStatsOctetString_len * sizeof(rowreq_ctx->data.appStatsOctetString[0])); return MFD_SUCCESS; } /* appStatsOctetString_get */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_oids.h0000644000175000017500000000311211331020526020761 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ * * $Id:$ */ #ifndef DESSERTAPPPARAMSTABLE_OIDS_H #define DESSERTAPPPARAMSTABLE_OIDS_H #ifdef __cplusplus extern "C" { #endif /* * column number definitions for table dessertAppParamsTable */ #define DESSERTAPPPARAMSTABLE_OID 1,3,6,1,4,1,18898,0,19,10,1,1,9 #define COLUMN_APPPARAMSINDEX 1 #define COLUMN_APPPARAMSNAME 2 #define COLUMN_APPPARAMSNAME_FLAG (0x1 << 1) #define COLUMN_APPPARAMSDESC 3 #define COLUMN_APPPARAMSDESC_FLAG (0x1 << 2) #define COLUMN_APPPARAMSVALUETYPE 4 #define COLUMN_APPPARAMSVALUETYPE_FLAG (0x1 << 3) #define COLUMN_APPPARAMSTRUTHVALUE 5 #define COLUMN_APPPARAMSTRUTHVALUE_FLAG (0x1 << 4) #define COLUMN_APPPARAMSINTEGER32 6 #define COLUMN_APPPARAMSINTEGER32_FLAG (0x1 << 5) #define COLUMN_APPPARAMSUNSIGNED32 7 #define COLUMN_APPPARAMSUNSIGNED32_FLAG (0x1 << 6) #define COLUMN_APPPARAMSOCTETSTRING 9 #define COLUMN_APPPARAMSOCTETSTRING_FLAG (0x1 << 8) #define DESSERTAPPPARAMSTABLE_MIN_COL COLUMN_APPPARAMSNAME #define DESSERTAPPPARAMSTABLE_MAX_COL COLUMN_APPPARAMSOCTETSTRING /* * OR together all the writable cols. */ #define DESSERTAPPPARAMSTABLE_SETTABLE_COLS (COLUMN_APPPARAMSTRUTHVALUE_FLAG | COLUMN_APPPARAMSINTEGER32_FLAG | COLUMN_APPPARAMSUNSIGNED32_FLAG | COLUMN_APPPARAMSOCTETSTRING_FLAG) #ifdef __cplusplus } #endif #endif /* DESSERTAPPPARAMSTABLE_OIDS_H */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_interface.c0000644000175000017500000010462511331020526021644 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppStatsTable.h" #include #include #include "dessertAppStatsTable_interface.h" #include /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ typedef struct dessertAppStatsTable_interface_ctx_s { netsnmp_container *container; netsnmp_cache *cache; dessertAppStatsTable_registration *user_ctx; netsnmp_table_registration_info tbl_info; netsnmp_baby_steps_access_methods access_multiplexer; } dessertAppStatsTable_interface_ctx; static dessertAppStatsTable_interface_ctx dessertAppStatsTable_if_ctx; static void _dessertAppStatsTable_container_init(dessertAppStatsTable_interface_ctx * if_ctx); static void _dessertAppStatsTable_container_shutdown(dessertAppStatsTable_interface_ctx * if_ctx); netsnmp_container * dessertAppStatsTable_container_get(void) { return dessertAppStatsTable_if_ctx.container; } dessertAppStatsTable_registration * dessertAppStatsTable_registration_get(void) { return dessertAppStatsTable_if_ctx.user_ctx; } dessertAppStatsTable_registration * dessertAppStatsTable_registration_set(dessertAppStatsTable_registration * newreg) { dessertAppStatsTable_registration *old = dessertAppStatsTable_if_ctx.user_ctx; dessertAppStatsTable_if_ctx.user_ctx = newreg; return old; } int dessertAppStatsTable_container_size(void) { return CONTAINER_SIZE(dessertAppStatsTable_if_ctx.container); } /* * mfd multiplexer modes */ static Netsnmp_Node_Handler _mfd_dessertAppStatsTable_pre_request; static Netsnmp_Node_Handler _mfd_dessertAppStatsTable_post_request; static Netsnmp_Node_Handler _mfd_dessertAppStatsTable_object_lookup; static Netsnmp_Node_Handler _mfd_dessertAppStatsTable_get_values; /** * @internal * Initialize the table dessertAppStatsTable * (Define its contents and how it's structured) */ void _dessertAppStatsTable_initialize_interface (dessertAppStatsTable_registration * reg_ptr, u_long flags) { netsnmp_baby_steps_access_methods *access_multiplexer = &dessertAppStatsTable_if_ctx.access_multiplexer; netsnmp_table_registration_info *tbl_info = &dessertAppStatsTable_if_ctx.tbl_info; netsnmp_handler_registration *reginfo; netsnmp_mib_handler *handler; int mfd_modes = 0; DEBUGMSGTL(("internal:dessertAppStatsTable:_dessertAppStatsTable_initialize_interface", "called\n")); /************************************************* * * save interface context for dessertAppStatsTable */ /* * Setting up the table's definition */ netsnmp_table_helper_add_indexes(tbl_info,ASN_INTEGER, /** index: appStatsIndex */ 0); /* * Define the minimum and maximum accessible columns. This * optimizes retrival. */ tbl_info->min_column = DESSERTAPPSTATSTABLE_MIN_COL; tbl_info->max_column = DESSERTAPPSTATSTABLE_MAX_COL; /* * save users context */ dessertAppStatsTable_if_ctx.user_ctx = reg_ptr; /* * call data access initialization code */ dessertAppStatsTable_init_data(reg_ptr); /* * set up the container */ _dessertAppStatsTable_container_init(&dessertAppStatsTable_if_ctx); if (NULL == dessertAppStatsTable_if_ctx.container) { snmp_log(LOG_ERR, "could not initialize container for dessertAppStatsTable\n"); return; } /* * access_multiplexer: REQUIRED wrapper for get request handling */ access_multiplexer->object_lookup = _mfd_dessertAppStatsTable_object_lookup; access_multiplexer->get_values = _mfd_dessertAppStatsTable_get_values; /* * no wrappers yet */ access_multiplexer->pre_request = _mfd_dessertAppStatsTable_pre_request; access_multiplexer->post_request = _mfd_dessertAppStatsTable_post_request; /************************************************* * * Create a registration, save our reg data, register table. */ DEBUGMSGTL(("dessertAppStatsTable:init_dessertAppStatsTable", "Registering dessertAppStatsTable as a mibs-for-dummies table.\n")); handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); reginfo = netsnmp_handler_registration_create("dessertAppStatsTable", handler, dessertAppStatsTable_oid, dessertAppStatsTable_oid_size, HANDLER_CAN_BABY_STEP | HANDLER_CAN_RONLY); if (NULL == reginfo) { snmp_log(LOG_ERR, "error registering table dessertAppStatsTable\n"); return; } reginfo->my_reg_void = &dessertAppStatsTable_if_ctx; /************************************************* * * set up baby steps handler, create it and inject it */ if (access_multiplexer->object_lookup) mfd_modes |= BABY_STEP_OBJECT_LOOKUP; if (access_multiplexer->set_values) mfd_modes |= BABY_STEP_SET_VALUES; if (access_multiplexer->irreversible_commit) mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT; if (access_multiplexer->object_syntax_checks) mfd_modes |= BABY_STEP_CHECK_OBJECT; if (access_multiplexer->pre_request) mfd_modes |= BABY_STEP_PRE_REQUEST; if (access_multiplexer->post_request) mfd_modes |= BABY_STEP_POST_REQUEST; if (access_multiplexer->undo_setup) mfd_modes |= BABY_STEP_UNDO_SETUP; if (access_multiplexer->undo_cleanup) mfd_modes |= BABY_STEP_UNDO_CLEANUP; if (access_multiplexer->undo_sets) mfd_modes |= BABY_STEP_UNDO_SETS; if (access_multiplexer->row_creation) mfd_modes |= BABY_STEP_ROW_CREATE; if (access_multiplexer->consistency_checks) mfd_modes |= BABY_STEP_CHECK_CONSISTENCY; if (access_multiplexer->commit) mfd_modes |= BABY_STEP_COMMIT; if (access_multiplexer->undo_commit) mfd_modes |= BABY_STEP_UNDO_COMMIT; handler = netsnmp_baby_steps_handler_get(mfd_modes); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject row_merge helper with prefix rootoid_len + 2 (entry.col) */ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject container_table helper */ handler = netsnmp_container_table_handler_get(tbl_info, dessertAppStatsTable_if_ctx. container, TABLE_CONTAINER_KEY_NETSNMP_INDEX); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject cache helper */ if (NULL != dessertAppStatsTable_if_ctx.cache) { handler = netsnmp_cache_handler_get(dessertAppStatsTable_if_ctx.cache); netsnmp_inject_handler(reginfo, handler); } /* * register table */ netsnmp_register_table(reginfo, tbl_info); } /* _dessertAppStatsTable_initialize_interface */ /** * @internal * Shutdown the table dessertAppStatsTable */ void _dessertAppStatsTable_shutdown_interface(dessertAppStatsTable_registration * reg_ptr) { /* * shutdown the container */ _dessertAppStatsTable_container_shutdown(&dessertAppStatsTable_if_ctx); } void dessertAppStatsTable_valid_columns_set(netsnmp_column_info *vc) { dessertAppStatsTable_if_ctx.tbl_info.valid_columns = vc; } /* dessertAppStatsTable_valid_columns_set */ /** * @internal * convert the index component stored in the context to an oid */ int dessertAppStatsTable_index_to_oid(netsnmp_index * oid_idx, dessertAppStatsTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * appStatsIndex(1)///()//L/a/w/e/r/d/h */ netsnmp_variable_list var_appStatsIndex; /* * set up varbinds */ memset(&var_appStatsIndex, 0x00, sizeof(var_appStatsIndex)); var_appStatsIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_appStatsIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_index_to_oid", "called\n")); /* * appStatsIndex(1)///()//L/a/w/e/r/d/h */ snmp_set_var_value(&var_appStatsIndex, (u_char *) & mib_idx->appStatsIndex, sizeof(mib_idx->appStatsIndex)); err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, NULL, 0, &var_appStatsIndex); if (err) snmp_log(LOG_ERR, "error %d converting index to oid\n", err); /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_appStatsIndex); return err; } /* dessertAppStatsTable_index_to_oid */ /** * extract dessertAppStatsTable indexes from a netsnmp_index * * @retval SNMP_ERR_NOERROR : no error * @retval SNMP_ERR_GENERR : error */ int dessertAppStatsTable_index_from_oid(netsnmp_index * oid_idx, dessertAppStatsTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * appStatsIndex(1)///()//L/a/w/e/r/d/h */ netsnmp_variable_list var_appStatsIndex; /* * set up varbinds */ memset(&var_appStatsIndex, 0x00, sizeof(var_appStatsIndex)); var_appStatsIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_appStatsIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertAppStatsTable:dessertAppStatsTable_index_from_oid", "called\n")); /* * parse the oid into the individual index components */ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, &var_appStatsIndex); if (err == SNMP_ERR_NOERROR) { /* * copy out values */ mib_idx->appStatsIndex = *((long *)var_appStatsIndex.val.string); } /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_appStatsIndex); return err; } /* dessertAppStatsTable_index_from_oid */ /* ********************************************************************* * @internal * allocate resources for a dessertAppStatsTable_rowreq_ctx */ dessertAppStatsTable_rowreq_ctx * dessertAppStatsTable_allocate_rowreq_ctx(void) { dessertAppStatsTable_rowreq_ctx *rowreq_ctx = SNMP_MALLOC_TYPEDEF(dessertAppStatsTable_rowreq_ctx); DEBUGMSGTL(("internal:dessertAppStatsTable:dessertAppStatsTable_allocate_rowreq_ctx", "called\n")); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "Couldn't allocate memory for a " "dessertAppStatsTable_rowreq_ctx.\n"); return NULL; } rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; rowreq_ctx->dessertAppStatsTable_data_list = NULL; return rowreq_ctx; } /* dessertAppStatsTable_allocate_rowreq_ctx */ /* * @internal * release resources for a dessertAppStatsTable_rowreq_ctx */ void dessertAppStatsTable_release_rowreq_ctx(dessertAppStatsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("internal:dessertAppStatsTable:dessertAppStatsTable_release_rowreq_ctx", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * free index oid pointer */ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp) free(rowreq_ctx->oid_idx.oids); SNMP_FREE(rowreq_ctx); } /* dessertAppStatsTable_release_rowreq_ctx */ /** * @internal * wrapper */ static int _mfd_dessertAppStatsTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_pre_request", "called\n")); if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertAppStatsTable", "skipping additional pre_request\n")); return SNMP_ERR_NOERROR; } rc = dessertAppStatsTable_pre_request(dessertAppStatsTable_if_ctx. user_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppStatsTable", "error %d from " "dessertAppStatsTable_pre_request\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppStatsTable_pre_request */ /** * @internal * wrapper */ static int _mfd_dessertAppStatsTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppStatsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); int rc, packet_rc; DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_post_request", "called\n")); /* * release row context, if deleted */ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) dessertAppStatsTable_release_rowreq_ctx(rowreq_ctx); /* * wait for last call before calling user */ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertAppStatsTable", "waiting for last post_request\n")); return SNMP_ERR_NOERROR; } packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); rc = dessertAppStatsTable_post_request(dessertAppStatsTable_if_ctx. user_ctx, packet_rc); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertAppStatsTable", "error %d from " "dessertAppStatsTable_post_request\n", rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertAppStatsTable_post_request */ /** * @internal * wrapper */ static int _mfd_dessertAppStatsTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc = SNMP_ERR_NOERROR; dessertAppStatsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_object_lookup", "called\n")); /* * get our context from mfd * dessertAppStatsTable_interface_ctx *if_ctx = * (dessertAppStatsTable_interface_ctx *)reginfo->my_reg_void; */ if (NULL == rowreq_ctx) { rc = SNMP_ERR_NOCREATION; } if (MFD_SUCCESS != rc) netsnmp_request_set_error_all(requests, rc); else dessertAppStatsTable_row_prep(rowreq_ctx); return SNMP_VALIDATE_ERR(rc); } /* _mfd_dessertAppStatsTable_object_lookup */ /*********************************************************************** * * GET processing * ***********************************************************************/ /* * @internal * Retrieve the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertAppStatsTable_get_column(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * appStatsName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPSTATSNAME: if (!(COLUMN_APPSTATSNAME_FLAG & rowreq_ctx->column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsName) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appStatsName_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * appStatsDesc(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPSTATSDESC: if (!(COLUMN_APPSTATSDESC_FLAG & rowreq_ctx->column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsDesc) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appStatsDesc_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * appStatsNodeOrLink(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ case COLUMN_APPSTATSNODEORLINK: if (! (COLUMN_APPSTATSNODEORLINK_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsNodeOrLink) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_INTEGER; rc = appStatsNodeOrLink_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appStatsValueType(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ case COLUMN_APPSTATSVALUETYPE: if (! (COLUMN_APPSTATSVALUETYPE_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsValueType) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_INTEGER; rc = appStatsValueType_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appStatsMacAddress1(6)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPSTATSMACADDRESS1: if (! (COLUMN_APPSTATSMACADDRESS1_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsMacAddress1) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appStatsMacAddress1_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * appStatsMacAddress2(7)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_APPSTATSMACADDRESS2: if (! (COLUMN_APPSTATSMACADDRESS2_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsMacAddress2) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appStatsMacAddress2_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * appStatsTruthValue(8)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ case COLUMN_APPSTATSTRUTHVALUE: if (! (COLUMN_APPSTATSTRUTHVALUE_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsTruthValue) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_INTEGER; rc = appStatsTruthValue_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appStatsInteger32(9)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */ case COLUMN_APPSTATSINTEGER32: if (! (COLUMN_APPSTATSINTEGER32_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsInteger32) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(long); var->type = ASN_INTEGER; rc = appStatsInteger32_get(rowreq_ctx, (long *) var->val.string); break; /* * appStatsUnsigned32(10)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h */ case COLUMN_APPSTATSUNSIGNED32: if (! (COLUMN_APPSTATSUNSIGNED32_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsUnsigned32) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(u_long); var->type = ASN_UNSIGNED; rc = appStatsUnsigned32_get(rowreq_ctx, (u_long *) var->val.string); break; /* * appStatsCounter64(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_APPSTATSCOUNTER64: if (! (COLUMN_APPSTATSCOUNTER64_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsCounter64) doesn't exist\n", column)); return MFD_SKIP; } var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = appStatsCounter64_get(rowreq_ctx, (U64 *) var->val.string); break; /* * appStatsOctetString(12)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */ case COLUMN_APPSTATSOCTETSTRING: if (! (COLUMN_APPSTATSOCTETSTRING_FLAG & rowreq_ctx-> column_exists_flags)) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "column %d (appStatsOctetString) doesn't exist\n", column)); return MFD_SKIP; } var->type = ASN_OCTET_STR; rc = appStatsOctetString_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; default: if (DESSERTAPPSTATSTABLE_MIN_COL <= column && column <= DESSERTAPPSTATSTABLE_MAX_COL) { DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_column", "assume column %d is reserved\n", column)); rc = MFD_SKIP; } else { snmp_log(LOG_ERR, "unknown column %d in _dessertAppStatsTable_get_column\n", column); } break; } return rc; } /* _dessertAppStatsTable_get_column */ int _mfd_dessertAppStatsTable_get_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertAppStatsTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; u_char *old_string; void (*dataFreeHook) (void *); int rc; DEBUGMSGTL(("internal:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); DEBUGMSGTL(("9:dessertAppStatsTable:_mfd_dessertAppStatsTable_get_values", "exists %p\n", rowreq_ctx->column_exists_flags)); for (; requests; requests = requests->next) { /* * save old pointer, so we can free it if replaced */ old_string = requests->requestvb->val.string; dataFreeHook = requests->requestvb->dataFreeHook; if (NULL == requests->requestvb->val.string) { requests->requestvb->val.string = requests->requestvb->buf; requests->requestvb->val_len = sizeof(requests->requestvb->buf); } else if (requests->requestvb->buf == requests->requestvb->val.string) { if (requests->requestvb->val_len != sizeof(requests->requestvb->buf)) requests->requestvb->val_len = sizeof(requests->requestvb->buf); } /* * get column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertAppStatsTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum); if (rc) { if (MFD_SKIP == rc) { requests->requestvb->type = SNMP_NOSUCHINSTANCE; rc = SNMP_ERR_NOERROR; } } else if (NULL == requests->requestvb->val.string) { snmp_log(LOG_ERR, "NULL varbind data pointer!\n"); rc = SNMP_ERR_GENERR; } if (rc) netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc)); /* * if the buffer wasn't used previously for the old data (i.e. it * was allcoated memory) and the get routine replaced the pointer, * we need to free the previous pointer. */ if (old_string && (old_string != requests->requestvb->buf) && (requests->requestvb->val.string != old_string)) { if (dataFreeHook) (*dataFreeHook) (old_string); else free(old_string); } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertAppStatsTable_get_values */ /*********************************************************************** * * SET processing * ***********************************************************************/ /* * SET PROCESSING NOT APPLICABLE (per MIB or user setting) */ /*********************************************************************** * * DATA ACCESS * ***********************************************************************/ static void _container_free(netsnmp_container * container); /** * @internal */ static int _cache_load(netsnmp_cache * cache, void *vmagic) { DEBUGMSGTL(("internal:dessertAppStatsTable:_cache_load", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache for dessertAppStatsTable_cache_load\n"); return -1; } /** should only be called for an invalid or expired cache */ netsnmp_assert((0 == cache->valid) || (1 == cache->expired)); /* * call user code */ return dessertAppStatsTable_container_load((netsnmp_container *) cache->magic); } /* _cache_load */ /** * @internal */ static void _cache_free(netsnmp_cache * cache, void *magic) { netsnmp_container *container; DEBUGMSGTL(("internal:dessertAppStatsTable:_cache_free", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache in dessertAppStatsTable_cache_free\n"); return; } container = (netsnmp_container *) cache->magic; _container_free(container); } /* _cache_free */ /** * @internal */ static void _container_item_free(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, void *context) { DEBUGMSGTL(("internal:dessertAppStatsTable:_container_item_free", "called\n")); if (NULL == rowreq_ctx) return; dessertAppStatsTable_release_rowreq_ctx(rowreq_ctx); } /* _container_item_free */ /** * @internal */ static void _container_free(netsnmp_container * container) { DEBUGMSGTL(("internal:dessertAppStatsTable:_container_free", "called\n")); if (NULL == container) { snmp_log(LOG_ERR, "invalid container in dessertAppStatsTable_container_free\n"); return; } /* * call user code */ dessertAppStatsTable_container_free(container); /* * free all items. inefficient, but easy. */ CONTAINER_CLEAR(container, (netsnmp_container_obj_func *) _container_item_free, NULL); } /* _container_free */ /** * @internal * initialize the container with functions or wrappers */ void _dessertAppStatsTable_container_init(dessertAppStatsTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertAppStatsTable:_dessertAppStatsTable_container_init", "called\n")); /* * cache init */ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ _cache_load, _cache_free, dessertAppStatsTable_oid, dessertAppStatsTable_oid_size); if (NULL == if_ctx->cache) { snmp_log(LOG_ERR, "error creating cache for dessertAppStatsTable\n"); return; } if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; dessertAppStatsTable_container_init(&if_ctx->container, if_ctx->cache); if (NULL == if_ctx->container) if_ctx->container = netsnmp_container_find("dessertAppStatsTable:table_container"); if (NULL == if_ctx->container) { snmp_log(LOG_ERR, "error creating container in " "dessertAppStatsTable_container_init\n"); return; } if (NULL != if_ctx->cache) if_ctx->cache->magic = (void *) if_ctx->container; } /* _dessertAppStatsTable_container_init */ /** * @internal * shutdown the container with functions or wrappers */ void _dessertAppStatsTable_container_shutdown(dessertAppStatsTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertAppStatsTable:_dessertAppStatsTable_container_shutdown", "called\n")); dessertAppStatsTable_container_shutdown(if_ctx->container); _container_free(if_ctx->container); } /* _dessertAppStatsTable_container_shutdown */ dessertAppStatsTable_rowreq_ctx * dessertAppStatsTable_row_find_by_mib_index(dessertAppStatsTable_mib_index * mib_idx) { dessertAppStatsTable_rowreq_ctx *rowreq_ctx; oid oid_tmp[MAX_OID_LEN]; netsnmp_index oid_idx; int rc; /* * set up storage for OID */ oid_idx.oids = oid_tmp; oid_idx.len = sizeof(oid_tmp) / sizeof(oid); /* * convert */ rc = dessertAppStatsTable_index_to_oid(&oid_idx, mib_idx); if (MFD_SUCCESS != rc) return NULL; rowreq_ctx = CONTAINER_FIND(dessertAppStatsTable_if_ctx.container, &oid_idx); return rowreq_ctx; } libdessert0.87-0.87.2/snmp/dessertMeshifTable-README-FIRST.txt0000644000175000017500000001466011331020526021514 0ustar dvddvd************************************************************************ dessertMeshifTable README ------------------------------------------------------------------------ This document describes the results of the mib2c code generation system using the mfd code generation template. The resulting files are documented both in this README file as well as per-table specific README files. All of the files generated by this run of mib2c will begin with the dessertMeshifTable prefix. Quick Start ----------- For those interested in a quick start, to get a pseudo-todo list, try this command in directory with the generated code: grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n Key: :o: Optional :r: Recommended :M: Mandatory :A: Advanced users This will give you and ordered list of places in the code that you may (or must) take a closer look at). You may also want to take a look at the on-line tutorial, found here: http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html MIBs For Dummies Overview ------------------------- The MIBs For Dummies (MFD) configuration files have been written to help SNMP novices implement SNMP MIBs. This section will be a brief introduction to some of the general concepts you should be familar with. Managed Information Base (MIB) ------------------------------ A SNMP MIB (Managed information base) is a text file that describes the syntax for some set of data objects. The MIB creates a correlation between an ASCII name for an object and a number OID (Object Identifier). The SNMP protocol communicates information using the OIDs, and the MIB allows tools to display a name, which we humans find easier to deal with. To use an analogy, a MIB is much like a menu at a restaurant. If you've ever been to a reataurant and ordered a meal, and later received a bill that simply had '#6' on it, you get the idea. The name is easier for the customers to remember, and the waiters and chefs use the number for efficency. Scalars ------- A scalar variable is a unique object in a MIB which can represent a single value. For example, the SNMP standard MIB-II defines a variable, sysContact.0, which is a string containing the contact information for the person in charge of a particular agent. Note that scalar variable always end with '.0'. Rows and Tables --------------- When a group of related attributes occur more than once, they can be grouped together in a table. A table has an index, which uniquely identifies a particular row, and data columns, which contain the attributes for that row. For example, the SNMP standard MIB-II defines a table, ifTable, which contains information on the ethernet interfaces on a system. Data Structures --------------- The code generated by the MFD configuration files has a few important structures. The Data Context ---------------- The data context structure should contain the necessary information to provide the data for the columns in a given row. As long as you can extract the data for a column for the data context, the data context can be anything you want: a pointer to an existing structure, the parameters needed for a function call or an actual copy of the data. By default, a data context structure is generated with storage for all the data in a row. Information on changing the default is presented later on in this help. The MIB Context --------------- The MIB context structure is generated with storage for all the indexes of a table. This data will be used when searching for the correct row to process for a request. The Row Request Context ----------------------- Each table will have a unique data structure for holding data during the processing of a particular row. The row request context contains the registration context (that you supply during initilization), the data context, the MIB context, the undo context (for settable tables) and other data. There is also a netsnmp_data_list, which can be used to temporary storage during processing. The Table Registration Pointer ------------------------------ During initilization, you may provide a pointer to arbitrary data for you own use. This pointer will be saved in the row request context, and is passed as a parameter to several functions. It is not required, and is provided as a way for you to access table specific data in the generated code. These files are top-level files potentially useful for all the tables: ------------------------------------------------------------------------ File : dessertMeshifTable_Makefile ---------------------------------------------------------------------- Purpose : Make file for compiling a (sub)agent. This file is only useful if you don't want to compile your code directly into the Net-SNMP master agent. Editable: Optional Usage : make -f dessertMeshifTable_Makefile File : dessertMeshifTable_subagent.c ---------------------------------------------------------------------- Purpose : This file contains a main() function for an agent or sub-agent and is compiled using the Makefile above. Table specific README files ------------------------------------------------------------------------ Each table for which code was generated has its own README file describing the files specifically associated with each table. You should probably read these next: dessertMeshifTable-README-dessertMeshifTable.txt These are miscellaneous auto-generated code files you generally shouldn't edit. They contain code that ties your code together with the Net-SNMP agent. ------------------------------------------------------------------------ File : dessertMeshifTable.h Purpose : Header file for the module set. Includes config_require macros to auto-load the other code pieces when compiled into the agent. File : dessertMeshifTable_oids.h Purpose : C #define definitions of the tables, columns, and OIDs File : dessertMeshifTable_enums.h Purpose : C #define definitions of the enumerated type values for each column of each table that requires them. File : dessertMeshifTable_interface.c Purpose : MFD interface to Net-SNMP. This auto-generated code ties the functions you will fill out to the code that the agent needs. libdessert0.87-0.87.2/snmp/dessertMeshifTable_data_access.c0000644000175000017500000003006111331020526021602 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "../dessert_internal.h" #include "dessertMeshifTable_data_access.h" /** @ingroup interface * @addtogroup data_access data_access: Routines to access data * * These routines are used to locate the data used to satisfy * requests. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertMeshifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertMeshifTable is subid 5 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.5, length: 12 */ /** * initialization for dessertMeshifTable data access * * This function is called during startup to allow you to * allocate any resources you need for the data table. * * @param dessertMeshifTable_reg * Pointer to dessertMeshifTable_registration * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : unrecoverable error. */ int dessertMeshifTable_init_data(dessertMeshifTable_registration * dessertMeshifTable_reg) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_init_data", "called\n")); dessert_debug("dessertMeshifTable_container_load called"); /* * TODO:303:o: Initialize dessertMeshifTable data. */ /* *************************************************** *** START EXAMPLE CODE *** ***---------------------------------------------***/ /* * if you are the sole writer for the file, you could * open it here. However, as stated earlier, we are assuming * the worst case, which in this case means that the file is * written to by someone else, and might not even exist when * we start up. So we can't do anything here. */ /* ***---------------------------------------------*** *** END EXAMPLE CODE *** ***************************************************/ return MFD_SUCCESS; } /* dessertMeshifTable_init_data */ /** * container overview * */ /** * container initialization * * @param container_ptr_ptr A pointer to a container pointer. If you * create a custom container, use this parameter to return it * to the MFD helper. If set to NULL, the MFD helper will * allocate a container for you. * @param cache A pointer to a cache structure. You can set the timeout * and other cache flags using this pointer. * * This function is called at startup to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. If no custom * container is allocated, the MFD code will create one for your. * * This is also the place to set up cache behavior. The default, to * simply set the cache timeout, will work well with the default * container. If you are using a custom container, you may want to * look at the cache helper documentation to see if there are any * flags you want to set. * * @remark * This would also be a good place to do any initialization needed * for you data source. For example, opening a connection to another * process that will supply the data, opening a database, etc. */ void dessertMeshifTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_container_init", "called\n")); if (NULL == container_ptr_ptr) { snmp_log(LOG_ERR, "bad container param to dessertMeshifTable_container_init\n"); return; } /* * For advanced users, you can use a custom container. If you * do not create one, one will be created for you. */ *container_ptr_ptr = NULL; if (NULL == cache) { snmp_log(LOG_ERR, "bad cache param to dessertMeshifTable_container_init\n"); return; } /* * TODO:345:A: Set up dessertMeshifTable cache properties. * * Also for advanced users, you can set parameters for the * cache. Do not change the magic pointer, as it is used * by the MFD helper. To completely disable caching, set * cache->enabled to 0. */ cache->timeout = DESSERTMESHIFTABLE_CACHE_TIMEOUT; /* seconds */ } /* dessertMeshifTable_container_init */ /** * container shutdown * * @param container_ptr A pointer to the container. * * This function is called at shutdown to allow you to customize certain * aspects of the access method. For the most part, it is for advanced * users. The default code should suffice for most cases. * * This function is called before dessertMeshifTable_container_free(). * * @remark * This would also be a good place to do any cleanup needed * for you data source. For example, closing a connection to another * process that supplied the data, closing a database, etc. */ void dessertMeshifTable_container_shutdown(netsnmp_container * container_ptr) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_container_shutdown", "called\n")); if (NULL == container_ptr) { snmp_log(LOG_ERR, "bad params to dessertMeshifTable_container_shutdown\n"); return; } } /* dessertMeshifTable_container_shutdown */ /** * load initial data * * TODO:350:M: Implement dessertMeshifTable data load * This function will also be called by the cache helper to load * the container again (after the container free function has been * called to free the previous contents). * * @param container container to which items should be inserted * * @retval MFD_SUCCESS : success. * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source * @retval MFD_ERROR : other error. * * This function is called to load the index(es) (and data, optionally) * for the every row in the data set. * * @remark * While loading the data, the only important thing is the indexes. * If access to your data is cheap/fast (e.g. you have a pointer to a * structure in memory), it would make sense to update the data here. * If, however, the accessing the data invovles more work (e.g. parsing * some other existing data, or peforming calculations to derive the data), * then you can limit yourself to setting the indexes and saving any * information you will need later. Then use the saved information in * dessertMeshifTable_row_prep() for populating data. * * @note * If you need consistency between rows (like you want statistics * for each row to be from the same time frame), you should set all * data here. * */ int dessertMeshifTable_container_load(netsnmp_container * container) { dessertMeshifTable_rowreq_ctx *rowreq_ctx; dessert_meshif_t *meshif; size_t count = 0; char inPkts[I64CHARSZ+1]; char outPkts[I64CHARSZ+1]; char inOctets[I64CHARSZ+1]; char outOctets[I64CHARSZ+1]; /* * temporary storage for index values */ /* * meshifIndex(1)///()//L/a/w/e/r/d/h */ long meshifIndex = -1; dessert_debug("dessertMeshifTable_container_load called"); DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_container_load", "called\n")); /* * TODO:351:M: |-> Load/update data in the dessertMeshifTable container. * loop over your dessertMeshifTable data, allocate a rowreq context, * set the index(es) [and data, optionally] and insert into * the container. */ pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(dessert_meshiflist_get(), meshif){ meshifIndex = ++count; /* * TODO:352:M: | |-> set indexes in new dessertMeshifTable rowreq context. * data context will be set from the param (unless NULL, * in which case a new data context will be allocated) */ rowreq_ctx = dessertMeshifTable_allocate_rowreq_ctx(NULL); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "memory allocation failed\n"); pthread_rwlock_unlock(&dessert_cfglock); return MFD_RESOURCE_UNAVAILABLE; } if (MFD_SUCCESS != dessertMeshifTable_indexes_set(rowreq_ctx, meshifIndex)) { snmp_log(LOG_ERR, "error setting index while loading " "dessertMeshifTable data.\n"); dessertMeshifTable_release_rowreq_ctx(rowreq_ctx); continue; } /* * TODO:352:r: | |-> populate dessertMeshifTable data context. * Populate data context here. (optionally, delay until row prep) */ rowreq_ctx->data.meshifName_len = strlen(meshif->if_name); strcpy(rowreq_ctx->data.meshifName, meshif->if_name); rowreq_ctx->data.meshifMacAddress_len = 6; memcpy(rowreq_ctx->data.meshifMacAddress, meshif->hwaddr, 6); pthread_mutex_lock(&(meshif->cnt_mutex)); rowreq_ctx->data.meshifInPkts.low = meshif->ipkts & 0xffffffff; rowreq_ctx->data.meshifInPkts.high = meshif->ipkts >> 32; rowreq_ctx->data.meshifOutPkts.low = meshif->opkts & 0xffffffff; rowreq_ctx->data.meshifOutPkts.high = meshif->opkts >> 32; rowreq_ctx->data.meshifInOctets.low = meshif->ibytes & 0xffffffff; rowreq_ctx->data.meshifInOctets.high = meshif->ibytes >> 32; rowreq_ctx->data.meshifOutOctets.low = meshif->obytes & 0xffffffff; rowreq_ctx->data.meshifOutOctets.high = meshif->obytes >> 32; printU64(inPkts, &rowreq_ctx->data.meshifInPkts); printU64(outPkts, &rowreq_ctx->data.meshifOutPkts); printU64(inOctets, &rowreq_ctx->data.meshifInOctets); printU64(outOctets, &rowreq_ctx->data.meshifOutOctets); dessert_debug("inPkts [%s] [%u]", inPkts, meshif->ipkts); dessert_debug("outPkts [%s] [%u]", outPkts, meshif->opkts); dessert_debug("inOctets [%s] [%u]", inOctets, meshif->ibytes); dessert_debug("outOctets [%s] [%u]", outOctets,meshif->obytes); pthread_mutex_unlock(&(meshif->cnt_mutex)); /* * insert into table container */ CONTAINER_INSERT(container, rowreq_ctx); } pthread_rwlock_unlock(&dessert_cfglock); DEBUGMSGT(("verbose:dessertMeshifTable:dessertMeshifTable_container_load", "inserted %d records\n", count)); if (meshifIndex == -1) return MFD_RESOURCE_UNAVAILABLE; return MFD_SUCCESS; } /* dessertMeshifTable_container_load */ /** * container clean up * * @param container container with all current items * * This optional callback is called prior to all * item's being removed from the container. If you * need to do any processing before that, do it here. * * @note * The MFD helper will take care of releasing all the row contexts. * */ void dessertMeshifTable_container_free(netsnmp_container * container) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_container_free", "called\n")); /* * TODO:380:M: Free dessertMeshifTable container data. */ } /* dessertMeshifTable_container_free */ /** * prepare row for processing. * * When the agent has located the row for a request, this function is * called to prepare the row for processing. If you fully populated * the data context during the index setup phase, you may not need to * do anything. * * @param rowreq_ctx pointer to a context. * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error. */ int dessertMeshifTable_row_prep(dessertMeshifTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertMeshifTable:dessertMeshifTable_row_prep", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:390:o: Prepare row for request. * If populating row data was delayed, this is the place to * fill in the row for this request. */ return MFD_SUCCESS; } /* dessertMeshifTable_row_prep */ /** @} */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_data_set.h0000644000175000017500000001605611331020526021622 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ */ #ifndef DESSERTAPPPARAMSTABLE_DATA_SET_H #define DESSERTAPPPARAMSTABLE_DATA_SET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * SET function declarations */ /* ********************************************************************* * SET Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ int dessertAppParamsTable_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_undo_cleanup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_commit(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_undo_commit(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsName_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsName_val_ptr, size_t appParamsName_val_ptr_len); int appParamsName_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsName_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsName_val_ptr, size_t appParamsName_val_ptr_len); int appParamsName_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsDesc_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsDesc_val_ptr, size_t appParamsDesc_val_ptr_len); int appParamsDesc_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsDesc_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsDesc_val_ptr, size_t appParamsDesc_val_ptr_len); int appParamsDesc_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsValueType_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsValueType_val); int appParamsValueType_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsValueType_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsValueType_val); int appParamsValueType_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsTruthValue_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsTruthValue_val); int appParamsTruthValue_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsTruthValue_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsTruthValue_val); int appParamsTruthValue_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsInteger32_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long appParamsInteger32_val); int appParamsInteger32_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsInteger32_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long appParamsInteger32_val); int appParamsInteger32_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsUnsigned32_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsUnsigned32_val); int appParamsUnsigned32_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsUnsigned32_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsUnsigned32_val); int appParamsUnsigned32_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsOctetString_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsOctetString_val_ptr, size_t appParamsOctetString_val_ptr_len); int appParamsOctetString_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int appParamsOctetString_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsOctetString_val_ptr, size_t appParamsOctetString_val_ptr_len); int appParamsOctetString_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); int dessertAppParamsTable_check_dependencies (dessertAppParamsTable_rowreq_ctx * ctx); #ifdef __cplusplus } #endif #endif /* DESSERTAPPPARAMSTABLE_DATA_SET_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable_interface.c0000644000175000017500000007070611331020526021204 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertSysifTable.h" #include #include #include "dessertSysifTable_interface.h" #include /********************************************************************** ********************************************************************** *** *** Table dessertSysifTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertSysifTable is subid 7 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.7, length: 12 */ typedef struct dessertSysifTable_interface_ctx_s { netsnmp_container *container; netsnmp_cache *cache; dessertSysifTable_registration *user_ctx; netsnmp_table_registration_info tbl_info; netsnmp_baby_steps_access_methods access_multiplexer; } dessertSysifTable_interface_ctx; static dessertSysifTable_interface_ctx dessertSysifTable_if_ctx; static void _dessertSysifTable_container_init(dessertSysifTable_interface_ctx * if_ctx); static void _dessertSysifTable_container_shutdown(dessertSysifTable_interface_ctx * if_ctx); netsnmp_container * dessertSysifTable_container_get(void) { return dessertSysifTable_if_ctx.container; } dessertSysifTable_registration * dessertSysifTable_registration_get(void) { return dessertSysifTable_if_ctx.user_ctx; } dessertSysifTable_registration * dessertSysifTable_registration_set(dessertSysifTable_registration * newreg) { dessertSysifTable_registration *old = dessertSysifTable_if_ctx.user_ctx; dessertSysifTable_if_ctx.user_ctx = newreg; return old; } int dessertSysifTable_container_size(void) { return CONTAINER_SIZE(dessertSysifTable_if_ctx.container); } /* * mfd multiplexer modes */ static Netsnmp_Node_Handler _mfd_dessertSysifTable_pre_request; static Netsnmp_Node_Handler _mfd_dessertSysifTable_post_request; static Netsnmp_Node_Handler _mfd_dessertSysifTable_object_lookup; static Netsnmp_Node_Handler _mfd_dessertSysifTable_get_values; /** * @internal * Initialize the table dessertSysifTable * (Define its contents and how it's structured) */ void _dessertSysifTable_initialize_interface(dessertSysifTable_registration * reg_ptr, u_long flags) { netsnmp_baby_steps_access_methods *access_multiplexer = &dessertSysifTable_if_ctx.access_multiplexer; netsnmp_table_registration_info *tbl_info = &dessertSysifTable_if_ctx.tbl_info; netsnmp_handler_registration *reginfo; netsnmp_mib_handler *handler; int mfd_modes = 0; DEBUGMSGTL(("internal:dessertSysifTable:_dessertSysifTable_initialize_interface", "called\n")); /************************************************* * * save interface context for dessertSysifTable */ /* * Setting up the table's definition */ netsnmp_table_helper_add_indexes(tbl_info, /** index: sysifIndex */ 0); /* * Define the minimum and maximum accessible columns. This * optimizes retrival. */ tbl_info->min_column = DESSERTSYSIFTABLE_MIN_COL; tbl_info->max_column = DESSERTSYSIFTABLE_MAX_COL; /* * save users context */ dessertSysifTable_if_ctx.user_ctx = reg_ptr; /* * call data access initialization code */ dessertSysifTable_init_data(reg_ptr); /* * set up the container */ _dessertSysifTable_container_init(&dessertSysifTable_if_ctx); if (NULL == dessertSysifTable_if_ctx.container) { snmp_log(LOG_ERR, "could not initialize container for dessertSysifTable\n"); return; } /* * access_multiplexer: REQUIRED wrapper for get request handling */ access_multiplexer->object_lookup = _mfd_dessertSysifTable_object_lookup; access_multiplexer->get_values = _mfd_dessertSysifTable_get_values; /* * no wrappers yet */ access_multiplexer->pre_request = _mfd_dessertSysifTable_pre_request; access_multiplexer->post_request = _mfd_dessertSysifTable_post_request; /************************************************* * * Create a registration, save our reg data, register table. */ DEBUGMSGTL(("dessertSysifTable:init_dessertSysifTable", "Registering dessertSysifTable as a mibs-for-dummies table.\n")); handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); reginfo = netsnmp_handler_registration_create("dessertSysifTable", handler, dessertSysifTable_oid, dessertSysifTable_oid_size, HANDLER_CAN_BABY_STEP | HANDLER_CAN_RONLY); if (NULL == reginfo) { snmp_log(LOG_ERR, "error registering table dessertSysifTable\n"); return; } reginfo->my_reg_void = &dessertSysifTable_if_ctx; /************************************************* * * set up baby steps handler, create it and inject it */ if (access_multiplexer->object_lookup) mfd_modes |= BABY_STEP_OBJECT_LOOKUP; if (access_multiplexer->set_values) mfd_modes |= BABY_STEP_SET_VALUES; if (access_multiplexer->irreversible_commit) mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT; if (access_multiplexer->object_syntax_checks) mfd_modes |= BABY_STEP_CHECK_OBJECT; if (access_multiplexer->pre_request) mfd_modes |= BABY_STEP_PRE_REQUEST; if (access_multiplexer->post_request) mfd_modes |= BABY_STEP_POST_REQUEST; if (access_multiplexer->undo_setup) mfd_modes |= BABY_STEP_UNDO_SETUP; if (access_multiplexer->undo_cleanup) mfd_modes |= BABY_STEP_UNDO_CLEANUP; if (access_multiplexer->undo_sets) mfd_modes |= BABY_STEP_UNDO_SETS; if (access_multiplexer->row_creation) mfd_modes |= BABY_STEP_ROW_CREATE; if (access_multiplexer->consistency_checks) mfd_modes |= BABY_STEP_CHECK_CONSISTENCY; if (access_multiplexer->commit) mfd_modes |= BABY_STEP_COMMIT; if (access_multiplexer->undo_commit) mfd_modes |= BABY_STEP_UNDO_COMMIT; handler = netsnmp_baby_steps_handler_get(mfd_modes); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject row_merge helper with prefix rootoid_len + 2 (entry.col) */ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject container_table helper */ handler = netsnmp_container_table_handler_get(tbl_info, dessertSysifTable_if_ctx. container, TABLE_CONTAINER_KEY_NETSNMP_INDEX); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject cache helper */ if (NULL != dessertSysifTable_if_ctx.cache) { handler = netsnmp_cache_handler_get(dessertSysifTable_if_ctx.cache); netsnmp_inject_handler(reginfo, handler); } /* * register table */ netsnmp_register_table(reginfo, tbl_info); } /* _dessertSysifTable_initialize_interface */ /** * @internal * Shutdown the table dessertSysifTable */ void _dessertSysifTable_shutdown_interface(dessertSysifTable_registration * reg_ptr) { /* * shutdown the container */ _dessertSysifTable_container_shutdown(&dessertSysifTable_if_ctx); } void dessertSysifTable_valid_columns_set(netsnmp_column_info *vc) { dessertSysifTable_if_ctx.tbl_info.valid_columns = vc; } /* dessertSysifTable_valid_columns_set */ /** * @internal * convert the index component stored in the context to an oid */ int dessertSysifTable_index_to_oid(netsnmp_index * oid_idx, dessertSysifTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * sysifIndex(1)///()//L/a/w/e/r/d/h */ netsnmp_variable_list var_sysifIndex; /* * set up varbinds */ memset(&var_sysifIndex, 0x00, sizeof(var_sysifIndex)); var_sysifIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_sysifIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_index_to_oid", "called\n")); /* * sysifIndex(1)///()//L/a/w/e/r/d/h */ snmp_set_var_value(&var_sysifIndex, (u_char *) & mib_idx->sysifIndex, sizeof(mib_idx->sysifIndex)); err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, NULL, 0, &var_sysifIndex); if (err) snmp_log(LOG_ERR, "error %d converting index to oid\n", err); /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_sysifIndex); return err; } /* dessertSysifTable_index_to_oid */ /** * extract dessertSysifTable indexes from a netsnmp_index * * @retval SNMP_ERR_NOERROR : no error * @retval SNMP_ERR_GENERR : error */ int dessertSysifTable_index_from_oid(netsnmp_index * oid_idx, dessertSysifTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * sysifIndex(1)///()//L/a/w/e/r/d/h */ netsnmp_variable_list var_sysifIndex; /* * set up varbinds */ memset(&var_sysifIndex, 0x00, sizeof(var_sysifIndex)); var_sysifIndex.type = ASN_INTEGER; /* * chain temp index varbinds together */ var_sysifIndex.next_variable = NULL; DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_index_from_oid", "called\n")); /* * parse the oid into the individual index components */ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, &var_sysifIndex); if (err == SNMP_ERR_NOERROR) { /* * copy out values */ mib_idx->sysifIndex = *((long *)var_sysifIndex.val.string); } /* * parsing may have allocated memory. free it. */ snmp_reset_var_buffers(&var_sysifIndex); return err; } /* dessertSysifTable_index_from_oid */ /* ********************************************************************* * @internal * allocate resources for a dessertSysifTable_rowreq_ctx */ dessertSysifTable_rowreq_ctx * dessertSysifTable_allocate_rowreq_ctx(void *user_init_ctx) { dessertSysifTable_rowreq_ctx *rowreq_ctx = SNMP_MALLOC_TYPEDEF(dessertSysifTable_rowreq_ctx); DEBUGMSGTL(("internal:dessertSysifTable:dessertSysifTable_allocate_rowreq_ctx", "called\n")); if (NULL == rowreq_ctx) { snmp_log(LOG_ERR, "Couldn't allocate memory for a " "dessertSysifTable_rowreq_ctx.\n"); return NULL; } rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; rowreq_ctx->dessertSysifTable_data_list = NULL; /* * if we allocated data, call init routine */ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { if (SNMPERR_SUCCESS != dessertSysifTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) { dessertSysifTable_release_rowreq_ctx(rowreq_ctx); rowreq_ctx = NULL; } } return rowreq_ctx; } /* dessertSysifTable_allocate_rowreq_ctx */ /* * @internal * release resources for a dessertSysifTable_rowreq_ctx */ void dessertSysifTable_release_rowreq_ctx(dessertSysifTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("internal:dessertSysifTable:dessertSysifTable_release_rowreq_ctx", "called\n")); netsnmp_assert(NULL != rowreq_ctx); dessertSysifTable_rowreq_ctx_cleanup(rowreq_ctx); /* * free index oid pointer */ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp) free(rowreq_ctx->oid_idx.oids); SNMP_FREE(rowreq_ctx); } /* dessertSysifTable_release_rowreq_ctx */ /** * @internal * wrapper */ static int _mfd_dessertSysifTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc; DEBUGMSGTL(("internal:dessertSysifTable:_mfd_dessertSysifTable_pre_request", "called\n")); if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertSysifTable", "skipping additional pre_request\n")); return SNMP_ERR_NOERROR; } rc = dessertSysifTable_pre_request(dessertSysifTable_if_ctx.user_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertSysifTable", "error %d from " "dessertSysifTable_pre_request\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertSysifTable_pre_request */ /** * @internal * wrapper */ static int _mfd_dessertSysifTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertSysifTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); int rc, packet_rc; DEBUGMSGTL(("internal:dessertSysifTable:_mfd_dessertSysifTable_post_request", "called\n")); /* * release row context, if deleted */ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) dessertSysifTable_release_rowreq_ctx(rowreq_ctx); /* * wait for last call before calling user */ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:dessertSysifTable", "waiting for last post_request\n")); return SNMP_ERR_NOERROR; } packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); rc = dessertSysifTable_post_request(dessertSysifTable_if_ctx.user_ctx, packet_rc); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("dessertSysifTable", "error %d from " "dessertSysifTable_post_request\n", rc)); } return SNMP_ERR_NOERROR; } /* _mfd_dessertSysifTable_post_request */ /** * @internal * wrapper */ static int _mfd_dessertSysifTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { int rc = SNMP_ERR_NOERROR; dessertSysifTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:dessertSysifTable:_mfd_dessertSysifTable_object_lookup", "called\n")); /* * get our context from mfd * dessertSysifTable_interface_ctx *if_ctx = * (dessertSysifTable_interface_ctx *)reginfo->my_reg_void; */ if (NULL == rowreq_ctx) { rc = SNMP_ERR_NOCREATION; } if (MFD_SUCCESS != rc) netsnmp_request_set_error_all(requests, rc); else dessertSysifTable_row_prep(rowreq_ctx); return SNMP_VALIDATE_ERR(rc); } /* _mfd_dessertSysifTable_object_lookup */ /*********************************************************************** * * GET processing * ***********************************************************************/ /* * @internal * Retrieve the value for a particular column */ NETSNMP_STATIC_INLINE int _dessertSysifTable_get_column(dessertSysifTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column) { int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:dessertSysifTable:_mfd_dessertSysifTable_get_column", "called for %d\n", column)); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * sysifName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_SYSIFNAME: var->type = ASN_OCTET_STR; rc = sysifName_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * sysifMacAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ case COLUMN_SYSIFMACADDRESS: var->type = ASN_OCTET_STR; rc = sysifMacAddress_get(rowreq_ctx, (char **) &var->val.string, &var->val_len); break; /* * sysifInPkts(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_SYSIFINPKTS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = sysifInPkts_get(rowreq_ctx, (U64 *) var->val.string); break; /* * sysifOutPkts(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_SYSIFOUTPKTS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = sysifOutPkts_get(rowreq_ctx, (U64 *) var->val.string); break; /* * sysifInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_SYSIFINOCTETS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = sysifInOctets_get(rowreq_ctx, (U64 *) var->val.string); break; /* * sysifOutOctets(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ case COLUMN_SYSIFOUTOCTETS: var->val_len = sizeof(U64); var->type = ASN_COUNTER64; rc = sysifOutOctets_get(rowreq_ctx, (U64 *) var->val.string); break; default: if (DESSERTSYSIFTABLE_MIN_COL <= column && column <= DESSERTSYSIFTABLE_MAX_COL) { DEBUGMSGTL(("internal:dessertSysifTable:_mfd_dessertSysifTable_get_column", "assume column %d is reserved\n", column)); rc = MFD_SKIP; } else { snmp_log(LOG_ERR, "unknown column %d in _dessertSysifTable_get_column\n", column); } break; } return rc; } /* _dessertSysifTable_get_column */ int _mfd_dessertSysifTable_get_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests) { dessertSysifTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; u_char *old_string; void (*dataFreeHook) (void *); int rc; DEBUGMSGTL(("internal:dessertSysifTable:_mfd_dessertSysifTable_get_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); for (; requests; requests = requests->next) { /* * save old pointer, so we can free it if replaced */ old_string = requests->requestvb->val.string; dataFreeHook = requests->requestvb->dataFreeHook; if (NULL == requests->requestvb->val.string) { requests->requestvb->val.string = requests->requestvb->buf; requests->requestvb->val_len = sizeof(requests->requestvb->buf); } else if (requests->requestvb->buf == requests->requestvb->val.string) { if (requests->requestvb->val_len != sizeof(requests->requestvb->buf)) requests->requestvb->val_len = sizeof(requests->requestvb->buf); } /* * get column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _dessertSysifTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum); if (rc) { if (MFD_SKIP == rc) { requests->requestvb->type = SNMP_NOSUCHINSTANCE; rc = SNMP_ERR_NOERROR; } } else if (NULL == requests->requestvb->val.string) { snmp_log(LOG_ERR, "NULL varbind data pointer!\n"); rc = SNMP_ERR_GENERR; } if (rc) netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc)); /* * if the buffer wasn't used previously for the old data (i.e. it * was allcoated memory) and the get routine replaced the pointer, * we need to free the previous pointer. */ if (old_string && (old_string != requests->requestvb->buf) && (requests->requestvb->val.string != old_string)) { if (dataFreeHook) (*dataFreeHook) (old_string); else free(old_string); } } /* for results */ return SNMP_ERR_NOERROR; } /* _mfd_dessertSysifTable_get_values */ /*********************************************************************** * * SET processing * ***********************************************************************/ /* * SET PROCESSING NOT APPLICABLE (per MIB or user setting) */ /*********************************************************************** * * DATA ACCESS * ***********************************************************************/ static void _container_free(netsnmp_container * container); /** * @internal */ static int _cache_load(netsnmp_cache * cache, void *vmagic) { DEBUGMSGTL(("internal:dessertSysifTable:_cache_load", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache for dessertSysifTable_cache_load\n"); return -1; } /** should only be called for an invalid or expired cache */ netsnmp_assert((0 == cache->valid) || (1 == cache->expired)); /* * call user code */ return dessertSysifTable_container_load((netsnmp_container *) cache-> magic); } /* _cache_load */ /** * @internal */ static void _cache_free(netsnmp_cache * cache, void *magic) { netsnmp_container *container; DEBUGMSGTL(("internal:dessertSysifTable:_cache_free", "called\n")); if ((NULL == cache) || (NULL == cache->magic)) { snmp_log(LOG_ERR, "invalid cache in dessertSysifTable_cache_free\n"); return; } container = (netsnmp_container *) cache->magic; _container_free(container); } /* _cache_free */ /** * @internal */ static void _container_item_free(dessertSysifTable_rowreq_ctx * rowreq_ctx, void *context) { DEBUGMSGTL(("internal:dessertSysifTable:_container_item_free", "called\n")); if (NULL == rowreq_ctx) return; dessertSysifTable_release_rowreq_ctx(rowreq_ctx); } /* _container_item_free */ /** * @internal */ static void _container_free(netsnmp_container * container) { DEBUGMSGTL(("internal:dessertSysifTable:_container_free", "called\n")); if (NULL == container) { snmp_log(LOG_ERR, "invalid container in dessertSysifTable_container_free\n"); return; } /* * call user code */ dessertSysifTable_container_free(container); /* * free all items. inefficient, but easy. */ CONTAINER_CLEAR(container, (netsnmp_container_obj_func *) _container_item_free, NULL); } /* _container_free */ /** * @internal * initialize the container with functions or wrappers */ void _dessertSysifTable_container_init(dessertSysifTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertSysifTable:_dessertSysifTable_container_init", "called\n")); /* * cache init */ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ _cache_load, _cache_free, dessertSysifTable_oid, dessertSysifTable_oid_size); if (NULL == if_ctx->cache) { snmp_log(LOG_ERR, "error creating cache for dessertSysifTable\n"); return; } if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; dessertSysifTable_container_init(&if_ctx->container, if_ctx->cache); if (NULL == if_ctx->container) if_ctx->container = netsnmp_container_find("dessertSysifTable:table_container"); if (NULL == if_ctx->container) { snmp_log(LOG_ERR, "error creating container in " "dessertSysifTable_container_init\n"); return; } if (NULL != if_ctx->cache) if_ctx->cache->magic = (void *) if_ctx->container; } /* _dessertSysifTable_container_init */ /** * @internal * shutdown the container with functions or wrappers */ void _dessertSysifTable_container_shutdown(dessertSysifTable_interface_ctx * if_ctx) { DEBUGMSGTL(("internal:dessertSysifTable:_dessertSysifTable_container_shutdown", "called\n")); dessertSysifTable_container_shutdown(if_ctx->container); _container_free(if_ctx->container); } /* _dessertSysifTable_container_shutdown */ dessertSysifTable_rowreq_ctx * dessertSysifTable_row_find_by_mib_index(dessertSysifTable_mib_index * mib_idx) { dessertSysifTable_rowreq_ctx *rowreq_ctx; oid oid_tmp[MAX_OID_LEN]; netsnmp_index oid_idx; int rc; /* * set up storage for OID */ oid_idx.oids = oid_tmp; oid_idx.len = sizeof(oid_tmp) / sizeof(oid); /* * convert */ rc = dessertSysifTable_index_to_oid(&oid_idx, mib_idx); if (MFD_SUCCESS != rc) return NULL; rowreq_ctx = CONTAINER_FIND(dessertSysifTable_if_ctx.container, &oid_idx); return rowreq_ctx; } libdessert0.87-0.87.2/snmp/dessertAppParamsTable_enums.h0000644000175000017500000000626011331020526021161 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ * * $Id:$ */ #ifndef DESSERTAPPPARAMSTABLE_ENUMS_H #define DESSERTAPPPARAMSTABLE_ENUMS_H #include "../dessert.h" #ifdef __cplusplus extern "C" { #endif /* * NOTES on enums * ============== * * Value Mapping * ------------- * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them * below. For example, a boolean flag (1/0) is usually represented * as a TruthValue in a MIB, which maps to the values (1/2). * */ /************************************************************************* ************************************************************************* * * enum definitions for table dessertAppParamsTable * ************************************************************************* *************************************************************************/ /************************************************************* * constants for enums for the MIB node * appParamsValueType (DessertAppValueType / ASN_INTEGER) * * since a Textual Convention may be referenced more than once in a * MIB, protect againt redefinitions of the enum values. */ #ifndef DESSERTAPPVALUETYPE_ENUMS #define DESSERTAPPVALUETYPE_ENUMS #define DESSERTAPPVALUETYPE_BOOL 0 #define DESSERTAPPVALUETYPE_INT32 1 #define DESSERTAPPVALUETYPE_UINT32 2 #define DESSERTAPPVALUETYPE_COUNTER64 3 #define DESSERTAPPVALUETYPE_OCTETSTRING 4 #endif /* DESSERTAPPVALUETYPE_ENUMS */ /* * TODO:140:o: Define your interal representation of appParamsValueType enums. * (used for value mapping; see notes at top of file) */ #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_BOOL DESSERT_APPPARAMS_VALUETYPE_BOOL #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_INT32 DESSERT_APPPARAMS_VALUETYPE_INT32 #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_UINT32 DESSERT_APPPARAMS_VALUETYPE_UINT32 #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_COUNTER64 DESSERT_APPPARAMS_VALUETYPE_COUNTER64 #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSVALUETYPE_OCTETSTRING DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING /************************************************************* * constants for enums for the MIB node * appParamsTruthValue (TruthValue / ASN_INTEGER) * * since a Textual Convention may be referenced more than once in a * MIB, protect againt redefinitions of the enum values. */ #ifndef TRUTHVALUE_ENUMS #define TRUTHVALUE_ENUMS #define TRUTHVALUE_TRUE 1 #define TRUTHVALUE_FALSE 2 #endif /* TRUTHVALUE_ENUMS */ /* * TODO:140:o: Define your interal representation of appParamsTruthValue enums. * (used for value mapping; see notes at top of file) */ #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSTRUTHVALUE_TRUE DESSERT_APPPARAMS_BOOL_TRUE #define INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSTRUTHVALUE_FALSE DESSERT_APPPARAMS_BOOL_FALSE #ifdef __cplusplus } #endif #endif /* DESSERTAPPPARAMSTABLE_ENUMS_H */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_data_get.h0000644000175000017500000002112411331020526021451 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12088 $ of $ * * $Id:$ * * @file dessertAppStatsTable_data_get.h * * @addtogroup get * * Prototypes for get functions * * @{ */ #ifndef DESSERTAPPSTATSTABLE_DATA_GET_H #define DESSERTAPPSTATSTABLE_DATA_GET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * GET function declarations */ /* ********************************************************************* * GET Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppStatsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppStatsTable is subid 8 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.8, length: 12 */ /* * indexes */ int appStatsIndex_map(uint *mib_appStatsIndex_val_ptr, uint raw_appStatsIndex_val); int appStatsName_map(char **mib_appStatsName_val_ptr_ptr, size_t *mib_appStatsName_val_ptr_len_ptr, char *raw_appStatsName_val_ptr, size_t raw_appStatsName_val_ptr_len, int allow_realloc); int appStatsName_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsName_val_ptr_ptr, size_t *appStatsName_val_ptr_len_ptr); int appStatsDesc_map(char **mib_appStatsDesc_val_ptr_ptr, size_t *mib_appStatsDesc_val_ptr_len_ptr, char *raw_appStatsDesc_val_ptr, size_t raw_appStatsDesc_val_ptr_len, int allow_realloc); int appStatsDesc_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsDesc_val_ptr_ptr, size_t *appStatsDesc_val_ptr_len_ptr); int appStatsNodeOrLink_map(u_long * mib_appStatsNodeOrLink_val_ptr, u_long raw_appStatsNodeOrLink_val); int appStatsNodeOrLink_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsNodeOrLink_val_ptr); int appStatsValueType_map(u_long * mib_appStatsValueType_val_ptr, u_long raw_appStatsValueType_val); int appStatsValueType_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsValueType_val_ptr); int appStatsMacAddress1_map(char **mib_appStatsMacAddress1_val_ptr_ptr, size_t *mib_appStatsMacAddress1_val_ptr_len_ptr, char *raw_appStatsMacAddress1_val_ptr, size_t raw_appStatsMacAddress1_val_ptr_len, int allow_realloc); int appStatsMacAddress1_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsMacAddress1_val_ptr_ptr, size_t *appStatsMacAddress1_val_ptr_len_ptr); int appStatsMacAddress2_map(char **mib_appStatsMacAddress2_val_ptr_ptr, size_t *mib_appStatsMacAddress2_val_ptr_len_ptr, char *raw_appStatsMacAddress2_val_ptr, size_t raw_appStatsMacAddress2_val_ptr_len, int allow_realloc); int appStatsMacAddress2_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsMacAddress2_val_ptr_ptr, size_t *appStatsMacAddress2_val_ptr_len_ptr); int appStatsTruthValue_map(u_long * mib_appStatsTruthValue_val_ptr, u_long raw_appStatsTruthValue_val); int appStatsTruthValue_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsTruthValue_val_ptr); int appStatsInteger32_map(long *mib_appStatsInteger32_val_ptr, long raw_appStatsInteger32_val); int appStatsInteger32_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, long *appStatsInteger32_val_ptr); int appStatsUnsigned32_map(u_long * mib_appStatsUnsigned32_val_ptr, u_long raw_appStatsUnsigned32_val); int appStatsUnsigned32_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, u_long * appStatsUnsigned32_val_ptr); int appStatsCounter64_map(U64 * mib_appStatsCounter64_val_ptr, U64 raw_appStatsCounter64_val); int appStatsCounter64_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, U64 * appStatsCounter64_val_ptr); int appStatsOctetString_map(char **mib_appStatsOctetString_val_ptr_ptr, size_t *mib_appStatsOctetString_val_ptr_len_ptr, char *raw_appStatsOctetString_val_ptr, size_t raw_appStatsOctetString_val_ptr_len, int allow_realloc); int appStatsOctetString_get(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, char **appStatsOctetString_val_ptr_ptr, size_t *appStatsOctetString_val_ptr_len_ptr); int dessertAppStatsTable_indexes_set_tbl_idx (dessertAppStatsTable_mib_index * tbl_idx, long appStatsIndex_val); int dessertAppStatsTable_indexes_set(dessertAppStatsTable_rowreq_ctx * rowreq_ctx, long appStatsIndex_val); #ifdef __cplusplus } #endif #endif /* DESSERTAPPSTATSTABLE_DATA_GET_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertSysifTable_interface.h0000644000175000017500000000726511331020526021211 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /** @ingroup interface: Routines to interface to Net-SNMP * * \warning This code should not be modified, called directly, * or used to interpret functionality. It is subject to * change at any time. * * @{ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ #ifndef DESSERTSYSIFTABLE_INTERFACE_H #define DESSERTSYSIFTABLE_INTERFACE_H #ifdef __cplusplus extern "C" { #endif #include "dessertSysifTable.h" /* ******************************************************************** * Table declarations */ /* * PUBLIC interface initialization routine */ void _dessertSysifTable_initialize_interface (dessertSysifTable_registration * user_ctx, u_long flags); void _dessertSysifTable_shutdown_interface (dessertSysifTable_registration * user_ctx); dessertSysifTable_registration *dessertSysifTable_registration_get(void); dessertSysifTable_registration *dessertSysifTable_registration_set(dessertSysifTable_registration * newreg); netsnmp_container *dessertSysifTable_container_get(void); int dessertSysifTable_container_size(void); dessertSysifTable_rowreq_ctx *dessertSysifTable_allocate_rowreq_ctx(void *); void dessertSysifTable_release_rowreq_ctx(dessertSysifTable_rowreq_ctx * rowreq_ctx); int dessertSysifTable_index_to_oid(netsnmp_index * oid_idx, dessertSysifTable_mib_index * mib_idx); int dessertSysifTable_index_from_oid(netsnmp_index * oid_idx, dessertSysifTable_mib_index * mib_idx); /* * access to certain internals. use with caution! */ void dessertSysifTable_valid_columns_set(netsnmp_column_info *vc); #ifdef __cplusplus } #endif #endif /* DESSERTSYSIFTABLE_INTERFACE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_interface.h0000644000175000017500000000726411331020526021326 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /** @ingroup interface: Routines to interface to Net-SNMP * * \warning This code should not be modified, called directly, * or used to interpret functionality. It is subject to * change at any time. * * @{ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ #ifndef DESSERTMESHIFTABLE_INTERFACE_H #define DESSERTMESHIFTABLE_INTERFACE_H #ifdef __cplusplus extern "C" { #endif #include "dessertMeshifTable.h" /* ******************************************************************** * Table declarations */ /* * PUBLIC interface initialization routine */ void _dessertMeshifTable_initialize_interface (dessertMeshifTable_registration * user_ctx, u_long flags); void _dessertMeshifTable_shutdown_interface (dessertMeshifTable_registration * user_ctx); dessertMeshifTable_registration *dessertMeshifTable_registration_get(void); dessertMeshifTable_registration *dessertMeshifTable_registration_set (dessertMeshifTable_registration * newreg); netsnmp_container *dessertMeshifTable_container_get(void); int dessertMeshifTable_container_size(void); dessertMeshifTable_rowreq_ctx *dessertMeshifTable_allocate_rowreq_ctx(void *); void dessertMeshifTable_release_rowreq_ctx(dessertMeshifTable_rowreq_ctx * rowreq_ctx); int dessertMeshifTable_index_to_oid(netsnmp_index * oid_idx, dessertMeshifTable_mib_index * mib_idx); int dessertMeshifTable_index_from_oid(netsnmp_index * oid_idx, dessertMeshifTable_mib_index * mib_idx); /* * access to certain internals. use with caution! */ void dessertMeshifTable_valid_columns_set(netsnmp_column_info *vc); #ifdef __cplusplus } #endif #endif /* DESSERTMESHIFTABLE_INTERFACE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertMeshifTable_data_set.h0000644000175000017500000000110411331020526021135 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ */ #ifndef DESSERTMESHIFTABLE_DATA_SET_H #define DESSERTMESHIFTABLE_DATA_SET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * SET function declarations */ /* ********************************************************************* * SET Table declarations */ #ifdef __cplusplus } #endif #endif /* DESSERTMESHIFTABLE_DATA_SET_H */ libdessert0.87-0.87.2/snmp/dessertAppStatsTable_interface.h0000644000175000017500000000731111331020526021643 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 15899 $ of $ * * $Id:$ */ /** @ingroup interface: Routines to interface to Net-SNMP * * \warning This code should not be modified, called directly, * or used to interpret functionality. It is subject to * change at any time. * * @{ */ /* * ********************************************************************* * ********************************************************************* * ********************************************************************* * *** *** * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE *** * *** *** * *** *** * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. *** * *** *** * *** *** * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND *** * *** *** * *** *** * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. *** * *** *** * *** *** * ********************************************************************* * ********************************************************************* * ********************************************************************* */ #ifndef DESSERTAPPSTATSTABLE_INTERFACE_H #define DESSERTAPPSTATSTABLE_INTERFACE_H #ifdef __cplusplus extern "C" { #endif #include "dessertAppStatsTable.h" /* ******************************************************************** * Table declarations */ /* * PUBLIC interface initialization routine */ void _dessertAppStatsTable_initialize_interface (dessertAppStatsTable_registration * user_ctx, u_long flags); void _dessertAppStatsTable_shutdown_interface (dessertAppStatsTable_registration * user_ctx); dessertAppStatsTable_registration *dessertAppStatsTable_registration_get(void); dessertAppStatsTable_registration *dessertAppStatsTable_registration_set (dessertAppStatsTable_registration * newreg); netsnmp_container *dessertAppStatsTable_container_get(void); int dessertAppStatsTable_container_size(void); dessertAppStatsTable_rowreq_ctx *dessertAppStatsTable_allocate_rowreq_ctx(void); void dessertAppStatsTable_release_rowreq_ctx (dessertAppStatsTable_rowreq_ctx * rowreq_ctx); int dessertAppStatsTable_index_to_oid(netsnmp_index * oid_idx, dessertAppStatsTable_mib_index * mib_idx); int dessertAppStatsTable_index_from_oid(netsnmp_index * oid_idx, dessertAppStatsTable_mib_index * mib_idx); /* * access to certain internals. use with caution! */ void dessertAppStatsTable_valid_columns_set(netsnmp_column_info *vc); #ifdef __cplusplus } #endif #endif /* DESSERTAPPSTATSTABLE_INTERFACE_H */ /** @} */ libdessert0.87-0.87.2/snmp/dessertSysifTable.c0000644000175000017500000001255511331020526017162 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ /** \page MFD helper for dessertSysifTable * * \section intro Introduction * Introductory text. * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertSysifTable.h" #include #include "dessertSysifTable_interface.h" oid dessertSysifTable_oid[] = { DESSERTSYSIFTABLE_OID }; int dessertSysifTable_oid_size = OID_LENGTH(dessertSysifTable_oid); dessertSysifTable_registration dessertSysifTable_user_context; void initialize_table_dessertSysifTable(void); void shutdown_table_dessertSysifTable(void); /** * Initializes the dessertSysifTable module */ void init_dessertSysifTable(void) { DEBUGMSGTL(("verbose:dessertSysifTable:init_dessertSysifTable", "called\n")); /* * TODO:300:o: Perform dessertSysifTable one-time module initialization. */ /* * here we initialize all the tables we're planning on supporting */ if (should_init("dessertSysifTable")) initialize_table_dessertSysifTable(); } /* init_dessertSysifTable */ /** * Shut-down the dessertSysifTable module (agent is exiting) */ void shutdown_dessertSysifTable(void) { if (should_init("dessertSysifTable")) shutdown_table_dessertSysifTable(); } /** * Initialize the table dessertSysifTable * (Define its contents and how it's structured) */ void initialize_table_dessertSysifTable(void) { dessertSysifTable_registration *user_context; u_long flags; DEBUGMSGTL(("verbose:dessertSysifTable:initialize_table_dessertSysifTable", "called\n")); /* * TODO:301:o: Perform dessertSysifTable one-time table initialization. */ /* * TODO:302:o: |->Initialize dessertSysifTable 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("dessertSysifTable", NULL, NULL); /* * No support for any flags yet, but in the future you would * set any flags here. */ flags = 0; /* * call interface initialization code */ _dessertSysifTable_initialize_interface(user_context, flags); } /* initialize_table_dessertSysifTable */ /** * Shutdown the table dessertSysifTable */ void shutdown_table_dessertSysifTable(void) { /* * call interface shutdown code */ _dessertSysifTable_shutdown_interface(&dessertSysifTable_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 dessertSysifTable_rowreq_ctx_init(dessertSysifTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_rowreq_ctx_init", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:210:o: |-> Perform extra dessertSysifTable rowreq initialization. (eg DEFVALS) */ return MFD_SUCCESS; } /* dessertSysifTable_rowreq_ctx_init */ /** * extra context cleanup * */ void dessertSysifTable_rowreq_ctx_cleanup(dessertSysifTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_rowreq_ctx_cleanup", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:211:o: |-> Perform extra dessertSysifTable rowreq cleanup. */ } /* dessertSysifTable_rowreq_ctx_cleanup */ /** * pre-request callback * * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error */ int dessertSysifTable_pre_request(dessertSysifTable_registration * user_context) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_pre_request", "called\n")); /* * TODO:510:o: Perform dessertSysifTable pre-request actions. */ return MFD_SUCCESS; } /* dessertSysifTable_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 dessertSysifTable_post_request(dessertSysifTable_registration * user_context, int rc) { DEBUGMSGTL(("verbose:dessertSysifTable:dessertSysifTable_post_request", "called\n")); /* * TODO:511:o: Perform dessertSysifTable post-request actions. */ return MFD_SUCCESS; } /* dessertSysifTable_post_request */ /** @{ */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_data_access.h0000644000175000017500000000641311331020526022264 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 14170 $ of $ * * $Id:$ */ #ifndef DESSERTAPPPARAMSTABLE_DATA_ACCESS_H #define DESSERTAPPPARAMSTABLE_DATA_ACCESS_H #include "../dessert_internal.h" #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * function declarations */ /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ int dessertAppParamsTable_init_data(dessertAppParamsTable_registration * dessertAppParamsTable_reg); /* * TODO:180:o: Review dessertAppParamsTable cache timeout. * The number of seconds before the cache times out */ #define DESSERTAPPPARAMSTABLE_CACHE_TIMEOUT DESSERT_AGENTX_APPPARAMTABLE_CACHE_TIMEOUT void dessertAppParamsTable_container_init(netsnmp_container ** container_ptr_ptr, netsnmp_cache * cache); void dessertAppParamsTable_container_shutdown(netsnmp_container * container_ptr); int dessertAppParamsTable_container_load(netsnmp_container * container); void dessertAppParamsTable_container_free(netsnmp_container * container); int dessertAppParamsTable_cache_load(netsnmp_container * container); void dessertAppParamsTable_cache_free(netsnmp_container * container); /* *************************************************** *** START EXAMPLE CODE *** ***---------------------------------------------***/ /* ********************************************************************* * Since we have no idea how you really access your data, we'll go with * a worst case example: a flat text file. */ #define MAX_LINE_SIZE 256 /* ***---------------------------------------------*** *** END EXAMPLE CODE *** ***************************************************/ int dessertAppParamsTable_row_prep(dessertAppParamsTable_rowreq_ctx * rowreq_ctx); #ifdef __cplusplus } #endif #endif /* DESSERTAPPPARAMSTABLE_DATA_ACCESS_H */ libdessert0.87-0.87.2/snmp/dessertSysifTable_data_set.h0000644000175000017500000000110111331020526021014 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ */ #ifndef DESSERTSYSIFTABLE_DATA_SET_H #define DESSERTSYSIFTABLE_DATA_SET_H #ifdef __cplusplus extern "C" { #endif /* ********************************************************************* * SET function declarations */ /* ********************************************************************* * SET Table declarations */ #ifdef __cplusplus } #endif #endif /* DESSERTSYSIFTABLE_DATA_SET_H */ libdessert0.87-0.87.2/snmp/dessertAppParamsTable_data_set.c0000644000175000017500000012216211331020526021611 0ustar dvddvd/* * Note: this file originally auto-generated by mib2c using * version : 12077 $ of $ * * $Id:$ * */ /* * standard Net-SNMP includes */ #include #include #include /* * include our parent header */ #include "dessertAppParamsTable.h" #include "dessertAppParamsTable_enums.h" #include "../dessert_internal.h" /** @defgroup data_set data_set: Routines to set data * * These routines are used to set the value for individual objects. The * row context is passed, along with the new value. * * @{ */ /********************************************************************** ********************************************************************** *** *** Table dessertAppParamsTable *** ********************************************************************** **********************************************************************/ /* * DESSERT-MIB::dessertAppParamsTable is subid 9 of dessertObjects. * Its status is Current. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9, length: 13 */ /* * NOTE: if you update this chart, please update the versions in * local/mib2c-conf.d/parent-set.m2i * agent/mibgroup/helpers/baby_steps.c * while you're at it. */ /* *********************************************************************** * Baby Steps Flow Chart (2004.06.05) * * * * +--------------+ +================+ U = unconditional path * * |optional state| ||required state|| S = path for success * * +--------------+ +================+ E = path for error * *********************************************************************** * * +--------------+ * | pre | * | request | * +--------------+ * | U * +==============+ * +----------------|| object || * | E || lookup || * | +==============+ * | | S * | +==============+ * | E || check || * |<---------------|| values || * | +==============+ * | | S * | +==============+ * | +<-------|| undo || * | | E || setup || * | | +==============+ * | | | S * | | +==============+ * | | || set ||-------------------------->+ * | | || value || E | * | | +==============+ | * | | | S | * | | +--------------+ | * | | | check |-------------------------->| * | | | consistency | E | * | | +--------------+ | * | | | S | * | | +==============+ +==============+ | * | | || commit ||-------->|| undo || | * | | || || E || commit || | * | | +==============+ +==============+ | * | | | S U |<--------+ * | | +--------------+ +==============+ * | | | irreversible | || undo || * | | | commit | || set || * | | +--------------+ +==============+ * | | | U U | * | +-------------->|<------------------------+ * | +==============+ * | || undo || * | || cleanup || * | +==============+ * +---------------------->| U * +--------------+ * | post | * | request | * +--------------+ * */ /** * Setup up context with information needed to undo a set request. * * This function will be called before the individual node undo setup * functions are called. If you need to do any undo setup that is not * related to a specific column, you can do it here. * * Note that the undo context has been allocated with * dessertAppParamsTable_allocate_data(), but may need extra * initialization similar to what you may have done in * dessertAppParamsTable_rowreq_ctx_init(). * Note that an individual node's undo_setup function will only be called * if that node is being set to a new value. * * If there is any setup specific to a particular column (e.g. allocating * memory for a string), you should do that setup in the node's undo_setup * function, so it won't be done unless it is necessary. * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. */ int dessertAppParamsTable_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_undo_setup", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:451:M: |-> Setup dessertAppParamsTable undo. * set up dessertAppParamsTable undo information, in preparation for a set. * Undo storage is in (* appParamsOctetString_val_ptr_ptr )* */ return rc; } /* dessertAppParamsTable_undo_setup */ /** * Undo a set request. * * This function will be called before the individual node undo * functions are called. If you need to do any undo that is not * related to a specific column, you can do it here. * * Note that an individual node's undo function will only be called * if that node is being set to a new value. * * If there is anything specific to a particular column (e.g. releasing * memory for a string), you should do that setup in the node's undo * function, so it won't be done unless it is necessary. * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. */ int dessertAppParamsTable_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_undo", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:451:M: |-> dessertAppParamsTable undo. * dessertAppParamsTable undo information, in response to a failed set. * Undo storage is in (* appParamsOctetString_val_ptr_ptr )* */ return rc; } /* dessertAppParamsTable_undo_setup */ /** * Cleanup up context undo information. * * This function will be called after set/commit processing. If you * allocated any resources in undo_setup, this is the place to release * those resources. * * This function is called regardless of the success or failure of the set * request. If you need to perform different steps for cleanup depending * on success or failure, you can add a flag to the rowreq_ctx. * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error */ int dessertAppParamsTable_undo_cleanup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_undo_cleanup", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:452:M: |-> Cleanup dessertAppParamsTable undo. * Undo storage is in (* appParamsOctetString_val_ptr_ptr )* */ return rc; } /* dessertAppParamsTable_undo_cleanup */ /** * commit new values. * * At this point, you should have done everything you can to ensure that * this commit will not fail. * * Should you need different behavior depending on which columns were * set, rowreq_ctx->column_set_flags will indicate which writeable columns were * set. The definitions for the COLUMN_*_FLAG bits can be found in * dessertAppParamsTable_oids.h. * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags. * * @param dessertAppParamsTable_rowreq_ctx * Pointer to the users context. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error */ int dessertAppParamsTable_commit(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { int rc = MFD_SUCCESS; int save_flags; dessert_agentx_appparams_t *appparam; dessert_agentx_appparamscb_set_t *set; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_commit", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); set = _dessert_agentx_appparams_getsettercbforindex(rowreq_ctx->tbl_idx.appParamsIndex); if (set == NULL) { snmp_log( LOG_ERR, "dessertAppParamsTable commit failed, no setter for index %ld!\n", rowreq_ctx->tbl_idx.appParamsIndex); return MFD_ERROR; } /* * save flags, then clear until we actually do something */ save_flags = rowreq_ctx->column_set_flags; rowreq_ctx->column_set_flags = 0; appparam = malloc(sizeof(dessert_agentx_appparams_t)); appparam->index = rowreq_ctx->tbl_idx.appParamsIndex; appparam->value_type = rowreq_ctx->data.appParamsValueType; dessert_debug("commit\n" "\n\t\trowreq_ctx->tbl_idx \t[%u]" "\n\t\trowreq_ctx->data.appParamsValueType \t[%u]" "\n\t\trowreq_ctx->data.appParamsTruthValue \t[%u]" "\n\t\trowreq_ctx->data.appParamsInteger32 \t[%d]" "\n\t\trowreq_ctx->data.appParamsUnsigned32 \t[%u]" "\n\t\trowreq_ctx->data.appParamsOctetString_len \t[%u]" "\n",rowreq_ctx->tbl_idx, rowreq_ctx->data.appParamsValueType, rowreq_ctx->data.appParamsTruthValue, rowreq_ctx->data.appParamsInteger32, rowreq_ctx->data.appParamsUnsigned32, rowreq_ctx->data.appParamsOctetString_len ); /* * commit dessertAppParamsTable data * 1) check the column's flag in save_flags to see if it was set. * 2) clear the flag when you handle that column * 3) set the column's flag in column_set_flags if it needs undo * processing in case of a failure. */ if (save_flags & COLUMN_APPPARAMSTRUTHVALUE_FLAG) { /* clear appParamsTruthValue */ save_flags &= ~COLUMN_APPPARAMSTRUTHVALUE_FLAG; /* * commit column appParamsTruthValue. */ appparam->bool = rowreq_ctx->data.appParamsTruthValue; rc = set(appparam); if (DESSERT_ERR == rc) { snmp_log(LOG_ERR, "dessertAppParamsTable column appParamsTruthValue commit failed\n"); } else { /* * set flag, in case we need to undo appParamsTruthValue */ rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSTRUTHVALUE_FLAG; } } if (save_flags & COLUMN_APPPARAMSINTEGER32_FLAG) { /* clear appParamsInteger32 */ save_flags &= ~COLUMN_APPPARAMSINTEGER32_FLAG; /* * commit column appParamsInteger32. */ appparam->int32 = rowreq_ctx->data.appParamsInteger32; rc = set(appparam); if (DESSERT_ERR == rc) { snmp_log(LOG_ERR, "dessertAppParamsTable column appParamsInteger32 commit failed\n"); } else { /* * set flag, in case we need to undo appParamsInteger32 */ rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSINTEGER32_FLAG; } } if (save_flags & COLUMN_APPPARAMSUNSIGNED32_FLAG) { /* clear appParamsUnsigned32 */ save_flags &= ~COLUMN_APPPARAMSUNSIGNED32_FLAG; /* * commit column appParamsUnsigned32. */ appparam->uint32 = rowreq_ctx->data.appParamsUnsigned32; rc = set(appparam); if (DESSERT_ERR == rc) { snmp_log(LOG_ERR, "dessertAppParamsTable column appParamsUnsigned32 commit failed\n"); } else { /* * set flag, in case we need to undo appParamsUnsigned32 */ rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSUNSIGNED32_FLAG; } } if (save_flags & COLUMN_APPPARAMSOCTETSTRING_FLAG) { /* clear appParamsOctetString */ save_flags &= ~COLUMN_APPPARAMSOCTETSTRING_FLAG; /* * TODO:482:o: |-> commit column appParamsOctetString. */ appparam->octetstring_len = rowreq_ctx->data.appParamsOctetString_len; appparam->octetstring = malloc(sizeof(char) * appparam->octetstring_len); memcpy(appparam->octetstring, rowreq_ctx->data.appParamsOctetString, rowreq_ctx->data.appParamsOctetString_len * sizeof(rowreq_ctx->data.appParamsOctetString[0])); rc = set(appparam); if (DESSERT_ERR == rc) { snmp_log(LOG_ERR, "dessertAppParamsTable column appParamsOctetString commit failed\n"); } else { /* * set flag, in case we need to undo appParamsOctetString */ dessert_debug("dessertAppParamsTable column appParamsOctetString committed"); rowreq_ctx->column_set_flags |= COLUMN_APPPARAMSOCTETSTRING_FLAG; } } if (rc == DESSERT_ERR) rc = -1; else {rc = MFD_SUCCESS;} /* * if we successfully committed this row, set the dirty flag. */ if (MFD_SUCCESS == rc) { rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY; } if (save_flags) { snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags); return MFD_ERROR; } _dessert_agentx_appparams_free(appparam); return rc; } /* dessertAppParamsTable_commit */ /** * undo commit new values. * * Should you need different behavior depending on which columns were * set, rowreq_ctx->column_set_flags will indicate which writeable columns were * set. The definitions for the COLUMN_*_FLAG bits can be found in * dessertAppParamsTable_oids.h. * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags. * * @param dessertAppParamsTable_rowreq_ctx * Pointer to the users context. * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error */ int dessertAppParamsTable_undo_commit(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:dessertAppParamsTable:dessertAppParamsTable_undo_commit", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:485:M: |-> Undo dessertAppParamsTable commit. * check the column's flag in rowreq_ctx->column_set_flags to see * if it was set during commit, then undo it. * * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {} */ /* * if we successfully un-committed this row, clear the dirty flag. */ if (MFD_SUCCESS == rc) { rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY; } return rc; } /* dessertAppParamsTable_undo_commit */ /* * TODO:440:M: Implement dessertAppParamsTable node value checks. * TODO:450:M: Implement dessertAppParamsTable undo functions. * TODO:460:M: Implement dessertAppParamsTable set functions. * TODO:480:M: Implement dessertAppParamsTable commit functions. */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsTruthValue * appParamsTruthValue is subid 5 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.5 * Description: A parameter with TruthValue semantics. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * Enum range: 2/8. Values: true(1), false(2) * * Its syntax is TruthValue (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) */ /** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsTruthValue_val * A long containing the new value. * * @retval MFD_SUCCESS : incoming value is legal * @retval MFD_NOT_VALID_NOW : incoming value is not valid now * @retval MFD_NOT_VALID_EVER : incoming value is never valid * * This is the place to check for requirements that are not * expressed in the mib syntax (for example, a requirement that * is detailed in the description for an object). * * You should check that the requested change between the undo value and the * new value is legal (ie, the transistion from one value to another * is legal). * *@note * This check is only to determine if the new value * is \b potentially valid. This is the first check of many, and * is one of the simplest ones. * *@note * this is not the place to do any checks for values * which depend on some other value in the mib. Those * types of checks should be done in the * dessertAppParamsTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_INTEGER * The value is one of true(1), false(2) * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */ int appParamsTruthValue_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsTruthValue_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsTruthValue_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * Check for valid appParamsTruthValue value. */ if (rowreq_ctx->data.appParamsValueType != DESSERT_APPPARAMS_VALUETYPE_BOOL) { return MFD_NOT_VALID_EVER; } else { return MFD_SUCCESS; /* appParamsTruthValue value not illegal */ } } /* appParamsTruthValue_check_value */ /** * Save old value information * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. * * This function will be called after the table level undo setup function * dessertAppParamsTable_undo_setup has been called. * *@note * this function will only be called if a new value is set for this column. * * If there is any setup specific to a particular column (e.g. allocating * memory for a string), you should do that setup in this function, so it * won't be done unless it is necessary. */ int appParamsTruthValue_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsTruthValue_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup appParamsTruthValue undo. */ /* * copy appParamsTruthValue data * set rowreq_ctx->undo->appParamsTruthValue from rowreq_ctx->data.appParamsTruthValue */ rowreq_ctx->undo->appParamsTruthValue = rowreq_ctx->data.appParamsTruthValue; return MFD_SUCCESS; } /* appParamsTruthValue_undo_setup */ /** * Set the new value. * * @param rowreq_ctx * Pointer to the users context. You should know how to * manipulate the value from this object. * @param appParamsTruthValue_val * A long containing the new value. */ int appParamsTruthValue_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsTruthValue_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsTruthValue_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:245:o: |-> Implement appParamsTruthValue reverse mapping. * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. */ /* *************************************************** *** START EXAMPLE CODE *** ***---------------------------------------------***/ switch (appParamsTruthValue_val) { case TRUTHVALUE_TRUE: rowreq_ctx->data.appParamsTruthValue = INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSTRUTHVALUE_TRUE; break; case TRUTHVALUE_FALSE: rowreq_ctx->data.appParamsTruthValue = INTERNAL_DESSERTAPPPARAMSTABLE_APPPARAMSTRUTHVALUE_FALSE; break; default: snmp_log(LOG_ERR, "couldn't reverse map value %ld for appParamsTruthValue\n", appParamsTruthValue_val); return SNMP_ERR_GENERR; } /* ***---------------------------------------------*** *** END EXAMPLE CODE *** ***************************************************/ return MFD_SUCCESS; } /* appParamsTruthValue_set */ /** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */ int appParamsTruthValue_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsTruthValue_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up appParamsTruthValue undo. */ /* * copy appParamsTruthValue data * set rowreq_ctx->data.appParamsTruthValue from rowreq_ctx->undo->appParamsTruthValue */ rowreq_ctx->data.appParamsTruthValue = rowreq_ctx->undo->appParamsTruthValue; return MFD_SUCCESS; } /* appParamsTruthValue_undo */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsInteger32 * appParamsInteger32 is subid 6 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.6 * Description: A parameter with Integer32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) */ /** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsInteger32_val * A long containing the new value. * * @retval MFD_SUCCESS : incoming value is legal * @retval MFD_NOT_VALID_NOW : incoming value is not valid now * @retval MFD_NOT_VALID_EVER : incoming value is never valid * * This is the place to check for requirements that are not * expressed in the mib syntax (for example, a requirement that * is detailed in the description for an object). * * You should check that the requested change between the undo value and the * new value is legal (ie, the transistion from one value to another * is legal). * *@note * This check is only to determine if the new value * is \b potentially valid. This is the first check of many, and * is one of the simplest ones. * *@note * this is not the place to do any checks for values * which depend on some other value in the mib. Those * types of checks should be done in the * dessertAppParamsTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_INTEGER * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */ int appParamsInteger32_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long appParamsInteger32_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsInteger32_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * Check for valid appParamsInteger32 value. */ dessert_debug("check_value\n\t\trowreq_ctx->data.appParamsValueType [%d]",rowreq_ctx->data.appParamsValueType); if (rowreq_ctx->data.appParamsValueType != DESSERT_APPPARAMS_VALUETYPE_INT32) { return MFD_NOT_VALID_EVER; } else { return MFD_SUCCESS; /* appParamsInteger32 value not illegal */ } } /* appParamsInteger32_check_value */ /** * Save old value information * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. * * This function will be called after the table level undo setup function * dessertAppParamsTable_undo_setup has been called. * *@note * this function will only be called if a new value is set for this column. * * If there is any setup specific to a particular column (e.g. allocating * memory for a string), you should do that setup in this function, so it * won't be done unless it is necessary. */ int appParamsInteger32_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsInteger32_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup appParamsInteger32 undo. */ /* * copy appParamsInteger32 data * set rowreq_ctx->undo->appParamsInteger32 from rowreq_ctx->data.appParamsInteger32 */ rowreq_ctx->undo->appParamsInteger32 = rowreq_ctx->data.appParamsInteger32; return MFD_SUCCESS; } /* appParamsInteger32_undo_setup */ /** * Set the new value. * * @param rowreq_ctx * Pointer to the users context. You should know how to * manipulate the value from this object. * @param appParamsInteger32_val * A long containing the new value. */ int appParamsInteger32_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, long appParamsInteger32_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsInteger32_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:245:o: |-> Implement appParamsInteger32 reverse mapping. * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. */ /* * TODO:461:M: |-> Set appParamsInteger32 value. * set appParamsInteger32 value in rowreq_ctx->data */ rowreq_ctx->data.appParamsInteger32 = appParamsInteger32_val; return MFD_SUCCESS; } /* appParamsInteger32_set */ /** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */ int appParamsInteger32_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsInteger32_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up appParamsInteger32 undo. */ /* * copy appParamsInteger32 data * set rowreq_ctx->data.appParamsInteger32 from rowreq_ctx->undo->appParamsInteger32 */ rowreq_ctx->data.appParamsInteger32 = rowreq_ctx->undo->appParamsInteger32; return MFD_SUCCESS; } /* appParamsInteger32_undo */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsUnsigned32 * appParamsUnsigned32 is subid 7 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.7 * Description: A parameter with Unsigned32 semantics. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) */ /** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsUnsigned32_val * A u_long containing the new value. * * @retval MFD_SUCCESS : incoming value is legal * @retval MFD_NOT_VALID_NOW : incoming value is not valid now * @retval MFD_NOT_VALID_EVER : incoming value is never valid * * This is the place to check for requirements that are not * expressed in the mib syntax (for example, a requirement that * is detailed in the description for an object). * * You should check that the requested change between the undo value and the * new value is legal (ie, the transistion from one value to another * is legal). * *@note * This check is only to determine if the new value * is \b potentially valid. This is the first check of many, and * is one of the simplest ones. * *@note * this is not the place to do any checks for values * which depend on some other value in the mib. Those * types of checks should be done in the * dessertAppParamsTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_UNSIGNED * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */ int appParamsUnsigned32_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsUnsigned32_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsUnsigned32_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:441:o: |-> Check for valid appParamsUnsigned32 value. */ if (rowreq_ctx->data.appParamsValueType != DESSERT_APPPARAMS_VALUETYPE_UINT32) { return MFD_NOT_VALID_EVER; } else { return MFD_SUCCESS; /* appParamsUnsigned32 value not illegal */ } } /* appParamsUnsigned32_check_value */ /** * Save old value information * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. * * This function will be called after the table level undo setup function * dessertAppParamsTable_undo_setup has been called. * *@note * this function will only be called if a new value is set for this column. * * If there is any setup specific to a particular column (e.g. allocating * memory for a string), you should do that setup in this function, so it * won't be done unless it is necessary. */ int appParamsUnsigned32_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsUnsigned32_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup appParamsUnsigned32 undo. */ /* * copy appParamsUnsigned32 data * set rowreq_ctx->undo->appParamsUnsigned32 from rowreq_ctx->data.appParamsUnsigned32 */ rowreq_ctx->undo->appParamsUnsigned32 = rowreq_ctx->data.appParamsUnsigned32; return MFD_SUCCESS; } /* appParamsUnsigned32_undo_setup */ /** * Set the new value. * * @param rowreq_ctx * Pointer to the users context. You should know how to * manipulate the value from this object. * @param appParamsUnsigned32_val * A u_long containing the new value. */ int appParamsUnsigned32_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, u_long appParamsUnsigned32_val) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsUnsigned32_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:245:o: |-> Implement appParamsUnsigned32 reverse mapping. * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. */ /* * TODO:461:M: |-> Set appParamsUnsigned32 value. * set appParamsUnsigned32 value in rowreq_ctx->data */ rowreq_ctx->data.appParamsUnsigned32 = appParamsUnsigned32_val; return MFD_SUCCESS; } /* appParamsUnsigned32_set */ /** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */ int appParamsUnsigned32_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsUnsigned32_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up appParamsUnsigned32 undo. */ /* * copy appParamsUnsigned32 data * set rowreq_ctx->data.appParamsUnsigned32 from rowreq_ctx->undo->appParamsUnsigned32 */ rowreq_ctx->data.appParamsUnsigned32 = rowreq_ctx->undo->appParamsUnsigned32; return MFD_SUCCESS; } /* appParamsUnsigned32_undo */ /*--------------------------------------------------------------------- * DESSERT-MIB::dessertAppParamsEntry.appParamsOctetString * appParamsOctetString is subid 9 of dessertAppParamsEntry. * Its status is Current, and its access level is ReadWrite. * OID: .1.3.6.1.4.1.18898.0.19.10.1.1.9.1.9 * Description: A parameter containing of up to 1024 octets. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 1 * hint: 1024a * * Ranges: 0 - 1024; * * Its syntax is DessertApplicationOctetString (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 1024) */ /** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx * Pointer to the row request context. * @param appParamsOctetString_val_ptr * A char containing the new value. * @param appParamsOctetString_val_ptr_len * The size (in bytes) of the data pointed to by appParamsOctetString_val_ptr * * @retval MFD_SUCCESS : incoming value is legal * @retval MFD_NOT_VALID_NOW : incoming value is not valid now * @retval MFD_NOT_VALID_EVER : incoming value is never valid * * This is the place to check for requirements that are not * expressed in the mib syntax (for example, a requirement that * is detailed in the description for an object). * * You should check that the requested change between the undo value and the * new value is legal (ie, the transistion from one value to another * is legal). * *@note * This check is only to determine if the new value * is \b potentially valid. This is the first check of many, and * is one of the simplest ones. * *@note * this is not the place to do any checks for values * which depend on some other value in the mib. Those * types of checks should be done in the * dessertAppParamsTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_OCTET_STR * The length is < sizeof(rowreq_ctx->data.appParamsOctetString). * The length is in (one of) the range set(s): 0 - 1024 * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */ int appParamsOctetString_check_value(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsOctetString_val_ptr, size_t appParamsOctetString_val_ptr_len) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsOctetString_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); netsnmp_assert(NULL != appParamsOctetString_val_ptr); /* * TODO:441:o: |-> Check for valid appParamsOctetString value. */ if (rowreq_ctx->data.appParamsValueType != DESSERT_APPPARAMS_VALUETYPE_OCTETSTRING) { return MFD_NOT_VALID_EVER; } else { return MFD_SUCCESS; /* appParamsOctetString value not illegal */ } } /* appParamsOctetString_check_value */ /** * Save old value information * * @param rowreq_ctx * Pointer to the table context (dessertAppParamsTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. * * This function will be called after the table level undo setup function * dessertAppParamsTable_undo_setup has been called. * *@note * this function will only be called if a new value is set for this column. * * If there is any setup specific to a particular column (e.g. allocating * memory for a string), you should do that setup in this function, so it * won't be done unless it is necessary. */ int appParamsOctetString_undo_setup(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsOctetString_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup appParamsOctetString undo. */ /* * copy appParamsOctetString and appParamsOctetString_len data * set rowreq_ctx->undo->appParamsOctetString from rowreq_ctx->data.appParamsOctetString */ memcpy(rowreq_ctx->undo->appParamsOctetString, rowreq_ctx->data.appParamsOctetString, (rowreq_ctx->data.appParamsOctetString_len * sizeof(rowreq_ctx->undo->appParamsOctetString[0]))); rowreq_ctx->undo->appParamsOctetString_len = rowreq_ctx->data.appParamsOctetString_len; return MFD_SUCCESS; } /* appParamsOctetString_undo_setup */ /** * Set the new value. * * @param rowreq_ctx * Pointer to the users context. You should know how to * manipulate the value from this object. * @param appParamsOctetString_val_ptr * A char containing the new value. * @param appParamsOctetString_val_ptr_len * The size (in bytes) of the data pointed to by appParamsOctetString_val_ptr */ int appParamsOctetString_set(dessertAppParamsTable_rowreq_ctx * rowreq_ctx, char *appParamsOctetString_val_ptr, size_t appParamsOctetString_val_ptr_len) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsOctetString_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); netsnmp_assert(NULL != appParamsOctetString_val_ptr); /* * TODO:245:o: |-> Implement appParamsOctetString reverse mapping. * If the values for your data type don't exactly match the * possible values defined by the mib, you should map them here. */ /* * TODO:461:M: |-> Set appParamsOctetString value. * set appParamsOctetString value in rowreq_ctx->data */ memcpy(rowreq_ctx->data.appParamsOctetString, appParamsOctetString_val_ptr, appParamsOctetString_val_ptr_len); /** convert bytes to number of char */ rowreq_ctx->data.appParamsOctetString_len = appParamsOctetString_val_ptr_len / sizeof(appParamsOctetString_val_ptr[0]); return MFD_SUCCESS; } /* appParamsOctetString_set */ /** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */ int appParamsOctetString_undo(dessertAppParamsTable_rowreq_ctx * rowreq_ctx) { DEBUGMSGTL(("verbose:dessertAppParamsTable:appParamsOctetString_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up appParamsOctetString undo. */ /* * copy appParamsOctetString and appParamsOctetString_len data * set rowreq_ctx->data.appParamsOctetString from rowreq_ctx->undo->appParamsOctetString */ memcpy(rowreq_ctx->data.appParamsOctetString, rowreq_ctx->undo->appParamsOctetString, (rowreq_ctx->undo->appParamsOctetString_len * sizeof(rowreq_ctx->data.appParamsOctetString[0]))); rowreq_ctx->data.appParamsOctetString_len = rowreq_ctx->undo->appParamsOctetString_len; return MFD_SUCCESS; } /* appParamsOctetString_undo */ /** @} */ libdessert0.87-0.87.2/dessert_meshiface.c0000644000175000017500000010007011331020526016211 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" #ifdef TARGET_FREEBSD #include #include #endif /* global data storage // P U B L I C */ /* nothing here - yet */ /* global data storage // P R I V A T E */ /* nothing here - yet */ /* local data storage*/ dessert_meshif_t *_dessert_meshiflist = NULL; pthread_mutex_t _dessert_meshiflist_mutex = PTHREAD_MUTEX_INITIALIZER; int _dessert_meshiflist_len = 0; int _dessert_meshiflist_perm_count = 0; int _dessert_meshiflist_current_perm = 0; dessert_meshif_t ***_dessert_meshiflist_perms = NULL; dessert_meshrxcbe_t *_dessert_meshrxcblist; int _dessert_meshrxcblistver = 0; /* internal functions forward declarations*/ static void _dessert_packet_process(u_char *args, const struct pcap_pkthdr *header, const u_char *packet); static void *_dessert_meshif_add_thread(void* arg); static inline int _dessert_meshsend_if2(dessert_msg_t* msg, dessert_meshif_t *iface); static void _dessert_meshif_cleanup(dessert_meshif_t *meshif); static void _dessert_meshiflist_update_permutations(void); static inline int DL_LENGTH(dessert_meshif_t *l); static inline void list2array(dessert_meshif_t *l, dessert_meshif_t **a, int len); static inline int fact(int i); static inline void permutation(int k, int len, dessert_meshif_t **a); /****************************************************************************** * * EXTERNAL / PUBLIC * * M E S H - I N T E R F A C E S * ******************************************************************************/ /****************************************************************************** * sending messages ******************************************************************************/ /** Sends a \b dessert \b message via the specified interface or all interfaces. * * The original message buffer will not be altered, and the ethernet src address * will be set correctly * * @param[in] *msgin message to send * @param[in] *iface interface to send from - use NULL for all interfaces * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend(const dessert_msg_t* msgin, const dessert_meshif_t *iface) { dessert_msg_t* msg; int res; /* check message - we only send valid messages! */ if (dessert_msg_check(msgin, msgin->hlen + msgin->plen)) { dessert_warn("will not send invalid message - aborting"); return EINVAL; } /* clone message */ dessert_msg_clone(&msg, msgin, 1); res = dessert_meshsend_fast(msg, iface); dessert_msg_destroy(msg); return res; } /** Sends a \b dessert \b message via all interfaces, except via the specified interface. * * The original message buffer will not be altered, and the ethernet src address will be set correctly. * * @param[in] *msgin message to send * @param[in] *iface interface NOT to send from - use NULL for all interfaces * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_allbutone(const dessert_msg_t* msgin, const dessert_meshif_t *iface) { dessert_msg_t* msg; int res; /* check message - we only send valid messages! */ if (dessert_msg_check(msgin, msgin->hlen + msgin->plen)) { dessert_warn("will not send invalid message - aborting"); return EINVAL; } /* clone message */ dessert_msg_clone(&msg, msgin, 1); res = dessert_meshsend_fast_allbutone(msg, iface); dessert_msg_destroy(msg); return res; } /** Sends a \b dessert \b message via the interface which is identified by the given hardware address. * * The original message buffer will not be altered, and the ethernet src address * will be set correctly. * * @param[in] *msgin message to send * @param[in] *hwaddr hardware address of the interface to send from * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_hwaddr(const dessert_msg_t* msgin, const uint8_t hwaddr[ETHER_ADDR_LEN]) { dessert_msg_t* msg; int res; /* check message - we only send valid messages! */ if (dessert_msg_check(msgin, msgin->hlen + msgin->plen)) { dessert_warn("will not send invalid message - aborting"); return EINVAL; } /* clone message */ dessert_msg_clone(&msg, msgin, 1); res = dessert_meshsend_fast_hwaddr(msg, hwaddr); dessert_msg_destroy(msg); return res; } /** Sends a \b dessert \b message via all interfaces in a randomized fashion. * * The original message buffer will not be altered, and the ethernet src address * will be set correctly. * * @param[in] *msgin message to send * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_randomized(const dessert_msg_t* msgin) { dessert_msg_t* msg; int res; /* check message - we only send valid messages! */ if (dessert_msg_check(msgin, msgin->hlen + msgin->plen)) { dessert_warn("will not send invalid message - aborting"); return EINVAL; } /* clone message */ dessert_msg_clone(&msg, msgin, 1); res = dessert_meshsend_fast_randomized(msg); dessert_msg_destroy(msg); return res; } /** Sends a \b dessert \b message fast via the specified interface or all interfaces. * * This method is faster than dessert_meshsend(), but does not check the message * and may alter the message buffer. * * @param[in] *msg message to send * @param[in] *iface interface to send from * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_fast(dessert_msg_t* msg, const dessert_meshif_t *iface) { int res = 0; /* we have no iface - send on all! */ if (iface == NULL) { pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, iface) { /* set shost */ memcpy(msg->l2h.ether_shost, iface->hwaddr, ETHER_ADDR_LEN); /* send */ res = _dessert_meshsend_if2(msg, iface); if (res) { break; } } pthread_rwlock_unlock(&dessert_cfglock); } else { /* set shost */ memcpy(msg->l2h.ether_shost, iface->hwaddr, ETHER_ADDR_LEN); /* send */ res = _dessert_meshsend_if2(msg, iface); } return (res); } /** Sends a \b dessert \b message fast via all interfaces, except the specified interface. * * This method is faster than dessert_meshsend_allbutone(), but does not check the message * and may alter the message buffer. * * @param[in] *msg message to send * @param[in] *iface interface to NOT send from - use NULL for all interfaces * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_fast_allbutone(dessert_msg_t* msg, const dessert_meshif_t *iface) { dessert_meshif_t *curr_iface; int res = 0; /* we have no iface - send on all! */ if (iface == NULL) { pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, curr_iface) { /* set shost */ memcpy(msg->l2h.ether_shost, iface->hwaddr, ETHER_ADDR_LEN); /* send */ res = _dessert_meshsend_if2(msg, iface); if (res) { break; } } pthread_rwlock_unlock(&dessert_cfglock); } else { pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, curr_iface) { /* skip if it is the 'allbutone' interface */ if (curr_iface == iface) curr_iface = curr_iface->next; /* set shost */ memcpy(msg->l2h.ether_shost, iface->hwaddr, ETHER_ADDR_LEN); /* send */ res = _dessert_meshsend_if2(msg, iface); if (res) { break; } } pthread_rwlock_unlock(&dessert_cfglock); } return (res); } /** Sends a \b dessert \b message fast via the interface specified by the given * hardware address. * * This method is faster than dessert_meshsend_hwaddr(), but does not check the message * and may alter the message buffer. * * @param[in] *msg message to send * @param[in] *hwaddr hardware address of the interface to send from * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_fast_hwaddr(dessert_msg_t* msg, const uint8_t hwaddr[ETHER_ADDR_LEN]) { int res; dessert_meshif_t *meshif; pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, meshif) { if (memcmp(meshif->hwaddr, hwaddr, ETHER_ADDR_LEN) == 0) break; } pthread_rwlock_unlock(&dessert_cfglock); if (likely(meshif != NULL)) { /* set shost */ memcpy(msg->l2h.ether_shost, meshif->hwaddr, ETHER_ADDR_LEN); /* send */ res = _dessert_meshsend_if2(msg, meshif); } else { dessert_err("No such interface - aborting"); return ENODEV; } return (res); } /** Sends a \b dessert \b message fast via all interfaces in a randomized fashion. * * This method is faster than dessert_meshsend_randomized(), but does not check * the message and may alter the message buffer. * * @param[in] *msgin message to send * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_fast_randomized(dessert_msg_t* msgin) { int i; int res = 0; pthread_mutex_lock(&_dessert_meshiflist_mutex); for (i = 0; i < _dessert_meshiflist_len; i++) { res = dessert_meshsend_fast(msgin, _dessert_meshiflist_perms[_dessert_meshiflist_current_perm][i]); if (res) { break; } } if (_dessert_meshiflist_perm_count > 0) { _dessert_meshiflist_current_perm = (_dessert_meshiflist_current_perm + 1) % _dessert_meshiflist_perm_count; } pthread_mutex_unlock(&_dessert_meshiflist_mutex); return res; } /** Sends a @b dessert @b message @a msg via the specified interface @a iface or * all interfaces. * * This method is faster than dessert_meshsend(), but does not check the message * and may alter the message buffer. In contrast to dessert_meshsend_fast() it * does not write the ether_shost address. * * @param[in] *msg message to send * @param[in] *iface interface to send from * * @retval DESSERT_OK on success * @retval EINVAL if message is broken * @retval EIO if message was not sent successfully * * %DESCRIPTION: * **/ int dessert_meshsend_raw(dessert_msg_t* msg, const dessert_meshif_t *iface) { int res = 0; if (iface == NULL) { pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, iface) { res = _dessert_meshsend_if2(msg, iface); if (res) { break; } } pthread_rwlock_unlock(&dessert_cfglock); } else { res = _dessert_meshsend_if2(msg, iface); } return (res); } /****************************************************************************** * meshrx-callback handling ******************************************************************************/ /** Removes all occurrences of the given callback function @a c from the meshrx * pipeline. * * @param[in] c callback function pointer * * @retval DESSERT_OK on success * @retval DESSERT_ERR otherwise * * %DESCRIPTION: * **/ int dessert_meshrxcb_del(dessert_meshrxcb_t* c) { int count = 0; dessert_meshrxcbe_t *i, *last; pthread_rwlock_wrlock(&dessert_cfglock); if (_dessert_meshrxcblist == NULL) { count++; goto dessert_meshrxcb_del_out; } while (_dessert_meshrxcblist->c == c) { count++; i = _dessert_meshrxcblist; _dessert_meshrxcblist = _dessert_meshrxcblist->next; free(i); if (_dessert_meshrxcblist == NULL) { goto dessert_meshrxcb_del_out; } } for (i = _dessert_meshrxcblist; i->next != NULL; i = i->next) { if (i->c == c) { count++; last->next = i->next; free(i); i = last; } last = i; } dessert_meshrxcb_del_out: _dessert_meshrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return ((count > 0) ? DESSERT_OK : DESSERT_ERR); } /** Adds a callback function to the meshrx pipeline. * * The callback going to get called if a packet is received via a dessert interface. * * @param[in] c callback function * @param[in] prio priority of the function - lower first! * * @retval DESSERT_OK on success * @retval -errno on error * * %DESCRIPTION: * **/ int dessert_meshrxcb_add(dessert_meshrxcb_t* c, int prio) { dessert_meshrxcbe_t *cb, *i; cb = (dessert_meshrxcbe_t *) malloc(sizeof(dessert_meshrxcbe_t)); if (cb == NULL) return (-errno); pthread_rwlock_wrlock(&dessert_cfglock); cb->c = c; cb->prio = prio; cb->next = NULL; if (_dessert_meshrxcblist == NULL) { _dessert_meshrxcblist = cb; _dessert_meshrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_OK; } if (_dessert_meshrxcblist->prio > cb->prio) { cb->next = _dessert_meshrxcblist; _dessert_meshrxcblist = cb; _dessert_meshrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_OK; } /* find right place for callback */ for (i = _dessert_meshrxcblist; i->next != NULL && i->next->prio <= cb->prio; i = i->next) ; /* insert it */ cb->next = i->next; i->next = cb; _dessert_meshrxcblistver++; pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_OK; } /****************************************************************************** * mesh interface handling ******************************************************************************/ /** Returns the head of the list of mesh interfaces (_desert_meshiflist). * * @retval pointer if list is not empty * @retval NULL otherwise * * %DESCRIPTION: * */ dessert_meshif_t* dessert_meshiflist_get() { return _dessert_meshiflist; } /** Looks for mesh interface with name @a dev in the list of mesh interfaces and * returns a pointer to it. * * @param[in] *dev interface name * * @retval pointer if the interface is found * @retval NULL otherwise * * %DESCRIPTION: * **/ dessert_meshif_t* dessert_meshif_get_name(const char* dev) { dessert_meshif_t *meshif = NULL; /* search dev name in iflist */ //meshif = _dessert_meshiflist; pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, meshif) { if (strncmp(meshif->if_name, dev, IF_NAMESIZE) == 0) break; } pthread_rwlock_unlock(&dessert_cfglock); return (meshif); } /** Looks for mesh interface with hardware address @a hwaddr in the list of mesh * interfaces and returns a pointer to it. * * @param[in] *hwaddr interface hardware address * * @retval pointer if the interface is found * @retval NULL otherwise * * %DESCRIPTION: * */ dessert_meshif_t* dessert_meshif_get_hwaddr(const uint8_t hwaddr[ETHER_ADDR_LEN]) { dessert_meshif_t *meshif = NULL; pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(_dessert_meshiflist, meshif) { if (memcmp(meshif->hwaddr, hwaddr, ETHER_ADDR_LEN) == 0) break; } pthread_rwlock_unlock(&dessert_cfglock); return meshif; } /** Removes the corresponding dessert_meshif struct from _dessert_meshiflist and does some cleanup. * * @param[in] dev interface name to remove from list * * @retval DESSERT_OK on success * @retval -errno on error * * %DESCRIPTION: * */ int dessert_meshif_del(const char* dev) { dessert_meshif_t *meshif; // dessert_meshif_t *meshif_prev; TODO MESHIF_HASH /* lock the list */ pthread_rwlock_wrlock(&dessert_cfglock); /* search dev name in iflist */ DL_FOREACH(_dessert_meshiflist, meshif) { if (strncmp(meshif->if_name, dev, IF_NAMESIZE) == 0) break; } if (meshif == NULL) { pthread_rwlock_unlock(&dessert_cfglock); return (ENODEV); } /* remove it from list */ DL_DELETE(_dessert_meshiflist, meshif); _dessert_meshiflist_update_permutations(); pthread_rwlock_unlock(&dessert_cfglock); /* tell pcap not to further process packets */ pcap_breakloop(meshif->pcap); /* the remaining cleanup is done in the interface thread * * using _dessert_meshif_cleanup */ return DESSERT_OK; } /** Initializes given mesh interface, starts up the packet processor thread. * @param[in] *dev interface name * @param[in] flags @todo Document the flags parameter. * * @retval DESSERT_OK on success * @retval DESSERT_ERR on error * * * * %DESCRIPTION: * */ int dessert_meshif_add(const char* dev, uint8_t flags) { dessert_meshif_t *meshif; uint8_t promisc = (flags & DESSERT_IF_NOPROMISC) ? 0 : 1; struct bpf_program fp; /* filter program for libpcap */ char fe[64]; /* filter expression for libpcap */ snprintf(fe, 64, "ether proto 0x%04x", DESSERT_ETHPROTO); /* init new interface entry */ meshif = (dessert_meshif_t*) malloc(sizeof(dessert_meshif_t)); if (meshif == NULL) return (-errno); memset((void *) meshif, 0, sizeof(dessert_meshif_t)); strncpy(meshif->if_name, dev, IF_NAMESIZE); meshif->if_name[IF_NAMESIZE - 1] = '\0'; meshif->if_index = if_nametoindex(dev); pthread_mutex_init(&(meshif->cnt_mutex), NULL); /* check if interface exists */ if (!meshif->if_index) { dessert_err("interface %s - no such interface", meshif->if_name); goto dessert_meshif_add_err; } /* initialize libpcap */ meshif->pcap = pcap_open_live(meshif->if_name, DESSERT_MAXFRAMELEN, promisc, 10, meshif->pcap_err); if (meshif->pcap == NULL) { dessert_err("pcap_open_live failed for interface %s(%d):\n%s", meshif->if_name, meshif->if_index, meshif->pcap_err); goto dessert_meshif_add_err; } if (pcap_datalink(meshif->pcap) != DLT_EN10MB) { dessert_err("interface %s(%d) is not an ethernet interface!", meshif->if_name, meshif->if_index); goto dessert_meshif_add_err; } /* pcap filter */ if (!(flags & DESSERT_IF_NOFILTER)) { if (pcap_compile(meshif->pcap, &fp, fe, 0, 0) == -1) { dessert_err("couldn't parse filter %s: %s\n", fe, pcap_geterr(meshif->pcap)); goto dessert_meshif_add_err; } if (pcap_setfilter(meshif->pcap, &fp) == -1) { dessert_err("couldn't install filter %s: %s\n", fe, pcap_geterr(meshif->pcap)); goto dessert_meshif_add_err; } /* else { TODO: pcap_freecode() } */ } /* get hardware address */ if (_dessert_meshif_gethwaddr(meshif) != 0) { dessert_err("failed to get hwaddr of interface %s(%d)", meshif->if_name, meshif->if_index); goto dessert_meshif_add_err; } /* check whether we need to set defsrc (default source) */ if (memcmp(dessert_l25_defsrc, ether_null, ETHER_ADDR_LEN) == 0) { memcpy(dessert_l25_defsrc, meshif->hwaddr, ETHER_ADDR_LEN); dessert_info("set dessert_l25_defsrc to hwaddr %02x:%02x:%02x:%02x:%02x:%02x", dessert_l25_defsrc[0], dessert_l25_defsrc[1],dessert_l25_defsrc[2], dessert_l25_defsrc[3], dessert_l25_defsrc[4], dessert_l25_defsrc[5]); } dessert_info("starting worker thread for interface %s(%d) hwaddr %02x:%02x:%02x:%02x:%02x:%02x", meshif->if_name, meshif->if_index, meshif->hwaddr[0], meshif->hwaddr[1], meshif->hwaddr[2], meshif->hwaddr[3], meshif->hwaddr[4], meshif->hwaddr[5]); /* start worker thread */ if (pthread_create(&(meshif->worker), NULL, _dessert_meshif_add_thread, (void *) meshif)) { dessert_err("creating worker thread failed for interface %s(%d)", meshif->if_name, meshif->if_index); goto dessert_meshif_add_err; } /* prepend to interface list */ pthread_rwlock_wrlock(&dessert_cfglock); DL_PREPEND(_dessert_meshiflist, meshif); _dessert_meshiflist_update_permutations(); pthread_rwlock_unlock(&dessert_cfglock); return (DESSERT_OK); dessert_meshif_add_err: if (meshif->pcap != NULL) { pcap_close(meshif->pcap); } free(meshif); return (DESSERT_ERR); } /***************************************************************************** * * INTERNAL / PRIVATE * * M E S H - I N T E R F A C E S * ******************************************************************************/ /** Run all registered callbacks. * * @internal * * @return the return status of the last callback called * * @warning Use with care - never register as callback! * * %DESCRIPTION: * */ int _dessert_meshrxcb_runall(dessert_msg_t* msg_in, size_t len, dessert_msg_proc_t *proc_in, const dessert_meshif_t *meshif, dessert_frameid_t id) { dessert_msg_t *msg = msg_in; dessert_msg_proc_t *proc = proc_in; dessert_meshrxcbe_t *cb; int res = 0; dessert_meshrxcb_t **cbl = NULL; int cbllen = 0; int cblcur = -1; /* copy callbacks to internal list to release dessert_cfglock before invoking callbacks*/ pthread_rwlock_rdlock(&dessert_cfglock); cbllen = 0; for (cb = _dessert_meshrxcblist; cb != NULL; cb = cb->next) cbllen++; cbl = malloc(cbllen * sizeof(dessert_meshrxcb_t *)); if (cbl == NULL) { dessert_err("failed to allocate memory for internal callback list"); pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_MSG_DROP; } cblcur = 0; for (cb = _dessert_meshrxcblist; cb != NULL; cb = cb->next) cbl[cblcur++] = cb->c; pthread_rwlock_unlock(&dessert_cfglock); /* call the interested */ res = 0; cblcur = 0; while (res > DESSERT_MSG_DROP && cblcur < cbllen) { _dessert_packet_process_cbagain: res = cbl[cblcur](msg, len, proc, meshif, id); if (res == DESSERT_MSG_NEEDNOSPARSE && msg == msg_in) { dessert_msg_clone(&msg, msg_in, 0); len = DESSERT_MAXFRAMEBUFLEN; goto _dessert_packet_process_cbagain; } else if (res == DESSERT_MSG_NEEDNOSPARSE && msg != msg_in) { dessert_warn("bogus DESSERT_MSG_NEEDNOSPARSE returned from callback!"); } if (res == DESSERT_MSG_NEEDMSGPROC && proc == NULL) { proc = malloc(DESSERT_MSGPROCLEN); memset(proc, 0, DESSERT_MSGPROCLEN); goto _dessert_packet_process_cbagain; } else if (res == DESSERT_MSG_NEEDMSGPROC && proc != NULL) { dessert_warn("bogus DESSERT_MSG_NEEDMSGPROC returned from callback!"); } cblcur++; } free(cbl); if (msg != msg_in) dessert_msg_destroy(msg); if (proc != proc_in) free(proc); return (res); } /** Get the hardware address of the ethernet device behind meshif. * * @internal * * @param *meshif pointer to dessert_meshif_t to query * * @retval DESSERT_OK on success * * \warning This is a platform depended function! * * %DESCRIPTION: * **/ int _dessert_meshif_gethwaddr(dessert_meshif_t *meshif) #ifdef TARGET_DARWIN { /* the Apple way... */ int mib[6]; size_t len; uint8_t *buf, *next; struct if_msghdr *ifm; struct sockaddr_dl *sdl; int ret = DESSERT_ERR; mib[0] = CTL_NET; mib[1] = AF_ROUTE; mib[2] = 0; mib[3] = AF_LINK; mib[4] = NET_RT_IFLIST; mib[5] = 0; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) { dessert_err("Acquiring hwaddr failed: sysctl 1 error"); return(DESSERT_ERR); } if ((buf = malloc(len)) == NULL) { dessert_err("acquiring hwaddr failed: malloc error"); return(DESSERT_ERR); } if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { dessert_err("acquiring hwaddr failed: sysctl 2 error"); return(DESSERT_ERR); } for (next = buf; next < buf+len; next += ifm->ifm_msglen) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); if (strncmp(&sdl->sdl_data[0], meshif->if_name, sdl->sdl_len) == 0) { memcpy(meshif->hwaddr, LLADDR(sdl), ETHER_ADDR_LEN); ret = DESSERT_OK; break; } } } free(buf); return ret; } #elif TARGET_FREEBSD { struct ifaddrs *ifaphead; struct ifaddrs *ifap; struct sockaddr_dl *sdl = NULL; if (getifaddrs(&ifaphead) != 0) { dessert_err("getifaddrs() failed"); return(DESSERT_ERR); } for (ifap = ifaphead; ifap; ifap = ifap->ifa_next) { if ((ifap->ifa_addr->sa_family == AF_LINK)) { if (strcmp(ifap->ifa_name,meshif->if_name) == 0) { sdl = (struct sockaddr_dl *)ifap->ifa_addr; if (sdl) { memcpy(meshif->hwaddr, LLADDR(sdl), ETHER_ADDR_LEN); return(DESSERT_OK); } } } } return(DESSERT_ERR); } #elif TARGET_LINUX { /* the linux and solaris way */ int sockfd; struct ifreq ifr; /* we need some socket to do that */ sockfd = socket(AF_INET, SOCK_STREAM, 0); /* set interface options and get hardware address */ strncpy(ifr.ifr_name, meshif->if_name, sizeof(ifr.ifr_name)); #ifdef SIOCGIFHWADDR if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) >= 0) { memcpy(meshif->hwaddr, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN); /* } */ #elif defined SIOCGENADDR if ( ioctl(sd, SIOCGENADDR, &ifr_work) >= 0 ) { memcpy( meshif->hwaddr, &ifr.ifr_enaddr, ETHER_ADDR_LEN ); /* } */ #else if (false) { #endif close(sockfd); return (DESSERT_OK); } else { dessert_err("acquiring hwaddr failed"); close(sockfd); return (DESSERT_ERR); } } #else { dessert_err("acquiring hwaddr failed - platform not supported"); return(DESSERT_ERR); } #endif /****************************************************************************** * * LOCAL * * M E S H - I N T E R F A C E S * ******************************************************************************/ /** Function to send packet via a single interface. * * @internal * * @param[in] *msg the message to send * @param[in] *iface the interface the message should be send via * * @retval DESSERT_OK on success * @retval EINVAL if *iface is NULL * @retval EIO if there was a problem sending the message * * %DESCRIPTION: * */ static inline int _dessert_meshsend_if2(dessert_msg_t* msg, dessert_meshif_t *iface) { int res; uint8_t oldflags; size_t msglen = ntohs(msg->hlen) + ntohs(msg->plen); /* check for null meshInterface */ if (iface == NULL) { dessert_err("NULL-pointer given as interface - programming error!"); return EINVAL; } /* send packet - temporally setting DESSERT_FLAG_SPARSE */ oldflags = msg->flags; msg->flags &= ~DESSERT_FLAG_SPARSE; res = pcap_inject(iface->pcap, (u_char *) msg, msglen); msg->flags = oldflags; if (res != msglen) { if (res == -1) { dessert_warn("couldn't send message: %s\n", pcap_geterr(iface->pcap)); } else { dessert_warn("couldn't send message: sent only %d of %d bytes\n", res, msglen); } return (EIO); } pthread_mutex_lock(&(iface->cnt_mutex)); iface->opkts++; iface->obytes += res; pthread_mutex_unlock(&(iface->cnt_mutex)); return (DESSERT_OK); } /** Callback doing the main work for packets received through a dessert interface. * * @internal * * @param arg - meshif-pointer carried by libpcap in something else * @param header - pointer to the header by libpcap * @param packet - pointer to the packet by libpcap * * %DESCRIPTION: * */ static void _dessert_packet_process(u_char *args, const struct pcap_pkthdr *header, const u_char *packet) { dessert_meshif_t *meshif = (dessert_meshif_t *) args; dessert_msg_t *msg = (dessert_msg_t *) packet; size_t len = header->caplen; dessert_frameid_t id; dessert_msg_proc_t proc; /* is it something I understand? */ if (ntohs(msg->l2h.ether_type) != DESSERT_ETHPROTO) { dessert_debug("got packet with ethertype %04x - discarding", ntohs(msg->l2h.ether_type)); return; } /* check message */ if (header->caplen < header->len) { dessert_warn("packet too short - check pcap_open_live() parameters"); return; } if (header->caplen < DESSERT_MSGLEN) { dessert_notice("packet too short - shorter than DESSERT_MSGLEN"); return; } /* generate frame id */ id = _dessert_newframeid(); memset(&proc, 0, DESSERT_MSGPROCLEN); /* count packet */ pthread_mutex_lock(&(meshif->cnt_mutex)); meshif->ipkts++; meshif->ibytes += header->caplen; pthread_mutex_unlock(&(meshif->cnt_mutex)); _dessert_meshrxcb_runall(msg, len, &proc, meshif, id); } /** Internal routine called before interface thread finishes. * * @internal * * @param *meshif the interface to be cleaned up * * %DESCRIPTION: * */ static void _dessert_meshif_cleanup(dessert_meshif_t *meshif) { pcap_close(meshif->pcap); free(meshif); } /** Internal thread function running the capture loop. * * @internal * * @param *arg a void pointer representing a dessert_meshif_t interface * * %DESCRIPTION: */ static void *_dessert_meshif_add_thread(void* arg) { dessert_meshif_t *meshif = (dessert_meshif_t *) arg; pcap_loop(meshif->pcap, -1, _dessert_packet_process, (u_char *) meshif); _dessert_meshif_cleanup(meshif); return (NULL); } /** Internal function to update the lookup table of permutations of the current _dessert_meshiflist. * * @internal * * %DESCRIPTION: \n */ static void _dessert_meshiflist_update_permutations() { int i, r; pthread_mutex_lock(&_dessert_meshiflist_mutex); _dessert_meshiflist_len = DL_LENGTH(_dessert_meshiflist); dessert_meshif_t **a = calloc(sizeof(a) * _dessert_meshiflist_len, 1); list2array(_dessert_meshiflist, a, _dessert_meshiflist_len); _dessert_meshiflist_perm_count = fact(_dessert_meshiflist_len); if (_dessert_meshiflist_perms != NULL) { free(_dessert_meshiflist_perms); } _dessert_meshiflist_perms = calloc(sizeof(dessert_meshif_t **) * _dessert_meshiflist_perm_count + sizeof(dessert_meshif_t *) * _dessert_meshiflist_perm_count * _dessert_meshiflist_len, 1); for (i = 0; i < _dessert_meshiflist_perm_count; ++i) { _dessert_meshiflist_perms[i] = (dessert_meshif_t **) (((char *) _dessert_meshiflist_perms) + sizeof(dessert_meshif_t **) * _dessert_meshiflist_perm_count + i * _dessert_meshiflist_len * sizeof(dessert_meshif_t *)); } for (r = 0; r < _dessert_meshiflist_perm_count; r++) { memcpy(_dessert_meshiflist_perms[r], a, sizeof(dessert_meshif_t *) * _dessert_meshiflist_len); } free(a); for(r = 0; r < _dessert_meshiflist_perm_count; r++){ permutation(r, _dessert_meshiflist_len, _dessert_meshiflist_perms[r]); } pthread_mutex_unlock(&_dessert_meshiflist_mutex); } /** Internal function to get the length of a double-linked utlist. * * @internal * * @param[in] *l a pointer to the list head * * @return the number of elements in the list * * %DESCRIPTION: \n */ static inline int DL_LENGTH(dessert_meshif_t *l) { int len = 0; dessert_meshif_t *temp; DL_FOREACH(l, temp) len++; return len; } /** Internal function to copy the element pointers of the _dessert_meshiflist to an array. * * @internal * * @param[in] *l a pointer to the list head * @param[out] **a a pointer to an array of dessert_meshif_t * * %DESCRIPTION: \n */ static inline void list2array(dessert_meshif_t *l, dessert_meshif_t **a, int len) { dessert_meshif_t *t; int i = 0; DL_FOREACH(l, t) { a[i++] = t; if (--len == 0) break; } } /** Internal function to compute the factorial of a given number. * * @internal * * @param[in] i the number * * @return the factorial * * %DESCRIPTION: \n */ static inline int fact(int i){ int fact = 1; while (i > 0) fact *= i--; return fact; } /** Internal function to produce a permutation of @a a. * * @internal * * @param[in] k the permutation to generate * @param[in] len the number of elements in the array * @param[out] the array to permute * * @note Algorithm adopted from the Wikipedia article on * Permutations. * * %DESCRIPTION: \n */ static inline void permutation(int k, int len, dessert_meshif_t **a) { dessert_meshif_t *temp; int j; for(j = 2 ; j <= len; j++ ) { temp = a[(k%j)]; a[(k%j)] = a[j-1]; a[j-1] = temp; k = k / j; } } libdessert0.87-0.87.2/dessert_core.c0000644000175000017500000001512211331020526015220 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" #include /* global data storage // P U B L I C */ char dessert_proto[DESSERT_PROTO_STRLEN + 1]; u_int8_t dessert_ver; u_int8_t dessert_l25_defsrc[ETHER_ADDR_LEN]; u_char ether_broadcast[ETHER_ADDR_LEN]; u_char ether_null[ETHER_ADDR_LEN]; pthread_rwlock_t dessert_cfglock = PTHREAD_RWLOCK_INITIALIZER; /* global data storage // P R I V A T E */ int _dessert_status = 0x0; /* local data storage*/ dessert_frameid_t _dessert_nextframeid = 0; pthread_mutex_t _dessert_nextframeid_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t _dessert_exit_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t _dessert_exit_do = PTHREAD_COND_INITIALIZER; int _dessert_exit_code = 0; char *dessert_pidfile_name; /* internal functions forward declarations*/ static void _dessert_cleanup(void); static void _dessert_daemonize(void); static int _dessert_pid(char* pidfile); /****************************************************************************** * * EXTERNAL / PUBLIC * * C O R E * ******************************************************************************/ /** Initializes dessert framework and sets up logging * @arg *proto 4 char string for protocol name * @arg version version number of protocol * @arg opts @see DESSERT_OPT_* * @returns DESSERT_OK on success, DESSERT_ERR otherwise **/ int dessert_init(const char* proto, int version, uint16_t opts, char* pidfile) { pthread_rwlock_wrlock(&dessert_cfglock); /* save global config */ memset(dessert_proto, 0x0, DESSERT_PROTO_STRLEN + 1); strncpy(dessert_proto, proto, DESSERT_PROTO_STRLEN); dessert_ver = version; /* initialize pseudo constants */ memset(ether_broadcast, 255, ETHER_ADDR_LEN); memset(ether_null, 0, ETHER_ADDR_LEN); pthread_rwlock_unlock(&dessert_cfglock); /* daemonize if needed */ if ((opts & DESSERT_OPT_DAEMONIZE) && !(opts & DESSERT_OPT_NODAEMONIZE)) { _dessert_daemonize(); } /* write pid to file if needed */ if (pidfile != NULL) { dessert_pidfile_name = pidfile; _dessert_pid(pidfile); } /* initialize cli */ _dessert_cli_init(); /* start periodic thread */ _dessert_periodic_init(); /* initialize net-snmp subagent */ _dessert_agentx_init_subagent(); return DESSERT_OK; } /** main loop - wait until dessert_exit() is called or killed * @return arg to dessert_exit */ int dessert_run() { pthread_mutex_lock(&_dessert_exit_mutex); pthread_cond_wait(&_dessert_exit_do, &_dessert_exit_mutex); _dessert_cleanup(); pthread_mutex_unlock(&_dessert_exit_mutex); return (_dessert_exit_code); } /**Causes dessert_run() to break out of the main loop. */ void dessert_exit() { /* kill snmp_worker thread */ dessert_agentx_stop_subagent(); pthread_cond_signal(&_dessert_exit_do); } /** generates a new, runtime-unique frame id * @returns runtime-unique frame id **/ dessert_frameid_t _dessert_newframeid() { dessert_frameid_t x; pthread_mutex_lock(&_dessert_nextframeid_mutex); x = _dessert_nextframeid++; pthread_mutex_unlock(&_dessert_nextframeid_mutex); return (x); } /****************************************************************************** * * INTERNAL / PRIVATE * * C O R E * ******************************************************************************/ /** command "shutdown" */ int _dessert_cli_cmd_shutdown(struct cli_def *cli, char *command, char *argv[], int argc) { cli_print(cli, "daemon will shut down now!"); pthread_mutex_lock(&_dessert_exit_mutex); pthread_cond_broadcast(&_dessert_exit_do); pthread_mutex_unlock(&_dessert_exit_mutex); return CLI_OK; } /****************************************************************************** * * LOCAL * * C O R E * ******************************************************************************/ /** internal function to clean up things */ void _dessert_cleanup(void) { /* remove pidfile */ if (dessert_pidfile_name != NULL) { unlink(dessert_pidfile_name); } } /** internal daemonize helper */ void _dessert_daemonize(void) { pid_t pid, sid; /* Fork off the parent process */ pid = fork(); if (pid < 0) { perror("could not create daemon process!"); exit(EXIT_FAILURE); } /* If we got a good PID, then we can exit the parent process. */ if (pid > 0) { exit(EXIT_SUCCESS); } /* Change the file mode mask */ umask(0); /* Open any logs here */ /* Create a new SID for the child process */ sid = setsid(); if (sid < 0) { perror("could not set sid!"); exit(EXIT_FAILURE); } /* Change the current working directory */ if ((chdir("/")) < 0) { perror("could not chdir /!"); exit(EXIT_FAILURE); } /* Close out the standard file descriptors */ close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); /* write config */ pthread_rwlock_wrlock(&dessert_cfglock); _dessert_status |= _DESSERT_STATUS_DAEMON; pthread_rwlock_unlock(&dessert_cfglock); /* adopt logging */ dessert_logcfg(0x0); } /** internal pid-write helper */ int _dessert_pid(char* pidfile) { FILE *fd; fd = fopen(pidfile, "w"); if (fd == 0) { dessert_warn("could not open pid file"); return 1; } else { int r; r = fprintf(fd, "%d\n", getpid()); if (r < 0) { dessert_warn("could not write to pid file"); return DESSERT_ERR; } if (fclose(fd) != 0) { dessert_warn("failed to close pid file"); } } return DESSERT_OK; } libdessert0.87-0.87.2/dessert_msg.c0000644000175000017500000006720711331020526015071 0ustar dvddvd/****************************************************************************** Copyright 2009, The DES-SERT Team, Freie Universitaet Berlin (FUB). All rights reserved. These sources were originally developed by Philipp Schmidt at Freie Universitaet Berlin (http://www.fu-berlin.de/), Computer Systems and Telematics / Distributed, Embedded Systems (DES) group (http://cst.mi.fu-berlin.de/, http://www.des-testbed.net/) ------------------------------------------------------------------------------ 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 3 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/ . ------------------------------------------------------------------------------ For further information and questions please use the web site http://www.des-testbed.net/ *******************************************************************************/ #include "dessert_internal.h" #include "dessert.h" /* global data storage // P U B L I C */ /* global data storage // P R I V A T E */ /* local data storage*/ /* internal functions forward declarations*/ /****************************************************************************** * * EXTERNAL / PUBLIC * * M E S S A G E H A N D L I N G * ******************************************************************************/ /** creates a new dessert_msg_t and initializes it. * @arg **msgout (out) pointer to return message address * @return 0 on success, -errno on error **/ int dessert_msg_new(dessert_msg_t **msgout) { dessert_msg_t *msg; msg = malloc(DESSERT_MAXFRAMEBUFLEN); if (msg == NULL) { dessert_err("failed to allocate buffer for new message!"); return (-ENOMEM); } memset(msg, 0, DESSERT_MAXFRAMEBUFLEN); msg->l2h.ether_type = htons(DESSERT_ETHPROTO); memset(msg->l2h.ether_dhost, 255, ETHER_ADDR_LEN); memcpy(msg->proto, dessert_proto, DESSERT_PROTO_STRLEN); msg->ver = dessert_ver; msg->ttl = 0xff; msg->u8 = 0x00; msg->u16 = htons(0xbeef); msg->hlen = htons(sizeof(dessert_msg_t)); msg->plen = htons(0); *msgout = msg; return (DESSERT_OK); } /** generates a copy of a dessert_msg * @arg **msgnew (out) pointer to return message address * @arg *msgold pointer to the message to clone * @arg sparse whether to allocate DESSERT_MAXFRAMELEN or only hlen+plen * @return DESSERT_OK on success, -errno otherwise **/ int dessert_msg_clone(dessert_msg_t **msgnew, const dessert_msg_t *msgold, uint8_t sparse) { dessert_msg_t *msg; size_t msglen = ntohs(msgold->hlen) + ntohs(msgold->plen); if (sparse) { msg = malloc(msglen); } else { msg = malloc(DESSERT_MAXFRAMEBUFLEN); } if (msg == NULL) { return (-errno); } memcpy(msg, msgold, msglen); if (sparse) { msg->flags |= DESSERT_FLAG_SPARSE; } else { msg->flags &= DESSERT_FLAG_SPARSE ^ DESSERT_FLAG_SPARSE; } *msgnew = msg; return (DESSERT_OK); } /** checks whether a dessert_msg is consistent * @arg msg the message to be checked * @arg len the length of the buffer * @return DESSERT_OK on success * @return -1 of the message is too large for the buffer * @return -2 if the message was not intended to this daemon * @return -3 if some extension is not consistent * %DESCRIPTION: ***********************************************************************/ int dessert_msg_check(const dessert_msg_t* msg, size_t len) { dessert_ext_t *ext; /* is the message large enough to at least carry the header */ if (len < DESSERT_MSGLEN) { dessert_info("message too short - shorter than DESSERT_MSGLEN"); return (-1); } if (ntohs(msg->hlen) + ntohs(msg->plen) > len) { dessert_info("message too short - shorter than header + payload"); return (-1); } /* right protocol and version */ if (msg->proto[0] != dessert_proto[0] || msg->proto[1] != dessert_proto[1] || msg->proto[2] != dessert_proto[2] || msg->proto[3] != dessert_proto[3]) { dessert_info("wrong dessert protocol"); return (-2); } if (msg->ver != dessert_ver) { dessert_info("wrong dessert protocol version"); return (-2); } /* now check extensions.... */ ext = (dessert_ext_t *) ((uint8_t *) msg + DESSERT_MSGLEN); while ((uint8_t *) ext < ((uint8_t *) msg + (size_t) ntohs(msg->hlen))) { /* does current extension fit into the header? */ if (((uint8_t *) ext + (size_t) ext->len) > ((uint8_t *) msg + (size_t) ntohs(msg->hlen))) { dessert_info("extension %x too long", ext->type); return (-3); } if (ext->len < 2) { dessert_info("extension %x too short", ext->type); return (-3); } ext = (dessert_ext_t *) ((uint8_t *) ext + (size_t) ext->len); } /* message is valid */ return DESSERT_OK; } /** dump a dessert_msg_t to a string * @arg *msg the message to be dumped * @arg len the length of the buffer * @arg *buf text output buffer * @arg blen text output buffer length **/ void dessert_msg_dump(const dessert_msg_t* msg, size_t len, char *buf, size_t blen) { dessert_msg_proc_dump(msg, len, NULL, buf, blen); } /** free a dessert_msg * @arg *msg message to free **/ void dessert_msg_destroy(dessert_msg_t* msg) { free(msg); } /** creates a new dessert_msg from an ethernet frame. * @arg *eth ethernet frame to encapsulate * @arg len length of the ethernet frame * @arg **msgout (out) pointer to return message address * @return DESSERT_OK on success, -errno otherwise **/ int dessert_msg_ethencap(const struct ether_header* eth, size_t eth_len, dessert_msg_t** msgout) { int res; dessert_ext_t *ext; void *payload; /* check len */ if (eth_len > DESSERT_MAXFRAMELEN - DESSERT_MSGLEN + ETHER_HDR_LEN) { dessert_debug("failed to encapsulate ethernet frame of %d bytes (max=%d)", eth_len, DESSERT_MAXFRAMELEN - DESSERT_MSGLEN + ETHER_HDR_LEN); return (-EMSGSIZE); } /* create message */ res = dessert_msg_new(msgout); if (res) { return res; } /* add ether header */ res = dessert_msg_addext(*msgout, &ext, DESSERT_EXT_ETH, ETHER_HDR_LEN); if (res) { return res; } memcpy(ext->data, eth, ETHER_HDR_LEN); /* copy message */ dessert_msg_addpayload(*msgout, &payload, (eth_len - ETHER_HDR_LEN)); memcpy(payload, ((uint8_t *) eth) + ETHER_HDR_LEN, (eth_len - ETHER_HDR_LEN)); return (DESSERT_OK); } /** extracts an ethernet frame from a dessert_msg * @arg *msg pointer to dessert_msg message to decapsulate * @arg **ethout (out) pointer to return ethernet message * @return eth_len on success, -1 otherwise **/ int dessert_msg_ethdecap(const dessert_msg_t* msg, struct ether_header** ethout) { dessert_ext_t *ext; int res; /* create message */ size_t eth_len = ntohs(msg->plen) + ETHER_HDR_LEN; *ethout = malloc(eth_len); if (*ethout == NULL) { return (-1); } /* copy header */ res = dessert_msg_getext(msg, &ext, DESSERT_EXT_ETH, 0); if (res != 1) { free(ethout); return (-1); } memcpy(*ethout, ext->data, ETHER_HDR_LEN); /* copy message */ memcpy(((uint8_t *) (*ethout)) + ETHER_HDR_LEN, (((uint8_t *) msg) +ntohs(msg->hlen)), ntohs(msg->plen)); return (eth_len); } /** get the ether_header sent as DESSERT_EXT_ETH in a dessert_msg * @arg *msg the message * @return pointer to ether_header data, NULL if DESSERT_EXT_ETH not present **/ struct ether_header* dessert_msg_getl25ether(const dessert_msg_t* msg) { dessert_ext_t *ext; struct ether_header *l25h; int res; res = dessert_msg_getext(msg, &ext, DESSERT_EXT_ETH, 0); if (res != 1) { l25h = NULL; } else { l25h = (struct ether_header *) ext->data; } return l25h; } /** generates a copy of a dessert_msg_proc * @arg **procnew (out) pointer to return message address * @arg *procold pointer to the message to clone * @return DESSERT_OK on success, -errno otherwise **/ int dessert_msg_proc_clone(dessert_msg_proc_t **procnew, const dessert_msg_proc_t *procold) { if (procold == NULL) { *procnew = procold; return (DESSERT_OK); } dessert_msg_proc_t *proc; proc = malloc(DESSERT_MSGPROCLEN); if (proc == NULL) { return (-errno); } memcpy(proc, procold, DESSERT_MSGPROCLEN); *procnew = proc; return (DESSERT_OK); } /** dump a dessert_msg_t to a string * @arg *msg the message to be dumped * @arg len the length of the buffer * @arg *proc the processing buffer * @arg *buf text output buffer * @arg blen text output buffer length **/ void dessert_msg_proc_dump(const dessert_msg_t* msg, size_t len, const dessert_msg_proc_t *proc, char *buf, size_t blen) { dessert_ext_t *ext; int extidx = 0; int i; struct ether_header *l25h; #define _dessert_msg_check_append(...) snprintf(buf+strlen(buf), blen-strlen(buf), __VA_ARGS__) memset((void *) buf, 0, blen); _dessert_msg_check_append("\tl2_dhost: %02x:%02x:%02x:%02x:%02x:%02x\n", msg->l2h.ether_dhost[0], msg->l2h.ether_dhost[1], msg->l2h.ether_dhost[2], msg->l2h.ether_dhost[3], msg->l2h.ether_dhost[4], msg->l2h.ether_dhost[5]); _dessert_msg_check_append("\tl2_shost: %02x:%02x:%02x:%02x:%02x:%02x\n", msg->l2h.ether_shost[0], msg->l2h.ether_shost[1], msg->l2h.ether_shost[2], msg->l2h.ether_shost[3], msg->l2h.ether_shost[4], msg->l2h.ether_shost[5]); _dessert_msg_check_append("\tl2_type: %x\n\n", ntohs(msg->l2h.ether_type)); _dessert_msg_check_append("\tproto: "); strncpy(buf + strlen(buf), msg->proto, DESSERT_PROTO_STRLEN); _dessert_msg_check_append("\n\tver: %d\n", msg->ver); _dessert_msg_check_append("\tflags: "); if (msg->flags & DESSERT_FLAG_SPARSE) _dessert_msg_check_append(" SPARSE"); _dessert_msg_check_append("\n\tttl: %x\n", (msg->ttl)); _dessert_msg_check_append("\tu8: %x\n", (msg->u8)); _dessert_msg_check_append("\tu16: %x\n", ntohs(msg->u16)); _dessert_msg_check_append("\thlen: %d\n", ntohs(msg->hlen)); _dessert_msg_check_append("\tplen: %d\n\n", ntohs(msg->plen)); /* get l2.5 header if possible */ if ((l25h = dessert_msg_getl25ether(msg)) != NULL) { _dessert_msg_check_append("\tl25 proto: ethernet\n"); _dessert_msg_check_append("\tl25_dhost: %02x:%02x:%02x:%02x:%02x:%02x\n", l25h->ether_dhost[0], l25h->ether_dhost[1], l25h->ether_dhost[2], l25h->ether_dhost[3], l25h->ether_dhost[4], l25h->ether_dhost[5]); _dessert_msg_check_append("\tl25_shost: %02x:%02x:%02x:%02x:%02x:%02x\n", l25h->ether_shost[0], l25h->ether_shost[1], l25h->ether_shost[2], l25h->ether_shost[3], l25h->ether_shost[4], l25h->ether_shost[5]); _dessert_msg_check_append("\tl25_type: %x\n\n", ntohs(l25h->ether_type)); } /* we have a trace */ if (dessert_msg_trace_dump(msg, buf, blen - strlen(buf)) > 1) _dessert_msg_check_append("\n"); /* now other extensions.... */ ext = (dessert_ext_t *) ((uint8_t *) msg + DESSERT_MSGLEN); while ((uint8_t *) ext < ((uint8_t *) msg + (size_t) ntohs(msg->hlen))) { _dessert_msg_check_append("\textension %d:\n", extidx); /* does current extension fit into the header? */ if ((((uint8_t *) ext + (size_t) ext->len) > ((uint8_t *) msg + (size_t) ntohs(msg->hlen))) || (ext->len < 2)) { _dessert_msg_check_append("\t\tbroken extension - giving up!\n"); break; } _dessert_msg_check_append("\t\ttype: 0x%02x\n", ext->type); _dessert_msg_check_append("\t\tlen: %d\n", ext->len); if (ext->type != DESSERT_EXT_ETH && ext->type != DESSERT_EXT_TRACE) { _dessert_msg_check_append("\t\tdata: "); for (i = 0; i < dessert_ext_getdatalen(ext); i++) { _dessert_msg_check_append("0x%x ", ext->data[i]); if (i % 12 == 1 && i != 1) _dessert_msg_check_append("\t\t "); } } _dessert_msg_check_append("\n"); ext = (dessert_ext_t *) ((uint8_t *) ext + (size_t) ext->len); extidx++; } if (proc != NULL) { _dessert_msg_check_append("\tlocal processing header:\n"); _dessert_msg_check_append("\tlflags: "); if (proc->lflags & DESSERT_LFLAG_SRC_SELF) _dessert_msg_check_append(" DESSERT_FLAG_SRC_SELF"); if (proc->lflags & DESSERT_LFLAG_DST_SELF) _dessert_msg_check_append(" DESSERT_FLAG_DST_MULTICAST"); if (proc->lflags & DESSERT_LFLAG_DST_MULTICAST) _dessert_msg_check_append(" DESSERT_FLAG_DST_SELF"); if (proc->lflags & DESSERT_LFLAG_DST_BROADCAST) _dessert_msg_check_append(" DESSERT_FLAG_DST_BROADCAST"); if (proc->lflags & DESSERT_LFLAG_PREVHOP_SELF) _dessert_msg_check_append(" DESSERT_FLAG_PREVHOP_SELF"); if (proc->lflags & DESSERT_LFLAG_NEXTHOP_SELF) _dessert_msg_check_append(" NEXTHOP_SELF"); if (proc->lflags & DESSERT_LFLAG_NEXTHOP_BROADCAST) _dessert_msg_check_append(" NEXTHOP_BROADCAST"); } } /** free a dessert_prc_msg * @arg *proc processing buffer to free **/ void dessert_msg_proc_destroy(dessert_msg_proc_t* proc) { free(proc); } /** add or replace payload to a dessert_msg * @arg *msg the message the payload should be added to * @arg **payload (out) the pointer to place the payload * @arg len the length of the payload * @return DESSERT_OK on success, DESSERT_ERR otherwise **/ int dessert_msg_addpayload(dessert_msg_t* msg, void** payload, int len) { /* check payload */ if (len > DESSERT_MAXFRAMELEN - ntohs(msg->hlen)) { return DESSERT_ERR; /* too big */ } /* export payload pointer */ *payload = ((uint8_t *) msg + ntohs(msg->hlen)); msg->plen = htons(len); return DESSERT_OK; } /** Retrieves a pointer to the payload of a dessert message @a msg. * * @param[in] *msg the message the payload should be retrieved from * @param[out] **payload the pointer to place the payload in * * @return the length of the payload in bytes if any, 0 otherwise */ int dessert_msg_getpayload(dessert_msg_t *msg, void** payload) { /* test if payload is present in msg */ if (msg->plen == 0) { *payload = NULL; return 0; } *payload = (uint8_t *) msg + ntohs(msg->hlen); return msg->plen; } /** add an extension record to a dessert_msg * @arg *msg the message the extension should be added to * @arg **ext (out) the extension pointer to the reserved extension space * @arg type the type of the extension * @arg len the length of the ext data (without 2 byte extension header) * @return DESSERT_OK on success, **/ int dessert_msg_addext(dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, size_t len) { /* check if sparse message */ if ((msg->flags & DESSERT_FLAG_SPARSE) > 0) { dessert_debug("tried to add extension to a sparse message - use dessert_msg_clone() first!"); return -1; } /* add DESSERT_EXTLEN to len for convenience*/ len += DESSERT_EXTLEN; /* check ext */ if (len > DESSERT_MAXFRAMELEN - ntohs(msg->hlen) - ntohs(msg->plen)) { dessert_debug("message would be too large after adding extension!"); return -2; /* too big */ } else if (len < DESSERT_EXTLEN) { dessert_debug("extension too small!"); return -3; /* too small */ } else if (len > 255) { dessert_debug("extension too big!"); return -2; /* too big */ } /* move payload if necessary */ if (ntohs(msg->plen) > 0) { memmove(((uint8_t *) msg + ntohs(msg->hlen) + len), ((uint8_t *) msg + ntohs(msg->hlen)), ntohs(msg->plen)); } /* get ext addr */ *ext = (dessert_ext_t *) ((uint8_t *) msg + ntohs(msg->hlen)); /* update msg hlen */ msg->hlen = htons(ntohs(msg->hlen) + len); /* copy in extension data */ (*ext)->len = len; (*ext)->type = type; return DESSERT_OK; } /** remove an extension record from a dessert_msg * @arg *msg the message the extension should be added to * @arg *ext (out) the extension pointer to the extension to be removed * @return DESSERT_OK on success, **/ int dessert_msg_delext(dessert_msg_t *msg, dessert_ext_t *ext) { /* check ext */ if ((((uint8_t *) ext) < ((uint8_t *) msg)) || (((uint8_t *) ext) > (((uint8_t *) msg) + ntohs(msg->hlen)))) { dessert_debug("extension not within packet header - won't remove"); return DESSERT_ERR; } msg->hlen = htons(ntohs(msg->hlen) - ext->len); memmove(ext, ((uint8_t *) ext) + ext->len, (ntohs(msg->hlen) + ntohs(msg->plen)) - (((uint8_t *) ext) - ((uint8_t *) msg))); return DESSERT_OK; } /** Resizes a given extension record @a ext within in a @b dessert @b message * @a msg to the new length @a new_len. * * @param[in] *msg the message * @param[in] *ext the extension record * @param[in] new_len the new length of the extension record * * @retval DESSERT_OK on success * * %DESCRIPTION: * **/ int dessert_msg_resizeext(dessert_msg_t *msg, dessert_ext_t *ext, size_t new_len) { int old_len = ext->len; /* check ext */ if (new_len > DESSERT_MAXFRAMELEN - ntohs(msg->hlen) - ntohs(msg->plen) - old_len) { dessert_debug("message would be too large after adding extension!"); return -2; /* too big */ } else if (new_len < DESSERT_EXTLEN) { dessert_debug("extension too small!"); return -3; /* too small */ } else if (new_len > 255) { dessert_debug("extension too big!"); return -2; /* too big */ } memmove(((uint8_t *)ext) + new_len,((uint8_t *)ext) + ext->len, ntohs(msg->hlen) + ntohs(msg->plen) - (((uint8_t *) ext) - ((uint8_t *) msg)) - ext->len); msg->hlen = htons(ntohs(msg->hlen) - (ext->len - new_len)); ext->len = new_len; return DESSERT_OK; } /** get an specific or all extensions * * @arg *msg the message * @arg **ext (out) pointer to extracted extension * sets *ext=NULL if extension not found * may be NULL in this case only count/existence matters * @arg type type of the ext to retrieve - use DESSERT_EXT_ANY to get any ext * @arg index the index of the extension of that type, starting with 0 * @return 0 if the message has no such extension, * @return count of extensions of that type if count > index * @return -count of extensions of that type if count <= index **/ int dessert_msg_getext(const dessert_msg_t* msg, dessert_ext_t** ext, uint8_t type, int index) { int i = 0; dessert_ext_t *exti; if (ext != NULL) *ext = NULL; exti = (dessert_ext_t *) ((uint8_t *) msg + DESSERT_MSGLEN); while ((uint8_t *) exti < ((uint8_t *) msg + (size_t) ntohs(msg->hlen))) { /* does current extension fit into the header? */ if (type == exti->type || type == DESSERT_EXT_ANY) { if (i == index && ext != NULL) { *ext = exti; } i++; } exti = (dessert_ext_t *) (((uint8_t *) exti) + (size_t) exti->len); } if (i <= index) { i = -i; } return (i); } /** get an specific or all extensions * * @arg *msg the message * @arg type type of the ext to retrieve - use DESSERT_EXT_ANY to get any ext * @return 0 if the message has no such extension, * @return count of extensions of that type **/ int dessert_msg_get_ext_count(const dessert_msg_t* msg, uint8_t type) { return dessert_msg_getext(msg, NULL, type, 0); } /** add initial trace header to dessert message * @arg *msg dessert_msg_t message used for tracing * @arg mode trace mode * use DESSERT_MSG_TRACE_HOST to only record default mac of hosts on the way * use DESSERT_MSG_TRACE_IFACE to also trace input interface and last hop * ®return DESSERT_OK on success **/ int dessert_msg_trace_initiate(dessert_msg_t* msg, int mode) { dessert_ext_t *ext; struct ether_header *l25h; if (mode != DESSERT_MSG_TRACE_HOST && mode != DESSERT_MSG_TRACE_IFACE) return EINVAL; if (msg->flags & DESSERT_FLAG_SPARSE) return DESSERT_MSG_NEEDNOSPARSE; dessert_msg_addext(msg, &ext, DESSERT_EXT_TRACE, mode); memcpy((ext->data), dessert_l25_defsrc, ETHER_ADDR_LEN); if (mode == DESSERT_MSG_TRACE_IFACE) { memcpy((ext->data) + ETHER_ADDR_LEN, msg->l2h.ether_shost, ETHER_ADDR_LEN); l25h = dessert_msg_getl25ether(msg); if (l25h == NULL) { memcpy((ext->data) + ETHER_ADDR_LEN, ether_null, ETHER_ADDR_LEN); } else { memcpy((ext->data) + ETHER_ADDR_LEN * 2, l25h->ether_shost, ETHER_ADDR_LEN); } } return DESSERT_OK; } /** dump packet trace to string * @arg *msg dessert_msg_t message used for tracing * @arg *buf char buffer to place string * use DESSERT_MSG_TRACE_HOST to only record default mac of hosts on the way * use DESSERT_MSG_TRACE_IFACE to also trace input interface and last hop * ®return length of the string - 0 if msg has no trace header **/ int dessert_msg_trace_dump(const dessert_msg_t* msg, char* buf, int blen) { dessert_ext_t *ext; int x, i = 0; #define _dessert_msg_trace_dump_append(...) snprintf(buf+strlen(buf), blen-strlen(buf), __VA_ARGS__) x = dessert_msg_getext(msg, &ext, DESSERT_EXT_TRACE, 0); if (x < 1) return 0; _dessert_msg_trace_dump_append("\tpacket trace:\n"); _dessert_msg_trace_dump_append("\t\tfrom %02x:%02x:%02x:%02x:%02x:%02x\n", ext->data[0], ext->data[1], ext->data[2], ext->data[3], ext->data[4], ext->data[5]); if (dessert_ext_getdatalen(ext) == DESSERT_MSG_TRACE_IFACE) { _dessert_msg_trace_dump_append("\t\t received on %02x:%02x:%02x:%02x:%02x:%02x\n", ext->data[6], ext->data[7], ext->data[8], ext->data[9], ext->data[10], ext->data[11]); _dessert_msg_trace_dump_append("\t\t l2.5 src %02x:%02x:%02x:%02x:%02x:%02x\n", ext->data[12], ext->data[13], ext->data[14], ext->data[15], ext->data[16], ext->data[17]); } for (i = 1; i < x; i++) { dessert_msg_getext(msg, &ext, DESSERT_EXT_TRACE, i); _dessert_msg_trace_dump_append("\t\t#%3d %02x:%02x:%02x:%02x:%02x:%02x\n", i, ext->data[0], ext->data[1], ext->data[2], ext->data[3], ext->data[4], ext->data[5]); if (dessert_ext_getdatalen(ext) == DESSERT_MSG_TRACE_IFACE) { _dessert_msg_trace_dump_append("\t\t received from %02x:%02x:%02x:%02x:%02x:%02x\n", ext->data[12], ext->data[13], ext->data[14], ext->data[15], ext->data[16], ext->data[17]); _dessert_msg_trace_dump_append("\t\t receiving iface %02x:%02x:%02x:%02x:%02x:%02x\n", ext->data[6], ext->data[7], ext->data[8], ext->data[9], ext->data[10], ext->data[11]); } } return strlen(buf); } /** callback that checks whether a dessert_msg is consistent * @arg *msg dessert_msg_t frame received * @arg len length of ethernet frame received * @arg *iface interface received packet on * @return DESSERT_MSG_KEEP if message is valid, DESSERT_MSG_DROP otherwise **/ int dessert_msg_check_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id) { if (dessert_msg_check(msg, len)) { dessert_debug("invalid package - discarding"); return DESSERT_MSG_DROP; } return DESSERT_MSG_KEEP; } /** dump a dessert_msg_t to debug log * @arg *msg dessert_msg_t frame received * @arg len length of ethernet frame received * @arg *iface interface received packet on * ®return DESSERT_MSG_KEEP always **/ int dessert_msg_dump_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id) { char buf[1024]; dessert_msg_proc_dump(msg, len, proc, buf, 1024); dessert_debug("received frame #%lu on interface %s - dump:\n%s", (unsigned long) id, iface->if_name, buf); return DESSERT_MSG_KEEP; } /** check if the message carries a trace extension and add the current trace info * if iface is NULL, the packet is ignored * @arg *msg dessert_msg_t frame received * @arg len length of ethernet frame received * @arg *iface interface received packet on * ®return DESSERT_MSG_KEEP always **/ int dessert_msg_trace_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id) { dessert_ext_t *ext; /* abort if message has no trace extension */ if (dessert_msg_getext(msg, &ext, DESSERT_EXT_TRACE, 0) == 0) return DESSERT_MSG_KEEP; /* abort if iface is NULL */ if (iface == NULL) return DESSERT_MSG_KEEP; /* we cannot add header to sparse messages */ if (msg->flags & DESSERT_FLAG_SPARSE) return DESSERT_MSG_NEEDNOSPARSE; /* get the trace mode (hop vs interface) */ if (dessert_ext_getdatalen(ext) == DESSERT_MSG_TRACE_HOST) { dessert_msg_addext(msg, &ext, DESSERT_EXT_TRACE, DESSERT_MSG_TRACE_HOST); memcpy((ext->data), dessert_l25_defsrc, ETHER_ADDR_LEN); } else if (dessert_ext_getdatalen(ext) == DESSERT_MSG_TRACE_IFACE) { dessert_msg_addext(msg, &ext, DESSERT_EXT_TRACE, DESSERT_MSG_TRACE_IFACE); memcpy((ext->data), dessert_l25_defsrc, ETHER_ADDR_LEN); memcpy((ext->data) + ETHER_ADDR_LEN, iface->hwaddr, ETHER_ADDR_LEN); memcpy((ext->data) + ETHER_ADDR_LEN * 2, msg->l2h.ether_shost, ETHER_ADDR_LEN); } else { dessert_warn("got packet with %d bytes trace extension - ignoring"); } return DESSERT_MSG_KEEP; } /** callback to set the local processing flags in dessert_msg_proc_t on an arriving dessert_msg_t * @arg *msg dessert_msg_t frame received * @arg len length of ethernet frame received * @arg *iface interface received packet on * ®return DESSERT_MSG_KEEP or DESSERT_MSG_NEEDMSGPROC **/ int dessert_msg_ifaceflags_cb(dessert_msg_t* msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *riface, dessert_frameid_t id) { dessert_meshif_t *iface; struct ether_header *l25h; /* check if we have an processing header */ if (proc == NULL) return DESSERT_MSG_NEEDMSGPROC; /* get l2.5 header if possible */ l25h = dessert_msg_getl25ether(msg); /* clear flags */ proc->lflags &= ~(DESSERT_LFLAG_DST_SELF | DESSERT_LFLAG_SRC_SELF | DESSERT_LFLAG_NEXTHOP_SELF | DESSERT_LFLAG_PREVHOP_SELF | DESSERT_LFLAG_NEXTHOP_BROADCAST | DESSERT_LFLAG_DST_SELF_OVERHEARD | DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD); /* checks against defaults */ if (l25h != NULL && memcmp(l25h->ether_dhost, ether_broadcast, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_DST_BROADCAST; } else if (l25h != NULL && l25h->ether_dhost[0] & 0x01) { /* broadcast also has this bit set */ proc->lflags |= DESSERT_LFLAG_DST_MULTICAST; } if (l25h != NULL && memcmp(l25h->ether_dhost, dessert_l25_defsrc, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_DST_SELF; } if (l25h != NULL && memcmp(l25h->ether_shost, dessert_l25_defsrc, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_SRC_SELF; } if (memcmp(msg->l2h.ether_dhost, dessert_l25_defsrc, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_NEXTHOP_SELF; } if (memcmp(msg->l2h.ether_shost, dessert_l25_defsrc, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_PREVHOP_SELF; } if (memcmp(msg->l2h.ether_dhost, ether_broadcast, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_NEXTHOP_BROADCAST; } /* checks against interfaces in list */ pthread_rwlock_rdlock(&dessert_cfglock); DL_FOREACH(dessert_meshiflist_get(), iface) { if (l25h != NULL && memcmp(l25h->ether_dhost, iface->hwaddr, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_DST_SELF; if (memcmp(l25h->ether_dhost, riface->hwaddr, ETHER_ADDR_LEN) != 0) { proc->lflags |= DESSERT_LFLAG_DST_SELF_OVERHEARD; } } if (l25h != NULL && memcmp(l25h->ether_shost, iface->hwaddr, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_SRC_SELF; } if (memcmp(msg->l2h.ether_dhost, iface->hwaddr, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_NEXTHOP_SELF; if (memcmp(msg->l2h.ether_dhost, riface->hwaddr, ETHER_ADDR_LEN) != 0) { proc->lflags |= DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD; } } if (memcmp(msg->l2h.ether_shost, iface->hwaddr, ETHER_ADDR_LEN) == 0) { proc->lflags |= DESSERT_LFLAG_PREVHOP_SELF; } } pthread_rwlock_unlock(&dessert_cfglock); return DESSERT_MSG_KEEP; } /****************************************************************************** * * INTERNAL / PRIVATE * * M E S S A G E H A N D L I N G * ******************************************************************************/ /* nothing here - yet */ /****************************************************************************** * * LOCAL * * M E S S A G E H A N D L I N G * ******************************************************************************/ /* nothing here - yet */ libdessert0.87-0.87.2/AUTHORS0000644000175000017500000000161611331020526013446 0ustar dvddvd==================================== The D E S - S E R T T E A M ==================================== Main Developers: David Gutzmann originally developed by Philip Schmidt Project Management: Bastian Blywis Bug reports and contributions by: Wladimir Degtjarew Sebastian Hofmann DES-SERT is under development at Freie Universitaet Berlin, Germany Distributed, Embedded Systems (DES) research group, Prof Mesut Guenes --> http://www.des-testbed.net/ --> http://cst.mi.fu-berlin.de/ --> http://www.fu-berlin.de/ We love feedback - if you have patches, comments or questions, please contact us! Recent contact information is available on http://www.des-testbed.net/des-sert/ or mail to des-sert@spline.inf.fu-berlin.de