[Olsr-cvs] olsrd-current/src defs.c, NONE, 1.1 olsrd_plugin.h, NONE, 1.1 apm.h, 1.8, 1.9 defs.h, 1.48, 1.49 hna_set.c, 1.16, 1.17 hna_set.h, 1.13, 1.14 interfaces.c, 1.24, 1.25 interfaces.h, 1.27, 1.28 link_set.c, 1.58, 1.59 link_set.h, 1.26, 1.27 mantissa.h, 1.8, 1.9 mid_set.c, 1.14, 1.15 mid_set.h, 1.12, 1.13 mpr_selector_set.h, 1.11, 1.12 neighbor_table.c, 1.27, 1.28 neighbor_table.h, 1.13, 1.14 olsr.c, 1.45, 1.46 olsr.h, 1.23, 1.24 packet.h, 1.16, 1.17 parser.c, 1.23, 1.24 parser.h, 1.8, 1.9 plugin_loader.c, 1.22, 1.23 plugin_loader.h, 1.14, 1.15 process_routes.c, 1.25, 1.26 process_routes.h, 1.8, 1.9 routing_table.c, 1.21, 1.22 routing_table.h, 1.15, 1.16 socket_parser.c, 1.22, 1.23 socket_parser.h, 1.9, 1.10 tc_set.c, 1.21, 1.22 tc_set.h, 1.14, 1.15 two_hop_neighbor_table.c, 1.15, 1.16 two_hop_neighbor_table.h, 1.13, 1.14 olsr_plugin_io.h, 1.16, NONE plugin.c, 1.20, NONE

Bruno Randolf (spam-protected)
Sun May 29 14:47:48 CEST 2005


Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25973/src

Modified Files:
	apm.h defs.h hna_set.c hna_set.h interfaces.c interfaces.h 
	link_set.c link_set.h mantissa.h mid_set.c mid_set.h 
	mpr_selector_set.h neighbor_table.c neighbor_table.h olsr.c 
	olsr.h packet.h parser.c parser.h plugin_loader.c 
	plugin_loader.h process_routes.c process_routes.h 
	routing_table.c routing_table.h socket_parser.c 
	socket_parser.h tc_set.c tc_set.h two_hop_neighbor_table.c 
	two_hop_neighbor_table.h 
Added Files:
	defs.c olsrd_plugin.h 
Removed Files:
	olsr_plugin_io.h plugin.c 
Log Message:
new plugin interface:
  - plugins can now directly access all olsrd data structures
  - a plugin only has to include "olsrd_plugin.h" and provide 3 interface functions:
      1. olsrd_plugin_interface_version()
      2. olsrd_plugin_register_param()
      3. olsrd_plugin_init()
    which are called in the above order
  - moved all plugins to the new interface


Index: mid_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** mid_set.h	20 Feb 2005 18:52:18 -0000	1.12
--- mid_set.h	29 May 2005 12:47:45 -0000	1.13
***************
*** 41,45 ****
  
  
- 
  #ifndef _OLSR_MID
  #define _OLSR_MID
--- 41,44 ----
***************
*** 72,79 ****
  
  
! #ifndef OLSR_PLUGIN
  
- struct mid_entry mid_set[HASHSIZE];
- struct mid_address reverse_mid_set[HASHSIZE];
  
  int
--- 71,77 ----
  
  
! extern struct mid_entry mid_set[HASHSIZE];
! extern struct mid_address reverse_mid_set[HASHSIZE];
  
  
  int
***************
*** 105,107 ****
  
  #endif
- #endif
--- 103,104 ----

Index: packet.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/packet.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** packet.h	20 Feb 2005 17:34:10 -0000	1.16
--- packet.h	29 May 2005 12:47:45 -0000	1.17
***************
*** 40,44 ****
   */
  
- #ifndef OLSR_PLUGIN
  #ifndef _OLSR_PACKET
  #define _OLSR_PACKET
--- 40,43 ----
***************
*** 173,175 ****
  
  #endif
- #endif
--- 172,173 ----

--- NEW FILE: defs.c ---
#include "defs.h"

FILE *debug_handle;

struct olsrd_config *olsr_cnf;

olsr_u16_t system_tick_divider;

int exit_value;


/* Timer data */
clock_t now_times;              /* current idea of times(2) reported uptime */
struct timeval now;		/* current idea of time */
struct tm *nowtm;		/* current idea of time (in tm) */

olsr_bool disp_pack_in;         /* display incoming packet content? */
olsr_bool disp_pack_out;        /* display outgoing packet content? */

olsr_bool del_gws;

float will_int;
float max_jitter;

size_t ipsize;

union olsr_ip_addr main_addr;

int olsr_udp_port;

int ioctl_s;

#if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
int rts;
#endif

float max_tc_vtime;

clock_t fwdtimer[MAX_IFS];	/* forwarding timer */

int minsize;

olsr_bool changes;                /* is set if changes occur in MPRS set */ 

/* TC empty message sending */
clock_t send_empty_tc;

Index: olsr.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** olsr.h	28 May 2005 14:01:59 -0000	1.23
--- olsr.h	29 May 2005 12:47:45 -0000	1.24
***************
*** 47,53 ****
  #include "interfaces.h"
  
! olsr_bool changes_topology;
! olsr_bool changes_neighborhood;
! olsr_bool changes_hna;
  
  void
--- 47,53 ----
  #include "interfaces.h"
  
! extern olsr_bool changes_topology;
! extern olsr_bool changes_neighborhood;
! extern olsr_bool changes_hna;
  
  void

Index: defs.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** defs.h	25 May 2005 20:59:46 -0000	1.48
--- defs.h	29 May 2005 12:47:45 -0000	1.49
***************
*** 40,44 ****
   */
  
- #ifndef OLSR_PLUGIN
  
  #ifndef _OLSR_DEFS
--- 40,43 ----
***************
*** 83,87 ****
  #endif
  
! FILE *debug_handle;
  
  #ifdef NODEBUG
--- 82,86 ----
  #endif
  
! extern FILE *debug_handle;
  
  #ifdef NODEBUG
***************
*** 126,146 ****
   */
  
! struct olsrd_config *olsr_cnf;
  
  /* Global tick resolution */
! olsr_u16_t system_tick_divider;
  
! int exit_value; /* Global return value for process termination */
  
  
  /* Timer data */
! clock_t now_times;              /* current idea of times(2) reported uptime */
! struct timeval now;		/* current idea of time */
! struct tm *nowtm;		/* current idea of time (in tm) */
  
! olsr_bool disp_pack_in;         /* display incoming packet content? */
! olsr_bool disp_pack_out;        /* display outgoing packet content? */
  
! olsr_bool del_gws;
  
  /*
--- 125,145 ----
   */
  
! extern struct olsrd_config *olsr_cnf;
  
  /* Global tick resolution */
! extern olsr_u16_t system_tick_divider;
  
! extern int exit_value; /* Global return value for process termination */
  
  
  /* Timer data */
! extern clock_t now_times;              /* current idea of times(2) reported uptime */
! extern struct timeval now;		/* current idea of time */
! extern struct tm *nowtm;		/* current idea of time (in tm) */
  
! extern olsr_bool disp_pack_in;         /* display incoming packet content? */
! extern olsr_bool disp_pack_out;        /* display outgoing packet content? */
  
! extern olsr_bool del_gws;
  
  /*
***************
*** 148,180 ****
   */
  
! float will_int;
! float max_jitter;
  
! size_t ipsize;
  
  /* Main address of this node */
! union olsr_ip_addr main_addr;
  
  /* OLSR UPD port */
! int olsr_udp_port;
  
  /* The socket used for all ioctls */
! int ioctl_s;
  
  /* routing socket */
  #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
! int rts;
  #endif
  
! float max_tc_vtime;
  
! clock_t fwdtimer[MAX_IFS];	/* forwarding timer */
  
! int minsize;
  
! olsr_bool changes;                /* is set if changes occur in MPRS set */ 
  
  /* TC empty message sending */
! clock_t send_empty_tc;
  
  /*
--- 147,179 ----
   */
  
! extern float will_int;
! extern float max_jitter;
  
! extern size_t ipsize;
  
  /* Main address of this node */
! extern union olsr_ip_addr main_addr;
  
  /* OLSR UPD port */
! extern int olsr_udp_port;
  
  /* The socket used for all ioctls */
! extern int ioctl_s;
  
  /* routing socket */
  #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
! extern int rts;
  #endif
  
! extern float max_tc_vtime;
  
! extern clock_t fwdtimer[MAX_IFS];	/* forwarding timer */
  
! extern int minsize;
  
! extern olsr_bool changes;                /* is set if changes occur in MPRS set */ 
  
  /* TC empty message sending */
! extern clock_t send_empty_tc;
  
  /*
***************
*** 202,207 ****
  ipc_route_send_rtentry(union olsr_ip_addr*, union olsr_ip_addr *, int, int, char *);
  
- 
- 
- #endif
  #endif
--- 201,203 ----

Index: mid_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** mid_set.c	26 Feb 2005 23:01:41 -0000	1.14
--- mid_set.c	29 May 2005 12:47:45 -0000	1.15
***************
*** 48,51 ****
--- 48,56 ----
  #include "link_set.h"
  
+ 
+ struct mid_entry mid_set[HASHSIZE];
+ struct mid_address reverse_mid_set[HASHSIZE];
+ 
+ 
  /**
   * Initialize the MID set

--- plugin.c DELETED ---

--- olsr_plugin_io.h DELETED ---

Index: hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** hna_set.c	27 Feb 2005 10:43:38 -0000	1.16
--- hna_set.c	29 May 2005 12:47:45 -0000	1.17
***************
*** 45,48 ****
--- 45,52 ----
  
  
+ struct hna_entry hna_set[HASHSIZE];
+ size_t netmask_size;
+ 
+ 
  /**
   *Initialize the HNA set

Index: two_hop_neighbor_table.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/two_hop_neighbor_table.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** two_hop_neighbor_table.h	19 Feb 2005 17:43:28 -0000	1.13
--- two_hop_neighbor_table.h	29 May 2005 12:47:46 -0000	1.14
***************
*** 72,78 ****
  };
  
- #ifndef OLSR_PLUGIN
  
! struct neighbor_2_entry two_hop_neighbortable[HASHSIZE];
  
  int
--- 72,78 ----
  };
  
  
! extern struct neighbor_2_entry two_hop_neighbortable[HASHSIZE];
! 
  
  int
***************
*** 98,100 ****
  
  #endif
- #endif
--- 98,99 ----

Index: two_hop_neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/two_hop_neighbor_table.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** two_hop_neighbor_table.c	26 Feb 2005 23:01:41 -0000	1.15
--- two_hop_neighbor_table.c	29 May 2005 12:47:46 -0000	1.16
***************
*** 48,51 ****
--- 48,54 ----
  
  
+ struct neighbor_2_entry two_hop_neighbortable[HASHSIZE];
+ 
+ 
  /**
   *Initialize 2 hop neighbor table

Index: neighbor_table.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** neighbor_table.h	20 Feb 2005 18:52:18 -0000	1.13
--- neighbor_table.h	29 May 2005 12:47:45 -0000	1.14
***************
*** 74,84 ****
  
  
- #ifndef OLSR_PLUGIN
- 
  /*
   * The neighbor table
   */
  
- struct neighbor_entry neighbortable[HASHSIZE];
  
  void
--- 74,82 ----
  
  
  /*
   * The neighbor table
   */
+ extern struct neighbor_entry neighbortable[HASHSIZE];
  
  
  void
***************
*** 117,119 ****
  
  #endif
- #endif
--- 115,116 ----

Index: process_routes.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** process_routes.h	21 Nov 2004 11:28:56 -0000	1.8
--- process_routes.h	29 May 2005 12:47:45 -0000	1.9
***************
*** 48,54 ****
  #include <sys/ioctl.h>
  
! 
! struct rt_entry old_routes[HASHSIZE];
! struct rt_entry old_hna[HASHSIZE];
  
  int
--- 48,53 ----
  #include <sys/ioctl.h>
  
! extern struct rt_entry old_routes[HASHSIZE];
! extern struct rt_entry old_hna[HASHSIZE];
  
  int

Index: socket_parser.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/socket_parser.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** socket_parser.h	21 Nov 2004 11:28:56 -0000	1.9
--- socket_parser.h	29 May 2005 12:47:45 -0000	1.10
***************
*** 52,56 ****
  };
  
! struct olsr_socket_entry *olsr_socket_entries;
  
  
--- 52,57 ----
  };
  
! 
! extern struct olsr_socket_entry *olsr_socket_entries;
  
  

Index: apm.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/apm.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** apm.h	7 Apr 2005 18:22:43 -0000	1.8
--- apm.h	29 May 2005 12:47:45 -0000	1.9
***************
*** 58,62 ****
  };
  
- #ifndef OLSR_PLUGIN
  
  int apm_init(void);
--- 58,61 ----
***************
*** 74,76 ****
  
  #endif
- #endif
--- 73,74 ----

--- NEW FILE: olsrd_plugin.h ---
(This appears to be a binary file; contents omitted.)

Index: process_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** process_routes.c	23 May 2005 17:27:41 -0000	1.25
--- process_routes.c	29 May 2005 12:47:45 -0000	1.26
***************
*** 53,56 ****
--- 53,59 ----
  
  
+ struct rt_entry old_routes[HASHSIZE];
+ struct rt_entry old_hna[HASHSIZE];
+ 
  
  int

Index: neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** neighbor_table.c	26 Feb 2005 23:01:41 -0000	1.27
--- neighbor_table.c	29 May 2005 12:47:45 -0000	1.28
***************
*** 52,55 ****
--- 52,59 ----
  #include "mpr_selector_set.h"
  
+ 
+ struct neighbor_entry neighbortable[HASHSIZE];
+ 
+ 
  void
  olsr_init_neighbor_table()

Index: hna_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** hna_set.h	20 Feb 2005 17:34:10 -0000	1.13
--- hna_set.h	29 May 2005 12:47:45 -0000	1.14
***************
*** 41,45 ****
  
  
- 
  #ifndef _OLSR_HNA
  #define _OLSR_HNA
--- 41,44 ----
***************
*** 67,74 ****
  };
  
- #ifndef OLSR_PLUGIN
  
! struct hna_entry hna_set[HASHSIZE];
! size_t netmask_size;
  
  int
--- 66,73 ----
  };
  
  
! extern struct hna_entry hna_set[HASHSIZE];
! extern size_t netmask_size;
! 
  
  int
***************
*** 96,100 ****
  olsr_print_hna_set(void);
  
- 
- #endif
  #endif
--- 95,97 ----

Index: tc_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** tc_set.h	20 Feb 2005 18:52:19 -0000	1.14
--- tc_set.h	29 May 2005 12:47:46 -0000	1.15
***************
*** 69,76 ****
  
  
- #ifndef OLSR_PLUGIN
- 
  /* Queue */
! struct tc_entry tc_table[HASHSIZE];
  
  int
--- 69,75 ----
  
  
  /* Queue */
! extern struct tc_entry tc_table[HASHSIZE];
! 
  
  int
***************
*** 108,110 ****
  
  #endif
- #endif
--- 107,108 ----

Index: mpr_selector_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** mpr_selector_set.h	6 Mar 2005 19:33:35 -0000	1.11
--- mpr_selector_set.h	29 May 2005 12:47:45 -0000	1.12
***************
*** 41,50 ****
  
  
- 
  #ifndef _OLSR_MPRS_SET
  #define _OLSR_MPRS_SET
  
  
- 
  struct mpr_selector
  {
--- 41,48 ----
***************
*** 56,61 ****
  
  
- #ifndef OLSR_PLUGIN
- 
  olsr_u16_t
  get_local_ansn(void);
--- 54,57 ----
***************
*** 88,90 ****
  
  #endif
- #endif
--- 84,85 ----

Index: interfaces.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** interfaces.c	25 May 2005 14:32:52 -0000	1.24
--- interfaces.c	29 May 2005 12:47:45 -0000	1.25
***************
*** 46,51 ****
--- 46,60 ----
  #include "olsr.h"
  
+ 
  static olsr_u32_t if_property_id;
  
+ /* The interface linked-list */
+ struct interface *ifnet;
+ 
+ /* Datastructures to use when creating new sockets */
+ struct sockaddr_in addrsock;
+ struct sockaddr_in6 addrsock6;
+ 
+ 
  /* Ifchange functions */
  struct ifchgf

Index: link_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** link_set.c	23 May 2005 17:43:01 -0000	1.58
--- link_set.c	29 May 2005 12:47:45 -0000	1.59
***************
*** 55,61 ****
  #include "lq_route.h"
  
  static clock_t hold_time_neighbor;
  
! static struct link_entry *link_set;
  
  static int
--- 55,63 ----
  #include "lq_route.h"
  
+ 
  static clock_t hold_time_neighbor;
  
! struct link_entry *link_set;
! 
  
  static int

Index: mantissa.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mantissa.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** mantissa.h	25 May 2005 13:36:26 -0000	1.8
--- mantissa.h	29 May 2005 12:47:45 -0000	1.9
***************
*** 64,72 ****
    (double)(VTIME_SCALE_FACTOR*(1+(double)(me>>4)/16)*(double)(1<<(me&0x0F)))
  
- #ifndef OLSR_PLUGIN
- 
  olsr_u8_t
  double_to_me(double);
  
  #endif
- #endif
--- 64,69 ----

Index: plugin_loader.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** plugin_loader.c	28 May 2005 15:56:47 -0000	1.22
--- plugin_loader.c	29 May 2005 12:47:45 -0000	1.23
***************
*** 41,44 ****
--- 41,45 ----
  
  #include "plugin_loader.h"
+ #include "olsrd_plugin.h"
  #include "defs.h"
  #include "olsr.h"
***************
*** 106,123 ****
      }
  
!   /* Fetch the interface version function */
    OLSR_PRINTF(1, "Checking plugin interface version... ")
!   if((get_interface_version = dlsym(new_entry.dlhandle, "get_plugin_interface_version")) == NULL)
      {
!       OLSR_PRINTF(1, "trying v1 detection... ")
!       if((interface_version = dlsym(new_entry.dlhandle, "plugin_interface_version")) == NULL)
          {
!           OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
!           dlclose(new_entry.dlhandle);
!           return -1;
          }
        else
          {
!           new_entry.plugin_interface_version = *interface_version;
          }
      }
--- 107,132 ----
      }
  
!   /* Fetch the interface version function, 3 different ways */
    OLSR_PRINTF(1, "Checking plugin interface version... ")
!   if((get_interface_version = dlsym(new_entry.dlhandle, "olsrd_plugin_interface_version")) == NULL)
      {
!       OLSR_PRINTF(1, "trying v2 detection... ")
!       if((get_interface_version = dlsym(new_entry.dlhandle, "get_plugin_interface_version")) == NULL)
          {
!           OLSR_PRINTF(1, "trying v1 detection... ")
!           if((interface_version = dlsym(new_entry.dlhandle, "plugin_interface_version")) == NULL)
!             {
!               OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
!               dlclose(new_entry.dlhandle);
!               return -1;
!             }
!           else
!             {
!               new_entry.plugin_interface_version = *interface_version;
!             }
          }
        else
          {
!           new_entry.plugin_interface_version = get_interface_version();
          }
      }
***************
*** 131,154 ****
      {
        /* old plugin interface */
        
-       OLSR_PRINTF(1, "\nWARNING: YOU ARE USING THE OLD PLUGIN INTERFACE! DETECTED %d CURRENT VERSION %d\nPLEASE CONSIDER CHANGING YOUR PLUGIN TO THE NEW VERSION!\nWILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(), PLUGIN_INTERFACE_VERSION)
        sleep(5);
! 
!       OLSR_PRINTF(1, "Trying to fetch register function... ")
!       if((new_entry.register_olsr_data = dlsym(new_entry.dlhandle, "register_olsr_data")) == NULL)
!         {
!           /* This function must be present */
!           OLSR_PRINTF(1, "\nCould not find function registration function in plugin!\n%s\nCRITICAL ERROR - aborting!\n", dlerror())
!           dlclose(new_entry.dlhandle);
!           return -1;
!         }
!       OLSR_PRINTF(1, "OK\n")
! 
!       /* Fetch the multipurpose function */
!       OLSR_PRINTF(1, "Trying to fetch plugin IO function... ")
!       if((new_entry.plugin_io = dlsym(new_entry.dlhandle, "plugin_io")) == NULL)
!         OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
!       else
!         OLSR_PRINTF(1, "OK\n")
      }
    else
--- 140,149 ----
      {
        /* old plugin interface */
+    
+       OLSR_PRINTF(1, "\nWARNING: YOU ARE USING AN OLD DEPRECATED PLUGIN INTERFACE! DETECTED VERSION %d CURRENT VERSION %d\nPLEASE UPGRADE YOUR PLUGIN!\nWILL CONTINUE IN 5 SECONDS...\n\n", new_entry.plugin_interface_version, OLSRD_PLUGIN_INTERFACE_VERSION)
        
        sleep(5);
!       dlclose(new_entry.dlhandle);
!       return -1;
      }
    else
***************
*** 156,162 ****
        /* new plugin interface */
        
!       if ( new_entry.plugin_interface_version != PLUGIN_INTERFACE_VERSION ) 
          {
!           OLSR_PRINTF(1, "\n\nWARNING: VERSION MISSMATCH! DETECTED %d CURRENT VERSION %d\nTHIS CAN CAUSE UNEXPECTED BEHAVIOUR AND CRASHES!\nWILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(), PLUGIN_INTERFACE_VERSION)
            sleep(5);
          }
--- 151,157 ----
        /* new plugin interface */
        
!       if ( new_entry.plugin_interface_version != OLSRD_PLUGIN_INTERFACE_VERSION ) 
          {
!           OLSR_PRINTF(1, "\n\nWARNING: VERSION MISSMATCH! DETECTED %d CURRENT VERSION %d\nTHIS CAN CAUSE UNEXPECTED BEHAVIOUR AND CRASHES!\nWILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(), OLSRD_PLUGIN_INTERFACE_VERSION)
            sleep(5);
          }
***************
*** 164,170 ****
        /* Fetch the init function */
        OLSR_PRINTF(1, "Trying to fetch plugin init function... ")
!       if((new_entry.plugin_init = dlsym(new_entry.dlhandle, "plugin_init")) == NULL)
! 	{
! 	  OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
            dlclose(new_entry.dlhandle);
            return -1;
--- 159,165 ----
        /* Fetch the init function */
        OLSR_PRINTF(1, "Trying to fetch plugin init function... ")
!       if((new_entry.plugin_init = dlsym(new_entry.dlhandle, "olsrd_plugin_init")) == NULL)
!         {
!           OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
            dlclose(new_entry.dlhandle);
            return -1;
***************
*** 178,182 ****
    /* Fetch the parameter function */
    OLSR_PRINTF(1, "Trying to fetch param function... ")
!   if((new_entry.register_param = dlsym(new_entry.dlhandle, "register_olsr_param")) == NULL)
      OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
    else
--- 173,177 ----
    /* Fetch the parameter function */
    OLSR_PRINTF(1, "Trying to fetch param function... ")
!   if((new_entry.register_param = dlsym(new_entry.dlhandle, "olsrd_plugin_register_param")) == NULL)
      OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror())
    else
***************
*** 213,217 ****
  init_olsr_plugin(struct olsr_plugin *entry)
  {
-   struct olsr_plugin_data plugin_data;
    struct plugin_param *params = entry->params;
    int retval;
--- 208,211 ----
***************
*** 233,256 ****
          }
      }
! 
!   if (entry->plugin_interface_version < 4) 
!     {
!       /* old plugin interface */
!       
!       OLSR_PRINTF(1, "Running registration function...\n")
!       /* Fill struct */
!       plugin_data.ipversion = olsr_cnf->ip_version;
!       plugin_data.main_addr = &main_addr;
!       plugin_data.olsr_plugin_io = &olsr_plugin_io;
! 
!       /* Register data with plugin */
!       entry->register_olsr_data(&plugin_data);
!     }
!   else
!     {
!       /* new plugin interface */
!       OLSR_PRINTF(1, "Running plugin_init function...\n")
!       entry->plugin_init();
!     }
  }
  
--- 227,233 ----
          }
      }
!     
!     OLSR_PRINTF(1, "Running plugin_init function...\n")
!     entry->plugin_init();
  }
  

Index: socket_parser.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/socket_parser.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** socket_parser.c	27 Feb 2005 18:39:43 -0000	1.22
--- socket_parser.c	29 May 2005 12:47:45 -0000	1.23
***************
*** 57,60 ****
--- 57,62 ----
  
  
+ struct olsr_socket_entry *olsr_socket_entries;
+ 
  static int hfd = 0;
  

Index: tc_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** tc_set.c	26 Feb 2005 23:01:41 -0000	1.21
--- tc_set.c	29 May 2005 12:47:46 -0000	1.22
***************
*** 46,49 ****
--- 46,53 ----
  #include "lq_route.h"
  
+ 
+ struct tc_entry tc_table[HASHSIZE];
+ 
+ 
  /**
   * Initialize the topology set

Index: interfaces.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** interfaces.h	23 May 2005 14:12:57 -0000	1.27
--- interfaces.h	29 May 2005 12:47:45 -0000	1.28
***************
*** 143,148 ****
  #define OLSR_DEFAULT_MTU             1500
  
- #ifndef OLSR_PLUGIN
- 
  /* Ifchange actions */
  
--- 143,146 ----
***************
*** 154,163 ****
  #define IFCHANGES_POLL_INT     2.5
  
  /* The interface linked-list */
! struct interface *ifnet;
  
  /* Datastructures to use when creating new sockets */
! struct sockaddr_in addrsock;
! struct sockaddr_in6 addrsock6;
  
  int
--- 152,163 ----
  #define IFCHANGES_POLL_INT     2.5
  
+ 
  /* The interface linked-list */
! extern struct interface *ifnet;
  
  /* Datastructures to use when creating new sockets */
! extern struct sockaddr_in addrsock;
! extern struct sockaddr_in6 addrsock6;
! 
  
  int
***************
*** 198,200 ****
  
  #endif
- #endif
--- 198,199 ----

Index: olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** olsr.c	28 May 2005 14:01:59 -0000	1.45
--- olsr.c	29 May 2005 12:47:45 -0000	1.46
***************
*** 66,69 ****
--- 66,74 ----
  
  
+ olsr_bool changes_topology;
+ olsr_bool changes_neighborhood;
+ olsr_bool changes_hna;
+ 
+ 
  /**
   * Process changes functions

Index: parser.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/parser.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** parser.c	26 May 2005 09:55:11 -0000	1.23
--- parser.c	29 May 2005 12:47:45 -0000	1.24
***************
*** 62,65 ****
--- 62,67 ----
  #endif
  
+ struct parse_function_entry *parse_functions;
+ 
  static char inbuf[MAXMESSAGESIZE+1];
  

Index: plugin_loader.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** plugin_loader.h	26 May 2005 16:09:26 -0000	1.14
--- plugin_loader.h	29 May 2005 12:47:45 -0000	1.15
***************
*** 48,64 ****
  #include "olsr_cfg.h"
  
- /* Data to sent to the plugin with the register_olsr_function call */
- struct olsr_plugin_data
- {
-   int ipversion;
-   union olsr_ip_addr *main_addr;
-   int (*olsr_plugin_io)(int, void *, size_t);
- };
- 
  #ifndef OLSR_PLUGIN
  
  #define MAX_LIBS 10
- #define PLUGIN_INTERFACE_VERSION 4
- 
  
  struct olsr_plugin
--- 48,54 ----
***************
*** 70,78 ****
    int plugin_interface_version;
    
-   /* old interface (PLUGIN_INTERFACE_VERSION <= 3) */
-   int (*register_olsr_data)(struct olsr_plugin_data *);
-   int (*plugin_io)(int, void *, size_t); /* Multi - purpose function */
- 
-   /* new interface (PLUGIN_INTERFACE_VERSION >= 4)*/
    int (*register_param)(char *, char *);
    int (*plugin_init)(void);
--- 60,63 ----

Index: routing_table.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** routing_table.h	20 Apr 2005 17:52:12 -0000	1.15
--- routing_table.h	29 May 2005 12:47:45 -0000	1.16
***************
*** 91,98 ****
  
  
! #ifndef OLSR_PLUGIN
! 
! struct rt_entry routingtable[HASHSIZE];
! struct rt_entry hna_routes[HASHSIZE];
  
  
--- 91,96 ----
  
  
! extern struct rt_entry routingtable[HASHSIZE];
! extern struct rt_entry hna_routes[HASHSIZE];
  
  
***************
*** 119,121 ****
  
  #endif
- #endif
--- 117,118 ----

Index: link_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** link_set.h	23 May 2005 17:43:01 -0000	1.26
--- link_set.h	29 May 2005 12:47:45 -0000	1.27
***************
*** 48,54 ****
  #define _LINK_SET_H
  
- #ifndef OLSR_PLUGIN
  #include "packet.h"
- #endif
  
  #define MID_ALIAS_HACK_VTIME  10.0
--- 48,52 ----
***************
*** 104,108 ****
  };
  
! #ifndef OLSR_PLUGIN
  /* Function prototypes */
  
--- 102,109 ----
  };
  
! 
! extern struct link_entry *link_set;
! 
! 
  /* Function prototypes */
  
***************
*** 143,147 ****
  void 
  olsr_print_link_set(void);
- #endif
  
  #endif
--- 144,147 ----

Index: parser.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/parser.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** parser.h	10 Mar 2005 07:01:48 -0000	1.8
--- parser.h	29 May 2005 12:47:45 -0000	1.9
***************
*** 58,62 ****
  
  
! struct parse_function_entry *parse_functions;
  
  void
--- 58,62 ----
  
  
! extern struct parse_function_entry *parse_functions;
  
  void

Index: routing_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** routing_table.c	19 May 2005 20:26:22 -0000	1.21
--- routing_table.c	29 May 2005 12:47:45 -0000	1.22
***************
*** 51,54 ****
--- 51,58 ----
  
  
+ struct rt_entry routingtable[HASHSIZE];
+ struct rt_entry hna_routes[HASHSIZE];
+ 
+ 
  /* Begin:
   * Prototypes for internal functions 




More information about the Olsr-cvs mailing list