[Olsr-dev] olsrd-0.5.4rc1 released

Hannes Gredler (spam-protected)
Mon Sep 17 09:17:32 CEST 2007


just curious - in the zebra route types array there is an entry "hsls"
is this a c&p error when mimikrying the "hazy sight linkstate" protocol
and it should read "olsr" or is hsls now an integral part of the quagga
distribution ?

/hannes

On Mon, Sep 17, 2007 at 12:18:58AM +0200, Bernd Petrovitsch wrote:
| On Fri, 2007-09-14 at 08:25 +0200, Immo 'FaUl' Wehrenberg wrote:
| > Hallo Bernd,
| > du schrobst:
| > 
| > > Hi all!
| > > 
| > > I just released olsrd-0.5.4rc1. Due to the further massive changes (a
| > > good part of it was rewritten) in the routing core to further reduce
| > > duplicated data and *lots* of malloc() and free() calls (see the
| > > changelog below for more), we ask for further testing and - thus - this
| > > is a release candidate.
| > > It compiles and runs on Linux and Win32 (though the testing on Win32 was
| > > pretty minimal), so we are especially interested in feedback from all
| > > non-Linux systems.
| > > The only known issues are
| > > - warnings on x86_64 in code only used by the nameservice plugin.
| > > - the Quagga plugin is the last with the old plugin interface version.
| > 
| > As it is on me to change that one then and i'm currently a bit short of 
| > time, may someone please point out shortly what exactly changed?
| 
| See the attached patch - it is so trivial that it is easier to do then
| to describe it;-)
| It would be nice if you could test it (as I have no Quagga working
| here).
| 
| 	Bernd
| -- 
| Firmix Software GmbH                   http://www.firmix.at/
| mobil: +43 664 4416156                 fax: +43 1 7890849-55
|           Embedded Linux Development and Services

| --- lib/quagga/version-script.txt	31 Jan 2007 12:38:26 -0000	1.1
| +++ lib/quagga/version-script.txt	16 Sep 2007 22:15:45 -0000
| @@ -2,8 +2,8 @@
|  {
|    global:
|      olsrd_plugin_interface_version;
| -    olsrd_plugin_register_param;
|      olsrd_plugin_init;
| +    olsrd_get_plugin_parameters;
|  
|    local:
|      *;
| --- lib/quagga/src/olsrd_plugin.c	16 Aug 2007 19:07:28 -0000	1.5
| +++ lib/quagga/src/olsrd_plugin.c	16 Sep 2007 22:15:45 -0000
| @@ -29,69 +29,100 @@
|  #define PLUGIN_VERSION "0.2.2"
|  #define PLUGIN_AUTHOR  "Immo 'FaUl' Wehrenberg"
|  #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR
| -#define PLUGIN_INTERFACE_VERSION 4
| +#define PLUGIN_INTERFACE_VERSION 5
|  
|  static void __attribute__ ((constructor)) my_init(void);
|  static void __attribute__ ((destructor)) my_fini(void);
|  static void redist_hna (void);
| +static set_plugin_parameter set_redistribute;
| +static set_plugin_parameter set_exportroutes;
| +static set_plugin_parameter set_distance;
| +static set_plugin_parameter set_localpref;
|  
|  
| -int olsrd_plugin_interface_version() {
| +int olsrd_plugin_interface_version(void) {
|    return PLUGIN_INTERFACE_VERSION;
|  }
|  
| +static const struct olsrd_plugin_parameters plugin_parameters[] = {
| +    { .name = "redistribute",   .set_plugin_parameter = &set_redistribute, },
| +    { .name = "ExportRoutes",   .set_plugin_parameter = &set_exportroutes, },
| +    { .name = "Distance",       .set_plugin_parameter = &set_distance,     },
| +    { .name = "LocalPref",      .set_plugin_parameter = &set_localpref,    },
| +};
|  
| -int olsrd_plugin_register_param(char *key, char *value) {
| -  const char *zebra_route_types[] = {"system","kernel","connect","static",
| -			      "rip","ripng","ospf","ospf6","isis",
| - 			      "bgp","hsls", NULL};
| -  unsigned char i = 0;
| +void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size)
| +{
| +    *params = plugin_parameters;
| +    *size = sizeof(plugin_parameters)/sizeof(*plugin_parameters);
| +}
|  
| -  if(!strcmp(key, "redistribute")) {
| -    for (i = 0; zebra_route_types[i]; i++)
| -      if (!strcmp(value, zebra_route_types[i])) {
| -	zebra_redistribute(i);
| -	return 1;
| -      }
| +static int set_redistribute(const char *value, void *data __attribute__((unused)), unsigned int addon __attribute__((unused)))
| +{
| +  static const char *zebra_route_types[] = {"system","kernel","connect","static",
| +                                              "rip","ripng","ospf","ospf6","isis",
| +                                              "bgp","hsls" };
| +  int *v = data;
| +  int i;
| +  for (i = 0; i < ARRAYSIZE(zebra_route_types); i++) {
| +    if (!strcmp(value, zebra_route_types[i])) {
| +      zebra_redistribute(i);
| +      return 0;
| +    }
|    }
| -  else if(!strcmp(key, "ExportRoutes")) {
| -    if (!strcmp(value, "only")) {
| -      if (!olsr_addroute_remove_function(&olsr_ioctl_add_route, AF_INET))
| -	puts ("AIII, could not remove the kernel route exporter");
| -      if (!olsr_delroute_remove_function(&olsr_ioctl_del_route, AF_INET))
| -	puts ("AIII, could not remove the kernel route deleter");
| -      olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET);
| -      olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET);
| -      zebra_export_routes(1);
| -      return 1;
| +  return 1;
| +}
| +
| +static int set_exportroutes(const char *value, void *data __attribute__((unused)), unsigned int addon __attribute__((unused)))
| +{
| +  if (!strcmp(value, "only")) {
| +    if (!olsr_addroute_remove_function(&olsr_ioctl_add_route, AF_INET)) {
| +      puts ("AIII, could not remove the kernel route exporter");
|      }
| -    else if (!strcmp(value, "additional")) {
| -      olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET);
| -      olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET);
| -      zebra_export_routes(1);
| -      return 1;
| +    if (!olsr_delroute_remove_function(&olsr_ioctl_del_route, AF_INET)) {
| +      puts ("AIII, could not remove the kernel route deleter");
|      }
| -    else zebra_export_routes(0);
| +    olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET);
| +    olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET);
| +    zebra_export_routes(1);
|    }
| -  else if (!strcmp(key, "Distance")) {
| -    unsigned int distance = atoi (value);
| -    if (distance < 255)
| -      zebra_olsr_distance(distance);
| -      return 1;
| +  else if (!strcmp(value, "additional")) {
| +    olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET);
| +    olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET);
| +    zebra_export_routes(1);
|    }
| -  
| -  else if (!strcmp(key, "LocalPref")) {
| -    if (!strcmp(value, "true")) 
| -      zebra_olsr_localpref();
| -    else if (strcmp (value, "false"))
| -      return -1;
| -    return 1;
| +  else {
| +    zebra_export_routes(0);
|    }
| -  return -1;
| +  return 0;
|  }
|  
| +static int set_distance(const char *value, void *data __attribute__((unused)), unsigned int addon __attribute__((unused)))
| +{
| +  int distance;
| +  if (set_plugin_int(value, &distance, 0) != 0) {
| +        return 1;    
| +  }
| +  if (distance < 0 || distance >= 255) {
| +    return 1;    
| +  }
| +  zebra_olsr_distance(distance);
| +  return 0;
| +}
|  
| -int olsrd_plugin_init() {
| +static int set_localpref(const char *value, void *data __attribute__((unused)), unsigned int addon __attribute__((unused)))
| +{
| +  int b;
| +  if (set_plugin_boolean(value, &b, 0) != 0) {
| +    return 1;    
| +  }
| +  if (b) {
| +    zebra_olsr_localpref();
| +  }
| +  return 0;
| +}
| +
| +int olsrd_plugin_init(void) {
|    if(olsr_cnf->ip_version != AF_INET) {
|      fputs("see the source - ipv6 so far not supported\n" ,stderr);
|      return 1;

| -- 
| Olsr-dev mailing list
| (spam-protected)
| http://lists.olsr.org/mailman/listinfo/olsr-dev




More information about the Olsr-dev mailing list