[Olsr-cvs] olsrd-current/lib/secure/src olsrd_plugin.c, 1.12, 1.13 olsrd_secure.c, 1.25, 1.26 olsrd_secure.h, 1.7, 1.8 secure_messages.h, 1.2, 1.3

Bernd Petrovitsch (spam-protected)
Sun Jul 15 23:47:19 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/lib/secure/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4585/lib/secure/src

Modified Files:
	olsrd_plugin.c olsrd_secure.c olsrd_secure.h secure_messages.h 
Log Message:
* moved to plugin interface version 5

Index: secure_messages.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/secure_messages.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** secure_messages.h	31 Jan 2007 12:36:50 -0000	1.2
--- secure_messages.h	15 Jul 2007 21:47:17 -0000	1.3
***************
*** 69,73 ****
  
  
! char keyfile[FILENAME_MAX];
  
  
--- 69,73 ----
  
  
! extern char keyfile[FILENAME_MAX+1];
  
  

Index: olsrd_secure.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** olsrd_secure.h	31 Jan 2007 12:36:49 -0000	1.7
--- olsrd_secure.h	15 Jul 2007 21:47:17 -0000	1.8
***************
*** 67,166 ****
  #define LOWER_DIFF -3
  
! char aes_key[16];
  /* Seconds of slack allowed */
  #define SLACK 3
  
! /* Timestamp node */
! struct stamp
! {
!   union olsr_ip_addr addr;
!   /* Timestamp difference */
!   int diff;
!   olsr_u32_t challenge;
!   olsr_u8_t validated;
!   clock_t valtime; /* Validity time */
!   clock_t conftime; /* Reconfiguration time */
!   struct stamp *prev;
!   struct stamp *next;
! };
! 
! /* Seconds to cache a valid timestamp entry */
! #define TIMESTAMP_HOLD_TIME 30
! /* Seconds to cache a not verified timestamp entry */
! #define EXCHANGE_HOLD_TIME 5
! 
! struct stamp timestamps[HASHSIZE];
! 
! /* Input interface */
! struct interface *olsr_in_if;
! 
! /* Timeout function to register with the sceduler */
! void
! olsr_timeout(void);
! 
! 
! /* Event function to register with the sceduler */
! void
! olsr_event(void);
! 
! int
! send_challenge(union olsr_ip_addr *);
! 
! int
! ifchange(struct interface *, int);
! 
! int
! send_cres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t, struct stamp *);
! 
! int
! send_rres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t);
! 
! int
! parse_challenge(char *);
! 
! int
! parse_cres(char *);
! 
! int
! parse_rres(char *);
! 
! int
! check_auth(char *, int *);
! 
! void
! ipc_action(int);
! 
! int
! ipc_send(char *, int);
! 
! int
! add_signature(olsr_u8_t *, int*);
! 
! int
! validate_packet(char *, int*);
! 
! void
! packet_parser(int);
! 
! void
! timeout_timestamps(void*);
! 
! int
! check_timestamp(union olsr_ip_addr *, time_t);
! 
! struct stamp *
! lookup_timestamp_entry(union olsr_ip_addr *);
! 
! int
! read_key_from_file(char *);
! 
! int
! secure_plugin_init(void);
  
! void
! secure_plugin_exit(void);
  
! int
! plugin_ipc_init(void);
  
  #endif
--- 67,79 ----
  #define LOWER_DIFF -3
  
! extern char aes_key[16];
  /* Seconds of slack allowed */
  #define SLACK 3
  
! int secure_plugin_init(void);
  
! void secure_plugin_exit(void);
  
! int plugin_ipc_init(void);
  
  #endif

Index: olsrd_plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_plugin.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** olsrd_plugin.c	15 Jul 2007 17:51:22 -0000	1.12
--- olsrd_plugin.c	15 Jul 2007 21:47:17 -0000	1.13
***************
*** 49,61 ****
  #define PLUGIN_AUTHOR   "Andreas Tønnesen"
  #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR
! #define PLUGIN_INTERFACE_VERSION 4
! 
! 
! static void __attribute__ ((constructor)) 
! my_init(void);
! 
! static void __attribute__ ((destructor)) 
! my_fini(void);
  
  
  /*
--- 49,56 ----
  #define PLUGIN_AUTHOR   "Andreas Tønnesen"
  #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR
! #define PLUGIN_INTERFACE_VERSION 5
  
+ static void my_init(void) __attribute__ ((constructor));
+ static void my_fini(void) __attribute__ ((destructor));
  
  /*
***************
*** 64,69 ****
   * Do not alter unless you know what you are doing!
   */
! int 
! olsrd_plugin_interface_version(void)
  {
    return PLUGIN_INTERFACE_VERSION;
--- 59,63 ----
   * Do not alter unless you know what you are doing!
   */
! int olsrd_plugin_interface_version(void)
  {
    return PLUGIN_INTERFACE_VERSION;
***************
*** 74,79 ****
   *Constructor
   */
! static void
! my_init(void)
  {
    /* Print plugin info to stdout */
--- 68,72 ----
   *Constructor
   */
! static void my_init(void)
  {
    /* Print plugin info to stdout */
***************
*** 86,91 ****
   *Destructor
   */
! static void
! my_fini(void)
  {
  
--- 79,83 ----
   *Destructor
   */
! static void my_fini(void)
  {
  
***************
*** 99,117 ****
  }
  
! 
! int
! olsrd_plugin_register_param(char *key, char *value)
  {
!   if(!strcmp(key, "Keyfile"))
!     {
!       strncpy(keyfile, value, FILENAME_MAX);
!     }
! 
!   return 1;
  }
  
  
! int
! olsrd_plugin_init(void) {
    /* Calls the initialization function
     * olsr_plugin_init()
--- 91,113 ----
  }
  
! static int store_string(const char *value, void *data)
  {
!   char *str = data;
!   snprintf(str, FILENAME_MAX+1, "%s", value);
!   return 0;
  }
  
  
! static const struct olsrd_plugin_parameters plugin_parameters[] = {
!     { .name = "keyfile", .set_plugin_parameter = &store_string, .data = keyfile },
! };
! 
! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size)
! {
!     *params = plugin_parameters;
!     *size = sizeof(plugin_parameters)/sizeof(*plugin_parameters);
! }
! 
! int olsrd_plugin_init(void) {
    /* Calls the initialization function
     * olsr_plugin_init()

Index: olsrd_secure.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** olsrd_secure.c	9 May 2007 17:41:17 -0000	1.25
--- olsrd_secure.c	15 Jul 2007 21:47:17 -0000	1.26
***************
*** 108,111 ****
--- 108,161 ----
  
  
+ /* Timestamp node */
+ struct stamp
+ {
+   union olsr_ip_addr addr;
+   /* Timestamp difference */
+   int diff;
+   olsr_u32_t challenge;
+   olsr_u8_t validated;
+   clock_t valtime; /* Validity time */
+   clock_t conftime; /* Reconfiguration time */
+   struct stamp *prev;
+   struct stamp *next;
+ };
+ 
+ /* Seconds to cache a valid timestamp entry */
+ #define TIMESTAMP_HOLD_TIME 30
+ /* Seconds to cache a not verified timestamp entry */
+ #define EXCHANGE_HOLD_TIME 5
+ 
+ static struct stamp timestamps[HASHSIZE];
+ 
+ 
+ char keyfile[FILENAME_MAX+1];
+ char aes_key[16];
+ /* Input interface */
+ static struct interface *olsr_in_if;
+ 
+ /* Event function to register with the sceduler */
+ #if 0
+ static void olsr_event(void);
+ #endif
+ static int send_challenge(union olsr_ip_addr *);
+ static int ifchange(struct interface *, int);
+ static int send_cres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t, struct stamp *);
+ static int send_rres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t);
+ static int parse_challenge(char *);
+ static int parse_cres(char *);
+ static int parse_rres(char *);
+ static int check_auth(char *, int *);
+ #if 0
+ static int ipc_send(char *, int);
+ #endif
+ static int add_signature(olsr_u8_t *, int*);
+ static int validate_packet(char *, int*);
+ static void packet_parser(int);
+ static void timeout_timestamps(void*);
+ static int check_timestamp(union olsr_ip_addr *, time_t);
+ static struct stamp *lookup_timestamp_entry(union olsr_ip_addr *);
+ static int read_key_from_file(char *);
+ 
  /**
   *Do initialization here
***************
*** 173,177 ****
  }
  
- 
  int
  plugin_ipc_init(void)
--- 223,226 ----
***************
*** 180,184 ****
  }
  
- 
  /*
   * destructor - called at unload
--- 229,232 ----
***************
*** 190,209 ****
  
  
  /**
   *Scheduled event
   */
! void
  olsr_event(void)
  {
  
  }
  
! 
! int
  ipc_send(char *data __attribute__((unused)), int size __attribute__((unused)))
  {
    return 1;
  }
! 
  
  /* XXX - ToDo */
--- 238,259 ----
  
  
+ #if 0
  /**
   *Scheduled event
   */
! static void
  olsr_event(void)
  {
  
  }
+ #endif
  
! #if 0
! static int
  ipc_send(char *data __attribute__((unused)), int size __attribute__((unused)))
  {
    return 1;
  }
! #endif
  
  /* XXX - ToDo */





More information about the Olsr-cvs mailing list