📄 hna_table.h
字号:
/* * Copyright (c) 2004 Ying Ge, Communication Research Center Canada. * * Copyright (c) 2002, 2003 Maoyu Wang, Communication Research Center Canada. * * By Ying Ge: * 1. Change the OLSR packet format and message processing procedure based * on the OLSR RFC. * 2. Add support of multiple interfaces to OLSR, including MID message * creating and processing procedure as specified in the OLSR RFC. * 3. Add QoS Support to OLSR * * By Maoyu Wang: * 1. Ported OLSR from IPv4 to IPv6. * 2. Added the Host and Network Association (HNA) functionality into OLSR. * 3. Added the default gateway functionality into OLSR by extending the HNA * message usage. The default gateway functionality supported the mobility * by cooperating with Mobile IPv6 for a mobile node as well as supported * Internet access for MANET nodes. * * DISTRIBUTED WITH NO WARRANTY, EXPRESS OR IMPLIED. * See the GNU Library General Public License (file COPYING in the distribution) * for conditions of use and redistribution *//* This software is available with usual "research" terms * with the aim of retain credits of the software. * Permission to use, copy, modify and distribute this software for any * purpose and without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, * and the name of INRIA, or any contributor not be used in advertising * or publicity pertaining to this material without the prior explicit * permission. The software is provided "as is" without any * warranties, support or liabilities of any kind. * This product includes software developed by the University of * California, Berkeley and its contributors protected by copyrights. * * $Id: hna_table.h,v 1.2 2002/12/06 10:36:12 prima Exp $ *//* * Routing table management daemon. *//* * host and network associated table management daemon. */struct host_list{ struct host_list *next; struct hna_host_entry *host; };struct hna_subnet_info{ olsr_u32_t subnet_hash; struct olsr_ip_addr subnet_addr; olsr_u16_t subnet_prefix; //do we need prefix? struct host_list *list_of_host;};struct hna_subnet_entry{ struct hna_subnet_entry *hna_subnet_forw; struct hna_subnet_entry *hna_subnet_back; struct hna_subnet_info hna_subnet_infos;};#define hna_subnet_hash_value hna_subnet_infos.subnet_hash#define hna_subnet_addr hna_subnet_infos.subnet_addr#define hna_subnet_prefix hna_subnet_infos.subnet_prefix#define hna_list_of_host hna_subnet_infos.list_of_hoststruct subnet_list{ struct subnet_list *next; struct hna_subnet_entry *subnet; struct timeval subnet_timer; //added by Y.Ge};struct hna_host_info{ olsr_u32_t host_hash; struct olsr_ip_addr host_addr; olsr_u16_t host_prefix; olsr_u16_t host_seq; struct timeval host_timer; struct subnet_list *list_of_subnet;};struct hna_host_entry{ struct hna_host_entry *hna_host_forw; struct hna_host_entry *hna_host_back; struct hna_host_info hna_host_infos;};#define hna_host_hash_value hna_host_infos.host_hash#define hna_host_addr hna_host_infos.host_addr #define hna_host_prefix hna_host_infos.host_prefix #define hna_host_seq hna_host_infos.host_seq #define hna_host_timer hna_host_infos.host_timer // for invalidation#define hna_list_of_subnet hna_host_infos.list_of_subnet struct hna_host_hash{ struct hna_host_entry *hna_host_forw; struct hna_host_entry *hna_host_back;};struct hna_subnet_hash{ struct hna_subnet_entry *hna_subnet_forw; struct hna_subnet_entry *hna_subnet_back;};voidolsr_delete_list_of_host(struct hna_host_entry *host_entry,struct olsr_ip_addr *subaddr);voidolsr_delete_hna_subnet_table(struct hna_subnet_entry *subnet_entry);voidolsr_delete_list_of_subnet(struct hna_subnet_entry *subnet_entry,struct olsr_ip_addr *hostaddr);voidolsr_delete_hna_host_table(struct hna_host_entry *host_entry);voidolsr_insert_hna_host_table(struct hna_host_entry *host_entry,struct hna_message *message);voidolsr_insert_hna_subnet_table(struct hna_subnet_entry *subnet_entry,struct hna_net_addr *netaddr);struct hna_host_entry *olsr_lookup_hna_host_table(struct olsr_ip_addr *hostaddr);struct hna_subnet_entry*olsr_lookup_hna_subnet_table(struct hna_net_addr *subnetaddr);struct subnet_list *olsr_in_list_hna_host(struct hna_host_entry *host_entry,struct olsr_ip_addr *subnetaddr);struct hna_net_addr*olsr_subnet_existing_in_hnainfo(struct olsr_ip_addr* subnetaddr);struct host_list *olsr_insert_host_in_order_list(struct hna_host_entry *host_entry, struct hna_subnet_entry *subnet_entry);voidolsr_update_hna_host_table(struct hna_host_entry *host_entry,struct hna_message *message);voidolsr_release_hna_table();void olsr_time_out_subnet_list(struct hna_host_entry *hna_host); //added by Y.Gevoidolsr_time_out_hna_table();voidolsr_print_hna_host_table();voidolsr_print_hna_subnet_table();voidolsr_print_trace_hna_host_table(); //added by Y.Gevoidolsr_print_trace_hna_subnet_table(); //added by Y.Geint olsr_prefix_compare(struct in6_addr *addr, struct in6_addr *prefix, int nprefix);int olsr_prefix_setting(struct in6_addr *addr,int nprefix);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -