📄 defs.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 Copyright notice is in French. An English summary is given * but the referee text is the French one. * * Copyright (c) 2000, 2001 Adokoe.Plakoo@inria.fr, INRIA Rocquencourt, * Anis.Laouiti@inria.fr, INRIA Rocquencourt. * * Ce logiciel informatique est disponible aux conditions * usuelles dans la recherche, c'est-à-dire qu'il peut * être utilisé, copié, modifié, distribué à l'unique * condition que ce texte soit conservé afin que * l'origine de ce logiciel soit reconnue. * Le nom de l'Institut National de Recherche en Informatique * et en Automatique (INRIA), ou d'une personne morale * ou physique ayant participé à l'élaboration de ce logiciel ne peut * être utilisé sans son accord préalable explicite. * * Ce logiciel est fourni tel quel sans aucune garantie, * support ou responsabilité d'aucune sorte. * Certaines parties de ce logiciel sont dérivées de sources developpees par * University of California, Berkeley et ses contributeurs couvertes * par des copyrights. * 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: defs.h,v 1.2 2000/12/06 10:36:11 prima Exp $ */#include <sys/param.h>#include <sys/socket.h>#include <time.h>#include <sys/time.h>#include <net/route.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/ioctl.h>#include <netdb.h>#include <signal.h>#include <syslog.h>#include <stdio.h>#include <stdlib.h>#include <search.h>#include <string.h>#include <unistd.h>#include <errno.h>#include "types.h"#include "packet.h"#include "trace.h"#include "interface.h"#include "two_hop_neighbor_table.h"#include "neighbor_table.h"#include "mpr_selector_table.h"#include "duplicate_table.h"#include "topology_table.h"#include "routing_table.h"#include "af.h"#include "olsr.h"#include "top_statique.h"#include "kernel_routes.h"#include "ins_rem_q.h"#include "main_addr_neigh_table.h"#include "interface_association_table.h"//CRC HNA add//#include "hna_duplicate_table.h" //commented by Y.Ge#include "hna_table.h"#define equal(a1, a2) \ (memcmp((a1), (a2), sizeof (struct sockaddr_in6)) == 0)#define UP 1#define DOWN 0#define TRUE 1//#define NOT_DETECTED 0 //commented by Y.Ge#define NOT_DETECTED 16 //added by Y.Ge#define OLSRPORT 698#define INT_TIMEOUT 3#define OLSRTOOLSPORT IPPORT_RESERVED - 1#define MAXIFACENUM 5 //added by Y.Ge, number of interface in this node//CRC HNA add/*---------------------------------------------------------------------------------*/#define GATEWAY 1 /* the host acts as a gateway*/#define MANETNODE 2 /* the host acts as a manet node*/#define MOBILENODE 3 /* the host acts as a mobile node*/#define SIOCSHNA 0x8982 /* send interface device to kernel for radvd*/ #define SIOCSRTDEL 0x8983 /* to get the routing table clear message from kernel*/#define SIOCSFLAGSET 0x8984 /* to erease the routing table clear message to kernel*//*---------------------------------------------------------------------------------*/extern struct timeval hold_time_neighbor ;extern struct timeval hold_time_topology;extern struct timeval hold_time_duplicate_tc;/**************** added by Y.Ge *************/extern struct timeval hold_time_expired;extern struct timeval hold_time_duplicate;/**************** end of revision ***********///CRC HNA add/*---------------------------------------------------------------------------------*/extern struct timeval hold_time_duplicate_hna;extern struct timeval hold_time_hna;/*---------------------------------------------------------------------------------*/extern sigset_t psigset; /* set of blocked signals which have been raised while blocked */extern olsr_8_t changes_topology;extern olsr_8_t changes_neighborhood;//CRC HNA add/*---------------------------------------------------------------------------------*/extern olsr_8_t changes_net;/*---------------------------------------------------------------------------------*/extern struct neighbor_table neighbortable; extern struct neighbor2_hash neighbor2table[HASHSIZE];extern struct duplicatehash duplicatetable[HASHSIZE];extern struct mpr_selector_table mprstable;extern struct rthash routingtable[HASHSIZE];extern struct rthash mirror_table[HASHSIZE];extern struct topology_destination_hash topologytable[HASHSIZE];extern struct topology_last_hash topologylasttable[HASHSIZE];/*************** added by Y.Ge **************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -