⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.h

📁 wifi 无线网络路由协议OLSR linux下C代码
💻 H
字号:
/* * OLSR ad-hoc routing table management protocol GUI front-end * Copyright (C) 2003 Andreas T鴑nesen (andreto@ifi.uio.no) * * This file is part of olsr.org. * * uolsrGUI 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. * * uolsrGUI 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 olsr.org; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * *//* *Andreas T鴑mnesen */#ifndef _OLSRD_FORNTEND_COMMON#define _OLSRD_FORNTEND_COMMON#include <gtk/gtk.h>#include <stdlib.h>#include <netinet/in.h>#include <stdio.h>#include <string.h>//#include "interface.h"#include "callbacks.h"//#include "types.h"#include "olsr_protocol.h"#define olsrd_version "olsr.org GUI 0.2.7" #define IPC_INTERVAL 500 //interval for IPC read timeout#define MAXPACKS 20#define BUFFSIZE 512extern int connected;extern struct timeval hold_time_nodes; /* Timeout for all nodes */extern struct timeval now;/* Our address */union olsr_ip_addr main_addr;union olsr_ip_addr null_addr;int ipversion;int ipsize;char ipv6_buf[100];      /* buffer for IPv6 inet_htop */int nodes_timeout;int freeze_packets;int display_dec;extern int timeouts;/* *Node info */struct mid{  union olsr_ip_addr alias;  struct mid *next;  struct mid *prev;};struct hna{  union olsr_ip_addr net;  union olsr_ip_addr mask;  struct hna *next;  struct hna *prev;};struct mpr{  union olsr_ip_addr addr;  struct timeval timer;  struct mpr *next;  struct mpr *prev;};struct node{  union olsr_ip_addr addr;  union olsr_ip_addr gw_addr;  int hopcount;  int display;  char dev[5];  struct mid mid;  struct hna hna;  struct mpr mpr;  struct timeval timer;  struct node *next;  struct node *prev;};/* *Interface public */GtkWidget * create_main_window (void);voidpacket_list_add(char *, char *, char *);voidroute_list_add(char *, char *, char *, char *);introute_list_del(char *);voidroute_list_update(char *);voidset_net_info(gchar *, int);voidset_net_info_offline();voidupdate_nodes_list(struct node *);intremove_nodes_list(union olsr_ip_addr *);/* *IPC public */intipc_connect();intipc_close();intipc_read();intipc_send();char *ip_to_string(union olsr_ip_addr *);intgui_itoa(int, char *);/* *Packet.c public */intadd_packet_to_buffer(union olsr_message *, int);union olsr_message *get_packet(int);/* *Nodes.c public */voidinit_nodes();struct node *find_node(char *);struct node *find_node_t(union olsr_ip_addr *);intupdate_timer_node(union olsr_ip_addr *, olsr_u8_t);intadd_hna_node(union olsr_ip_addr *, union olsr_ip_addr *, union olsr_ip_addr *, olsr_u8_t);intadd_mid_node(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u8_t);voidinit_timer(olsr_u32_t, struct timeval *);ginttime_out_nodes(gpointer);intadd_node(union olsr_ip_addr *, olsr_u8_t);intadd_mpr(union olsr_ip_addr *, union olsr_ip_addr *, struct timeval *);intupdate_timer_mpr(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u8_t);inttime_out_mprs(union olsr_ip_addr *);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -