00001 #ifndef RT_H
00002 #define RT_H
00003
00004 #include <linux/module.h>
00005 #include <linux/kernel.h>
00006 #include <linux/netdevice.h>
00007 #include <linux/skbuff.h>
00008 #include <linux/in.h>
00009 #include <linux/ip.h>
00010 #include <net/route.h>
00011 #include <net/ip_fib.h>
00012 #include <net/ip.h>
00013
00014 #include "aodv.h"
00015 #include "utils.h"
00016 #include "rerr.h"
00017 #include "flood_id_queue.h"
00018 #include "packet_queue.h"
00019
00020 struct route_table_entry *get_first_route_table_entry();
00021 struct route_table_entry *create_route_table_entry();
00022 struct route_table_entry *find_route_table_entry(u_int32_t tmp_ip);
00023 struct route_table_entry *fast_find_route_table_entry(u_int32_t tmp_ip);
00024 int delete_route_table_entry(u_int32_t tmp_ip);
00025 int cleanup_route_table(void);
00026 void find_inactive_route_table_entries();
00027 int insert_precursor_entry(struct route_table_entry *tmp_entry, u_int32_t tmp_ip);
00028 void delete_precursor_entry(struct route_table_entry *tmp_entry, u_int32_t tmp_ip);
00029 void delete_precursor_entry_from_route_table(u_int32_t tmp_ip);
00030 struct precursor_entry* find_precursor_entry(struct route_table_entry *tmp_entry, u_int32_t tmp_ip);
00031 int update_route_entry(u_int32_t ip, u_int32_t next_hop_ip, u_int8_t hop_count, u_int32_t seq, struct net_device *dev);
00032 void delete_precursors_from_route_table_entry(struct route_table_entry *tmp_entry);
00033 struct rtentry *create_kernel_route_entry(u_int32_t dst_ip, u_int32_t gw_ip,char *interf);
00034
00035 int insert_kernel_route_entry(u_int32_t dst_ip, u_int32_t gw_ip, char *interf);
00036 int delete_kernel_route_entry(u_int32_t dst_ip, u_int32_t gw_ip);
00037 int init_route_table( void);
00038
00039 int read_route_table_proc(char *buffer, char **buffer_location, off_t offset, int buffer_length,int *eof,void *data);
00040 int read_monitor_proc(char *buffer, char **buffer_location, off_t offset, int buffer_length,int *eof,void *data);
00041 void print_route_table();
00042 void reset_route_table_link();
00043
00044 #endif
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072