📄 aodv_rreq.h
字号:
/***************************************************************************** * * Copyright (C) 2001 Uppsala University and Ericsson AB. * Copyright (C) 2003 Simon Fraser University and NewMIC * * 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 2 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: Erik Nordstr鰉, <erik.nordstrom@it.uu.se> * : Peter Lee <peter.lee@shaw.ca> * * *****************************************************************************/#ifndef AODV_RREQ_H#define AODV_RREQ_H#ifndef NS_NO_GLOBALS#include <endian.h>#include "defs.h"#include "seek_list.h"#include "routing_table.h"/* RREQ Flags: */#define RREQ_JOIN 0x4#define RREQ_REPAIR 0x2#define RREQ_GRATUITOUS 0x1#define RREQ_INTERNET 0x8typedef struct { u_int8_t type;# if __BYTE_ORDER == __LITTLE_ENDIAN u_int8_t res1:4; u_int8_t i:1; u_int8_t g:1; u_int8_t r:1; u_int8_t j:1;# elif __BYTE_ORDER == __BIG_ENDIAN u_int8_t j:1; u_int8_t r:1; u_int8_t g:1; u_int8_t i:1; u_int8_t res1:4;# else# error "Adjust your <bits/endian.h> defines"# endif u_int8_t res2; u_int8_t hcnt; u_int32_t rreq_id; //PL:#ifdef _IPV6 u_int32_t dest_seqno; u_int32_t orig_seqno; struct in6_addr dest_addr; struct in6_addr orig_addr;#else u_int32_t dest_addr; u_int32_t dest_seqno; u_int32_t orig_addr; u_int32_t orig_seqno;#endif /* _IPV6 */} RREQ;#define RREQ_SIZE sizeof(RREQ)/* A data structure to buffer information about received RREQ's */struct rreq_record { //PL:#ifdef _IPV6 struct in6_addr orig_addr; /* Source of the RREQ */#else u_int32_t orig_addr; /* Source of the RREQ */#endif /* _IPV6 */ u_int32_t rreq_id; /* RREQ's broadcast ID */ struct timer rec_timer; struct rreq_record *next;};struct blacklist { //PL:#ifdef _IPV6 struct in6_addr dest_addr;#else u_int32_t dest_addr;#endif /* _IPV6 */ struct timer bl_timer; struct blacklist *next;};#endif /* NS_NO_GLOBALS */#ifndef NS_NO_DECLARATIONS//PL:#ifdef _IPV6RREQ *rreq_create(u_int8_t flags, struct in6_addr dest_addr, u_int32_t dest_seqno, struct in6_addr orig_addr);void rreq_process(RREQ * rreq, int rreqlen, struct in6_addr ip_src, struct in6_addr ip_dst, int hop_limit, unsigned int ifindex);void rreq_route_discovery(struct in6_addr dest_addr, u_int8_t flags, struct ip_data *ipd);int rreq_record_remove(struct in6_addr orig_addr, u_int32_t rreq_id);struct blacklist *rreq_blacklist_insert(struct in6_addr dest_addr);int rreq_blacklist_remove(struct in6_addr dest_addr);void rreq_local_repair(rt_table_t * rt_entry);#elseRREQ *rreq_create(u_int8_t flags, u_int32_t dest_addr, u_int32_t dest_seqno, u_int32_t orig_addr);void rreq_process(RREQ * rreq, int rreqlen, u_int32_t ip_src, u_int32_t ip_dst, int ip_ttl, unsigned int ifindex);void rreq_route_discovery(u_int32_t dest_addr, u_int8_t flags, struct ip_data *ipd);int rreq_record_remove(u_int32_t orig_addr, u_int32_t rreq_id);struct blacklist *rreq_blacklist_insert(u_int32_t dest_addr);int rreq_blacklist_remove(u_int32_t dest_addr);void rreq_local_repair(rt_table_t * rt_entry);#endif /* _IPV6 */#ifdef NS_PORTstruct rreq_record *rreq_record_insert(u_int32_t orig_addr, u_int32_t rreq_id);struct rreq_record *rreq_record_find(u_int32_t orig_addr, u_int32_t rreq_id);struct blacklist *rreq_blacklist_find(u_int32_t dest_addr);#endif /* NS_PORT */#endif /* NS_NO_DECLARATIONS */#endif /* AODV_RREQ_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -