00001 00002 /* 00003 * The olsr.org Optimized Link-State Routing daemon(olsrd) 00004 * Copyright (c) 2004-2009, the olsr.org team - see HISTORY file 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in 00015 * the documentation and/or other materials provided with the 00016 * distribution. 00017 * * Neither the name of olsr.org, olsrd nor the names of its 00018 * contributors may be used to endorse or promote products derived 00019 * from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 * Visit http://www.olsr.org for more information. 00035 * 00036 * If you find this software useful feel free to make a donation 00037 * to the project. For more information see the website or contact 00038 * the copyright holders. 00039 * 00040 */ 00041 00042 #ifndef _OLSR_MID 00043 #define _OLSR_MID 00044 00045 #include "defs.h" 00046 #include "olsr_types.h" 00047 #include "olsr_protocol.h" 00048 #include "common/avl.h" 00049 #include "duplicate_set.h" 00050 00051 struct mid_entry { 00052 struct avl_node mid_tc_node; /* node in the per-tc mid tree */ 00053 struct avl_node mid_node; /* node in the global mid tree */ 00054 union olsr_ip_addr mid_alias_addr; /* key for both trees */ 00055 struct tc_entry *mid_tc; /* backpointer to owning tc entry */ 00056 struct olsr_timer_entry *mid_timer; /* Vtime */ 00057 }; 00058 00059 #define OLSR_FOR_ALL_MID_ENTRIES(mid_alias, iterator) avl_for_each_element_safe(&mid_tree, mid_alias, mid_node, iterator) 00060 #define OLSR_FOR_ALL_TC_MID_ENTRIES(tc, mid_alias, iterator) avl_for_each_element_safe(&tc->mid_tree, mid_alias, mid_tc_node, iterator) 00061 00062 #define OLSR_MID_JITTER 5 /* percent */ 00063 00064 extern struct avl_tree mid_tree; 00065 00066 /* MID msg input parser */ 00067 void olsr_input_mid(struct olsr_message *, struct interface *, union olsr_ip_addr *, enum duplicate_status); 00068 00069 void olsr_init_mid_set(void); 00070 void olsr_delete_mid_entry(struct mid_entry *); 00071 void olsr_flush_mid_entries(struct tc_entry *); 00072 union olsr_ip_addr *EXPORT(olsr_lookup_main_addr_by_alias) (const union olsr_ip_addr *); 00073 struct mid_entry *olsr_lookup_tc_mid_entry(struct tc_entry *, const union olsr_ip_addr *); 00074 void olsr_print_mid_set(void); 00075 void generate_mid(void *p); 00076 #endif 00077 00078 /* 00079 * Local Variables: 00080 * c-basic-offset: 2 00081 * indent-tabs-mode: nil 00082 * End: 00083 */
1.6.3