📄 defs.h
字号:
extern struct main_addr_neighhash mainaddrneightable[HASHSIZE];extern struct main_addr_hash nodemainaddresstable[HASHSIZE];extern struct iface_addr_hash nodeifaceaddresstable[HASHSIZE];/*************** end of revision ************///CRC HNA add/*---------------------------------------------------------------------------------*/extern struct hna_duplicatehash hna_duplicatetable[HASHSIZE];extern struct hna_host_hash hnahosttable[HASHSIZE];extern struct hna_subnet_hash hnasubnettable[HASHSIZE];extern struct hna_message hnainfo;extern struct gateway saved_gateway;/*---------------------------------------------------------------------------------*/#if defined(__FreeBSD__)extern olsr_16_t kernel_raw_sock; /*used to communicate with the kernel*/#define SEQ 9999#endifextern FILE *f_r_id;extern FILE *hys_id;extern FILE *y_file; //added by Y.Ge/***** added by Y.Ge *****//* qos OLSR */extern olsr_u32_t my_busy_time;extern int use_qos;extern double bw_update_threshold;extern int default_busy_time;/***** end of revision *****///CRC v4->v6 add/*--------------------------------------------------------------------------------*///extern struct sockaddr_in6 addr; /* address of daemon's socket */ //commented by Y.Geextern struct sockaddr_in6 addr[MAXIFACENUM]; //added by Y.Geextern struct olsr_ip_addr addr_ip; /* IP address of "in_addr" */olsr_u16_t addr_ip_prefix; /* Prefix of "addr_ip" */extern struct olsr_ip_addr addr_coa; /* care of address, it's a location address*///extern struct olsr_ip_addr addr_manet; /* the address propagated in the manet*/ //commented by Y.Geextern struct olsr_ip_addr addr_manet[MAXIFACENUM]; //added by Y.Geextern struct olsr_ip_addr my_main_addr; /* added by Y.Ge */extern struct olsr_ip_addr multiaddr; /* multicast addr using in hello and tc msg*/extern olsr_u8_t hw_addr[8]; /* hardware address of the olsr interface*/extern struct olsr_ip_addr default_gateway;//extern struct sockaddr_in6 addrsock6; /* ipv6 address of daemon's socket */ //commeented by Y.Geextern struct sockaddr_in6 addrsock6[MAXIFACENUM]; //added by Y.Ge//extern int s6; /* source and sink of all data */ //commented by Y.Geextern int s6[MAXIFACENUM]; //added by Y.Geextern int olsr_if_index[MAXIFACENUM]; //added by Y.Ge, keep the "int_ifindex" of "struct interface" of all OLSR interfaces/*-------------------------------------------------------------------------------*/extern int supplier; /* process should supply updates */extern char packet[MAXPACKETSIZE+1];extern int outputsize;extern struct olsr *msg;/*extern short hello_seqnum;*/ /* counter use to identifie HELLO PACKET */ /*commented by Y.Ge *//*extern short tc_seqnum;*/ /* counter use to identifie TC PACKET */ /*commented by Y.Ge *//*extern short hna_seqnum;*/ /* counter use to identifie HNA PACKET */ /*commented by Y.Ge */extern char unknown_packet[MAXPACKETSIZE+1]; /* added by Y.Ge, remember the unknown packet that should be forwarded */extern short pkt_seqnum[MAXIFACENUM]; /* added by Y.Ge, counter use to identifie OLSR PACKET*/extern struct olsr_msg_seq msg_seqnum; /* added by Y.Ge, counter use to identifie OLSR MESSAGE */extern struct tc_message tcpacket_relay; /* added by Y.Ge, remember the packet should be relayed out */extern struct mid_message midpacket_relay; /* added by Y.Ge, remember the packet should be relayed out */extern struct hna_message hnapacket_relay; /* added by Y.Ge, remember the packet should be relayed out */extern struct qos_tc_message qostcpacket_relay; /* added by Y.Ge, remember the packet should be relayed out */extern int hello_chunk[MAXIFACENUM]; //added by Y.Geextern int tc_chunk[MAXIFACENUM]; //added by Y.Geextern int mid_chunk[MAXIFACENUM]; //added by Y.Geextern int hna_chunk[MAXIFACENUM]; //added by Y.Geextern short my_willingness; /* added by Y.Ge, my willingness */extern int tc_to_relay; /* added by Y.Ge, if node should relay a received tc */extern int qostc_to_relay; /* added by Y.Ge, if node should relay a received qos tc */extern int mid_to_relay; /* added by Y.Ge, if node should relay a received mid */extern int hna_to_relay; /*added by Y.Ge, if the node should relay the hna */extern int tc_relay_size; /* added by Y.Ge. the size of the TC that should be relayed */extern int mid_relay_size; /* added by Y.Ge. the size of the MID that should be relayed */extern int hna_relay_size; /* added by Y.Ge. the size of the HNA that should be relayed */extern int qostc_relay_size; /* added by Y.Ge. the size of the QoS TC that should be relayed */extern float tc_relay_jitter; /* added by Y.Ge */extern float mid_relay_jitter; /* added by Y.Ge */ extern float hna_relay_jitter; //added by Y.Geextern float tc_relay_interval; /* added by Y.Ge */extern float mid_relay_interval; /* added by Y.Ge */extern float hna_relay_interval; //added by Y.Geextern int use_hyst; /* added by Y.Ge, use hysteresis or not */extern struct servent *sp;extern struct timeval now; /* current idea of time */extern struct tm *nowtm; /* current idea of time (in tm) */extern int changes;extern int debug, debug_level;extern float hello_int, hello_int_wjit, hello_jitter, tc_int, tc_jitter, mid_int, mid_jitter, hna_jitter, polling_int, min_tc_int;extern float topology_hold_time, neighbor_hold_time, duplicate_hold_time, mid_hold_time;//CRC HNA add/*--------------------------------------------------------------------------------*///extern int sd; /*Raw Socket for ioctl()*/ //commented by Y.Geextern int sd[MAXIFACENUM]; //added by Y.Geextern int role; /*define this host as a gateway,or a mobile node, or a manet node*/extern int print_time_debug; //added by Y.Ge, for debugging "timeout" functionsextern short hello_start;extern int rt_reset, refresh;extern int num_of_interface; //added by Y.Ge/*--------------------------------------------------------------------------------*/u_long inet_netof_subnet(struct in_addr);int inet_rtflags(struct sockaddr *);int inet_sendroute(struct rt_entry *, struct sockaddr *);//CRC v4->v6 add/*--------------------------------------------------------------------------------*/int inet6_rtflags(struct sockaddr *sa);int inet6_sendroute(struct rt_entry *rt, struct sockaddr *sa);/*--------------------------------------------------------------------------------*/void olsr_input(struct sockaddr *, struct olsr *, int, int); //Y.Ge: add another int to record the index of the interfacevoid toall(void (*)(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, int, struct interface *), struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, struct interface *);void tointerface (void (*)(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, int, struct interface *), struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, struct interface *, int); //added by Y.Gevoid sndmsg(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, int, struct interface *);void supply(struct sockaddr *, struct hello_message *, struct rt_message *, int, int); //last "int" is added by Y.Ge to define interfacevoid hello_build(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, int, struct interface *);void tc_build(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, int, struct interface *, int); //last "int" added by Y.Ge, to tell whether the packet is the relayed onevoid hna_build(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *, int, struct interface *, int); //last "int" added by Y.Ge, to tell whether the packet is the relayed onevoid mid_build(struct sockaddr *, struct hello_message *, struct tc_message *, struct mid_message *, struct hna_message *,int, struct interface *, int); //last "int" added by Y.Ge, to tell whether the packet is the relayed onevoid rt_build(struct sockaddr *, struct rt_message *, int, struct interface *);void timer(int);void olsr_delete_all_kernel_routes(int signal);void olsr_del_all_kernel_routes();int delete_subnet_default_entry(struct olsr_ip_addr* addrptr, olsr_u16_t addr_prefix, int iface_index); //"iface_index" added by Y.Geint add_subnet_default_entry(struct olsr_ip_addr* addrptr, olsr_u16_t addr_prefix, int iface_index); //"iface_index" added by Y.Gevoid ifinit(void);/********* added by Y.Ge **********//* deal with packet sequence number of * the chunked packet */void reset_chunk_count(int *array); int check_chunk_count (int *array); /* qos OLSR */void qoshello_build(struct sockaddr *, int, struct interface *);void qostc_build(struct sockaddr *, struct qos_tc_message *, struct tc_message *, int, struct interface *, int);/********* end of revision ********/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -